Skip to content

feat: TransientArray#23576

Merged
mverzilli merged 2 commits into
merge-train/fairies-v5from
martin/tx-local-storage
Jun 8, 2026
Merged

feat: TransientArray#23576
mverzilli merged 2 commits into
merge-train/fairies-v5from
martin/tx-local-storage

Conversation

@mverzilli

@mverzilli mverzilli commented May 27, 2026

Copy link
Copy Markdown
Contributor

Implements a new storage mechanism, TransientArray. It is similar to EphemeralArray, but its lifetime is a top level execution instead of a call frame.

It also adds store/load/delete convenience functions providing similar single KV store semantics as their equally named capsule counterparts

Closes F-677

@mverzilli mverzilli requested a review from nventuro as a code owner May 27, 2026 07:45
@mverzilli mverzilli requested a review from nchamo May 27, 2026 13:54
@mverzilli mverzilli changed the base branch from next to merge-train/fairies May 27, 2026 13:55
@mverzilli mverzilli changed the title feat: TxLocalArray feat: TransientArray May 27, 2026

@nchamo nchamo 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.

I haven't finished yet, but I wanted to leave some initial comments

Comment thread noir-projects/aztec-nr/aztec/src/ephemeral/mod.nr Outdated
Comment thread noir-projects/aztec-nr/aztec/src/transient/mod.nr
Comment thread noir-projects/aztec-nr/aztec/src/oracle/transient.nr
Comment thread yarn-project/txe/src/txe_session.ts Outdated
Comment thread noir-projects/aztec-nr/aztec/src/oracle/transient.nr Outdated
Comment thread noir-projects/aztec-nr/aztec/src/transient/mod.nr Outdated
Comment thread noir-projects/noir-contracts/contracts/test/transient_parent_contract/src/main.nr Outdated
Comment thread yarn-project/pxe/src/contract_function_simulator/oracle/oracle.ts Outdated
mverzilli added a commit that referenced this pull request May 29, 2026
Squashed work for PR #23576 (Linear F-677). Introduces TransientArray<T>:
an in-memory array that lives for one top-level PXE call (private tx
simulation or utility call), shared across all frames of the same contract
(private and utility alike), and isolated per contract.

aztec-nr:
- TransientArray<T> with push/pop/get/set/len/remove/clear/for_each plus
  Serialize/Deserialize as slot identifier.
- Single-value store/load/delete helpers in the transient module.
- Companion oracle bindings (aztec_utl_*Transient).
- Cross-references between EphemeralArray and TransientArray docs.

PXE:
- TransientArrayService keyed by (contract address, slot).
- Threaded through PrivateExecutionOracle and inherited by nested utility
  frames via UtilityExecutionOracle.callUtilityFunction, so private->utility
  same-contract calls share the store; contract-sync utility runs get their
  own fresh store.
- Bumped ORACLE_INTERFACE_HASH / oracle minor version for the new oracles.

TXE:
- Handles TransientArray oracles; top-level utility entrypoints get a fresh
  store, nested frames inherit it.

Tests:
- Unit tests for TransientArrayService (push/pop/get/set/len/remove/clear).
- transient_parent_contract + transient_child_contract noir tests covering
  same-contract sharing across private frames (test_sharing via
  self.call_self.appender) and cross-contract isolation (test_isolation).
- utility_execution.test.ts covers nested utility sharing and a private->
  utility .run()-based test (test_sharing_with_utility) proving the
  transient store is shared across the private/utility boundary.

Review feedback applied (nchamo): doc wording "execution" -> "top-level PXE
call", test_sharing uses macro-generated self.call_self, txe_session
top-level-utility comment clarified.
@mverzilli mverzilli force-pushed the martin/tx-local-storage branch from ad6c013 to f4b9386 Compare May 29, 2026 08:41
@mverzilli mverzilli requested a review from nchamo May 29, 2026 12:23

@nchamo nchamo 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.

Small question on the tests: ts vs Noir

Comment thread yarn-project/txe/src/txe_session.ts Outdated
Comment thread yarn-project/pxe/src/contract_function_simulator/transient_array_service.ts Outdated
Comment thread noir-projects/aztec-nr/aztec/src/oracle/transient.nr
Comment thread yarn-project/pxe/src/oracle_version.ts Outdated
Comment thread noir-projects/noir-contracts/contracts/test/transient_parent_contract/src/main.nr Outdated
Comment thread yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution.test.ts Outdated
@mverzilli mverzilli changed the base branch from merge-train/fairies to merge-train/fairies-v5 June 5, 2026 12:11
Adds an execution-scoped, contract-isolated in-memory array (`TransientArray`)
shared across all frames of one top-level PXE call (private + utility), sitting
between `EphemeralArray` (one call frame) and `CapsuleArray` (persistent).

- aztec-nr: `TransientArray` type, transient oracle suite, oracle version bump.
- PXE: `TransientArrayService` threaded through the private/utility execution
  oracles; 7 `aztec_utl_*Transient` handlers registered in the typed oracle
  registry; oracle version 29.1 + interface hash.
- TXE: transient handlers in the rpc translator; store threaded through the
  session.
- Tests: Noir TXE tests for private→private, private→utility, utility→utility
  sharing and cross-contract isolation; PXE service unit tests.
@mverzilli mverzilli force-pushed the martin/tx-local-storage branch from d2d4dd1 to 8019d11 Compare June 5, 2026 12:51

@nchamo nchamo 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.

Great work!

…tin/tx-local-storage

# Conflicts:
#	yarn-project/pxe/src/oracle_version.ts
@mverzilli mverzilli enabled auto-merge (squash) June 8, 2026 09:56
@mverzilli mverzilli merged commit 6414564 into merge-train/fairies-v5 Jun 8, 2026
12 checks passed
@mverzilli mverzilli deleted the martin/tx-local-storage branch June 8, 2026 10:25
mverzilli added a commit that referenced this pull request Jun 8, 2026
Brings in TransientArray (#23576) and the Proxy-based buildACIRCallback
oracle dispatch (#23915). Conflict resolutions:

- oracle.ts: accepted upstream's deletion of the hand-written 711-line
  dispatch. FactStore oracles now dispatch through the registry-driven
  buildACIRCallback; their entries auto-merged into oracle_registry.ts.
- utility_execution_oracle.ts: dropped the obsolete `Oracle` import,
  kept `FactOutput`. FactStore and transient handler methods auto-merged.
- oracle_version.ts: recomputed ORACLE_INTERFACE_HASH for the merged
  65-oracle registry (ae63cb…) and bumped minor 29.1 -> 29.2 (the merged
  interface is a strict superset of both branches' independent 29.1
  additions). Mirrored the minor bump into the two Noir version files.

Verified: TS build green, oracle hash confirmed by check_oracle_version,
offchain + FactStore Noir suite 13/13 and oracle_version_is_checked 9/9.
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.

2 participants