-
Notifications
You must be signed in to change notification settings - Fork 105
Keep chain tip in memory for sync_chain_mmr endpoint #1841
Copy link
Copy link
Description
Not for this PR, but it may be good to keep this info in memory somehow so that we could avoid going to the DB just to look up just to figure out which block number to use. Maybe this could be returned from State::latest_block_num() - e.g., as something like:
let chain_tip = self.state.latest_block_num(finality_level).await;Let's create an issue for this.
Originally posted by @bobbinth in #1725 (comment)
// Determine the effective tip based on the requested finality level.
let effective_tip = match request.finality() {
proto::rpc::Finality::Unspecified | proto::rpc::Finality::Committed => chain_tip,
proto::rpc::Finality::Proven => self
.state
.db()
.select_latest_proven_block_num()
.await
.map_err(SyncChainMmrError::DatabaseError)?,
};Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
storeRelated to the store componentRelated to the store component