diff --git a/yarn-project/simulator/src/avm/avm_execution_environment.ts b/yarn-project/simulator/src/avm/avm_execution_environment.ts index 9e067710bda..36592fd7a03 100644 --- a/yarn-project/simulator/src/avm/avm_execution_environment.ts +++ b/yarn-project/simulator/src/avm/avm_execution_environment.ts @@ -1,4 +1,4 @@ -import { FunctionSelector, type GlobalVariables, type Header } from '@aztec/circuits.js'; +import { FunctionSelector, type GlobalVariables } from '@aztec/circuits.js'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { Fr } from '@aztec/foundation/fields'; @@ -14,7 +14,6 @@ export class AvmExecutionEnvironment { public readonly functionSelector: FunctionSelector, // may be temporary (#7224) public readonly contractCallDepth: Fr, public readonly transactionFee: Fr, - public readonly header: Header, public readonly globals: GlobalVariables, public readonly isStaticCall: boolean, public readonly isDelegateCall: boolean, @@ -35,7 +34,6 @@ export class AvmExecutionEnvironment { functionSelector, this.contractCallDepth.add(Fr.ONE), this.transactionFee, - this.header, this.globals, isStaticCall, isDelegateCall, diff --git a/yarn-project/simulator/src/avm/avm_simulator.test.ts b/yarn-project/simulator/src/avm/avm_simulator.test.ts index a5dac0b3035..03078a1b713 100644 --- a/yarn-project/simulator/src/avm/avm_simulator.test.ts +++ b/yarn-project/simulator/src/avm/avm_simulator.test.ts @@ -819,7 +819,6 @@ describe('AVM simulator: transpiled Noir contracts', () => { /*nestedEnvironment=*/ expect.objectContaining({ sender: environment.address, // sender is top-level call contractCallDepth: new Fr(1), // top call is depth 0, nested is depth 1 - header: environment.header, // just confirming that nested env looks roughly right globals: environment.globals, // just confirming that nested env looks roughly right isStaticCall: isStaticCall, // TODO(7121): can't check calldata like this since it is modified on environment construction diff --git a/yarn-project/simulator/src/avm/fixtures/index.ts b/yarn-project/simulator/src/avm/fixtures/index.ts index 9d8e2183322..084767f0317 100644 --- a/yarn-project/simulator/src/avm/fixtures/index.ts +++ b/yarn-project/simulator/src/avm/fixtures/index.ts @@ -1,5 +1,5 @@ import { isNoirCallStackUnresolved } from '@aztec/circuit-types'; -import { GasFees, GlobalVariables, Header } from '@aztec/circuits.js'; +import { GasFees, GlobalVariables } from '@aztec/circuits.js'; import { FunctionSelector, getFunctionDebugMetadata } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; @@ -63,7 +63,6 @@ export function initExecutionEnvironment(overrides?: Partial n.value), ); - const avmExecutionEnv = createAvmExecutionEnvironment( - executionRequest, - this.header, - globalVariables, - transactionFee, - ); + const avmExecutionEnv = createAvmExecutionEnvironment(executionRequest, globalVariables, transactionFee); const avmMachineState = new AvmMachineState(availableGas); const avmContext = new AvmContext(avmPersistableState, avmExecutionEnv, avmMachineState); @@ -120,7 +115,6 @@ export class PublicExecutor { */ function createAvmExecutionEnvironment( executionRequest: PublicExecutionRequest, - header: Header, globalVariables: GlobalVariables, transactionFee: Fr, ): AvmExecutionEnvironment { @@ -131,7 +125,6 @@ function createAvmExecutionEnvironment( executionRequest.callContext.functionSelector, /*contractCallDepth=*/ Fr.zero(), transactionFee, - header, globalVariables, executionRequest.callContext.isStaticCall, executionRequest.callContext.isDelegateCall, diff --git a/yarn-project/simulator/src/public/public_processor.ts b/yarn-project/simulator/src/public/public_processor.ts index 7739c0a501d..486747c7f92 100644 --- a/yarn-project/simulator/src/public/public_processor.ts +++ b/yarn-project/simulator/src/public/public_processor.ts @@ -57,7 +57,7 @@ export class PublicProcessorFactory { const historicalHeader = maybeHistoricalHeader ?? merkleTree.getInitialHeader(); const worldStateDB = new WorldStateDB(merkleTree, this.contractDataSource); - const publicExecutor = new PublicExecutor(worldStateDB, historicalHeader, telemetryClient); + const publicExecutor = new PublicExecutor(worldStateDB, telemetryClient); const publicKernelSimulator = new RealPublicKernelCircuitSimulator(this.simulator); return PublicProcessor.create( diff --git a/yarn-project/txe/src/oracle/txe_oracle.ts b/yarn-project/txe/src/oracle/txe_oracle.ts index 6bd3aef063e..32791a806b8 100644 --- a/yarn-project/txe/src/oracle/txe_oracle.ts +++ b/yarn-project/txe/src/oracle/txe_oracle.ts @@ -679,24 +679,14 @@ export class TXE implements TypedOracle { return `${artifact.name}:${f.name}`; } - async executePublicFunction( - targetContractAddress: AztecAddress, - args: Fr[], - callContext: CallContext, - counter: number, - ) { - const header = Header.empty(); - header.state = await this.trees.getStateReference(true); - header.globalVariables.blockNumber = new Fr(await this.getBlockNumber()); - + executePublicFunction(targetContractAddress: AztecAddress, args: Fr[], callContext: CallContext, counter: number) { const executor = new PublicExecutor( new TXEWorldStateDB(this.trees.asLatest(), new TXEPublicContractDataSource(this)), - header, new NoopTelemetryClient(), ); const execution = new PublicExecutionRequest(targetContractAddress, callContext, args); - return executor.simulate( + const executionResult = executor.simulate( execution, GlobalVariables.empty(), Gas.test(), @@ -705,6 +695,7 @@ export class TXE implements TypedOracle { /* transactionFee */ Fr.ONE, counter, ); + return Promise.resolve(executionResult); } async avmOpcodeCall(