Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@thewhaleking
Copy link
Contributor

Issue #3083 raised the issue of block_hash and block being passed to determine_block_hash when supplying a block to get_neuron_for_pubkey_and_subnet.

The short fix for this was #3084, but improving on this is better.

Because AsyncSubtensor.get_block_hash is cached, there's really no performance loss in checking the block hash if both the block and block_hash are supplied to determine_block_hash.

With this PR, if both a block and block_hash are passed to determine_block_hash, it will verify that the actual block hash maps to the corresponding supplied block hash for the given block, raising a ValueError if not.

@thewhaleking thewhaleking requested a review from a team October 7, 2025 15:57
@thewhaleking thewhaleking requested a review from basfroman October 7, 2025 16:15
@thewhaleking thewhaleking requested a review from a team October 7, 2025 16:17
@basfroman basfroman merged commit 4182d96 into staging Oct 7, 2025
237 checks passed
@basfroman basfroman deleted the chore/thewhaleking/dev-comment branch October 7, 2025 16:31
@ibraheem-abe ibraheem-abe mentioned this pull request Oct 8, 2025
basfroman added a commit that referenced this pull request Oct 14, 2025
Improves `determine_block_hash` method of `AsyncSubtensor`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AsyncSubtensor get_neuron_for_pubkey_and_subnet passes block and block_hash to future calls

3 participants