-
Notifications
You must be signed in to change notification settings - Fork 247
Prefetch COSE endorsements of previous identities #7518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefetch COSE endorsements of previous identities #7518
Conversation
07c68c6 to
88f363c
Compare
7f82348 to
78b7f4f
Compare
78b7f4f to
5740891
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the COSE endorsement fetching mechanism from on-demand to asynchronous prefetching. The goal is to enable instant verification of incoming COSE receipts against the current ledger by preloading the entire chain of previous service identity endorsements during disaster recovery.
Key changes:
- Moves endorsement fetching logic from historical queries adapter into the
NetworkIdentitySubsystem - Implements asynchronous prefetching that starts in the subsystem constructor and retries until complete
- Changes
populate_cose_service_endorsementsto depend on the prefetched chain rather than on-demand loading
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
src/node/rpc/network_identity_subsystem.h |
Adds new async prefetching implementation with validation logic for endorsement chains |
src/node/historical_queries_utils.cpp |
Removes on-demand fetching logic and updates to use prefetched endorsements from subsystem |
src/node/historical_queries_adapter.cpp |
Updates function call to pass network identity subsystem instead of state cache |
src/node/tx_receipt_impl.h |
Changes endorsements type from raw vector to CoseEndorsementsChain type alias |
include/ccf/network_identity_interface.h |
Adds new interface methods and types for fetching status and endorsement chains |
include/ccf/historical_queries_utils.h |
Updates function signature to accept network identity subsystem |
src/enclave/enclave.h |
Updates subsystem construction to pass historical cache dependency |
Co-authored-by: Copilot <[email protected]>
Missing links are inconclusive, some ledger files could be missing etc. But there are ill-formed chains that are definitely very bad, like the current identity pointing a previous at a seqno that directly conflicts with what we fetch. I think we need to consider shutting down if that happens. |
Co-authored-by: Amaury Chamayou <[email protected]>
This PR changes the way CCF pulls up COSE endorsements for previous service identities (one of #7401).
Why?
What's changed?
populate_cose_service_endorsementsnow depends on it, rather then re-loading the chain from the historical cache.Q. Why wait until the current identity endorses the previous one?
Q. Why not fail the node if prefetching went wrong?
FetchStatus::Failto play safe, and although user can't make a historical request (with COSE endorsements), the node keeps functioning, although producing FAIL logs once when fetch has failed, and any time it's called to get the chainQ. Why fetching status is atomic, but everything else isn't?
Q. Where are the tests?