Skip to content

test(txe): extend oracle roundtrip coverage to more scalar oracles#24550

Merged
nchamo merged 2 commits into
merge-train/fairies-v5from
nchamo/more-oracle-tests
Jul 6, 2026
Merged

test(txe): extend oracle roundtrip coverage to more scalar oracles#24550
nchamo merged 2 commits into
merge-train/fairies-v5from
nchamo/more-oracle-tests

Conversation

@nchamo

@nchamo nchamo commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extends the #[generate_oracle_tests] roundtrip suite to six more oracles: aztec_utl_deleteFactCollection, aztec_prv_getNextTaggingIndex, and the four AVM aztec_avm_getContractInstance* members (79 generated tests, up from 73).
  • Adds paired test-value impls for OnchainDeliveryMode and GetContractInstanceResult, and teaches the macro's type pinning to preserve concrete array lengths (e.g. [T; 1]) instead of rewriting them to the test collection length.
  • Fixes the CONTRACT_INSTANCE_MEMBER wire modeling, now composed as FIXED_ARRAY(STRUCT(...), 1): nargo encodes the [GetContractInstanceResult; 1] return as a single heap-array slot in struct field order, not two scalar slots — a latent mismatch that no production path exercised. The TXE handlers now build the one-element array themselves, so the hashed oracle interface changed (hash constant updated; no version bump since the wire itself is unchanged).

@nchamo nchamo self-assigned this Jul 6, 2026
@nchamo nchamo added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure labels Jul 6, 2026
exists: bool,
member: Field,
#[derive(Eq)]
pub(crate) struct GetContractInstanceResult {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Made public so we can generate tests for them. It's just the struct used to deserialize oracle return values

* - TXE_ORACLE_VERSION_MINOR for additive changes (new oracle method added).
*/
export const TXE_ORACLE_INTERFACE_HASH = 'f6694961673ada551f57f5c09fa04cd566b175e63b7b965343bd4cf02b3cbdf6';
export const TXE_ORACLE_INTERFACE_HASH = '4ed3618087fafb4aa63c6580996a69bf6bc257844035a2019692586b5b8daf34';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No version bump, since nothing really changed

getContractInstanceClassId(address: AztecAddress): Promise<{ member: Fr; exists: boolean }>;
getContractInstanceInitializationHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }>;
getContractInstanceImmutablesHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }>;
getContractInstanceDeployer(address: AztecAddress): Promise<{ member: Fr; exists: boolean }[]>;

Copy link
Copy Markdown
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 reflecting what the oracle actually returns in Noir. We are slowly fixing all oracles with these auto-tests

@nchamo nchamo marked this pull request as ready for review July 6, 2026 17:02
@nchamo nchamo requested a review from nventuro as a code owner July 6, 2026 17:02
@nchamo nchamo requested a review from mverzilli July 6, 2026 17:02
Comment on lines +42 to +44
quote { record_fact_oracle }, // TODO: implement once we support more complex types
quote { get_fact_collection_oracle }, // TODO: implement once we support more complex types
quote { get_fact_collections_by_type_oracle }, // TODO: implement once we support more complex types

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.

maybe worth a linear issue?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It goes away in the next PR (already 80% there)

Comment thread yarn-project/txe/src/oracle/test-resolver/default_fixtures.ts Outdated

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

LGTM!

@nchamo nchamo enabled auto-merge (squash) July 6, 2026 18:30
@nchamo nchamo merged commit db2b240 into merge-train/fairies-v5 Jul 6, 2026
12 checks passed
@nchamo nchamo deleted the nchamo/more-oracle-tests branch July 6, 2026 18:44
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. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants