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
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(privateCallNewFlowin 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?
aztec-packages/yarn-project/txe/src/rpc_translator.ts
Lines 660 to 661 in c13d950
Proposed Solution
No response
Example Use Case
No response
Alternative Solutions
No response
Additional Context
v4.2.0-aztecnr-rc.2