feat(execution): return result of error if panic when execution#398
Open
AshinGau wants to merge 1 commit into
Open
feat(execution): return result of error if panic when execution#398AshinGau wants to merge 1 commit into
AshinGau wants to merge 1 commit into
Conversation
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.
Summary
This PR establishes a typed error path for Gravity's pipe execution instead of panicking, unwrapping runtime failures, or dropping the results of spawned block tasks.
The main changes are:
PipeBlockErrorwith block ID, block number, epoch, and execution stage context;ProviderError,BlockExecutionError, andChannelErrorso callers can classify failures without string parsing or downcasting;PipeExecServicesupervise block tasks through aJoinSet, observe returned errors and task panics, and shut down all pipe barriers and channels consistently after the first fatal failure;Resultspine;ProviderResultfrom the engine tree to the pipe, while treating a dropped oneshot response receiver as best-effort delivery cancellation;Motivation
The pipe previously spawned one task per block and discarded each task handle. Several runtime error paths then used
unwrap,expect, orpanic!. For example, an executor error caused the node to panic after attempting to dump the block, while a dump failure could panic first and hide the actual execution error.The EIP-7702 nonce-side-effect issue demonstrated why this boundary matters: a filter/executor mismatch can cause the executor to return an error for an ordered block. Known recoverable validation cases should be filtered and represented by the existing skipped receipt, but provider or executor failures must retain their concrete cause and reach a single owner that can stop the local pipe safely.
Error semantics
RevertorHaltresult"Fatal" here means that this node's pipe cannot safely continue from potentially partial state. It does not imply that the block is invalid or that the error necessarily affects the whole network.
Scope
This PR intentionally does not:
unwraporexpectin gravity-reth;PipeExecLayerApiworkflow.A consensus-layer interface for reporting and recovering from block execution failures remains a separate design problem.
Testing
cargo test -p reth-pipe-exec-layer-ext-v2 --lib— 64 passedcargo test -p reth-engine-tree --lib --no-runcargo check -p reth-pipe-exec-layer-ext-v2 -p gravity-storage -p reth-pipe-exec-layer-event-bus -p reth-engine-treecargo fmt --allgit diff --check