Skip to content

build: sonic trace marshal + EIP-7702 trace fix + rollback-to-version recovery - #1

Merged
littlehand26 merged 8 commits into
mainfrom
sonic-deploy
Jul 11, 2026
Merged

littlehand26 merged 8 commits into
mainfrom
sonic-deploy

Conversation

@littlehand26

Copy link
Copy Markdown
Contributor

Chaintable cronos build changes for the DeBank trace_debankBlock emitter, plus a store-recovery command.

Commits

  • sonic trace_debankBlock marshal (5ab3012): replace stdlib encoding/json with sonic.ConfigStd for the DebankBlock RPC response marshal (~9% CPU in trace serving). Output verified byte/semantically identical to stdlib.
  • EIP-7702 trace nil-pointer fix (be97edb): bump ethermint-cronos to 4c6016d2. validateAuthorization used k.eip155ChainID (nil on a frozen/query node, set only in BeginBlock) → uint256.CmpBig(nil) panic on type-4 (SetCode) txs. Use cfg.ChainConfig.ChainID instead.
  • rollback-to-version recovery command (7a1e4d4): cronosd rollback-to-version [height] loads the app multistore at an explicit version (instead of the latest) before rolling back, so it can recover a store left at mixed per-store versions by an interrupted rollback (where LoadLatestVersion then fails with "wanted to load target N but only found up to N-1").

ethermint-cronos b1e2dc72 marshals the trace_debankBlock response with sonic
(SIMD/JIT) instead of go-ethereum's reflection-based encoding/json codec, the
top CPU consumer in archive backfill. Output stays byte-compatible (ConfigStd).
…6d2)

trace_debankBlock / debug_trace* panicked on any block with a type-0x4
(EIP-7702) tx because validateAuthorization used the BeginBlock-only keeper
field k.eip155ChainID (nil on the frozen archive query path). Now uses the
EVM cfg chain ID. Includes the sonic marshal change.
Loads the app multistore at an explicit version (instead of the latest)
before rolling back, so it can recover a store left at mixed per-store
versions by an interrupted rollback (where LoadLatestVersion then fails
with "wanted to load target N but only found up to N-1").
@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

…e60d1)

trace_debankBlock now reconciles every replayed tx against the stored
consensus receipt (status / gas_used / logs). Replaying old-era blocks under
the current binary's gas semantics can flip a near-gas-limit tx's outcome
(OOG <-> success) versus what consensus recorded - 4 such txs found on
cronosmainnet_25-1 in pre-v1.2 blocks, plus in-block cascading event
divergence. Reconciliation is a no-op whenever replay agrees with consensus.

Chaintable/ethermint-cronos#5
Adds the guided second tracing pass: consensus-failed txs replay dry (no
state commit), consensus-successful txs retry on a gas ladder until their
logs reproduce consensus - eliminating in-block state contamination and
OOG-truncated call trees on divergent old-era blocks.
Picks up the round-2 reconciliation fixes (no-rung lowest-completing-gas tree,
content-based event pairing, native logIndex alignment) and the GASLIMIT
consensus-params fix. Wires app.ConsensusParamsKeeper into the EVM keeper so the
query/trace path can populate ctx.ConsensusParams().
Picks up the block_max_gas request-field approach for the GASLIMIT-on-replay
fix (CometBFT consensus params, works for all historical heights). Drops the
SetConsensusParamsKeeper wiring, which is no longer used.
build: bump ethermint-cronos to consensus receipt reconciliation
@littlehand26
littlehand26 merged commit 2ec3621 into main Jul 11, 2026
23 of 39 checks passed
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