Skip to content

Commit

Permalink
[improve] Add annotation for GravityStorage (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lchangliang authored Jan 20, 2025
1 parent 4df0b8b commit 61abcf1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/gravity-storage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,22 @@ impl std::fmt::Display for GravityStorageError {
pub trait GravityStorage: Send + Sync + 'static {
type StateView: DatabaseRef<Error = ProviderError>;

// get state view for execute
fn get_state_view(
&self,
block_number: u64,
) -> Result<(B256, Self::StateView), GravityStorageError>;

// Insert the mapping from block_number to block_id
fn insert_block_id(&self, block_number: u64, block_id: B256);

// Insert the mapping from block_number to bundle_state
fn insert_bundle_state(&self, block_number: u64, bundle_state: &BundleState);

fn update_canonical(&self, block_number: u64, block_hash: B256); // gc
// Update canonical to block_number and reclaim the intermediate result cache
fn update_canonical(&self, block_number: u64, block_hash: B256);

// calculate state root by block_number
fn state_root_with_updates(
&self,
block_number: u64,
Expand Down

0 comments on commit 61abcf1

Please sign in to comment.