Skip to content

Fix bug different hashes same tx seq vs occ - #3938

Open
alrevuelta wants to merge 1 commit into
sei-protocol:mainfrom
alrevuelta:coinbase-netzero-bug
Open

Fix bug different hashes same tx seq vs occ#3938
alrevuelta wants to merge 1 commit into
sei-protocol:mainfrom
alrevuelta:coinbase-netzero-bug

Conversation

@alrevuelta

Copy link
Copy Markdown
  • This PR adds a new failing test where sequential execution does not match OCC due to a different ChangeSet being produced. It also includes a potential fix.
  • When the coinbase account sends a transaction in its own block, it pays the gas fee for that tx and, because it's the coinbase (and sei doesn't burn the base fee) that same fee is credited back to it. With no other balance movement its balance nets back to the starting value.
  • On that net-zero balance, sequential still emits a Balance change (it force-emits any address that received a fee credit), while OCC omits it (final balance equals the block base). The applied state is identical seq vs OCC, but the emitted ChangeSet is not.
  • This can produce a serial-vs-parallel invariant break. It does not change any hash today (balances aren't folded into the lattice hash afaik) but once they do, it believe it will.

@yzang2019
yzang2019 requested a review from codchen August 17, 2026 22:20
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.46%. Comparing base (46671fb) to head (bd1ffc2).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3938      +/-   ##
==========================================
- Coverage   59.51%   58.46%   -1.05%     
==========================================
  Files        2326     2225     -101     
  Lines      198890   187794   -11096     
==========================================
- Hits       118367   109803    -8564     
+ Misses      69279    67617    -1662     
+ Partials    11244    10374     -870     
Flag Coverage Δ
sei-chain-pr 86.54% <100.00%> (?)
sei-db ?
sei-db-state-db ?

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

Files with missing lines Coverage Δ
giga/evmonly/state_db.go 88.75% <100.00%> (-0.02%) ⬇️

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants