Add support for block-until-commit responses#7562
Draft
eddyashton wants to merge 38 commits intomicrosoft:mainfrom
Draft
Add support for block-until-commit responses#7562eddyashton wants to merge 38 commits intomicrosoft:mainfrom
eddyashton wants to merge 38 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds support for endpoints that defer their HTTP responses until the transaction is globally committed (or invalidated) by the consensus protocol. The implementation introduces a commit callback subsystem, modifies the task system to use shared ownership for resumable tasks, and integrates these changes throughout the RPC stack.
- Introduces
CommitCallbackSubsystemto manage callbacks triggered when transactions reach terminal consensus states - Changes
Resumablefromunique_ptrtoshared_ptrto support capturing in lambda callbacks - Adds
set_consensus_committed_functionto endpoint configuration API allowing endpoints to defer responses
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e_logging.py | Adds test comparing response timing between blocking and non-blocking endpoints |
| src/tasks/task_system.cpp | Updates function signature to accept Resumable by value instead of rvalue reference |
| src/tasks/resumable.h | Changes Resumable from unique_ptr to shared_ptr to enable shared ownership |
| src/node/rpc_context_impl.h | Adds optional respond_on_commit field to track deferred responses |
| src/node/commit_callback_subsystem.h | New subsystem managing callbacks for committed/invalidated transactions |
| src/node/commit_callback_interface.h | Interface definition for commit callback subsystem |
| src/http/http_session.h | Implements response deferral by pausing tasks and registering commit callbacks |
| src/endpoints/endpoint_registry.cpp | Adds default handler for commit responses that reports invalidated transactions |
| src/endpoints/endpoint.cpp | Implements setter for consensus_committed_func |
| src/node/node_state.h | Integrates commit_callbacks subsystem into node state |
| src/enclave/rpc_sessions.h | Passes commit callbacks subsystem to HTTP sessions |
| src/enclave/enclave.h | Creates and installs commit callback subsystem during initialization |
| src/consensus/aft/raft.h | Integrates callback execution when transactions commit |
| src/node/rpc/frontend.h | Sets respond_on_commit when endpoint has consensus_committed_func |
| samples/apps/logging/logging.cpp | Demonstrates blocking endpoints with example /log/blocking/private endpoints |
| include/ccf/tx_status.h | Adds FinalTxStatus enum containing only terminal transaction states |
| include/ccf/endpoint_registry.h | Declares default_respond_on_commit_func in public API |
| include/ccf/endpoint_context.h | Defines ConsensusCommittedEndpointFunction type |
| include/ccf/endpoint.h | Adds consensus_committed_func field and setter to Endpoint |
| CHANGELOG.md | Documents the new feature and adds formatting changes to older sections |
Comments suppressed due to low confidence (5)
CHANGELOG.md:2160
- This adds an extra blank line that appears unintentional. This section already had proper formatting and this change doesn't improve readability.
- The new `command.start.service_configuration.maximum_node_certificate_validity_days` (defaults to 365 days) configuration entry sets the maximum validity period allowed for node certificates.
CHANGELOG.md:1874
- This adds an extra blank line that appears unintentional. This section already had proper formatting and this change doesn't improve readability.
- The new `node_certificate.initial_validity_days` (defaults to 1 day) configuration entry lets operators set the initial validity period for the node certificate (valid from the current system time).
CHANGELOG.md:2908
- This adds an extra blank line that appears unintentional. The surrounding sections don't use blank lines to separate items in this way.
CHANGELOG.md:2913 - This adds an extra blank line that appears unintentional. The surrounding sections don't use blank lines to separate items in this way.
- Governance
CHANGELOG.md:2918
- This adds an extra blank line that appears unintentional. The surrounding sections don't use blank lines to separate items in this way.
cjen1-msft
reviewed
Jan 9, 2026
cjen1-msft
reviewed
Jan 9, 2026
achamayou
reviewed
Jan 9, 2026
maxtropets
reviewed
Jan 12, 2026
maxtropets
reviewed
Jan 12, 2026
…into respond_at_commit
… back into consensus
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.
This has taken a few different forms as I tried to work out what the right API was. I think this is a neat approach, and roughly minimal for apps to implement - a new modifier when installing an endpoint that defers the response until commit, and a default callback that inserts an error response if the TxID is invalidated.
A handful of outstanding items, probably for future PRs but up-for-discussion:
CommittedorInvalid) is not reached for a long time, the caller may still want to know the assignedTxID, rather than simply getting a client HTTP timeout.