canton: scope replay tries by (consumer, namespace), not consumer alone#52
Merged
Merged
Conversation
kcsongor
approved these changes
Jul 22, 2026
kcsongor
approved these changes
Jul 23, 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.
Why
NTT's CIP-56 rework (wormholelabs-xyz/native-token-transfers#43) makes a deployment's admin role transferable. A replay trie scoped solely to a
consumer : Partytherefore no longer works as the deployment's replay scope: transferring the admin would either strand the trie or force a dedicated identity party per deployment.What
The trie scope key becomes (consumer, namespace): the
consumerparty keeps carrying the authority (NTT will usegg), and an opaquenamespace : Textdoes the actual partitioning, so one controller party can maintain many independent tries.ReplayNodegainsnamespace : Text(ensurebounds it at 128 chars — it is copied into all 16 children on a split, so it must stay out of the documented node/split size budgets).ConsumeDigestis untouched: recreates and splits inherit the namespace viacreate this with.ClaimReplayRoottakes anamespaceand stamps it on the claimed root. As before there is no uniqueness enforcement — the namespace is a free-form sub-scope under the consumer's authority, not a claim anyone else can contest; parallel roots under one scope remain consumer self-harm.VerifyAndConsumeVAAtakes anamespaceand assertsnode.namespace == namespacebeside the existing consumer/operator pins, so a node from the consumer's other trie fails cleanly instead of silently consuming there.The core treats the namespace as opaque. NTT-side (follow-up in the other repo): derive it as
"ntt:" <> keccak256(instrumentId + initial admin party)and check that equality onchain atRegisterManager.wormhole-coreis bumped 0.2.0 → 0.3.0 (template payload + choice-argument change; integrators vendor the DAR by version).Tests
dpm build --all+dpm test: all 41 scripts pass.testNamespaceScopes: one consumer, two namespaces — the same digest consumes in each, replays stay per-namespace, and a split in one trie leaves the other's single root untouched.testVerifyAndConsumeVAAextended: the same consumer consumes the same VAA under a second namespace; the namespace-mismatch case uses an unconsumed third-namespace root so only the new check can reject it (the same node then consumes fine with the right namespace).testTrieSplitasserts all 16 children inherit the namespace;testDepth63NeverSplitscovers the ensure bound.ExampleIntegratorcarries a namespace and its two example apps share the string, demonstrating the party component alone still separates tries.README §4.6/§4.7 updated to match.