From 0a54e47eab8ce60d2034cd06699c65cdbd9ba1eb Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 22 May 2023 12:03:25 +0200 Subject: [PATCH] chore: consistent _senders suffix (#2761) --- crates/consensus/beacon/src/engine/mod.rs | 2 +- crates/interfaces/src/blockchain_tree/mod.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/consensus/beacon/src/engine/mod.rs b/crates/consensus/beacon/src/engine/mod.rs index 38717fa3dc..d603330092 100644 --- a/crates/consensus/beacon/src/engine/mod.rs +++ b/crates/consensus/beacon/src/engine/mod.rs @@ -695,7 +695,7 @@ where &mut self, block: SealedBlock, ) -> Result { - self.blockchain.buffer_block_without_sender(block)?; + self.blockchain.buffer_block_without_senders(block)?; Ok(PayloadStatus::from_status(PayloadStatusEnum::Syncing)) } diff --git a/crates/interfaces/src/blockchain_tree/mod.rs b/crates/interfaces/src/blockchain_tree/mod.rs index 08ae5bfd5f..294776a7b4 100644 --- a/crates/interfaces/src/blockchain_tree/mod.rs +++ b/crates/interfaces/src/blockchain_tree/mod.rs @@ -15,6 +15,9 @@ pub mod error; /// blocks from p2p. Do reorg in tables if canonical chain if needed. pub trait BlockchainTreeEngine: BlockchainTreeViewer + Send + Sync { /// Recover senders and call [`BlockchainTreeEngine::insert_block`]. + /// + /// This will recover all senders of the transactions in the block first, and then try to insert + /// the block. fn insert_block_without_senders( &self, block: SealedBlock, @@ -26,7 +29,10 @@ pub trait BlockchainTreeEngine: BlockchainTreeViewer + Send + Sync { } /// Recover senders and call [`BlockchainTreeEngine::buffer_block`]. - fn buffer_block_without_sender(&self, block: SealedBlock) -> Result<(), InsertBlockError> { + /// + /// This will recover all senders of the transactions in the block first, and then try to buffer + /// the block. + fn buffer_block_without_senders(&self, block: SealedBlock) -> Result<(), InsertBlockError> { match block.try_seal_with_senders() { Ok(block) => self.buffer_block(block), Err(block) => Err(InsertBlockError::sender_recovery_error(block)),