Skip to content

Block-on-commit with inline signature response#7785

Merged
achamayou merged 26 commits into
microsoft:mainfrom
eddyashton:receipt_on_commit
Apr 1, 2026
Merged

Block-on-commit with inline signature response#7785
achamayou merged 26 commits into
microsoft:mainfrom
eddyashton:receipt_on_commit

Conversation

@eddyashton

Copy link
Copy Markdown
Member

Implementing #7781.

  • Signature cache subsystem: New SignatureCacheSubsystem captures signature, COSE signature, and serialised merkle tree via global commit hooks on the KV tables, making recent signature data available for inline receipt construction.
  • Block-until-commit with receipts: New ConsensusCommittedEndpointFunction callback signature passes a CommittedTxInfo struct containing all receipt leaf components (write set digest, commit evidence, claims digest), enabling commit callbacks to build full transaction receipts inline.
  • Receipt builder helper: build_receipt_for_committed_tx() reconstructs the merkle tree from cached data, extracts a proof for the specific seqno, and assembles a complete TxReceiptImpl — available for any endpoint to embed receipts in their own response format.
  • Write set observer refactor: Changed the write_set_observer callback to pass the digest (not raw bytes), and moved get_commit_evidence() formatting into the encryptor to eliminate duplication across committable_tx.h, historical_queries.h, and the new receipt path.
  • E2e tests: Extended test_blocking_calls to cover all three endpoint variants (non-blocking, blocking, blocking-with-receipt) with receipt verification via verify_receipt, and added invalidation testing for the receipt path in partitions_test.py.

@eddyashton eddyashton requested a review from a team as a code owner March 27, 2026 16:08
Copilot AI review requested due to automatic review settings March 27, 2026 16:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for returning transaction receipts inline from block-until-commit endpoints by caching recent signature material at commit time and extending the consensus-committed callback to include receipt leaf components.

Changes:

  • Introduces a SignatureCacheSubsystem that captures recent signature/COSE signature/serialised Merkle tree data via global commit hooks.
  • Updates the consensus-committed endpoint callback API to pass a CommittedTxInfo struct, enabling inline receipt construction on commit.
  • Extends sample logging app + OpenAPI schema and e2e tests to cover a new blocking-with-receipt endpoint and invalidation paths.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/partitions_test.py Extends invalidation test to cover receipt-capable blocking endpoint.
tests/e2e_logging.py Adds receipt endpoint to blocking/non-blocking timing tests and verifies returned receipts.
src/node/snapshotter.h Updates write-set observer to accept a digest directly.
src/node/signature_cache_subsystem.h New subsystem caching recent signatures/trees for inline receipt construction.
src/node/signature_cache_interface.h New node subsystem interface for querying cached signature material.
src/node/rpc_context_impl.h Adds claims digest getter and expands respond-on-commit stored info.
src/node/rpc/frontend.h Captures write set digest + commit evidence at commit time for later commit callbacks.
src/node/node_state.h Wires signature cache hook registration into node startup.
src/node/historical_queries.h Uses encryptor helper to format commit evidence, removing duplication.
src/kv/kv_types.h Adds AbstractTxEncryptor::get_commit_evidence() helper.
src/kv/committable_tx.h Refactors commit evidence formatting and changes write-set observer to pass digest.
src/http/http_session.h Builds CommittedTxInfo and invokes new consensus-committed callback signature.
src/endpoints/endpoint_registry.cpp Adds receipt builder helper + “respond with receipt on commit” callback factory.
src/enclave/enclave.h Installs SignatureCacheSubsystem in the node context.
samples/apps/logging/logging.cpp Adds /log/blocking/private/receipt endpoint using inline receipt response.
include/ccf/rpc_context.h Adds get_claims_digest() to the public RpcContext interface.
include/ccf/endpoint_registry.h Exposes new receipt-on-commit helpers in the public endpoint registry API.
include/ccf/endpoint_context.h Introduces CommittedTxInfo and updates consensus-committed callback type.
doc/schemas/app_openapi.json Updates sample app OpenAPI version and documents new receipt endpoint path.

Comment thread include/ccf/endpoint_context.h
Comment thread src/node/signature_cache_subsystem.h Outdated
Comment thread src/node/rpc/frontend.h Outdated
Comment thread src/endpoints/endpoint_registry.cpp Outdated
Comment thread include/ccf/endpoint_context.h
@achamayou achamayou added this to the 7.0.0-rc1 milestone Mar 30, 2026
Comment thread src/endpoints/endpoint_registry.cpp Outdated
@eddyashton eddyashton added the run-long-test Run Long Test job label Mar 31, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.

Comment thread src/node/signature_cache_subsystem.h Outdated
Comment thread src/node/signature_cache_subsystem.h Outdated
Comment thread src/endpoints/endpoint_registry.cpp
Comment thread doc/schemas/app_openapi.json
@achamayou achamayou enabled auto-merge (squash) April 1, 2026 07:38
@achamayou achamayou merged commit 72789db into microsoft:main Apr 1, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-long-test Run Long Test job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants