Skip to content

Handle incomplete network identity fetching consistently#7703

Merged
maxtropets merged 6 commits intomainfrom
copilot/update-get-cose-endorsements-chain
Mar 5, 2026
Merged

Handle incomplete network identity fetching consistently#7703
maxtropets merged 6 commits intomainfrom
copilot/update-get-cose-endorsements-chain

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

  • Update docstring in include/ccf/network_identity_interface.h for get_cose_endorsements_chain to document that it throws std::logic_error when fetching is not done, matching adjacent methods
  • Change implementation in src/node/rpc/network_identity_subsystem.h to throw std::logic_error instead of returning std::nullopt when fetch_status != FetchStatus::Done
  • Verify call site in src/node/historical_queries_utils.cpp is safe (already guards with status check)
  • Remove 'i.e.' and condition comparison from docstring per review feedback
  • Run code review and security checks

🔒 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.

… 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
@maxtropets maxtropets marked this pull request as ready for review March 4, 2026 22:45
@maxtropets maxtropets requested a review from a team as a code owner March 4, 2026 22:45
Copilot AI review requested due to automatic review settings March 4, 2026 22:45
Copy link
Contributor

Copilot AI left a 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 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 throw std::logic_error when fetch_status != FetchStatus::Done (instead of returning std::nullopt).
  • Update the public interface documentation to clarify that incomplete fetching results in an exception, while std::nullopt remains 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.

Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
Co-authored-by: maxtropets <16566519+maxtropets@users.noreply.github.com>
@maxtropets maxtropets enabled auto-merge (squash) March 5, 2026 11:46
@maxtropets maxtropets merged commit 8093d91 into main Mar 5, 2026
17 checks passed
@maxtropets maxtropets deleted the copilot/update-get-cose-endorsements-chain branch March 5, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants