Skip to content

refactor(txe): normalize deploy and addAccount to oracle registry#23536

Draft
nchamo wants to merge 2 commits into
nchamo/txe-oracle-registryfrom
nchamo/txe-deploy-normalize
Draft

refactor(txe): normalize deploy and addAccount to oracle registry#23536
nchamo wants to merge 2 commits into
nchamo/txe-oracle-registryfrom
nchamo/txe-deploy-normalize

Conversation

@nchamo
Copy link
Copy Markdown
Contributor

@nchamo nchamo commented May 24, 2026

Why we are doing this

The aztec_txe_deploy and aztec_txe_addAccount oracles were the last two handlers with special-case pre-processing in the dispatcher. The dispatcher manually deserialized inputs, resolved artifacts, cached them in module-level maps, and mutated the inputs array before forwarding to the session. This made the dispatcher responsible for domain logic that belongs in the oracle layer, and prevented these oracles from using the typed callTxeHandler registry pattern that all other oracles use.

Our fix

  • Extract artifact resolution and caching into a new TXEArtifactResolver service, shared across all sessions via injection from the dispatcher. Uses a single Map<string, Promise<ResolvedArtifact>> for deduplication of both in-flight and completed computations.
  • Move deploy and addAccount domain logic into TXEOracleTopLevelContext, which now accepts raw typed parameters and handles artifact resolution internally.
  • Register both oracles in TXE_ORACLE_REGISTRY with proper type mappings (STR for contract path/initializer, U32 for args length, etc.), so rpc_translator.ts uses callTxeHandler like every other oracle.
  • Remove all pre-processing, the switch statement, and ~130 lines of imports from the dispatcher.

@nchamo nchamo added the ci-draft Run CI on draft PRs. label May 24, 2026
@nchamo nchamo self-assigned this May 24, 2026
@AztecBot
Copy link
Copy Markdown
Collaborator

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/e82a72159881ef6e�e82a72159881ef6e8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/broadcasted_invalid_block_proposal_slash.test.ts (234s) (code: 0) group:e2e-p2p-epoch-flakes

@nchamo nchamo requested a review from mverzilli May 24, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants