pub trait SnapStorageStore {
// Required methods
fn storage_progress(
&self,
write: SnapWrite,
origin: B256,
) -> Result<StorageProgress, SnapSyncError>;
fn commit_storage_chunk(
&self,
write: SnapWrite,
origin: B256,
chunk: StorageChunk,
) -> Result<StorageProgress, SnapSyncError>
where Self: MetadataWriter + StateWriter + DBProvider<Tx: DbTxMut>;
}Expand description
Persistence for contract storage downloaded ahead of its account range.
Blanket-implemented over the node’s writers, so slots and progress join the caller’s transaction and commit together or not at all.
Required Methods§
Sourcefn storage_progress(
&self,
write: SnapWrite,
origin: B256,
) -> Result<StorageProgress, SnapSyncError>
fn storage_progress( &self, write: SnapWrite, origin: B256, ) -> Result<StorageProgress, SnapSyncError>
Returns how far the storage of the range requested from origin is persisted.
A contract part way through when the pivot moved resumes with its root unproved.
Sourcefn commit_storage_chunk(
&self,
write: SnapWrite,
origin: B256,
chunk: StorageChunk,
) -> Result<StorageProgress, SnapSyncError>
fn commit_storage_chunk( &self, write: SnapWrite, origin: B256, chunk: StorageChunk, ) -> Result<StorageProgress, SnapSyncError>
Persists chunk for the range requested from origin, where the coverage must continue.
A contract starts at the zero slot, dropping whatever an earlier attempt left for it, and otherwise continues only where its last chunk ended.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".