test(firehose): add prestate generator and mainnet replay case - #22
Open
maoueh wants to merge 1 commit into
Open
test(firehose): add prestate generator and mainnet replay case#22maoueh wants to merge 1 commit into
maoueh wants to merge 1 commit into
Conversation
Adds base-firehose-prestate to turn a mined Base transaction into a replayable fixture, plus a base_mainnet_replay case whose golden was seeded from production Firehose. L1Block slots are listed in the tool from existing constants so the generator does not grow the common API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
base-firehose-prestate, a thin Base wrapper aroundfirehose-tracer-prestate5.4.1, that turns a mined Base mainnet or Sepolia transaction into a self-containedprestate.jsonthe tracer can replay with no node and no Docker.base_mainnet_replayprestate case for a real Base mainnet transaction. Its golden was seeded from production Firehose so the first run compared the replay against production; from here it is an ordinaryGOLDEN_UPDATE=1golden.ProductionReplayfrombase-firehose-testsso the replay projection (drop block-wide positional fields, keep gas, call tree, logs, balances, nonce, storage) is shared by the case and any follow-up.firehose-tracer/firehose-tracer-testto5.4.1and adds thefirehose-tracer-prestateworkspace pin.Base supplies only what the shared crate cannot know: the
BaseTxEnvelopetype, the genesis config re-projected fromChainConfig(the chain spec's own genesis drops every timestamped fork), theL1Blockpredeploy slots the L1-cost function reads outside the EVM journal, and the chain id. Those slots are listed locally in the tool from the existingL1BlockInfoconstants so this does not grow thebase-common-*public API.Why
L1Blockslots, a replay computes a zero L1 fee and every fee balance change comes out wrong.Usage
The endpoint must expose
debug_traceTransactionwith theprestateTracerover archive state.How to validate
prestateTracer, then replay it withrun_prestateand inspect the L1 fee / balance changes (they should be non-zero).base_mainnet_replaygolden and confirm it is a production-shaped projection (gas, call tree, logs, absolute balances) without ordinals or transaction index.Related links