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/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..21293f8f868b 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.getVersion().toNumber(), }); } } diff --git a/yarn-project/accounts/src/defaults/account_interface.ts b/yarn-project/accounts/src/defaults/account_interface.ts index af98483b50c2..1e38b83db0ce 100644 --- a/yarn-project/accounts/src/defaults/account_interface.ts +++ b/yarn-project/accounts/src/defaults/account_interface.ts @@ -22,16 +22,16 @@ export class DefaultAccountInterface implements AccountInterface { 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.version = new Fr(nodeInfo.rollupVersion); } createTxExecutionRequest( diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index f158e386868b..ca4a0bc7c315 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -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.getVersion(), + this.getChainId(), + this.getEncodedEnr(), + this.getL1ContractAddresses(), + this.getProtocolContractAddresses(), + ]); const nodeInfo: NodeInfo = { nodeVersion, l1ChainId: chainId, - protocolVersion, + rollupVersion, enr, l1ContractAddresses: contractAddresses, protocolContractAddresses: protocolContractAddresses, 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/signerless_wallet.ts b/yarn-project/aztec.js/src/wallet/signerless_wallet.ts index a20517e85be7..c2ac6aa90cf7 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); 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..9f15b2282157 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(); 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/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/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/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/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index e637ac39e023..721f5a1fe901 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -188,7 +188,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; } @@ -846,20 +846,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.getVersion(), + 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..897489b0bd34 100644 --- a/yarn-project/pxe/src/test/pxe_service.test.ts +++ b/yarn-project/pxe/src/test/pxe_service.test.ts @@ -30,7 +30,7 @@ async function createPXEService(): Promise { dataStoreMapSizeKB: 1024 * 1024, l1Contracts: { rollupAddress: EthAddress.random() }, l1ChainId: 31337, - version: 1, + rollupVersion: 1, }; // Setup the relevant mocks @@ -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/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..54af41ef4e9e 100644 --- a/yarn-project/stdlib/src/interfaces/aztec-node.test.ts +++ b/yarn-project/stdlib/src/interfaces/aztec-node.test.ts @@ -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()]), diff --git a/yarn-project/stdlib/src/interfaces/pxe.test.ts b/yarn-project/stdlib/src/interfaces/pxe.test.ts index e1135bdd28dc..10c917209e1c 100644 --- a/yarn-project/stdlib/src/interfaces/pxe.test.ts +++ b/yarn-project/stdlib/src/interfaces/pxe.test.ts @@ -465,7 +465,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 987c19ca5f77..dd7dc2bc6818 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/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/oracle/txe_oracle.ts b/yarn-project/txe/src/oracle/txe_oracle.ts index ef203667cec4..d1e889a4621c 100644 --- a/yarn-project/txe/src/oracle/txe_oracle.ts +++ b/yarn-project/txe/src/oracle/txe_oracle.ts @@ -132,7 +132,7 @@ export class TXE implements TypedOracle { private committedBlocks = new Set(); - private VERSION = 1; + private ROLLUP_VERSION = 1; private CHAIN_ID = 1; private node: TXENode; @@ -160,7 +160,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);