From a3d88d7160c291f2eeb2db59424311c6696f8091 Mon Sep 17 00:00:00 2001 From: fcarreiro Date: Fri, 5 Apr 2024 14:45:40 +0000 Subject: [PATCH] feat(avm): add Header to AvmExecutionEnvironment --- .../src/avm/avm_execution_environment.ts | 18 +++++------------- .../simulator/src/avm/fixtures/index.ts | 3 ++- .../src/avm/temporary_executor_migration.ts | 3 +++ yarn-project/simulator/src/public/executor.ts | 2 +- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/yarn-project/simulator/src/avm/avm_execution_environment.ts b/yarn-project/simulator/src/avm/avm_execution_environment.ts index ee6c9e3d301..379444053e0 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 } from '@aztec/circuits.js'; +import { FunctionSelector, type GlobalVariables, type Header } from '@aztec/circuits.js'; import { computeVarArgsHash } from '@aztec/circuits.js/hash'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type EthAddress } from '@aztec/foundation/eth-address'; @@ -22,29 +22,18 @@ export class AvmContextInputs { export class AvmExecutionEnvironment { constructor( public readonly address: AztecAddress, - public readonly storageAddress: AztecAddress, - public readonly origin: AztecAddress, - public readonly sender: AztecAddress, - public readonly portal: EthAddress, - public readonly feePerL1Gas: Fr, - public readonly feePerL2Gas: Fr, - public readonly feePerDaGas: Fr, - public readonly contractCallDepth: Fr, - + public readonly header: Header, public readonly globals: GlobalVariables, - public readonly isStaticCall: boolean, - public readonly isDelegateCall: boolean, - public readonly calldata: Fr[], // Function selector is temporary since eventually public contract bytecode will be one blob @@ -73,6 +62,7 @@ export class AvmExecutionEnvironment { this.feePerL2Gas, this.feePerDaGas, this.contractCallDepth, + this.header, this.globals, this.isStaticCall, this.isDelegateCall, @@ -96,6 +86,7 @@ export class AvmExecutionEnvironment { this.feePerL2Gas, this.feePerDaGas, this.contractCallDepth, + this.header, this.globals, /*isStaticCall=*/ true, this.isDelegateCall, @@ -119,6 +110,7 @@ export class AvmExecutionEnvironment { this.feePerL2Gas, this.feePerDaGas, this.contractCallDepth, + this.header, this.globals, this.isStaticCall, /*isDelegateCall=*/ true, diff --git a/yarn-project/simulator/src/avm/fixtures/index.ts b/yarn-project/simulator/src/avm/fixtures/index.ts index cb7fb7e776b..95c7648c676 100644 --- a/yarn-project/simulator/src/avm/fixtures/index.ts +++ b/yarn-project/simulator/src/avm/fixtures/index.ts @@ -1,5 +1,5 @@ import { SiblingPath } from '@aztec/circuit-types'; -import { GlobalVariables, L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/circuits.js'; +import { GlobalVariables, Header, L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/circuits.js'; import { FunctionSelector } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; @@ -67,6 +67,7 @@ export function initExecutionEnvironment(overrides?: Partial