feat(sub-account-anonymizer): until_undeployed flag on get_sub_accounts - #921
Conversation
7a3356d to
2225665
Compare
a8b1487 to
a4d4280
Compare
2225665 to
4422591
Compare
a4d4280 to
0c5f57e
Compare
4422591 to
2433d80
Compare
8e89d82 to
8af08f0
Compare
219e73e to
a6e8c46
Compare
8af08f0 to
2ecbda6
Compare
a6e8c46 to
939ce67
Compare
2ecbda6 to
8ae0acb
Compare
f43d1fb to
4f2d9c0
Compare
8ae0acb to
a3db51f
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
consider removing the is_deployed flag now
@Yoni-Starkware reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on ittaysw).
4f2d9c0 to
73acefe
Compare
a3db51f to
b306453
Compare
b306453 to
f0cc325
Compare
73acefe to
1ee4a25
Compare
2558027 to
6d99b87
Compare
There was a problem hiding this comment.
Pull request overview
Adds an until_undeployed: bool flag to the SubAccountAnonymizer get_sub_accounts view so callers can fetch the contiguous deployed sub-account prefix in a single view call (instead of client-side window scanning), and regenerates the SDK ABI to reflect the updated contract interface (including OpenNote.collect_policy).
Changes:
- Extend
get_sub_accounts(Cairo + generated TS ABI) with a trailinguntil_undeployed: boolparameter and implement early-stop behavior at the first undeployed nonce. - Update Cairo test suites to pass the new parameter and add coverage for the new early-stop semantics.
- Document the ABI/signature change in the SDK changelog.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/src/internal/anonymizer-abi.ts | Regenerated ABI reflecting the new get_sub_accounts(..., until_undeployed) parameter (and includes collect_policy). |
| sdk/CHANGELOG.md | Notes the ABI signature change and its behavior. |
| packages/sub_account_anonymizer/src/sub_account_anonymizer.cairo | Updates the public trait + implementation to accept until_undeployed and break on first undeployed nonce. |
| packages/sub_account_anonymizer/src/tests/test_sub_account_anonymizer.cairo | Updates existing calls for the new arity and adds tests for the deployed-prefix behavior. |
| packages/privacy/src/tests/test_e2e.cairo | Updates e2e call site to include the new trailing boolean argument. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add a trailing `until_undeployed: bool` to the anonymizer's `get_sub_accounts` view. When true, the view stops at the first undeployed nonce and returns only the contiguous deployed prefix; when false it resolves every nonce in [start, end) (unchanged). This lets the client resolve a user's deployed sub-accounts in one view call instead of scanning window-by-window client-side. Regenerating SubAccountAnonymizerABI also picks up the OpenNote.collect_policy field, from which the committed ABI had drifted (never regenerated after CollectPolicy landed in Cairo).
6d99b87 to
986be50
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (1)
sdk/CHANGELOG.md:20
- This changelog entry describes a required new parameter on an existing view; that is a breaking change for any callers of
get_sub_accounts(older calldata/ABIs with 3 args will revert). The changelog should explicitly label this as breaking and mention that passingfalsepreserves the previous behavior.
`get_sub_accounts` takes a trailing `until_undeployed: bool`: when true the view stops at the
first undeployed nonce and returns only the contiguous deployed prefix, when false it resolves
every nonce in the range.

Add a trailing
until_undeployed: boolto the anonymizer'sget_sub_accountsview. When true, theview stops at the first undeployed nonce and returns only the contiguous deployed prefix; when
false it resolves every nonce in [start, end) (unchanged). This lets the client resolve a user's
deployed sub-accounts in one view call instead of scanning window-by-window client-side.
Regenerating SubAccountAnonymizerABI also picks up the OpenNote.collect_policy field, from which
the committed ABI had drifted (never regenerated after CollectPolicy landed in Cairo).
This change is