-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MARF Trie identifier refactoring #1604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you!
@@ -1397,7 +1398,7 @@ impl HttpRequestType { | |||
.ok_or(net_error::DeserializeError("Failed to match path to microblock minimum sequence group".to_string()))? | |||
.as_str(); | |||
|
|||
let block_hash = BlockHeaderHash::from_hex(block_hash_str) | |||
let block_hash = StacksBlockId::from_hex(block_hash_str) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also rename this block_hash instances?
@@ -675,16 +676,17 @@ impl Relayer { | |||
Ok(_) => { | |||
if need_relay { | |||
// we didn't have this block before, so relay it. | |||
// Group by anchored block hash, so we can convert them into | |||
// Group by index block hash, so we can convert them into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, isn’t “anchored block id” more accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, but I did have one lingering question -- besides unit tests, what's the point of keeping BlockHeaderHash
around at this point?
It only implements the MarfTrieIdentifier trait for unit tests (and is marked |
Is there a difference between |
The latter isn't changed -- |
This PR mostly does two things:
BurnchainHeaderHash
directly with the MARF, rather than casting it into aBlockHeaderHash
, and enabling the introduction of a new typeStacksBlockId
StacksBlockId
type for capturing the index block hash. Everywhere where an index hash was previously used now uses aStacksBlockId
(a lot of code changes!)Those changes are are almost exclusively type refactors -- mostly no actually functionality has changed.
There was one instance, however, where a change was made -- in
relay.rs
, theMicroblocksData.index_anchor_block
field was previously being filled with the anchored block hash, rather than the index block hash.