Skip to content

[CON-76] fix: sei-tendermint: include all fields in CommitHash#2600

Merged
arajasek merged 1 commit intomainfrom
asr/fix-commit-hash
Dec 16, 2025
Merged

[CON-76] fix: sei-tendermint: include all fields in CommitHash#2600
arajasek merged 1 commit intomainfrom
asr/fix-commit-hash

Conversation

@arajasek
Copy link
Copy Markdown
Contributor

Describe your changes and provide context

Pretty much as in the title -- the CommitHash now covers all fields.

Testing performed to validate your change

Added a few new tests, make test passes.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 12, 2025

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedDec 16, 2025, 2:47 PM

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.22%. Comparing base (944f13d) to head (9c1de29).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-tendermint/types/block.go 77.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2600      +/-   ##
==========================================
+ Coverage   42.01%   43.22%   +1.20%     
==========================================
  Files        1518     1857     +339     
  Lines      119497   153094   +33597     
==========================================
+ Hits        50207    66169   +15962     
- Misses      64906    81008   +16102     
- Partials     4384     5917    +1533     
Flag Coverage Δ
sei-chain 41.93% <ø> (ø)
sei-cosmos 38.04% <ø> (+<0.01%) ⬆️
sei-db 69.06% <ø> (ø)
sei-ibc-go 55.96% <ø> (ø)
sei-tendermint 47.50% <77.77%> (?)
sei-wasmd 42.10% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-tendermint/types/block.go 81.53% <77.77%> (ø)

... and 342 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sei-will sei-will self-requested a review December 12, 2025 19:49
@arajasek arajasek force-pushed the asr/fix-commit-hash branch from 4a28386 to f0e8d54 Compare December 15, 2025 15:04
Copy link
Copy Markdown
Collaborator

@udpatil udpatil left a comment

Choose a reason for hiding this comment

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

Overall the change looks good. However, when we actually roll it out via upgrade, how do we expect that it will behave changing the hashing algo across the blocks (eg. if upgrade is on height 100, will the last commit hash include these fields or not?


// Hash returns the hash of the commit
// Hash returns the hash of the commit.
// It computes a Merkle tree from all commit fields: Height, Round, BlockID, and Signatures.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: we're not computing a merkle tree here? just concating the fields to the hash

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The hash is the root of the merkle tree, as far as I understand the implementation of HashFromByteSlices.

@arajasek
Copy link
Copy Markdown
Contributor Author

@stevenlanders and I will discuss and perform upgrade testing for this, after which we can land this change.

@arajasek arajasek force-pushed the asr/fix-commit-hash branch from f0e8d54 to 7d9bf23 Compare December 15, 2025 22:02
@arajasek arajasek force-pushed the asr/fix-commit-hash branch from 7d9bf23 to 9c1de29 Compare December 16, 2025 14:46
@arajasek
Copy link
Copy Markdown
Contributor Author

Overall the change looks good. However, when we actually roll it out via upgrade, how do we expect that it will behave changing the hashing algo across the blocks (eg. if upgrade is on height 100, will the last commit hash include these fields or not?

Good question! The expectation is that if height 100 is finalized with the old rules, then the block at height 101's LastCommitHash (which points to block at height 100), will be the first one created by the new rules. This works because the block at height 101 will be created with the new version.

@arajasek
Copy link
Copy Markdown
Contributor Author

Testing update: @stevenlanders and I confirmed that:

  • a network with the new rules can be sustained
  • a network with the all rules can be created, and upgraded to use the new rules
  • a node can "miss" the period before the upgrade, and successfully blocksync over the upgrade (since it will shutdown at the upgrade window and need to be restarted with the new version anyway).

@arajasek arajasek merged commit 06c527a into main Dec 16, 2025
42 checks passed
@arajasek arajasek deleted the asr/fix-commit-hash branch December 16, 2025 15:16
arajasek added a commit that referenced this pull request Jan 29, 2026
arajasek added a commit that referenced this pull request Jan 30, 2026
arajasek added a commit that referenced this pull request Jan 30, 2026
arajasek added a commit that referenced this pull request Feb 2, 2026
arajasek added a commit that referenced this pull request Feb 4, 2026
arajasek added a commit that referenced this pull request Feb 5, 2026
arajasek added a commit that referenced this pull request Feb 6, 2026
arajasek added a commit that referenced this pull request Feb 10, 2026
arajasek added a commit that referenced this pull request Feb 18, 2026
cursor bot pushed a commit that referenced this pull request Mar 20, 2026
…grade

The Commit.Hash() algorithm changed in CON-76 (#2600) to include
Height, Round, and BlockID in the Merkle tree alongside signatures.
Blocks stored by v6.3 nodes have LastCommitHash computed with the old
signatures-only algorithm. When v6.4 loads these blocks, ValidateBasic
recomputes the hash with the new algorithm, causing a mismatch panic.

Add Commit.LegacyHash() that uses the old algorithm, and fall back to
it in ValidateBasic when the new hash doesn't match.

Co-authored-by: Masih H. Derkani <m@derkani.org>
masih added a commit that referenced this pull request Mar 20, 2026
The Commit.Hash() algorithm was changed in CON-76 (#2600) to include Height, Round, and BlockID in the Merkle tree alongside signatures. Blocks stored by v6.3 nodes have LastCommitHash computed with the old signatures-only algorithm. When v6.4 loads these blocks during ABCI handshake replay, ValidateBasic recomputes the hash with the new algorithm, producing a different value and causing a panic first observed on `arctic-1`.

Adds Commit.LegacyHash() that uses the old (signatures-only) algorithm, and updates Block.ValidateBasic() to fall back to it when the new hash doesn't match.

Note that release 6.5 would make this fallback path entirely redundant, and it should be removed in the next release.
github-merge-queue bot pushed a commit that referenced this pull request Mar 20, 2026
The Commit.Hash() algorithm was changed in CON-76 (#2600) to include
Height, Round, and BlockID in the Merkle tree alongside signatures.
Blocks stored by v6.3 nodes have LastCommitHash computed with the old
signatures-only algorithm. When v6.4 loads these blocks during ABCI
handshake replay, ValidateBasic recomputes the hash with the new
algorithm, producing a different value and causing a panic first
observed on `arctic-1`.

Adds Commit.LegacyHash() that uses the old (signatures-only) algorithm,
and updates Block.ValidateBasic() to fall back to it when the new hash
doesn't match.

Note that release 6.5 would make this fallback path entirely redundant,
and it should be removed in the next release.

Separated out from #3095
to capture a clear commit history of changes for the future
archeologists.
github-actions bot pushed a commit that referenced this pull request Mar 20, 2026
The Commit.Hash() algorithm was changed in CON-76 (#2600) to include
Height, Round, and BlockID in the Merkle tree alongside signatures.
Blocks stored by v6.3 nodes have LastCommitHash computed with the old
signatures-only algorithm. When v6.4 loads these blocks during ABCI
handshake replay, ValidateBasic recomputes the hash with the new
algorithm, producing a different value and causing a panic first
observed on `arctic-1`.

Adds Commit.LegacyHash() that uses the old (signatures-only) algorithm,
and updates Block.ValidateBasic() to fall back to it when the new hash
doesn't match.

Note that release 6.5 would make this fallback path entirely redundant,
and it should be removed in the next release.

Separated out from #3095
to capture a clear commit history of changes for the future
archeologists.

(cherry picked from commit 512976d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants