feat: integrate builder (#6611)

This commit is contained in:
Matthias Seitz
2024-02-29 17:50:04 +01:00
committed by GitHub
parent 7d36206dfe
commit c5955f1305
73 changed files with 2201 additions and 3022 deletions

View File

@ -163,8 +163,11 @@ impl BundleStateWithReceipts {
/// Returns the receipt root for all recorded receipts.
/// Note: this function calculated Bloom filters for every receipt and created merkle trees
/// of receipt. This is a expensive operation.
#[cfg(not(feature = "optimism"))]
#[allow(unused_variables)]
pub fn receipts_root_slow(&self, block_number: BlockNumber) -> Option<B256> {
#[cfg(feature = "optimism")]
panic!("This should not be called in optimism mode. Use `optimism_receipts_root_slow` instead.");
#[cfg(not(feature = "optimism"))]
self.receipts.root_slow(self.block_number_to_index(block_number)?)
}
@ -172,13 +175,17 @@ impl BundleStateWithReceipts {
/// Note: this function calculated Bloom filters for every receipt and created merkle trees
/// of receipt. This is a expensive operation.
#[cfg(feature = "optimism")]
pub fn receipts_root_slow(
pub fn optimism_receipts_root_slow(
&self,
block_number: BlockNumber,
chain_spec: &reth_primitives::ChainSpec,
timestamp: u64,
) -> Option<B256> {
self.receipts.root_slow(self.block_number_to_index(block_number)?, chain_spec, timestamp)
self.receipts.optimism_root_slow(
self.block_number_to_index(block_number)?,
chain_spec,
timestamp,
)
}
/// Returns reference to receipts.