Open
Conversation
Mirko-von-Leipzig
approved these changes
Mar 30, 2026
| impl From<proto::rpc::Finality> for Finality { | ||
| fn from(finality: proto::rpc::Finality) -> Self { | ||
| match finality { | ||
| proto::rpc::Finality::Unspecified | proto::rpc::Finality::Committed => { |
Collaborator
There was a problem hiding this comment.
I'm not sure how I feel about defaulting here for Unspecified, but its probably not a train smash.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1841.
Cache proven-in-sequence tip to avoid repeated DB queries
Adds a
watch::channel-based cache for the proven-in-sequence block number, so RPC endpoints requestingFinality::Provenno longer hit the database on every call.Changes
Finalityenum (Committed/Proven) in the store'sStateState::latest_block_num()withState::chain_tip(finality)which returns the committed tip (from the in-memory MMR) or the proven tip (from the cached watch channel) depending on the requested finalityState::load()initializes the proven tip from the DB and returns awatch::Senderthat the proof scheduler uses to push updates aftermark_proven_and_advance_sequenceadvances the sequencesync_chain_mmrfrom a match + DB query into a singlechain_tip(finality)callStore::serve()into helper functionsspawn_proof_scheduler()andspawn_grpc_servers()