From 55fae2ca9c082c363fc8ccdd121ab433221933b7 Mon Sep 17 00:00:00 2001
From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com>
Date: Thu, 1 Feb 2024 18:57:50 +0100
Subject: [PATCH] Add `Withdrawals` struct (#6267)
---
crates/blockchain-tree/src/blockchain_tree.rs | 4 +-
crates/consensus/common/src/validation.rs | 22 +++----
crates/interfaces/src/p2p/full_block.rs | 5 +-
crates/node-api/src/engine/mod.rs | 4 +-
crates/node-api/src/engine/traits.rs | 4 +-
crates/payload/basic/src/lib.rs | 11 ++--
crates/payload/builder/src/optimism.rs | 14 +++--
crates/payload/builder/src/payload.rs | 16 ++---
crates/primitives/src/block.rs | 23 +++-----
crates/primitives/src/lib.rs | 2 +-
crates/primitives/src/transaction/sidecar.rs | 35 +++++------
crates/primitives/src/withdrawal.rs | 58 ++++++++++++++++++-
crates/revm/src/processor.rs | 2 +-
crates/revm/src/state_change.rs | 10 ++--
crates/rpc/rpc-engine-api/tests/it/payload.rs | 9 ++-
.../rpc-types-compat/src/engine/payload.rs | 7 ++-
crates/rpc/rpc/src/debug.rs | 5 +-
crates/rpc/rpc/src/eth/api/pending_block.rs | 2 +-
crates/storage/db/src/tables/models/blocks.rs | 4 +-
.../provider/src/providers/database/mod.rs | 4 +-
.../src/providers/database/provider.rs | 6 +-
crates/storage/provider/src/providers/mod.rs | 5 +-
.../src/providers/snapshot/manager.rs | 4 +-
.../storage/provider/src/test_utils/blocks.rs | 8 +--
.../storage/provider/src/test_utils/mock.rs | 7 ++-
.../storage/provider/src/test_utils/noop.rs | 7 ++-
.../provider/src/traits/withdrawals.rs | 4 +-
testing/ef-tests/src/models.rs | 6 +-
28 files changed, 175 insertions(+), 113 deletions(-)
diff --git a/crates/blockchain-tree/src/blockchain_tree.rs b/crates/blockchain-tree/src/blockchain_tree.rs
index dc5914de21..4d587cdcb2 100644
--- a/crates/blockchain-tree/src/blockchain_tree.rs
+++ b/crates/blockchain-tree/src/blockchain_tree.rs
@@ -1248,7 +1248,7 @@ mod tests {
stage::StageCheckpoint,
Account, Address, ChainSpecBuilder, Genesis, GenesisAccount, Header, Signature,
Transaction, TransactionKind, TransactionSigned, TransactionSignedEcRecovered, TxEip1559,
- B256, MAINNET,
+ Withdrawals, B256, MAINNET,
};
use reth_provider::{
test_utils::{
@@ -1492,7 +1492,7 @@ mod tests {
.seal_slow(),
body: body.clone().into_iter().map(|tx| tx.into_signed()).collect(),
ommers: Vec::new(),
- withdrawals: Some(Vec::new()),
+ withdrawals: Some(Withdrawals::default()),
},
body.iter().map(|tx| tx.signer()).collect(),
)
diff --git a/crates/consensus/common/src/validation.rs b/crates/consensus/common/src/validation.rs
index 13a3571315..0fd6601761 100644
--- a/crates/consensus/common/src/validation.rs
+++ b/crates/consensus/common/src/validation.rs
@@ -478,7 +478,7 @@ mod tests {
use reth_primitives::{
constants::eip4844::DATA_GAS_PER_BLOB, hex_literal::hex, proofs, Account, Address,
BlockBody, BlockHash, BlockHashOrNumber, Bytes, ChainSpecBuilder, Header, Signature,
- TransactionKind, TransactionSigned, Withdrawal, MAINNET, U256,
+ TransactionKind, TransactionSigned, Withdrawal, Withdrawals, MAINNET, U256,
};
use std::ops::RangeBounds;
@@ -492,7 +492,7 @@ mod tests {
&self,
_id: BlockHashOrNumber,
_timestamp: u64,
- ) -> ProviderResult