-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: store safe block num as well (#11648)
- Loading branch information
Showing
14 changed files
with
130 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
use alloy_primitives::BlockNumber; | ||
use reth_errors::ProviderResult; | ||
|
||
/// Functionality to read the last known finalized block from the database. | ||
pub trait FinalizedBlockReader: Send + Sync { | ||
/// Functionality to read the last known chain blocks from the database. | ||
pub trait ChainStateBlockReader: Send + Sync { | ||
/// Returns the last finalized block number. | ||
/// | ||
/// If no finalized block has been written yet, this returns `None`. | ||
fn last_finalized_block_number(&self) -> ProviderResult<Option<BlockNumber>>; | ||
/// Returns the last safe block number. | ||
/// | ||
/// If no safe block has been written yet, this returns `None`. | ||
fn last_safe_block_number(&self) -> ProviderResult<Option<BlockNumber>>; | ||
} | ||
|
||
/// Functionality to write the last known finalized block to the database. | ||
pub trait FinalizedBlockWriter: Send + Sync { | ||
/// Functionality to write the last known chain blocks to the database. | ||
pub trait ChainStateBlockWriter: Send + Sync { | ||
/// Saves the given finalized block number in the DB. | ||
fn save_finalized_block_number(&self, block_number: BlockNumber) -> ProviderResult<()>; | ||
|
||
/// Saves the given safe block number in the DB. | ||
fn save_safe_block_number(&self, block_number: BlockNumber) -> ProviderResult<()>; | ||
} |
Oops, something went wrong.