Skip to content

Fix pre-v6.5 debug trace tx decoding#3470

Merged
Kbhat1 merged 7 commits into
mainfrom
fix-debug-trace-canonical-decode-main
May 20, 2026
Merged

Fix pre-v6.5 debug trace tx decoding#3470
Kbhat1 merged 7 commits into
mainfrom
fix-debug-trace-canonical-decode-main

Conversation

@Kbhat1
Copy link
Copy Markdown
Contributor

@Kbhat1 Kbhat1 commented May 20, 2026

Describe your changes and provide context

  • Add a trace-only pre-v6.5 tx decoder that skips the new TxBody bloat check
  • Use it when replaying historical debug_trace* blocks so old Cosmos tx bytes don’t break tracing
  • Add a regression test for an old tx with explicit memo=""; pre-v6.5 trace works, v6.5+ stays strict

Testing performed to validate your change

  • Unit tests
  • Verifying on node

@cursor
Copy link
Copy Markdown

cursor Bot commented May 20, 2026

PR Summary

Medium Risk
Touches transaction decoding and upgrade-gating logic used by debug_trace* paths; while normal mempool/DeliverTx decoding remains strict, mistakes could cause tracing failures or (if misused) weaken tx validation.

Overview
Fixes debug_trace* on pre-v6.5 blocks by introducing a trace-only Cosmos TxDecoder that skips the new TxBody “bloat” rejection, and wiring it into EVM RPC tracing/replay (BlockByNumber, GetTransaction, and replay helpers) based on whether the v6.5 upgrade is active at the target height.

Adds support utilities to detect upgrade activation (UpgradeKeeper.IsUpgradeActiveAtHeight and TxConfig.ProtoCodec) and extends tests to cover historical bloated TxBody bytes decoding for tracing (while asserting v6.5+ remains strict).

Reviewed by Cursor Bugbot for commit 34bfeaa. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 20, 2026, 7:36 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.07%. Comparing base (63067ee) to head (34bfeaa).

Files with missing lines Patch % Lines
evmrpc/trace_tx_decoder.go 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3470   +/-   ##
=======================================
  Coverage   59.07%   59.07%           
=======================================
  Files        2186     2187    +1     
  Lines      182269   182299   +30     
=======================================
+ Hits       107671   107702   +31     
  Misses      64947    64947           
+ Partials     9651     9650    -1     
Flag Coverage Δ
sei-chain-pr 67.94% <94.59%> (?)
sei-db 70.41% <ø> (-0.22%) ⬇️

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

Files with missing lines Coverage Δ
evmrpc/simulate.go 75.00% <100.00%> (+0.65%) ⬆️
sei-cosmos/x/auth/tx/config.go 93.10% <100.00%> (+0.51%) ⬆️
sei-cosmos/x/auth/tx/decoder.go 88.34% <100.00%> (+0.59%) ⬆️
sei-cosmos/x/upgrade/keeper/keeper.go 92.79% <100.00%> (+0.09%) ⬆️
evmrpc/trace_tx_decoder.go 87.50% <87.50%> (ø)

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

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9fe8237. Configure here.

Comment thread evmrpc/trace_tx_decoder.go
@Kbhat1 Kbhat1 requested review from masih and philipsu522 May 20, 2026 15:42
Copy link
Copy Markdown
Contributor

@arajasek arajasek left a comment

Choose a reason for hiding this comment

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

LGTM!

@Kbhat1 Kbhat1 added this pull request to the merge queue May 20, 2026
Merged via the queue into main with commit 5098e5b May 20, 2026
43 checks passed
@Kbhat1 Kbhat1 deleted the fix-debug-trace-canonical-decode-main branch May 20, 2026 21:28
@seidroid
Copy link
Copy Markdown

seidroid Bot commented May 20, 2026

Created backport PR for release/v6.5:

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin backport-3470-to-release/v6.5
git worktree add --checkout .worktree/backport-3470-to-release/v6.5 backport-3470-to-release/v6.5
cd .worktree/backport-3470-to-release/v6.5
git reset --hard HEAD^
git cherry-pick -x 5098e5b0e902f51d8966003f33aaa440fde9b0d5
git push --force-with-lease

Kbhat1 added a commit that referenced this pull request May 20, 2026
- Add a trace-only pre-v6.5 tx decoder that skips the new TxBody bloat
check
- Use it when replaying historical debug_trace* blocks so old Cosmos tx
bytes don’t break tracing
- Add a regression test for an old tx with explicit memo=""; pre-v6.5
trace works, v6.5+ stays strict

- Unit tests
- Verifying on node

(cherry picked from commit 5098e5b)
Kbhat1 added a commit that referenced this pull request May 21, 2026
Backport of #3470 to `release/v6.5`.

Co-authored-by: Kartik Bhat <kartikbhatri@gmail.com>
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.

4 participants