Repository navigation
CIP112: Forward each authorizer's own context to its Allocation_Settle - #127
Open
haseebrabbani wants to merge 1 commit into
Open
haseebrabbani wants to merge 1 commit into
haseebrabbani wants to merge 1 commit into
Conversation
haseebrabbani
requested review from
0xNeshi,
ericnordelo,
igingu and
pepebndc
as code owners
November 18, 2026 13:13
0xNeshi
force-pushed
the
audit-m1-02-l05
branch
from
November 19, 2026 10:37
20f5b0c to
56d7cac
Compare
0xNeshi
force-pushed
the
cip112-settle-context
branch
from
November 19, 2026 10:44
12cfee1 to
5a36154
Compare
settleBatchImpl takes a selector that picks the context each Allocation_Settle receives, given the allocation's view and the batch's choice context. The batch metadata still never reaches an allocation. TokenRules forwards nothing, so its behaviour is unchanged. The doc comment and the utils README state the two conditions that keep the batch context private: no authorizer is an informee of the batch, and the selector keys on the authorizer. The custom example keeps its compliance freeze on a per-account MyAccountStatus instead of a flag on MyHolding. A freeze no longer re-creates holdings, so pending instructions and allocations complete once the account is unfrozen. All three consumption operations, and the owner unlock, read the status from the choice context and refuse a frozen account. MyRules forwards each batch authorizer only its own status, MyTransferInstruction_Expire takes extraArgs, and MyRules_OpenAccount opens a status. The sandbox gate gains the JSON Ledger API witness check from #119. A new script uses it to show that each authorizer sees neither the batch context nor the other authorizer's entry. Closes #82
0xNeshi
force-pushed
the
cip112-settle-context
branch
from
November 19, 2026 13:01
5a36154 to
a52edb1
Compare
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.
Closes #82. Stacked on #116 (L-05): base
audit-m1-02-l05.Utils
settleBatchImpltakes a selectorAllocationView -> ChoiceContext -> ChoiceContextthat picks the context eachAllocation_Settlereceives. Batchmetastill never reaches an allocation.settlementFactory_settleBatchExtraObservers, and a selector keyed onallocView.allocation.authorizer.TokenRulespasses\_ _ -> emptyChoiceContext, so its behaviour is unchanged. The signature break is folded into the Unreleased entry instead of a version bump, since the package is pre-release.Custom example
MyHolding.frozento a per-accountMyAccountStatus, signed by the admin and the compliance officer and opened throughMyRules_OpenAccount. Holdings are never re-created, so pending contracts complete after an unfreeze.MyHolding_OwnerUnlockread the status from the context. They refuse a frozen account, a stale or missing id, another account's status, and a status not signed by the holding's officer.MyRulesforwards each batch authorizer only its own status.MyTransferInstruction_ExpiretakesextraArgs, in the same shape as L-13: Fold admin garbage collection into the expiry choices and add an admin unlock of expired locks #118.Sandbox gate
SCRIPTS/WITNESS_SCRIPTSlines.sandboxSettleBatchContextWitnesses: neither authorizer's transactions contain the batch-only entry or the other authorizer's entry.