Skip to content

Conversation

@nchamo
Copy link
Contributor

@nchamo nchamo commented Feb 12, 2026

Summary

  • TXE scope fix: When from is the zero address, TXE now returns [] (empty scopes, deny-all) instead of undefined (allow-all). This matches the behavior of BaseWallet.scopesFor() in the PXE/wallet path, where the zero address produces an empty scope list that causes ensureContractSynced to skip sync entirely.
  • ContractSyncService tests: Adds 19 unit tests covering scope-aware caching, cache invalidation (wipe/discard), overrides, concurrency, and error handling.

const effectiveScopes = from.isZero() ? undefined : [from];
// When `from` is the zero address (e.g. when deploying a new account contract), we return an
// empty scope list which acts as deny-all: no notes are visible and no keys are accessible.
const effectiveScopes = from.isZero() ? [] : [from];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are now making it consistent with the PXE

@nchamo nchamo requested a review from benesjan February 12, 2026 13:41
Copy link
Contributor

@benesjan benesjan left a comment

Choose a reason for hiding this comment

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

Looks good!

Just note that when testing you want to test external behavior and not irrelevant implementation details. AI sometimes over-tests and writes superfluous tests testing implementation details. So it's good to clear these useless test cases.

…ce tests

## Summary

- **TXE scope fix**: When `from` is the zero address, TXE now returns `[]` (empty scopes, deny-all) instead of `undefined` (allow-all). This matches the behavior of `BaseWallet.scopesFor()` in the PXE/wallet path, where the zero address produces an empty scope list that causes `ensureContractSynced` to skip sync entirely.
- **ContractSyncService tests**: Adds 19 unit tests covering scope-aware caching, cache invalidation (wipe/discard), overrides, concurrency, and error handling.

Co-authored-by: Nicolas Chamo <nicolas@chamo.com.ar>
@AztecBot AztecBot force-pushed the feat/contract-sync-tests-and-fixes branch from b11af16 to caca1bb Compare February 12, 2026 15:50
@AztecBot AztecBot enabled auto-merge February 12, 2026 15:50
@AztecBot AztecBot added this pull request to the merge queue Feb 12, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 12, 2026
…ce tests (#20425)

## Summary

- **TXE scope fix**: When `from` is the zero address, TXE now returns
`[]` (empty scopes, deny-all) instead of `undefined` (allow-all). This
matches the behavior of `BaseWallet.scopesFor()` in the PXE/wallet path,
where the zero address produces an empty scope list that causes
`ensureContractSynced` to skip sync entirely.
- **ContractSyncService tests**: Adds 19 unit tests covering scope-aware
caching, cache invalidation (wipe/discard), overrides, concurrency, and
error handling.
Merged via the queue into next with commit 0c257d2 Feb 12, 2026
18 checks passed
@AztecBot AztecBot deleted the feat/contract-sync-tests-and-fixes branch February 12, 2026 16:38
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.

3 participants