Skip to content

feat(external-call): enable hashing scheme V4 on protocol version 36 - #644

Open
angelol wants to merge 2 commits into
digital-asset:mainfrom
zenith-network:angelol/external-call-pv36-v4-hashing
Open

feat(external-call): enable hashing scheme V4 on protocol version 36#644
angelol wants to merge 2 commits into
digital-asset:mainfrom
zenith-network:angelol/external-call-pv36-v4-hashing

Conversation

@angelol

@angelol angelol commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

First slice of landing external calls in PV36 (per the Slack plan with @paulbrauner-da; September 2nd train). This slice is self-contained and independent of the serialization-version decision for external-call results, which the remaining slices depend on.

What it does

  • Moves the V4 row of MinimumProtocolVersionToHashingVersion from dev to v36 (onwards semantics keep dev supported), mirroring the V3-to-v35 promotion (86cea8e).
  • Binds the ProtoVersion(32) codecs of ExternalAuthorization and SubmitterMetadata to v36. Their v31→v32 delta is exactly the HASHING_SCHEME_VERSION_V4 enum value plus the Stable→Alpha marker, matching the pre-existing ViewParticipantData ProtoVersion(32) -> v36 binding; codec selection at v35 and below is unchanged.
  • Fallout: the ExternalTransactionProcessorSpec rejection test expects the v36 minimum and no longer registers at v36; the interactive-submission demo derives its schemes via getHashingSchemeVersionsForProtocolVersion (keeps its dev coverage, resolves the TODO on the exact-key lookup); the five ledger-API proto comments claiming V4 is dev-only are updated with proto-data.yml/openapi.yaml regenerated; UNRELEASED.md notes the promotion.
  • Second commit restores the V4 hashing specification in external_signing_hashing_algorithm.rst (V4 section, V3/V4 tabbed exercise encoding incl. external_call_results, V3 wording fixes) that was merged in feat(external-call): protocol and transaction-hash foundation #549 and unintentionally reverted by the 2026-07-02 internal sync (ff509b0), with the supported-schemes table saying v36 per this promotion.

What it deliberately does not do

External-call results themselves remain gated (LF feature at 2.dev; minExternalCallResults = VDev; ViewParticipantData.supportsExternalCallResults at dev) — a v36 V4 flow never encounters a node it cannot hash. Those gates move in the next slices once the serialization version for external-call results below 2.dev is settled.

Verification

  • CANTON_PROTOCOL_VERSION=36: ExternalTransactionProcessorSpec (the ungated honor test now runs V4), InteractiveSubmissionVersioningIntegrationTest + ExternalPartyOnboardingIntegrationTest (external-party flows with V4 as the default scheme, 21 tests green), SerializationDeserializationTest (24/24, round-trips V4 through the v36 codecs), HashingSchemeVersionSpec.
  • Default (v35) and dev runs of the same suites green — v35-and-below behavior is unchanged, dev keeps V4 via the map's onwards semantics.
  • sbt format + whole-repo sbt scalafixCheck clean. Comment-only proto changes: buf breaking is structure-only, so no snapshot churn.

Replace the dev row of MinimumProtocolVersionToHashingVersion with v36
(the map's onwards semantics keep dev supported), and bind the
ProtoVersion(32) codecs of ExternalAuthorization and SubmitterMetadata -
whose v31-to-v32 delta is the HASHING_SCHEME_VERSION_V4 enum value plus
the Stable-to-Alpha proto-version marker that a v36 codec binding needs -
to v36 accordingly. This is the first slice of shipping external calls
at protocol version 36: V4 is the hashing scheme that covers recorded
external-call results in prepared transactions.

Fallout folded in: the ExternalTransactionProcessorSpec rejection test
now expects the v36 minimum (and no longer runs at v36, where V4 is
accepted); the interactive-submission demo derives its schemes via
getHashingSchemeVersionsForProtocolVersion so its dev coverage survives
the dev row's removal (resolving the TODO on the exact-key lookup); the
five ledger API proto comments claiming V4 is dev-only are updated, with
proto-data.yml and openapi.yaml regenerated via GenerateJSONApiDocs; and
UNRELEASED.md notes the promotion.

Mirrors the V3-to-v35 promotion (86cea8e).
Restores the V4 section, the V3/V4 tabbed exercise-node encoding with
the external-call-result encoding, and the V3 wording fixes that were
merged in digital-asset#549 (8c30730) and unintentionally reverted by the
2026-07-02 internal sync (ff509b0). The supported-schemes table row
says v36 rather than the original dev, matching the promotion.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We currently don't change the rst files. Can you revert the changes?
@thibault-da What is the procedure to have this reflected in the public docs?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The public docs are now in a different repo, for this specific file it's here: https://github.com/canton-network/cf-docs/blob/main/docs-main/appdev/deep-dives/external-signing-hashing-algorithm.mdx
My understanding is that one should open a PR directly in that repo to update docs. Not sure how it works for external contributions regarding access

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would you agree to port the changes to the CF repo ? (not urgent)

@rgugliel-da rgugliel-da left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM
Please revert changes in the rst file.

@simonmaxen-da simonmaxen-da 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.

So this enabled the V4 hashing scheme version, that supports the hashing of external call results, to be used on PV36 but does not actually support the population of external call results (that will be included in follow up PR).

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.

4 participants