Handle incomplete network identity fetching consistently#7703
Merged
maxtropets merged 6 commits intomainfrom Mar 5, 2026
Merged
Handle incomplete network identity fetching consistently#7703maxtropets merged 6 commits intomainfrom
maxtropets merged 6 commits intomainfrom
Conversation
… incomplete Change get_cose_endorsements_chain to throw std::logic_error when endorsement fetching has not completed, matching the behavior of get_trusted_identity_for and get_trusted_keys. Update the docstring to document the @throws clause. Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update get_cose_endorsements_chain to throw if fetching not done
Handle incomplete network identity fetching consistently
Mar 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes incomplete network identity endorsement fetching failures consistent across the NetworkIdentitySubsystemInterface API by changing get_cose_endorsements_chain() to throw when fetching is not complete, matching the behavior of adjacent trusted-key accessors.
Changes:
- Change
NetworkIdentitySubsystem::get_cose_endorsements_chain()to throwstd::logic_errorwhenfetch_status != FetchStatus::Done(instead of returningstd::nullopt). - Update the public interface documentation to clarify that incomplete fetching results in an exception, while
std::nulloptremains for “no chain available for this seqno”.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/node/rpc/network_identity_subsystem.h |
Throws on incomplete fetch for get_cose_endorsements_chain(), aligning behavior with sibling methods. |
include/ccf/network_identity_interface.h |
Updates API docstring to document the new exception behavior and narrow std::nullopt to the “not available for seqno” case. |
maxtropets
reviewed
Mar 4, 2026
Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
maxtropets
approved these changes
Mar 5, 2026
achamayou
approved these changes
Mar 5, 2026
eddyashton
approved these changes
Mar 5, 2026
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.
include/ccf/network_identity_interface.hforget_cose_endorsements_chainto document that it throwsstd::logic_errorwhen fetching is not done, matching adjacent methodssrc/node/rpc/network_identity_subsystem.hto throwstd::logic_errorinstead of returningstd::nulloptwhenfetch_status != FetchStatus::Donesrc/node/historical_queries_utils.cppis safe (already guards with status check)🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.