Skip to content

[FEATURE] TXE privateCallNewFlow hardcodes minRevertibleSideEffectCounter, breaking contracts that call end_setup() #22291

@ilpepepig

Description

@ilpepepig

Problem Statement

TXE is cannot be used for testing FPCs and other contracts with functions that change phases calling end_setup, because it throws if nullifiers or other side effects are emitted during setup.

My understanding: TestEnvironment::call_private (privateCallNewFlow in txe_oracle_top_level_context.ts) skips the account contract entrypoint and compensates by forcing minRevertibleSideEffectCounter = 1 on the execution note cache and passing that same constant into generateSimulatedProvingResult.

Real txs that call end_setup() (e.g. FPC flows) fix the revertible boundary at the side-effect counter after setup. TXE instead assumes a fixed minRevertibleSideEffectCounter = 1, so nullifiers (and other side effects) emitted during setup are classified differently than in the circuit/kernel, and simulated proving / tail inputs no longer match.

Is this correct? Can it be fixed?

Also, is this error message correct?

public aztec_prv_notifyRevertiblePhaseStart(_foreignMinRevertibleSideEffectCounter: ForeignCallSingle) {
throw new Error('Enqueueing public calls is not supported in TestEnvironment::private_context');

Proposed Solution

No response

Example Use Case

No response

Alternative Solutions

No response

Additional Context

v4.2.0-aztecnr-rc.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-feature-requestType: Adding a brand new feature (not to be confused with improving an existing feature).from-communityThis originated from the community :)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions