Repository navigation
Conversation
Some chains change state in the block executor's finish, outside the EVM, where the Firehose inspector cannot see it. PostTxExtras gains capture_post_block, which runs before the inner finish and returns a PostBlockChanges. The wrapper emits it after the inner finish, after the withdrawal balance changes. The default captures nothing, so Ethereum output does not change. FirehoseEvmConfig<F> now uses F's hooks instead of the no-op ones: on the engine path through FirehoseLiveHooks, and on the pipeline path through a new LiveChainHooks for its batch executor. Before, a chain that wrapped its EVM configuration in FirehoseEvmConfig lost its hooks.
capture_post_block now receives the block's BlockFees, which exposes the block number, coinbase, chain id and spec, so a hook can decide from the block alone, as the pre-Merge rewards of #97 need. Both finish variants share one emission helper, and the docs state that post-block changes come last and must not touch withdrawal recipients, whose changes are rebuilt backwards from the final balances. A new test covers the live path's finish variant and both tests check the block invariants.
# Conflicts: # crates/firehose-tests/Cargo.toml
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.
Replaces #98 (same commit by @valvecitydev, plus a follow-up), since the fork branch did not accept maintainer pushes.
Some chains change state in the block executor's
finish, outside the EVM, where the Firehose inspector cannot see it.PostTxExtras::capture_post_blockruns before the inner finish and returns aPostBlockChanges, emitted as the block's last changes, after the withdrawal balance changes. The default captures nothing, so Ethereum output does not change. Those changes must not touch a withdrawal recipient, since withdrawals are rebuilt backwards from final balances.BlockFees, which now exposes the block number, coinbase, chain id and spec, so a hook can decide from the block alone (for example pre-Merge block rewards, see feat(firehose): emit pre-Merge block and uncle reward balance changes #97).FirehoseEvmConfig<F>now installsF's hooks on the engine path (FirehoseLiveHooks) and the pipeline path (newLiveChainHooks), instead of the no-op ones.ConfigureEvm for FirehoseEvmConfig<F>now requiresF: FirehoseLiveHooks.