From 8c274d0ad4a94a04d233c80e4664789b59364632 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Thu, 9 May 2024 20:41:27 +0800 Subject: [PATCH] placeholder withdrawal handling --- pkg/eth/backend.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/eth/backend.go b/pkg/eth/backend.go index ba9d91e1..0a26b9b2 100644 --- a/pkg/eth/backend.go +++ b/pkg/eth/backend.go @@ -349,8 +349,15 @@ func (b *Backend) BlockByHash(ctx context.Context, hash common.Hash) (*types.Blo return nil, err } + // Placeholder for withdrawal processing (TODO) + var withdrawals types.Withdrawals + if b.Config.ChainConfig.IsShanghai(header.Number, header.Time) { + // All blocks after Shanghai must include a withdrawals root. + withdrawals = make(types.Withdrawals, 0) + } + // Compose everything together into a complete block - return types.NewBlock(header, transactions, uncles, receipts, trie.NewEmpty(nil)), err + return types.NewBlockWithWithdrawals(header, transactions, uncles, receipts, withdrawals, trie.NewEmpty(nil)), err } // GetHeaderByBlockHash retrieves header for a provided block hash