diff --git a/pkg/validator/validator.go b/pkg/validator/validator.go index 1a201a9..9c6bf2d 100644 --- a/pkg/validator/validator.go +++ b/pkg/validator/validator.go @@ -334,7 +334,7 @@ func applyTransactions(block *types.Block, backend *ipldeth.Backend) (*ipldstate evm.Reset(core.NewEVMTxContext(msg), statedb) // Apply the transaction to the current state (included in the env). if _, err := core.ApplyMessage(evm, msg, &gp); err != nil { - return nil, fmt.Errorf("transaction %#x failed: %w", tx.Hash(), err) + return nil, fmt.Errorf("error applying tx %#x: %w", tx.Hash(), err) } if config.IsByzantium(block.Number()) { @@ -344,6 +344,14 @@ func applyTransactions(block *types.Block, backend *ipldeth.Backend) (*ipldstate } } + // Withdrawals processing. + for _, w := range block.Withdrawals() { + // Convert amount from gwei to wei. + amount := new(uint256.Int).SetUint64(w.Amount) + amount = amount.Mul(amount, uint256.NewInt(params.GWei)) + statedb.AddBalance(w.Address, amount) + } + if config.Ethash != nil { accumulateRewards(config, statedb, block.Header(), block.Uncles()) }