Skip to content

Fix buffer offset in ProposerPriorityHash (CON-200)#3255

Merged
wen-coding merged 2 commits intomainfrom
fix/proposer-priority-hash-offset
Apr 16, 2026
Merged

Fix buffer offset in ProposerPriorityHash (CON-200)#3255
wen-coding merged 2 commits intomainfrom
fix/proposer-priority-hash-offset

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

Summary

  • Fix binary.PutVarint writing to buf[0:] on every iteration instead of advancing the write position
  • Each validator's encoded priority now occupies its own position in the buffer
  • Add test verifying that changing a single validator's priority produces a different hash

Test plan

  • go vet ./sei-tendermint/types/... passes
  • go test ./sei-tendermint/types/... passes
  • New test fails without the fix, passes with it

binary.PutVarint was always writing to buf[0:] instead of advancing
the offset, so each validator overwrote the previous one. Write to
buf[offset:] so all validators contribute to the hash.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 15, 2026, 10:12 PM

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.25%. Comparing base (de50195) to head (8a7bc96).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3255      +/-   ##
==========================================
- Coverage   59.28%   59.25%   -0.03%     
==========================================
  Files        2070     2070              
  Lines      169775   169704      -71     
==========================================
- Hits       100655   100563      -92     
- Misses      60328    60340      +12     
- Partials     8792     8801       +9     
Flag Coverage Δ
sei-chain-pr 81.62% <100.00%> (?)
sei-db 70.41% <ø> (ø)

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

Files with missing lines Coverage Δ
sei-tendermint/types/validator_set.go 93.10% <100.00%> (ø)

... and 28 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.

@wen-coding wen-coding changed the title Fix buffer offset in ProposerPriorityHash Fix buffer offset in ProposerPriorityHash (CON-200) Apr 15, 2026
@wen-coding wen-coding added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit c5cad2b Apr 16, 2026
39 checks passed
@wen-coding wen-coding deleted the fix/proposer-priority-hash-offset branch April 16, 2026 01:28
yzang2019 added a commit that referenced this pull request Apr 16, 2026
* main:
  Fix buffer offset in ProposerPriorityHash (CON-200) (#3255)
  Handle error case in light client divergence detector (#3254)
  perf(evmrpc): eliminate redundant block fetches in simulate backend (#3208)
  fix(evmrpc): omit notifications from legacy JSON-RPC batch responses per spec (#3246)
  fix: deduplicate block fetch in getTransactionReceipt (#3244)
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.

3 participants