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

Fix BlockHeader hash #1868

Merged
merged 11 commits into from
Apr 29, 2024
1 change: 1 addition & 0 deletions crates/types/src/blockchain/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ impl ApplicationHeader<GeneratedApplicationFields> {
hasher.input(self.message_receipt_count.to_be_bytes());
hasher.input(self.transactions_root.as_ref());
hasher.input(self.message_outbox_root.as_ref());
hasher.input(self.event_inbox_root.as_ref());
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any logic to the order these things get added to the hash?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of fields in the header

hasher.input(self.consensus_parameters_version.to_bytes().as_slice());
hasher.input(self.state_transition_bytecode_version.to_bytes().as_slice());
hasher.digest()
Expand Down
Loading