mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 03:10:48 +00:00
Improve error handling and request initialization
Refactor error handling and request initialization in postExecution.
This commit is contained in:
parent
fee1233793
commit
2d6a0e8007
1 changed files with 10 additions and 11 deletions
|
|
@ -135,26 +135,25 @@ func (p *StateProcessor) Process(ctx context.Context, block *types.Block, stated
|
||||||
func postExecution(ctx context.Context, config *params.ChainConfig, block *types.Block, allLogs []*types.Log, evm *vm.EVM) (requests [][]byte, err error) {
|
func postExecution(ctx context.Context, config *params.ChainConfig, block *types.Block, allLogs []*types.Log, evm *vm.EVM) (requests [][]byte, err error) {
|
||||||
_, _, spanEnd := telemetry.StartSpan(ctx, "core.postExecution")
|
_, _, spanEnd := telemetry.StartSpan(ctx, "core.postExecution")
|
||||||
defer spanEnd(&err)
|
defer spanEnd(&err)
|
||||||
|
|
||||||
// Read requests if Prague is enabled.
|
// Read requests if Prague is enabled.
|
||||||
if config.IsPrague(block.Number(), block.Time()) {
|
if config.IsPrague(block.Number(), block.Time()) {
|
||||||
requests = [][]byte{}
|
var requests [][]byte
|
||||||
// EIP-6110
|
// EIP-6110
|
||||||
if err = ParseDepositLogs(&requests, allLogs, config); err != nil {
|
if err := ParseDepositLogs(&requests, allLogs, config); err != nil {
|
||||||
err = fmt.Errorf("failed to parse deposit logs: %w", err)
|
return nil, fmt.Errorf("failed to parse deposit logs: %w", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
// EIP-7002
|
// EIP-7002
|
||||||
if err = ProcessWithdrawalQueue(&requests, evm); err != nil {
|
if err := ProcessWithdrawalQueue(&requests, evm); err != nil {
|
||||||
err = fmt.Errorf("failed to process withdrawal queue: %w", err)
|
return nil, fmt.Errorf("failed to process withdrawal queue: %w", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
// EIP-7251
|
// EIP-7251
|
||||||
if err = ProcessConsolidationQueue(&requests, evm); err != nil {
|
if err := ProcessConsolidationQueue(&requests, evm); err != nil {
|
||||||
err = fmt.Errorf("failed to process consolidation queue: %w", err)
|
return nil, fmt.Errorf("failed to process consolidation queue: %w", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
|
||||||
|
return requests, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ApplyTransactionWithEVM attempts to apply a transaction to the given state database
|
// ApplyTransactionWithEVM attempts to apply a transaction to the given state database
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue