diff --git a/barretenberg/cpp/src/barretenberg/vm2/common/avm_inputs.testdata.bin b/barretenberg/cpp/src/barretenberg/vm2/common/avm_inputs.testdata.bin index 3bae0a36cc56..c8200f3acd0a 100644 Binary files a/barretenberg/cpp/src/barretenberg/vm2/common/avm_inputs.testdata.bin and b/barretenberg/cpp/src/barretenberg/vm2/common/avm_inputs.testdata.bin differ diff --git a/docs/docs/developers/tutorials/codealong/js_tutorials/aztecjs-getting-started.md b/docs/docs/developers/tutorials/codealong/js_tutorials/aztecjs-getting-started.md index a74d2bf69614..845e80762f22 100644 --- a/docs/docs/developers/tutorials/codealong/js_tutorials/aztecjs-getting-started.md +++ b/docs/docs/developers/tutorials/codealong/js_tutorials/aztecjs-getting-started.md @@ -112,7 +112,7 @@ A successful run should show something like this: enr: undefined, nodeVersion: '0.82.0', l1ChainId: 31337, - protocolVersion: 1, + rollupVersion: 1, l1ContractAddresses: { rollupAddress: EthAddress<0x759f145841f36282f23e0935697c7b2e00401902>, registryAddress: EthAddress<0xd5448148ccca5b2f27784c72265fc37201741778>, diff --git a/docs/docs/migration_notes.md b/docs/docs/migration_notes.md index 8bd3ac077e69..f429519ff2e3 100644 --- a/docs/docs/migration_notes.md +++ b/docs/docs/migration_notes.md @@ -8,6 +8,10 @@ Aztec is in full-speed development. Literally every version breaks compatibility ## TBD +## [aztec.js] AztecNode.getVersion | PXE.getVersion | TXE.getVersion changed to getRollupVersion + +Anywhere getVersion has been used (cross chain messages and authwits) has been updated to getRollupVersion. + ### [aztec.js] AztecNode.getPrivateEvents API change The `getPrivateEvents` method signature has changed to require an address of a contract that emitted the event and use recipient addresses instead of viewing public keys: diff --git a/noir-projects/aztec-nr/aztec/src/oracle/execution.nr b/noir-projects/aztec-nr/aztec/src/oracle/execution.nr index b96b588d1507..85446c63f93c 100644 --- a/noir-projects/aztec-nr/aztec/src/oracle/execution.nr +++ b/noir-projects/aztec-nr/aztec/src/oracle/execution.nr @@ -9,7 +9,7 @@ unconstrained fn get_block_number_oracle() -> u32 {} #[oracle(getChainId)] unconstrained fn get_chain_id_oracle() -> Field {} -#[oracle(getVersion)] +#[oracle(getRollupVersion)] unconstrained fn get_version_oracle() -> Field {} pub unconstrained fn get_contract_address() -> AztecAddress { diff --git a/spartan/aztec-network/templates/pxe.yaml b/spartan/aztec-network/templates/pxe.yaml index a18a8f4f0dea..cd841bb68ef0 100644 --- a/spartan/aztec-network/templates/pxe.yaml +++ b/spartan/aztec-network/templates/pxe.yaml @@ -123,7 +123,7 @@ spec: - | curl -s -X POST -H 'content-type: application/json' \ -d '{"jsonrpc":"2.0","method":"pxe_getNodeInfo","params":[],"id":67}' \ - 127.0.0.1:{{ .Values.pxe.service.nodePort }} | grep -q '"protocolVersion":1' + 127.0.0.1:{{ .Values.pxe.service.nodePort }} | grep -q '"rollupVersion":1' initialDelaySeconds: {{ .Values.pxe.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.pxe.readinessProbe.periodSeconds }} timeoutSeconds: {{ .Values.pxe.readinessProbe.timeoutSeconds }} diff --git a/yarn-project/accounts/src/dapp/dapp_interface.ts b/yarn-project/accounts/src/dapp/dapp_interface.ts index 6472c9dcd40b..5f35556b6532 100644 --- a/yarn-project/accounts/src/dapp/dapp_interface.ts +++ b/yarn-project/accounts/src/dapp/dapp_interface.ts @@ -17,7 +17,7 @@ export class DefaultDappInterface extends DefaultAccountInterface { authWitnessProvider: AuthWitnessProvider, userAddress: CompleteAddress, dappAddress: AztecAddress, - nodeInfo: Pick, + nodeInfo: Pick, ) { super(authWitnessProvider, userAddress, nodeInfo); this.entrypoint = new DefaultDappEntrypoint( @@ -25,14 +25,14 @@ export class DefaultDappInterface extends DefaultAccountInterface { authWitnessProvider, dappAddress, nodeInfo.l1ChainId, - nodeInfo.protocolVersion, + nodeInfo.rollupVersion, ); } static createFromUserWallet(wallet: AccountWallet, dappAddress: AztecAddress): DefaultDappInterface { return new DefaultDappInterface(wallet, wallet.getCompleteAddress(), dappAddress, { l1ChainId: wallet.getChainId().toNumber(), - protocolVersion: wallet.getVersion().toNumber(), + rollupVersion: wallet.getRollupVersion().toNumber(), }); } } diff --git a/yarn-project/accounts/src/defaults/account_interface.ts b/yarn-project/accounts/src/defaults/account_interface.ts index af98483b50c2..6c2e9d8ff75d 100644 --- a/yarn-project/accounts/src/defaults/account_interface.ts +++ b/yarn-project/accounts/src/defaults/account_interface.ts @@ -17,21 +17,21 @@ export class DefaultAccountInterface implements AccountInterface { protected entrypoint: EntrypointInterface; private chainId: Fr; - private version: Fr; + private rollupVersion: Fr; constructor( private authWitnessProvider: AuthWitnessProvider, private address: CompleteAddress, - nodeInfo: Pick, + nodeInfo: Pick, ) { this.entrypoint = new DefaultAccountEntrypoint( address.address, authWitnessProvider, nodeInfo.l1ChainId, - nodeInfo.protocolVersion, + nodeInfo.rollupVersion, ); this.chainId = new Fr(nodeInfo.l1ChainId); - this.version = new Fr(nodeInfo.protocolVersion); + this.rollupVersion = new Fr(nodeInfo.rollupVersion); } createTxExecutionRequest( @@ -58,7 +58,7 @@ export class DefaultAccountInterface implements AccountInterface { return this.chainId; } - getVersion(): Fr { - return this.version; + getRollupVersion(): Fr { + return this.rollupVersion; } } diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index f158e386868b..4331f044ecff 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -121,7 +121,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable { protected readonly sequencer: SequencerClient | undefined, protected readonly validatorsSentinel: Sentinel | undefined, protected readonly l1ChainId: number, - protected readonly version: number, + protected readonly rollupVersion: number, protected readonly globalVariableBuilder: GlobalVariableBuilder, private proofVerifier: ClientProtocolCircuitVerifier, private telemetry: TelemetryClient = getTelemetryClient(), @@ -185,7 +185,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable { const l1ContractsAddresses = await RegistryContract.collectAddresses( publicClient, config.l1Contracts.registryAddress, - config.version ?? 'canonical', + config.rollupVersion ?? 'canonical', ); // Overwrite the passed in vars. @@ -197,13 +197,13 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable { client: publicClient, }); - const versionFromRollup = Number(await rollup.read.getVersion()); + const rollupVersionFromRollup = Number(await rollup.read.getVersion()); - config.version ??= versionFromRollup; + config.rollupVersion ??= rollupVersionFromRollup; - if (config.version !== versionFromRollup) { + if (config.rollupVersion !== rollupVersionFromRollup) { log.warn( - `Registry looked up and returned a rollup with version (${config.version}), but this does not match with version detected from the rollup directly: (${versionFromRollup}).`, + `Registry looked up and returned a rollup with version (${config.rollupVersion}), but this does not match with version detected from the rollup directly: (${rollupVersionFromRollup}).`, ); } @@ -276,7 +276,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable { sequencer, validatorsSentinel, ethereumChain.chainInfo.id, - config.version, + config.rollupVersion, new GlobalVariableBuilder(config), proofVerifier, telemetry, @@ -325,20 +325,19 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable { } public async getNodeInfo(): Promise { - const [nodeVersion, protocolVersion, chainId, enr, contractAddresses, protocolContractAddresses] = - await Promise.all([ - this.getNodeVersion(), - this.getVersion(), - this.getChainId(), - this.getEncodedEnr(), - this.getL1ContractAddresses(), - this.getProtocolContractAddresses(), - ]); + const [nodeVersion, rollupVersion, chainId, enr, contractAddresses, protocolContractAddresses] = await Promise.all([ + this.getNodeVersion(), + this.getRollupVersion(), + this.getChainId(), + this.getEncodedEnr(), + this.getL1ContractAddresses(), + this.getProtocolContractAddresses(), + ]); const nodeInfo: NodeInfo = { nodeVersion, l1ChainId: chainId, - protocolVersion, + rollupVersion, enr, l1ContractAddresses: contractAddresses, protocolContractAddresses: protocolContractAddresses, @@ -402,8 +401,8 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable { * Method to fetch the version of the rollup the node is connected to. * @returns The rollup version. */ - public getVersion(): Promise { - return Promise.resolve(this.version); + public getRollupVersion(): Promise { + return Promise.resolve(this.rollupVersion); } /** diff --git a/yarn-project/aztec.js/src/account/interface.ts b/yarn-project/aztec.js/src/account/interface.ts index 74165393726a..56a9718e1ae8 100644 --- a/yarn-project/aztec.js/src/account/interface.ts +++ b/yarn-project/aztec.js/src/account/interface.ts @@ -20,6 +20,6 @@ export interface AccountInterface extends EntrypointInterface, AuthWitnessProvid getChainId(): Fr; /** Returns the rollup version for this account */ - getVersion(): Fr; + getRollupVersion(): Fr; } // docs:end:account-interface diff --git a/yarn-project/aztec.js/src/account_manager/account_manager.ts b/yarn-project/aztec.js/src/account_manager/account_manager.ts index 2ba874c7583c..520e9c3e4222 100644 --- a/yarn-project/aztec.js/src/account_manager/account_manager.ts +++ b/yarn-project/aztec.js/src/account_manager/account_manager.ts @@ -173,11 +173,11 @@ export class AccountManager { ); } - const { l1ChainId: chainId, protocolVersion } = await this.pxe.getNodeInfo(); + const { l1ChainId: chainId, rollupVersion } = await this.pxe.getNodeInfo(); // We use a signerless wallet with the multi call entrypoint in order to make multiple calls in one go. // If we used getWallet, the deployment would get routed via the account contract entrypoint // and it can't be used unless the contract is initialized. - const wallet = new SignerlessWallet(this.pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion)); + const wallet = new SignerlessWallet(this.pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion)); return new DeployMethod( this.getPublicKeys(), diff --git a/yarn-project/aztec.js/src/contract/contract.test.ts b/yarn-project/aztec.js/src/contract/contract.test.ts index 46f3ec4c6191..dd529a11de2c 100644 --- a/yarn-project/aztec.js/src/contract/contract.test.ts +++ b/yarn-project/aztec.js/src/contract/contract.test.ts @@ -144,7 +144,7 @@ describe('Contract Class', () => { const mockNodeInfo: NodeInfo = { nodeVersion: 'vx.x.x', l1ChainId: 1, - protocolVersion: 2, + rollupVersion: 2, l1ContractAddresses: l1Addresses, enr: undefined, protocolContractAddresses: { diff --git a/yarn-project/aztec.js/src/fee/utils.ts b/yarn-project/aztec.js/src/fee/utils.ts index df1e4ecb26cc..08c07aacc08a 100644 --- a/yarn-project/aztec.js/src/fee/utils.ts +++ b/yarn-project/aztec.js/src/fee/utils.ts @@ -29,8 +29,8 @@ export async function simulateWithoutSignature( const gasSettings = GasSettings.default({ maxFeesPerGas }); const fee = { gasSettings, paymentMethod }; - const { l1ChainId: chainId, protocolVersion } = await wallet.getNodeInfo(); - const entrypoint = new DefaultEntrypoint(chainId, protocolVersion); + const { l1ChainId: chainId, rollupVersion } = await wallet.getNodeInfo(); + const entrypoint = new DefaultEntrypoint(chainId, rollupVersion); const signerlessTxExecutionRequest = await entrypoint.createTxExecutionRequest(request, fee, {}); const simulationResult = await wallet.simulateTx(signerlessTxExecutionRequest, false, undefined, undefined, true); diff --git a/yarn-project/aztec.js/src/wallet/account_wallet.ts b/yarn-project/aztec.js/src/wallet/account_wallet.ts index 5528294834cd..496c3e946e6d 100644 --- a/yarn-project/aztec.js/src/wallet/account_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/account_wallet.ts @@ -38,8 +38,8 @@ export class AccountWallet extends BaseWallet { return this.account.getChainId(); } - getVersion(): Fr { - return this.account.getVersion(); + getRollupVersion(): Fr { + return this.account.getRollupVersion(); } /** @@ -120,7 +120,7 @@ export class AccountWallet extends BaseWallet { */ private getMessageHash(intent: IntentInnerHash | IntentAction): Promise { const chainId = this.getChainId(); - const version = this.getVersion(); + const version = this.getRollupVersion(); return computeAuthWitMessageHash(intent, { chainId, version }); } diff --git a/yarn-project/aztec.js/src/wallet/base_wallet.ts b/yarn-project/aztec.js/src/wallet/base_wallet.ts index ca3a1a6f78b5..ef059a049474 100644 --- a/yarn-project/aztec.js/src/wallet/base_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/base_wallet.ts @@ -37,7 +37,7 @@ export abstract class BaseWallet implements Wallet { abstract getChainId(): Fr; - abstract getVersion(): Fr; + abstract getRollupVersion(): Fr; abstract createTxExecutionRequest( exec: ExecutionPayload, diff --git a/yarn-project/aztec.js/src/wallet/signerless_wallet.ts b/yarn-project/aztec.js/src/wallet/signerless_wallet.ts index a20517e85be7..7d2c7ad92b12 100644 --- a/yarn-project/aztec.js/src/wallet/signerless_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/signerless_wallet.ts @@ -24,8 +24,8 @@ export class SignerlessWallet extends BaseWallet { ): Promise { let entrypoint = this.entrypoint; if (!entrypoint) { - const { l1ChainId: chainId, protocolVersion } = await this.pxe.getNodeInfo(); - entrypoint = new DefaultEntrypoint(chainId, protocolVersion); + const { l1ChainId: chainId, rollupVersion } = await this.pxe.getNodeInfo(); + entrypoint = new DefaultEntrypoint(chainId, rollupVersion); } return entrypoint.createTxExecutionRequest(execution, fee, options); @@ -35,8 +35,8 @@ export class SignerlessWallet extends BaseWallet { throw new Error('SignerlessWallet: Method getChainId not implemented.'); } - getVersion(): Fr { - throw new Error('SignerlessWallet: Method getVersion not implemented.'); + getRollupVersion(): Fr { + throw new Error('SignerlessWallet: Method getRollupVersion not implemented.'); } getPublicKeysHash(): Fr { diff --git a/yarn-project/cli/src/cmds/pxe/get_node_info.ts b/yarn-project/cli/src/cmds/pxe/get_node_info.ts index 991e2b07dd4c..b7d09f200d32 100644 --- a/yarn-project/cli/src/cmds/pxe/get_node_info.ts +++ b/yarn-project/cli/src/cmds/pxe/get_node_info.ts @@ -20,7 +20,7 @@ export async function getNodeInfo( logJson({ nodeVersion: info.nodeVersion, l1ChainId: info.l1ChainId, - protocolVersion: info.protocolVersion, + rollupVersion: info.rollupVersion, enr: info.enr, l1ContractAddresses: { rollup: info.l1ContractAddresses.rollupAddress.toString(), @@ -47,7 +47,7 @@ export async function getNodeInfo( } else { log(`Node Version: ${info.nodeVersion}`); log(`Chain Id: ${info.l1ChainId}`); - log(`Protocol Version: ${info.protocolVersion}`); + log(`Rollup Version: ${info.rollupVersion}`); log(`Node ENR: ${info.enr}`); log(`L1 Contract Addresses:`); log(` Rollup Address: ${info.l1ContractAddresses.rollupAddress.toString()}`); diff --git a/yarn-project/cli/src/utils/setup_contracts.ts b/yarn-project/cli/src/utils/setup_contracts.ts index 26becf2d9fb1..4be1f46835d1 100644 --- a/yarn-project/cli/src/utils/setup_contracts.ts +++ b/yarn-project/cli/src/utils/setup_contracts.ts @@ -81,9 +81,9 @@ export async function setupSponsoredFPC( const SponsoredFPCContract = await getSponsoredFPCContract(); const address = await getSponsoredFPCAddress(); const paymentMethod = new SponsoredFeePaymentMethod(address); - const { l1ChainId: chainId, protocolVersion } = await pxe.getNodeInfo(); + const { l1ChainId: chainId, rollupVersion } = await pxe.getNodeInfo(); - const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion)); + const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion)); const deployTx = SponsoredFPCContract.deploy(deployer).send({ contractAddressSalt: new Fr(SPONSORED_FPC_SALT), diff --git a/yarn-project/end-to-end/src/bench/utils.ts b/yarn-project/end-to-end/src/bench/utils.ts index d0e1bbce5941..d1cb573df096 100644 --- a/yarn-project/end-to-end/src/bench/utils.ts +++ b/yarn-project/end-to-end/src/bench/utils.ts @@ -160,7 +160,7 @@ export async function createNewPXE( startingBlock: number = INITIAL_L2_BLOCK_NUM, ): Promise { const l1Contracts = await node.getL1ContractAddresses(); - const { l1ChainId, protocolVersion } = await node.getNodeInfo(); + const { l1ChainId, rollupVersion } = await node.getNodeInfo(); const pxeConfig = { l2StartingBlock: startingBlock, l2BlockPollingIntervalMS: 100, @@ -168,7 +168,7 @@ export async function createNewPXE( dataStoreMapSizeKB: 1024 * 1024, l1Contracts, l1ChainId, - version: protocolVersion, + rollupVersion, } as PXEServiceConfig; const pxe = await createPXEService(node, pxeConfig); await pxe.registerContract(contract); diff --git a/yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts b/yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts index 1b37ac58e910..13ec99fddfde 100644 --- a/yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts +++ b/yarn-project/end-to-end/src/composed/e2e_sandbox_example.test.ts @@ -100,7 +100,7 @@ describe('e2e_sandbox_example', () => { logger.info(format('Aztec Sandbox Info ', nodeInfo)); // docs:end:setup - expect(typeof nodeInfo.protocolVersion).toBe('number'); + expect(typeof nodeInfo.rollupVersion).toBe('number'); expect(typeof nodeInfo.l1ChainId).toBe('number'); expect(typeof nodeInfo.l1ContractAddresses.rollupAddress).toBe('object'); diff --git a/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts index b700ae56b47f..d69758b2ea89 100644 --- a/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts +++ b/yarn-project/end-to-end/src/composed/integration_l1_publisher.test.ts @@ -232,7 +232,7 @@ describe('L1Publisher integration', () => { coinbase = config.coinbase || EthAddress.random(); feeRecipient = config.feeRecipient || (await AztecAddress.random()); - version = config.version ?? 1; + version = config.rollupVersion ?? 1; const fork = await worldStateSynchronizer.fork(); @@ -316,7 +316,7 @@ describe('L1Publisher integration', () => { slotNumber: `0x${block.header.globalVariables.slotNumber.toBuffer().toString('hex').padStart(64, '0')}`, chainId: Number(block.header.globalVariables.chainId.toBigInt()), timestamp: Number(block.header.globalVariables.timestamp.toBigInt()), - version: Number(block.header.globalVariables.version.toBigInt()), + version: Number(block.header.globalVariables.rollupVersion.toBigInt()), coinbase: `0x${block.header.globalVariables.coinbase.toBuffer().toString('hex').padStart(40, '0')}`, feeRecipient: `0x${block.header.globalVariables.feeRecipient.toBuffer().toString('hex').padStart(64, '0')}`, gasFees: { diff --git a/yarn-project/end-to-end/src/e2e_authwit.test.ts b/yarn-project/end-to-end/src/e2e_authwit.test.ts index c37b3099330d..de450aae575d 100644 --- a/yarn-project/end-to-end/src/e2e_authwit.test.ts +++ b/yarn-project/end-to-end/src/e2e_authwit.test.ts @@ -27,7 +27,7 @@ describe('e2e_authwit_tests', () => { const nodeInfo = await wallets[0].getNodeInfo(); chainId = new Fr(nodeInfo.l1ChainId); - version = new Fr(nodeInfo.protocolVersion); + version = new Fr(nodeInfo.rollupVersion); auth = await AuthWitTestContract.deploy(wallets[0]).send().deployed(); }); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/burn.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/burn.test.ts index b5063b8415da..e09f7efc917e 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/burn.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/burn.test.ts @@ -212,7 +212,7 @@ describe('e2e_blacklist_token_contract burn', () => { const action = asset.withWallet(wallets[1]).methods.burn(wallets[0].getAddress(), amount, nonce); const messageHash = await computeAuthWitMessageHash( { caller: wallets[1].getAddress(), action }, - { chainId: wallets[0].getChainId(), version: wallets[0].getVersion() }, + { chainId: wallets[0].getChainId(), version: wallets[0].getRollupVersion() }, ); await expect(action.prove()).rejects.toThrow(`Unknown auth witness for message hash ${messageHash.toString()}`); @@ -228,7 +228,7 @@ describe('e2e_blacklist_token_contract burn', () => { const action = asset.withWallet(wallets[2]).methods.burn(wallets[0].getAddress(), amount, nonce); const expectedMessageHash = await computeAuthWitMessageHash( { caller: wallets[2].getAddress(), action }, - { chainId: wallets[0].getChainId(), version: wallets[0].getVersion() }, + { chainId: wallets[0].getChainId(), version: wallets[0].getRollupVersion() }, ); const witness = await wallets[0].createAuthWit({ caller: wallets[1].getAddress(), action }); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts index 1aceae6956c7..ccc83f3c5fff 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/transfer_private.test.ts @@ -141,7 +141,7 @@ describe('e2e_blacklist_token_contract transfer private', () => { .methods.transfer(wallets[0].getAddress(), wallets[1].getAddress(), amount, nonce); const messageHash = await computeAuthWitMessageHash( { caller: wallets[1].getAddress(), action }, - { chainId: wallets[0].getChainId(), version: wallets[0].getVersion() }, + { chainId: wallets[0].getChainId(), version: wallets[0].getRollupVersion() }, ); await expect(action.prove()).rejects.toThrow(`Unknown auth witness for message hash ${messageHash.toString()}`); @@ -159,7 +159,7 @@ describe('e2e_blacklist_token_contract transfer private', () => { .methods.transfer(wallets[0].getAddress(), wallets[1].getAddress(), amount, nonce); const expectedMessageHash = await computeAuthWitMessageHash( { caller: wallets[2].getAddress(), action }, - { chainId: wallets[0].getChainId(), version: wallets[0].getVersion() }, + { chainId: wallets[0].getChainId(), version: wallets[0].getRollupVersion() }, ); const witness = await wallets[0].createAuthWit({ caller: wallets[1].getAddress(), action }); diff --git a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/unshielding.test.ts b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/unshielding.test.ts index 83ff0b4a1593..f304a74b0942 100644 --- a/yarn-project/end-to-end/src/e2e_blacklist_token_contract/unshielding.test.ts +++ b/yarn-project/end-to-end/src/e2e_blacklist_token_contract/unshielding.test.ts @@ -112,7 +112,7 @@ describe('e2e_blacklist_token_contract unshielding', () => { .methods.unshield(wallets[0].getAddress(), wallets[1].getAddress(), amount, nonce); const expectedMessageHash = await computeAuthWitMessageHash( { caller: wallets[2].getAddress(), action }, - { chainId: wallets[0].getChainId(), version: wallets[0].getVersion() }, + { chainId: wallets[0].getChainId(), version: wallets[0].getRollupVersion() }, ); // Both wallets are connected to same node and PXE so we could just insert directly diff --git a/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts b/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts index 59ff9bb14898..776b48b1108d 100644 --- a/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts +++ b/yarn-project/end-to-end/src/e2e_crowdfunding_and_claim.test.ts @@ -318,7 +318,11 @@ describe('e2e_crowdfunding_and_claim', () => { call.to, call.selector, entrypointHashedValues.hash, - new TxContext(donorWallets[1].getChainId(), donorWallets[1].getVersion(), GasSettings.default({ maxFeesPerGas })), + new TxContext( + donorWallets[1].getChainId(), + donorWallets[1].getRollupVersion(), + GasSettings.default({ maxFeesPerGas }), + ), [entrypointHashedValues], [], [], diff --git a/yarn-project/end-to-end/src/e2e_token_contract/burn.test.ts b/yarn-project/end-to-end/src/e2e_token_contract/burn.test.ts index 7578f85593a9..d57455009f40 100644 --- a/yarn-project/end-to-end/src/e2e_token_contract/burn.test.ts +++ b/yarn-project/end-to-end/src/e2e_token_contract/burn.test.ts @@ -207,7 +207,7 @@ describe('e2e_token_contract burn', () => { const action = asset.withWallet(wallets[1]).methods.burn_private(accounts[0].address, amount, nonce); const messageHash = await computeAuthWitMessageHash( { caller: accounts[1].address, action }, - { chainId: wallets[0].getChainId(), version: wallets[0].getVersion() }, + { chainId: wallets[0].getChainId(), version: wallets[0].getRollupVersion() }, ); await expect(action.simulate()).rejects.toThrow( @@ -225,7 +225,7 @@ describe('e2e_token_contract burn', () => { const action = asset.withWallet(wallets[2]).methods.burn_private(accounts[0].address, amount, nonce); const expectedMessageHash = await computeAuthWitMessageHash( { caller: accounts[2].address, action }, - { chainId: wallets[0].getChainId(), version: wallets[0].getVersion() }, + { chainId: wallets[0].getChainId(), version: wallets[0].getRollupVersion() }, ); const witness = await wallets[0].createAuthWit({ caller: accounts[1].address, action }); diff --git a/yarn-project/end-to-end/src/e2e_token_contract/transfer_in_private.test.ts b/yarn-project/end-to-end/src/e2e_token_contract/transfer_in_private.test.ts index 6da9c24758dc..8e0a8c697856 100644 --- a/yarn-project/end-to-end/src/e2e_token_contract/transfer_in_private.test.ts +++ b/yarn-project/end-to-end/src/e2e_token_contract/transfer_in_private.test.ts @@ -109,7 +109,7 @@ describe('e2e_token_contract transfer private', () => { { caller: accounts[1].address, action }, { chainId: wallets[0].getChainId(), - version: wallets[0].getVersion(), + version: wallets[0].getRollupVersion(), }, ); @@ -132,7 +132,7 @@ describe('e2e_token_contract transfer private', () => { { caller: accounts[2].address, action }, { chainId: wallets[0].getChainId(), - version: wallets[0].getVersion(), + version: wallets[0].getRollupVersion(), }, ); diff --git a/yarn-project/end-to-end/src/e2e_token_contract/transfer_to_public.test.ts b/yarn-project/end-to-end/src/e2e_token_contract/transfer_to_public.test.ts index 715a68c794d3..a2babd5dbff3 100644 --- a/yarn-project/end-to-end/src/e2e_token_contract/transfer_to_public.test.ts +++ b/yarn-project/end-to-end/src/e2e_token_contract/transfer_to_public.test.ts @@ -110,7 +110,7 @@ describe('e2e_token_contract transfer_to_public', () => { .methods.transfer_to_public(accounts[0].address, accounts[1].address, amount, nonce); const expectedMessageHash = await computeAuthWitMessageHash( { caller: accounts[2].address, action }, - { chainId: wallets[0].getChainId(), version: wallets[0].getVersion() }, + { chainId: wallets[0].getChainId(), version: wallets[0].getRollupVersion() }, ); // Both wallets are connected to same node and PXE so we could just insert directly diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index e88969abf0e8..d9f6326a62ac 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -773,8 +773,8 @@ export async function getSponsoredFPCAddress() { * Deploy a sponsored FPC contract to a running instance. */ export async function setupSponsoredFPC(pxe: PXE) { - const { l1ChainId: chainId, protocolVersion } = await pxe.getNodeInfo(); - const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, protocolVersion)); + const { l1ChainId: chainId, rollupVersion } = await pxe.getNodeInfo(); + const deployer = new SignerlessWallet(pxe, new DefaultMultiCallEntrypoint(chainId, rollupVersion)); // Make the contract pay for the deployment fee itself const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()); diff --git a/yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts b/yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts index 1e3493c9f4e9..e8cac44122cc 100644 --- a/yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts +++ b/yarn-project/end-to-end/src/shared/uniswap_l1_l2.ts @@ -627,7 +627,7 @@ export const uniswapL1L2TestSuite = ( nonceForWETHTransferToPublicApproval, ), }, - { chainId: ownerWallet.getChainId(), version: ownerWallet.getVersion() }, + { chainId: ownerWallet.getChainId(), version: ownerWallet.getRollupVersion() }, ); await expect( diff --git a/yarn-project/entrypoints/src/default_entrypoint.ts b/yarn-project/entrypoints/src/default_entrypoint.ts index 19814692b807..86baa3ed6263 100644 --- a/yarn-project/entrypoints/src/default_entrypoint.ts +++ b/yarn-project/entrypoints/src/default_entrypoint.ts @@ -8,7 +8,7 @@ import type { ExecutionPayload } from './payload.js'; * Default implementation of the entrypoint interface. It calls a function on a contract directly */ export class DefaultEntrypoint implements EntrypointInterface { - constructor(private chainId: number, private protocolVersion: number) {} + constructor(private chainId: number, private rollupVersion: number) {} async createTxExecutionRequest( exec: ExecutionPayload, @@ -39,7 +39,7 @@ export class DefaultEntrypoint implements EntrypointInterface { call.to, call.selector, hashedArguments[0].hash, - new TxContext(this.chainId, this.protocolVersion, fee.gasSettings), + new TxContext(this.chainId, this.rollupVersion, fee.gasSettings), [...hashedArguments, ...extraHashedArgs], authWitnesses, capsules, diff --git a/yarn-project/foundation/src/config/env_var.ts b/yarn-project/foundation/src/config/env_var.ts index 6040e74639e9..fa1bfb3dd31d 100644 --- a/yarn-project/foundation/src/config/env_var.ts +++ b/yarn-project/foundation/src/config/env_var.ts @@ -176,7 +176,7 @@ export type EnvVar = | 'VALIDATOR_DISABLED' | 'VALIDATOR_PRIVATE_KEY' | 'VALIDATOR_REEXECUTE' - | 'VERSION' + | 'ROLLUP_VERSION' | 'WS_BLOCK_CHECK_INTERVAL_MS' | 'WS_PROVEN_BLOCKS_ONLY' | 'WS_BLOCK_REQUEST_BATCH_SIZE' diff --git a/yarn-project/node-lib/src/actions/snapshot-sync.ts b/yarn-project/node-lib/src/actions/snapshot-sync.ts index 6f21c9727f3d..bc23cbc79102 100644 --- a/yarn-project/node-lib/src/actions/snapshot-sync.ts +++ b/yarn-project/node-lib/src/actions/snapshot-sync.ts @@ -32,7 +32,7 @@ import type { SharedNodeConfig } from '../config/index.js'; const MIN_L1_BLOCKS_TO_TRIGGER_REPLACE = 86400 / 2 / 12; type SnapshotSyncConfig = Pick & - Pick & + Pick & Pick & Required & EthereumClientConfig & { @@ -44,7 +44,7 @@ export async function trySnapshotSync(config: SnapshotSyncConfig, log: Logger) { let downloadDir: string | undefined; try { - const { syncMode, snapshotsUrl, dataDirectory, l1ChainId, version: l2Version, l1Contracts } = config; + const { syncMode, snapshotsUrl, dataDirectory, l1ChainId, rollupVersion, l1Contracts } = config; if (syncMode === 'full') { log.debug('Snapshot sync is disabled. Running full sync.', { syncMode: syncMode }); return false; @@ -96,7 +96,11 @@ export async function trySnapshotSync(config: SnapshotSyncConfig, log: Logger) { return false; } - const indexMetadata: SnapshotsIndexMetadata = { l1ChainId, l2Version, rollupAddress: l1Contracts.rollupAddress }; + const indexMetadata: SnapshotsIndexMetadata = { + l1ChainId, + rollupVersion, + rollupAddress: l1Contracts.rollupAddress, + }; let snapshot: SnapshotMetadata | undefined; try { snapshot = await getLatestSnapshotMetadata(indexMetadata, fileStore); diff --git a/yarn-project/node-lib/src/actions/upload-snapshot.ts b/yarn-project/node-lib/src/actions/upload-snapshot.ts index e5d5c3aec5af..cba2338d1bfe 100644 --- a/yarn-project/node-lib/src/actions/upload-snapshot.ts +++ b/yarn-project/node-lib/src/actions/upload-snapshot.ts @@ -14,7 +14,7 @@ import { mkdtemp } from 'fs/promises'; import { tmpdir } from 'os'; import { join } from 'path'; -type UploadSnapshotConfig = Pick & Pick; +type UploadSnapshotConfig = Pick & Pick; /** * Pauses the archiver and world state sync, creates backups of the archiver and world state lmdb environments, @@ -64,7 +64,7 @@ async function buildSnapshotMetadata( return { l1ChainId: config.l1ChainId, - l2Version: config.version, + rollupVersion: config.rollupVersion, rollupAddress, l2BlockNumber, l2BlockHash, diff --git a/yarn-project/noir-protocol-circuits-types/src/conversion/common.ts b/yarn-project/noir-protocol-circuits-types/src/conversion/common.ts index b50c3032ad7d..bf819281761f 100644 --- a/yarn-project/noir-protocol-circuits-types/src/conversion/common.ts +++ b/yarn-project/noir-protocol-circuits-types/src/conversion/common.ts @@ -508,7 +508,7 @@ export function mapVerificationKeyToNoir( export function mapGlobalVariablesToNoir(globalVariables: GlobalVariables): GlobalVariablesNoir { return { chain_id: mapFieldToNoir(globalVariables.chainId), - version: mapFieldToNoir(globalVariables.version), + version: mapFieldToNoir(globalVariables.rollupVersion), block_number: mapFieldToNoir(globalVariables.blockNumber), slot_number: mapFieldToNoir(globalVariables.slotNumber), timestamp: mapFieldToNoir(globalVariables.timestamp), diff --git a/yarn-project/p2p/src/testbench/worker_client_manager.ts b/yarn-project/p2p/src/testbench/worker_client_manager.ts index f05bc71d8a47..7388535e66e6 100644 --- a/yarn-project/p2p/src/testbench/worker_client_manager.ts +++ b/yarn-project/p2p/src/testbench/worker_client_manager.ts @@ -17,7 +17,7 @@ const workerPath = path.join(__dirname, '../../dest/testbench/p2p_client_testben const testChainConfig: ChainConfig = { l1ChainId: 31337, - version: 1, + rollupVersion: 1, l1Contracts: { rollupAddress: EthAddress.random(), }, diff --git a/yarn-project/p2p/src/versioning.test.ts b/yarn-project/p2p/src/versioning.test.ts index 02a716e6781a..de2a5de8de1e 100644 --- a/yarn-project/p2p/src/versioning.test.ts +++ b/yarn-project/p2p/src/versioning.test.ts @@ -25,14 +25,14 @@ describe('versioning', () => { l1Contracts: { rollupAddress: EthAddress.random(), }, - version: 3, + rollupVersion: 3, }; }); it.each([true, false])('sets and compares versions with xxhash=%s', (useXxHash: boolean) => { const versions = setAztecEnrKey(enr, chainConfig, useXxHash); expect(versions.l1ChainId).toEqual(1); - expect(versions.l2ChainVersion).toEqual(3); + expect(versions.rollupVersion).toEqual(3); expect(versions.l1RollupAddress).toEqual(chainConfig.l1Contracts.rollupAddress); expect(versionSet).toHaveLength(useXxHash ? 8 : 33); diff --git a/yarn-project/prover-client/src/block_builder/light.test.ts b/yarn-project/prover-client/src/block_builder/light.test.ts index 950363b374dd..791881e7b709 100644 --- a/yarn-project/prover-client/src/block_builder/light.test.ts +++ b/yarn-project/prover-client/src/block_builder/light.test.ts @@ -102,7 +102,7 @@ describe('LightBlockBuilder', () => { prefilledPublicData, ); - globalVariables = makeGlobalVariables(1, { chainId: Fr.ZERO, version: Fr.ZERO }); + globalVariables = makeGlobalVariables(1, { chainId: Fr.ZERO, rollupVersion: Fr.ZERO }); l1ToL2Messages = times(7, i => new Fr(i + 1)); fork = await db.fork(); expectsFork = await db.fork(); diff --git a/yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.ts b/yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.ts index fbc0c394f98f..37d772ce7b23 100644 --- a/yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.ts +++ b/yarn-project/pxe/src/pxe_oracle_interface/pxe_oracle_interface.ts @@ -266,8 +266,8 @@ export class PXEOracleInterface implements ExecutionDataProvider { * Fetches the current version. * @returns The version. */ - public async getVersion(): Promise { - return await this.aztecNode.getVersion(); + public async getRollupVersion(): Promise { + return await this.aztecNode.getRollupVersion(); } public getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise { diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index 541cad281d91..40f651e84bc8 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -193,7 +193,7 @@ export class PXEService implements PXE { await pxeService.#registerProtocolContracts(); const info = await pxeService.getNodeInfo(); - log.info(`Started PXE connected to chain ${info.l1ChainId} version ${info.protocolVersion}`); + log.info(`Started PXE connected to chain ${info.l1ChainId} version ${info.rollupVersion}`); return pxeService; } @@ -851,20 +851,19 @@ export class PXEService implements PXE { } public async getNodeInfo(): Promise { - const [nodeVersion, protocolVersion, chainId, enr, contractAddresses, protocolContractAddresses] = - await Promise.all([ - this.node.getNodeVersion(), - this.node.getVersion(), - this.node.getChainId(), - this.node.getEncodedEnr(), - this.node.getL1ContractAddresses(), - this.node.getProtocolContractAddresses(), - ]); + const [nodeVersion, rollupVersion, chainId, enr, contractAddresses, protocolContractAddresses] = await Promise.all([ + this.node.getNodeVersion(), + this.node.getRollupVersion(), + this.node.getChainId(), + this.node.getEncodedEnr(), + this.node.getL1ContractAddresses(), + this.node.getProtocolContractAddresses(), + ]); const nodeInfo: NodeInfo = { nodeVersion, l1ChainId: chainId, - protocolVersion, + rollupVersion, enr, l1ContractAddresses: contractAddresses, protocolContractAddresses: protocolContractAddresses, diff --git a/yarn-project/pxe/src/test/pxe_service.test.ts b/yarn-project/pxe/src/test/pxe_service.test.ts index 9cfa935f5ed5..804c165d7c97 100644 --- a/yarn-project/pxe/src/test/pxe_service.test.ts +++ b/yarn-project/pxe/src/test/pxe_service.test.ts @@ -30,12 +30,12 @@ async function createPXEService(): Promise { dataStoreMapSizeKB: 1024 * 1024, l1Contracts: { rollupAddress: EthAddress.random() }, l1ChainId: 31337, - version: 1, + rollupVersion: 1, }; // Setup the relevant mocks node.getBlockNumber.mockResolvedValue(2); - node.getVersion.mockResolvedValue(1); + node.getRollupVersion.mockResolvedValue(1); node.getChainId.mockResolvedValue(1); const mockedContracts: L1ContractAddresses = { rollupAddress: EthAddress.random(), @@ -79,7 +79,7 @@ describe('PXEService', () => { dataDirectory: undefined, dataStoreMapSizeKB: 1024 * 1024, l1Contracts: { rollupAddress: EthAddress.random() }, - version: 1, + rollupVersion: 1, l1ChainId: 31337, }; }); diff --git a/yarn-project/pxe/src/test/pxe_test_suite.ts b/yarn-project/pxe/src/test/pxe_test_suite.ts index 93fc485f2546..dc8b91f9b3ac 100644 --- a/yarn-project/pxe/src/test/pxe_test_suite.ts +++ b/yarn-project/pxe/src/test/pxe_test_suite.ts @@ -105,7 +105,7 @@ export const pxeTestSuite = (testName: string, pxeSetup: () => Promise) => it('successfully gets node info', async () => { const nodeInfo = await pxe.getNodeInfo(); - expect(typeof nodeInfo.protocolVersion).toEqual('number'); + expect(typeof nodeInfo.rollupVersion).toEqual('number'); expect(typeof nodeInfo.l1ChainId).toEqual('number'); expect(nodeInfo.l1ContractAddresses.rollupAddress.toString()).toMatch(/0x[a-fA-F0-9]+/); }); diff --git a/yarn-project/simulator/src/private/acvm/oracle/oracle.ts b/yarn-project/simulator/src/private/acvm/oracle/oracle.ts index 7715f95343f1..efe860bbdae9 100644 --- a/yarn-project/simulator/src/private/acvm/oracle/oracle.ts +++ b/yarn-project/simulator/src/private/acvm/oracle/oracle.ts @@ -40,8 +40,8 @@ export class Oracle { return [toACVMField(await this.typedOracle.getContractAddress())]; } - async getVersion(): Promise { - return [toACVMField(await this.typedOracle.getVersion())]; + async getRollupVersion(): Promise { + return [toACVMField(await this.typedOracle.getRollupVersion())]; } async getChainId(): Promise { diff --git a/yarn-project/simulator/src/private/acvm/oracle/typed_oracle.ts b/yarn-project/simulator/src/private/acvm/oracle/typed_oracle.ts index 4d949bc2d025..b20a92c0b436 100644 --- a/yarn-project/simulator/src/private/acvm/oracle/typed_oracle.ts +++ b/yarn-project/simulator/src/private/acvm/oracle/typed_oracle.ts @@ -67,8 +67,8 @@ export abstract class TypedOracle { return Promise.reject(new OracleMethodNotAvailableError('getChainId')); } - getVersion(): Promise { - return Promise.reject(new OracleMethodNotAvailableError('getVersion')); + getRollupVersion(): Promise { + return Promise.reject(new OracleMethodNotAvailableError('getRollupVersion')); } getKeyValidationRequest(_pkMHash: Fr): Promise { diff --git a/yarn-project/simulator/src/private/execution_data_provider.ts b/yarn-project/simulator/src/private/execution_data_provider.ts index 0954fd8b74a2..f18a53c0b3ac 100644 --- a/yarn-project/simulator/src/private/execution_data_provider.ts +++ b/yarn-project/simulator/src/private/execution_data_provider.ts @@ -194,10 +194,10 @@ export interface ExecutionDataProvider extends CommitmentsDBInterface { getChainId(): Promise; /** - * Fetches the current chain id. - * @returns The chain id. + * Fetches the current rollup version. + * @returns The rollup version. */ - getVersion(): Promise; + getRollupVersion(): Promise; /** * Returns the tagging secret for a given sender and recipient pair. For this to work, the ivsk_m of the sender must be known. diff --git a/yarn-project/simulator/src/private/unconstrained_execution.test.ts b/yarn-project/simulator/src/private/unconstrained_execution.test.ts index 7ca325a5ddcf..d8262f83918c 100644 --- a/yarn-project/simulator/src/private/unconstrained_execution.test.ts +++ b/yarn-project/simulator/src/private/unconstrained_execution.test.ts @@ -24,7 +24,7 @@ describe('Unconstrained Execution test suite', () => { executionDataProvider.getBlockNumber.mockResolvedValue(42); executionDataProvider.getChainId.mockResolvedValue(1); - executionDataProvider.getVersion.mockResolvedValue(1); + executionDataProvider.getRollupVersion.mockResolvedValue(1); acirSimulator = new AcirSimulator(executionDataProvider, simulationProvider); }); diff --git a/yarn-project/simulator/src/private/unconstrained_execution_oracle.ts b/yarn-project/simulator/src/private/unconstrained_execution_oracle.ts index d14d648b2d18..db6239d928ad 100644 --- a/yarn-project/simulator/src/private/unconstrained_execution_oracle.ts +++ b/yarn-project/simulator/src/private/unconstrained_execution_oracle.ts @@ -44,8 +44,8 @@ export class UnconstrainedExecutionOracle extends TypedOracle { return Promise.resolve(this.executionDataProvider.getChainId().then(id => new Fr(id))); } - public override getVersion(): Promise { - return Promise.resolve(this.executionDataProvider.getVersion().then(v => new Fr(v))); + public override getRollupVersion(): Promise { + return Promise.resolve(this.executionDataProvider.getRollupVersion().then(v => new Fr(v))); } /** diff --git a/yarn-project/simulator/src/public/avm/avm_simulator.test.ts b/yarn-project/simulator/src/public/avm/avm_simulator.test.ts index 4465582819b2..741b87377ede 100644 --- a/yarn-project/simulator/src/public/avm/avm_simulator.test.ts +++ b/yarn-project/simulator/src/public/avm/avm_simulator.test.ts @@ -474,7 +474,7 @@ describe('AVM simulator: transpiled Noir contracts', () => { const transactionFee = Fr.random(); const chainId = Fr.random(); - const version = Fr.random(); + const rollupVersion = Fr.random(); const blockNumber = Fr.random(); const timestamp = new Fr(randomInt(100000)); // cap timestamp since must fit in u64 const feePerDaGas = Fr.random(); @@ -487,7 +487,7 @@ describe('AVM simulator: transpiled Noir contracts', () => { const globals = initGlobalVariables({ chainId, - version, + rollupVersion, blockNumber, timestamp, gasFees, @@ -509,7 +509,7 @@ describe('AVM simulator: transpiled Noir contracts', () => { ['sender', () => sender.toField(), 'get_sender'], ['transactionFee', () => transactionFee.toField(), 'get_transaction_fee'], ['chainId', () => chainId.toField(), 'get_chain_id'], - ['version', () => version.toField(), 'get_version'], + ['version', () => rollupVersion.toField(), 'get_version'], ['blockNumber', () => blockNumber.toField(), 'get_block_number'], ['timestamp', () => timestamp.toField(), 'get_timestamp'], ['feePerDaGas', () => feePerDaGas.toField(), 'get_fee_per_da_gas'], diff --git a/yarn-project/simulator/src/public/avm/fixtures/index.ts b/yarn-project/simulator/src/public/avm/fixtures/index.ts index 12003bc2ee94..b726338e9eb1 100644 --- a/yarn-project/simulator/src/public/avm/fixtures/index.ts +++ b/yarn-project/simulator/src/public/avm/fixtures/index.ts @@ -105,7 +105,7 @@ export function initExecutionEnvironment(overrides?: Partial): GlobalVariables { return new GlobalVariables( overrides?.chainId ?? Fr.zero(), - overrides?.version ?? Fr.zero(), + overrides?.rollupVersion ?? Fr.zero(), overrides?.blockNumber ?? Fr.zero(), overrides?.slotNumber ?? Fr.zero(), overrides?.timestamp ?? Fr.zero(), diff --git a/yarn-project/simulator/src/public/avm/opcodes/environment_getters.test.ts b/yarn-project/simulator/src/public/avm/opcodes/environment_getters.test.ts index 70a15a6be274..d63f200277dc 100644 --- a/yarn-project/simulator/src/public/avm/opcodes/environment_getters.test.ts +++ b/yarn-project/simulator/src/public/avm/opcodes/environment_getters.test.ts @@ -15,7 +15,7 @@ const sender = await AztecAddress.random(); describe('Environment getters', () => { const transactionFee = Fr.random(); const chainId = Fr.random(); - const version = Fr.random(); + const rollupVersion = Fr.random(); const blockNumber = Fr.random(); const timestamp = new Fr(randomInt(100000)); // cap timestamp since must fit in u64 const feePerDaGas = Fr.random(); @@ -24,7 +24,7 @@ describe('Environment getters', () => { const gasFees = new GasFees(feePerDaGas, feePerL2Gas); const globals = initGlobalVariables({ chainId, - version, + rollupVersion, blockNumber, timestamp, gasFees, @@ -63,7 +63,7 @@ describe('Environment getters', () => { [EnvironmentVariable.SENDER, sender.toField()], [EnvironmentVariable.TRANSACTIONFEE, transactionFee.toField()], [EnvironmentVariable.CHAINID, chainId.toField()], - [EnvironmentVariable.VERSION, version.toField()], + [EnvironmentVariable.VERSION, rollupVersion.toField()], [EnvironmentVariable.BLOCKNUMBER, blockNumber.toField()], [EnvironmentVariable.TIMESTAMP, timestamp.toField(), TypeTag.UINT64], [EnvironmentVariable.FEEPERDAGAS, feePerDaGas.toField()], diff --git a/yarn-project/simulator/src/public/avm/opcodes/environment_getters.ts b/yarn-project/simulator/src/public/avm/opcodes/environment_getters.ts index b552f25fe0a3..36595d5e0fac 100644 --- a/yarn-project/simulator/src/public/avm/opcodes/environment_getters.ts +++ b/yarn-project/simulator/src/public/avm/opcodes/environment_getters.ts @@ -31,7 +31,7 @@ function getValue(e: EnvironmentVariable, ctx: AvmContext) { case EnvironmentVariable.CHAINID: return new Field(ctx.environment.globals.chainId); case EnvironmentVariable.VERSION: - return new Field(ctx.environment.globals.version); + return new Field(ctx.environment.globals.rollupVersion); case EnvironmentVariable.BLOCKNUMBER: return new Field(ctx.environment.globals.blockNumber); case EnvironmentVariable.TIMESTAMP: diff --git a/yarn-project/stdlib/src/config/config.ts b/yarn-project/stdlib/src/config/config.ts index abed12f5946c..b3a74e462ced 100644 --- a/yarn-project/stdlib/src/config/config.ts +++ b/yarn-project/stdlib/src/config/config.ts @@ -7,7 +7,7 @@ export { type AllowedElement, type SequencerConfig, SequencerConfigSchema } from export const emptyChainConfig: ChainConfig = { l1ChainId: 0, l1Contracts: { rollupAddress: EthAddress.ZERO }, - version: 0, + rollupVersion: 0, }; export const chainConfigMappings: ConfigMappingsType = { @@ -17,8 +17,8 @@ export const chainConfigMappings: ConfigMappingsType = { defaultValue: 31337, description: 'The chain ID of the ethereum host.', }, - version: { - env: 'VERSION', + rollupVersion: { + env: 'ROLLUP_VERSION', description: 'The version of the rollup.', parseEnv: (val: string) => (Number.isSafeInteger(parseInt(val, 10)) ? parseInt(val, 10) : undefined), }, @@ -33,7 +33,7 @@ export type ChainConfig = { /** The chain id of the ethereum host. */ l1ChainId: number; /** The version of the rollup. */ - version: number; + rollupVersion: number; /** The address to the L1 contracts. */ l1Contracts: { /** The address to rollup */ diff --git a/yarn-project/stdlib/src/contract/interfaces/node-info.ts b/yarn-project/stdlib/src/contract/interfaces/node-info.ts index 56a46898fc5b..11361fc0d658 100644 --- a/yarn-project/stdlib/src/contract/interfaces/node-info.ts +++ b/yarn-project/stdlib/src/contract/interfaces/node-info.ts @@ -11,8 +11,8 @@ export interface NodeInfo { nodeVersion: string; /** L1 chain id. */ l1ChainId: number; - /** Protocol version. */ - protocolVersion: number; + /** Rollup version. */ + rollupVersion: number; /** The node's ENR. */ enr: string | undefined; /** The deployed l1 contract addresses */ @@ -25,7 +25,7 @@ export const NodeInfoSchema: ZodFor = z .object({ nodeVersion: z.string(), l1ChainId: z.number().int().nonnegative(), - protocolVersion: z.number().int().nonnegative(), + rollupVersion: z.number().int().nonnegative(), enr: z.string().optional(), l1ContractAddresses: L1ContractAddressesSchema, protocolContractAddresses: ProtocolContractAddressesSchema, diff --git a/yarn-project/stdlib/src/interfaces/aztec-node.test.ts b/yarn-project/stdlib/src/interfaces/aztec-node.test.ts index 656dd2a2f210..4517d2b9da5d 100644 --- a/yarn-project/stdlib/src/interfaces/aztec-node.test.ts +++ b/yarn-project/stdlib/src/interfaces/aztec-node.test.ts @@ -202,8 +202,8 @@ describe('AztecNodeApiSchema', () => { expect(response).toBe('1.0.0'); }); - it('getVersion', async () => { - const response = await context.client.getVersion(); + it('getRollupVersion', async () => { + const response = await context.client.getRollupVersion(); expect(response).toBe(1); }); @@ -462,7 +462,7 @@ class MockAztecNode implements AztecNode { return { nodeVersion: '1.0', l1ChainId: 1, - protocolVersion: 1, + rollupVersion: 1, enr: 'enr', l1ContractAddresses: Object.fromEntries( L1ContractsNames.map(name => [name, EthAddress.random()]), @@ -491,7 +491,7 @@ class MockAztecNode implements AztecNode { getNodeVersion(): Promise { return Promise.resolve('1.0.0'); } - getVersion(): Promise { + getRollupVersion(): Promise { return Promise.resolve(1); } getChainId(): Promise { diff --git a/yarn-project/stdlib/src/interfaces/aztec-node.ts b/yarn-project/stdlib/src/interfaces/aztec-node.ts index 189a82c17f8f..6518401b672e 100644 --- a/yarn-project/stdlib/src/interfaces/aztec-node.ts +++ b/yarn-project/stdlib/src/interfaces/aztec-node.ts @@ -255,7 +255,7 @@ export interface AztecNode * Method to fetch the version of the rollup the node is connected to. * @returns The rollup version. */ - getVersion(): Promise; + getRollupVersion(): Promise; /** * Method to fetch the chain id of the base-layer for the rollup. @@ -491,7 +491,7 @@ export const AztecNodeApiSchema: ApiSchemaFor = { getNodeVersion: z.function().returns(z.string()), - getVersion: z.function().returns(z.number()), + getRollupVersion: z.function().returns(z.number()), getChainId: z.function().returns(z.number()), diff --git a/yarn-project/stdlib/src/interfaces/pxe.test.ts b/yarn-project/stdlib/src/interfaces/pxe.test.ts index a96da502cd45..f1135b7ea701 100644 --- a/yarn-project/stdlib/src/interfaces/pxe.test.ts +++ b/yarn-project/stdlib/src/interfaces/pxe.test.ts @@ -466,7 +466,7 @@ class MockPXE implements PXE { return { nodeVersion: '1.0', l1ChainId: 1, - protocolVersion: 1, + rollupVersion: 1, enr: 'enr', l1ContractAddresses: Object.fromEntries( L1ContractsNames.map(name => [name, EthAddress.random()]), diff --git a/yarn-project/stdlib/src/interfaces/pxe.ts b/yarn-project/stdlib/src/interfaces/pxe.ts index 7bdb765c95bc..48f9be54d15e 100644 --- a/yarn-project/stdlib/src/interfaces/pxe.ts +++ b/yarn-project/stdlib/src/interfaces/pxe.ts @@ -313,7 +313,7 @@ export interface PXE { /** * Returns the information about the server's node. Includes current Node version, compatible Noir version, - * L1 chain identifier, protocol version, and L1 address of the rollup contract. + * L1 chain identifier, rollup version, and L1 address of the rollup contract. * @returns - The node information. */ getNodeInfo(): Promise; diff --git a/yarn-project/stdlib/src/snapshots/download.ts b/yarn-project/stdlib/src/snapshots/download.ts index e9b08995ba28..b15f84dab4fc 100644 --- a/yarn-project/stdlib/src/snapshots/download.ts +++ b/yarn-project/stdlib/src/snapshots/download.ts @@ -40,7 +40,7 @@ export async function getLatestSnapshotMetadata( } export function getBasePath(metadata: SnapshotsIndexMetadata): string { - return `aztec-${metadata.l1ChainId}-${metadata.l2Version}-${metadata.rollupAddress}`; + return `aztec-${metadata.l1ChainId}-${metadata.rollupVersion}-${metadata.rollupAddress}`; } export function getSnapshotIndexPath(metadata: SnapshotsIndexMetadata): string { diff --git a/yarn-project/stdlib/src/snapshots/index.test.ts b/yarn-project/stdlib/src/snapshots/index.test.ts index eb8a33a51e97..9a89cb195aff 100644 --- a/yarn-project/stdlib/src/snapshots/index.test.ts +++ b/yarn-project/stdlib/src/snapshots/index.test.ts @@ -47,7 +47,7 @@ describe('snapshots', () => { store = mock(); store.upload.mockImplementation(dest => Promise.resolve(dest)); rollup = EthAddress.random(); - metadata = { l1ChainId: 1, l2Version: 2, rollupAddress: rollup }; + metadata = { l1ChainId: 1, rollupVersion: 2, rollupAddress: rollup }; snapshots = times(5, makeSnapshotMetadata); index = { ...metadata, snapshots }; }); diff --git a/yarn-project/stdlib/src/snapshots/types.ts b/yarn-project/stdlib/src/snapshots/types.ts index 4a0f4f68f503..adc51a048fcc 100644 --- a/yarn-project/stdlib/src/snapshots/types.ts +++ b/yarn-project/stdlib/src/snapshots/types.ts @@ -27,7 +27,7 @@ export type SnapshotMetadata = { export type SnapshotsIndexMetadata = { l1ChainId: number; - l2Version: number; + rollupVersion: number; rollupAddress: EthAddress; }; @@ -37,7 +37,7 @@ export type SnapshotsIndex = SnapshotsIndexMetadata & { export const SnapshotsIndexSchema = z.object({ l1ChainId: z.number(), - l2Version: z.number(), + rollupVersion: z.number(), rollupAddress: schemas.EthAddress, snapshots: z.array( z.object({ diff --git a/yarn-project/stdlib/src/snapshots/upload.ts b/yarn-project/stdlib/src/snapshots/upload.ts index 57345cb12232..20b48e38b6ac 100644 --- a/yarn-project/stdlib/src/snapshots/upload.ts +++ b/yarn-project/stdlib/src/snapshots/upload.ts @@ -6,7 +6,7 @@ import { getBasePath, getSnapshotIndex, getSnapshotIndexPath } from './download. import type { SnapshotDataKeys, SnapshotMetadata, SnapshotsIndex } from './types.js'; export type UploadSnapshotMetadata = Pick & - Pick; + Pick; export async function uploadSnapshot( localPaths: Record, @@ -45,9 +45,11 @@ export async function uploadSnapshot( return newSnapshotMetadata; } -function createEmptyIndex(metadata: Pick): SnapshotsIndex { +function createEmptyIndex( + metadata: Pick, +): SnapshotsIndex { return { - ...pick(metadata, 'l1ChainId', 'l2Version', 'rollupAddress'), + ...pick(metadata, 'l1ChainId', 'rollupVersion', 'rollupAddress'), snapshots: [], }; } diff --git a/yarn-project/stdlib/src/tests/factories.ts b/yarn-project/stdlib/src/tests/factories.ts index ec7aef6a33ea..3f76c9f80b3b 100644 --- a/yarn-project/stdlib/src/tests/factories.ts +++ b/yarn-project/stdlib/src/tests/factories.ts @@ -581,7 +581,7 @@ export function makePrivateCircuitPublicInputs(seed = 0): PrivateCircuitPublicIn export function makeGlobalVariables(seed = 1, overrides: Partial> = {}): GlobalVariables { return GlobalVariables.from({ chainId: new Fr(seed), - version: new Fr(seed + 1), + rollupVersion: new Fr(seed + 1), blockNumber: new Fr(seed + 2), slotNumber: new Fr(seed + 3), timestamp: new Fr(seed + 4), diff --git a/yarn-project/stdlib/src/tx/global_variables.ts b/yarn-project/stdlib/src/tx/global_variables.ts index 7969ea3cf358..9b4ba620a47a 100644 --- a/yarn-project/stdlib/src/tx/global_variables.ts +++ b/yarn-project/stdlib/src/tx/global_variables.ts @@ -20,7 +20,7 @@ export class GlobalVariables { /** ChainId for the L2 block. */ public chainId: Fr, /** Version for the L2 block. */ - public version: Fr, + public rollupVersion: Fr, /** Block number of the L2 block. */ public blockNumber: Fr, /** Slot number of the L2 block */ @@ -39,7 +39,7 @@ export class GlobalVariables { return z .object({ chainId: schemas.Fr, - version: schemas.Fr, + rollupVersion: schemas.Fr, blockNumber: schemas.Fr, slotNumber: schemas.Fr, timestamp: schemas.Fr, @@ -64,7 +64,7 @@ export class GlobalVariables { slotNumber: Fr.ZERO, timestamp: Fr.ZERO, chainId: Fr.ZERO, - version: Fr.ZERO, + rollupVersion: Fr.ZERO, coinbase: EthAddress.ZERO, feeRecipient: AztecAddress.ZERO, gasFees: GasFees.empty(), @@ -105,7 +105,7 @@ export class GlobalVariables { // Note: The order here must match the order in the HeaderLib solidity library. return [ fields.chainId, - fields.version, + fields.rollupVersion, fields.blockNumber, fields.slotNumber, fields.timestamp, @@ -150,7 +150,7 @@ export class GlobalVariables { isEmpty(): boolean { return ( this.chainId.isZero() && - this.version.isZero() && + this.rollupVersion.isZero() && this.blockNumber.isZero() && this.slotNumber.isZero() && this.timestamp.isZero() && @@ -163,7 +163,7 @@ export class GlobalVariables { toInspect() { return { chainId: this.chainId.toNumber(), - version: this.version.toNumber(), + rollupVersion: this.rollupVersion.toNumber(), blockNumber: this.blockNumber.toNumber(), slotNumber: this.slotNumber.toNumber(), timestamp: this.timestamp.toNumber(), @@ -181,7 +181,7 @@ export class GlobalVariables { public equals(other: this): boolean { return ( this.chainId.equals(other.chainId) && - this.version.equals(other.version) && + this.rollupVersion.equals(other.rollupVersion) && this.blockNumber.equals(other.blockNumber) && this.slotNumber.equals(other.slotNumber) && this.timestamp.equals(other.timestamp) && diff --git a/yarn-project/stdlib/src/versioning/versioning.test.ts b/yarn-project/stdlib/src/versioning/versioning.test.ts index 6826f5502fc1..e741be7ecdb2 100644 --- a/yarn-project/stdlib/src/versioning/versioning.test.ts +++ b/yarn-project/stdlib/src/versioning/versioning.test.ts @@ -22,7 +22,7 @@ describe('versioning', () => { versions = { l1ChainId: 1, l1RollupAddress: EthAddress.random(), - l2ChainVersion: 3, + rollupVersion: 3, l2ProtocolContractsTreeRoot: Fr.random().toString(), l2CircuitsVkTreeRoot: Fr.random().toString(), }; @@ -40,12 +40,12 @@ describe('versioning', () => { }); it('validates partial versions', () => { - const partial = { l1ChainId: 1, l2ChainVersion: 3 }; + const partial = { l1ChainId: 1, rollupVersion: 3 }; validatePartialComponentVersionsMatch(partial, versions); }); it('throws on mismatch for partial versions', () => { - const partial = { l1ChainId: 10, l2ChainVersion: 3 }; + const partial = { l1ChainId: 10, rollupVersion: 3 }; expect(() => validatePartialComponentVersionsMatch(partial, versions)).toThrow(/l1ChainId/); }); }); @@ -61,7 +61,7 @@ describe('versioning', () => { versions = { l1ChainId: 1, l1RollupAddress: EthAddress.random(), - l2ChainVersion: undefined, + rollupVersion: undefined, l2ProtocolContractsTreeRoot: Fr.random().toString(), l2CircuitsVkTreeRoot: Fr.random().toString(), }; @@ -93,7 +93,7 @@ describe('versioning', () => { it('passes if missing on server', async () => { const client = createSafeJsonRpcClient(context.url, TestApiSchema, { - onResponse: getVersioningResponseHandler({ ...versions, l2ChainVersion: 5 }), + onResponse: getVersioningResponseHandler({ ...versions, rollupVersion: 5 }), }); expect(await client.get()).toEqual(1); }); diff --git a/yarn-project/stdlib/src/versioning/versioning.ts b/yarn-project/stdlib/src/versioning/versioning.ts index aa56fc6ea364..5d86e89a6dd0 100644 --- a/yarn-project/stdlib/src/versioning/versioning.ts +++ b/yarn-project/stdlib/src/versioning/versioning.ts @@ -16,7 +16,7 @@ export type ComponentsVersions = { // Note that we are using the rollup address as identifier in multiple places // such as the keystore, we need to change it so we can handle updates. l1RollupAddress: EthAddress; - l2ChainVersion: number; + rollupVersion: number; l2ProtocolContractsTreeRoot: string; l2CircuitsVkTreeRoot: string; }; @@ -30,7 +30,7 @@ export function getComponentsVersionsFromConfig( return { l1ChainId: config.l1ChainId, l1RollupAddress: config.l1Contracts?.rollupAddress, // This should not be undefined, but sometimes the config lies to us and it is... - l2ChainVersion: config.version, + rollupVersion: config.rollupVersion, l2ProtocolContractsTreeRoot: l2ProtocolContractsTreeRoot.toString(), l2CircuitsVkTreeRoot: l2CircuitsVkTreeRoot.toString(), }; @@ -50,7 +50,7 @@ export function compressComponentVersions(versions: ComponentsVersions): string '00', versions.l1ChainId, versions.l1RollupAddress.toString().slice(2, 10), - versions.l2ChainVersion, + versions.rollupVersion, versions.l2ProtocolContractsTreeRoot.toString().slice(2, 10), versions.l2CircuitsVkTreeRoot.toString().slice(2, 10), ].join('-'); @@ -65,14 +65,8 @@ export class ComponentsVersionsError extends Error { /** Checks if the compressed string matches against the expected versions. Throws on mismatch. */ export function checkCompressedComponentVersion(compressed: string, expected: ComponentsVersions) { - const [ - versionVersion, - l1ChainId, - l1RollupAddress, - l2ChainVersion, - l2ProtocolContractsTreeRoot, - l2CircuitsVkTreeRoot, - ] = compressed.split('-'); + const [versionVersion, l1ChainId, l1RollupAddress, rollupVersion, l2ProtocolContractsTreeRoot, l2CircuitsVkTreeRoot] = + compressed.split('-'); if (versionVersion !== '00') { throw new ComponentsVersionsError('version', '00', versionVersion); } @@ -82,8 +76,8 @@ export function checkCompressedComponentVersion(compressed: string, expected: Co if (l1RollupAddress !== expected.l1RollupAddress.toString().slice(2, 10)) { throw new ComponentsVersionsError(`L1 address`, expected.l1RollupAddress.toString(), l1RollupAddress); } - if (l2ChainVersion !== expected.l2ChainVersion.toString()) { - throw new ComponentsVersionsError('L2 chain version', expected.l2ChainVersion.toString(), l2ChainVersion); + if (rollupVersion !== expected.rollupVersion.toString()) { + throw new ComponentsVersionsError('L2 chain version', expected.rollupVersion.toString(), rollupVersion); } if (l2ProtocolContractsTreeRoot !== expected.l2ProtocolContractsTreeRoot.toString().slice(2, 10)) { throw new ComponentsVersionsError( @@ -111,7 +105,7 @@ export function validatePartialComponentVersionsMatch( 'l2ProtocolContractsTreeRoot', 'l2CircuitsVkTreeRoot', 'l1ChainId', - 'l2ChainVersion', + 'rollupVersion', ] as const) { const actualValue = actual[key]; const expectedValue = expected[key]; diff --git a/yarn-project/txe/src/node/txe_node.ts b/yarn-project/txe/src/node/txe_node.ts index 00dbca17b237..4d02e47b0602 100644 --- a/yarn-project/txe/src/node/txe_node.ts +++ b/yarn-project/txe/src/node/txe_node.ts @@ -64,7 +64,7 @@ export class TXENode implements AztecNode { constructor( private blockNumber: number, - private version: number, + private rollupVersion: number, private chainId: number, private nativeWorldStateService: NativeWorldStateService, private baseFork: MerkleTreeWriteOperations, @@ -444,8 +444,8 @@ export class TXENode implements AztecNode { * Method to fetch the version of the rollup the node is connected to. * @returns The rollup version. */ - getVersion(): Promise { - return Promise.resolve(this.version); + getRollupVersion(): Promise { + return Promise.resolve(this.rollupVersion); } /** diff --git a/yarn-project/txe/src/oracle/txe_oracle.ts b/yarn-project/txe/src/oracle/txe_oracle.ts index a2fb99936482..8b670e0eb25d 100644 --- a/yarn-project/txe/src/oracle/txe_oracle.ts +++ b/yarn-project/txe/src/oracle/txe_oracle.ts @@ -134,7 +134,7 @@ export class TXE implements TypedOracle { private committedBlocks = new Set(); - private VERSION = 1; + private ROLLUP_VERSION = 1; private CHAIN_ID = 1; private node: TXENode; @@ -163,7 +163,7 @@ export class TXE implements TypedOracle { ) { this.noteCache = new ExecutionNoteCache(this.getTxRequestHash()); - this.node = new TXENode(this.blockNumber, this.VERSION, this.CHAIN_ID, nativeWorldStateService, baseFork); + this.node = new TXENode(this.blockNumber, this.ROLLUP_VERSION, this.CHAIN_ID, nativeWorldStateService, baseFork); // Default msg_sender (for entrypoints) is now Fr.max_value rather than 0 addr (see #7190 & #7404) this.msgSender = AztecAddress.fromField(Fr.MAX_FIELD_VALUE); @@ -236,8 +236,8 @@ export class TXE implements TypedOracle { return Promise.resolve(this.node.getChainId().then(id => new Fr(id))); } - getVersion(): Promise { - return Promise.resolve(this.node.getVersion().then(v => new Fr(v))); + getRollupVersion(): Promise { + return Promise.resolve(this.node.getRollupVersion().then(v => new Fr(v))); } getMsgSender() { @@ -319,7 +319,7 @@ export class TXE implements TypedOracle { const stateReference = await snap.getStateReference(); const inputs = PrivateContextInputs.empty(); inputs.txContext.chainId = new Fr(await this.node.getChainId()); - inputs.txContext.version = new Fr(await this.node.getVersion()); + inputs.txContext.version = new Fr(await this.node.getRollupVersion()); inputs.historicalHeader.globalVariables.blockNumber = new Fr(blockNumber); inputs.historicalHeader.state = stateReference; inputs.historicalHeader.lastArchive.root = Fr.fromBuffer( @@ -935,7 +935,7 @@ export class TXE implements TypedOracle { const globalVariables = GlobalVariables.empty(); globalVariables.chainId = new Fr(await this.node.getChainId()); - globalVariables.version = new Fr(await this.node.getVersion()); + globalVariables.rollupVersion = new Fr(await this.node.getRollupVersion()); globalVariables.blockNumber = new Fr(this.blockNumber); globalVariables.gasFees = new GasFees(1, 1); diff --git a/yarn-project/txe/src/txe_service/txe_service.ts b/yarn-project/txe/src/txe_service/txe_service.ts index 5e9daabecd25..f3f60f972396 100644 --- a/yarn-project/txe/src/txe_service/txe_service.ts +++ b/yarn-project/txe/src/txe_service/txe_service.ts @@ -473,8 +473,8 @@ export class TXEService { return toForeignCallResult([toSingle(await this.typedOracle.getChainId())]); } - async getVersion() { - return toForeignCallResult([toSingle(await this.typedOracle.getVersion())]); + async getRollupVersion() { + return toForeignCallResult([toSingle(await this.typedOracle.getRollupVersion())]); } async getBlockHeader(blockNumber: ForeignCallSingle) { @@ -737,7 +737,7 @@ export class TXEService { } async avmOpcodeVersion() { - const version = await (this.typedOracle as TXE).getVersion(); + const version = await (this.typedOracle as TXE).getRollupVersion(); return toForeignCallResult([toSingle(version)]); }