Skip to content
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

Remove previous_block_hash from Block Stream BlockHeader #468

Open
jasperpotts opened this issue Feb 11, 2025 · 1 comment
Open

Remove previous_block_hash from Block Stream BlockHeader #468

jasperpotts opened this issue Feb 11, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jasperpotts
Copy link
Member

jasperpotts commented Feb 11, 2025

Problem

Having previous_block_hash in the Block Stream BlockHeader causes a timing problem that prevents optimal parallel thread pipelining in the consensus node. To get the block hash we have to have finished hashing the state of the previous block. This can take as long as it takes to execute all transactions in the next block. Because of that we do not want to hold up creating the block header until that hash is ready.

Solution

We already also have the hash of the previous block in BlockProof.previous_block_root_hash so we can just remove BlockHeader.previous_block_hash. This should then remove the synchronization requirement from services and allow more optimal parallel thread pipelining. The detailed comment for explaining the hash should be moved to BlockProof.previous_block_root_hash so we don't loose it.

@jasperpotts
Copy link
Member Author

@steven-sheehy @xin-hedera You might need to update mirror node based on this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 👷🏼‍♀️ In Progress
Development

No branches or pull requests

4 participants