Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ A successful run should show something like this:
token Aztec Sandbox Info {
token sandboxVersion: '#include_aztec_short_version',
token chainId: 31337,
token protocolVersion: 1,
token rollupVersion: 1,
token l1ContractAddresses: {
token rollupAddress: EthAddress {
token buffer: <Buffer cf 7e d3 ac ca 5a 46 7e 9e 70 4c 70 3e 8d 87 f6 34 fb 0f c9>
Expand Down
2 changes: 1 addition & 1 deletion spartan/aztec-network/templates/pxe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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-9][0-9]*'
initialDelaySeconds: {{ .Values.pxe.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.pxe.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.pxe.readinessProbe.timeoutSeconds }}
Expand Down
6 changes: 3 additions & 3 deletions yarn-project/accounts/src/dapp/dapp_interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@ export class DefaultDappInterface extends DefaultAccountInterface {
authWitnessProvider: AuthWitnessProvider,
userAddress: CompleteAddress,
dappAddress: AztecAddress,
nodeInfo: Pick<NodeInfo, 'l1ChainId' | 'protocolVersion'>,
nodeInfo: Pick<NodeInfo, 'l1ChainId' | 'rollupVersion'>,
) {
super(authWitnessProvider, userAddress, nodeInfo);
this.entrypoint = new DefaultDappEntrypoint(
userAddress.address,
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(),
});
}
}
6 changes: 3 additions & 3 deletions yarn-project/accounts/src/defaults/account_interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ export class DefaultAccountInterface implements AccountInterface {
constructor(
private authWitnessProvider: AuthWitnessProvider,
private address: CompleteAddress,
nodeInfo: Pick<NodeInfo, 'l1ChainId' | 'protocolVersion'>,
nodeInfo: Pick<NodeInfo, 'l1ChainId' | 'rollupVersion'>,
) {
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(
Expand Down
21 changes: 10 additions & 11 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
worldStateSynchronizer,
sequencer,
ethereumChain.chainInfo.id,
config.version,
config.rollupVersion,
new GlobalVariableBuilder(config),
proofVerifier,
telemetry,
Expand Down Expand Up @@ -275,20 +275,19 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
}

public async getNodeInfo(): Promise<NodeInfo> {
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,
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec.js/src/account_manager/account_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,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(),
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/src/contract/contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec.js/src/fee/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/aztec.js/src/wallet/signerless_wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export class SignerlessWallet extends BaseWallet {
): Promise<TxExecutionRequest> {
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);
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/cli/src/cmds/pxe/get_node_info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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()}`);
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/cli/src/utils/setup_contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/end-to-end/src/bench/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,15 @@ export async function createNewPXE(
startingBlock: number = INITIAL_L2_BLOCK_NUM,
): Promise<PXEService> {
const l1Contracts = await node.getL1ContractAddresses();
const { l1ChainId, protocolVersion } = await node.getNodeInfo();
const { l1ChainId, rollupVersion } = await node.getNodeInfo();
const pxeConfig = {
l2StartingBlock: startingBlock,
l2BlockPollingIntervalMS: 100,
dataDirectory: undefined,
dataStoreMapSizeKB: 1024 * 1024,
l1Contracts,
l1ChainId,
version: protocolVersion,
rollupVersion,
} as PXEServiceConfig;
const pxe = await createPXEService(node, pxeConfig);
await pxe.registerContract(contract);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ describe('L1Publisher integration', () => {
makeBloatedProcessedTx({
header: prevHeader,
chainId: fr(chainId),
version: fr(config.version),
version: fr(config.rollupVersion),
vkTreeRoot: getVKTreeRoot(),
gasSettings: GasSettings.default({ maxFeesPerGas: baseFee }),
protocolContractTreeRoot,
Expand Down Expand Up @@ -422,7 +422,7 @@ describe('L1Publisher integration', () => {

const globalVariables = new GlobalVariables(
new Fr(chainId),
new Fr(config.version),
new Fr(config.rollupVersion),
new Fr(1 + i),
new Fr(slot),
new Fr(timestamp),
Expand Down Expand Up @@ -559,7 +559,7 @@ describe('L1Publisher integration', () => {
const timestamp = await rollup.getTimestampForSlot(slot);
const globalVariables = new GlobalVariables(
new Fr(chainId),
new Fr(config.version),
new Fr(config.rollupVersion),
new Fr(1),
new Fr(slot),
new Fr(timestamp),
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_authwit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/end-to-end/src/fixtures/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/entrypoints/src/default_entrypoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/foundation/src/config/env_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,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'
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/p2p/src/testbench/worker_client_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/p2p/src/versioning.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
21 changes: 10 additions & 11 deletions yarn-project/pxe/src/pxe_service/pxe_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -846,20 +846,19 @@ export class PXEService implements PXE {
}

public async getNodeInfo(): Promise<NodeInfo> {
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,
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/pxe/src/test/pxe_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function createPXEService(): Promise<PXE> {
dataStoreMapSizeKB: 1024 * 1024,
l1Contracts: { rollupAddress: EthAddress.random() },
l1ChainId: 31337,
version: 1,
rollupVersion: 1,
};

// Setup the relevant mocks
Expand Down Expand Up @@ -79,7 +79,7 @@ describe('PXEService', () => {
dataDirectory: undefined,
dataStoreMapSizeKB: 1024 * 1024,
l1Contracts: { rollupAddress: EthAddress.random() },
version: 1,
rollupVersion: 1,
l1ChainId: 31337,
};
});
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/pxe/src/test/pxe_test_suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const pxeTestSuite = (testName: string, pxeSetup: () => Promise<PXE>) =>

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]+/);
});
Expand Down
8 changes: 4 additions & 4 deletions yarn-project/stdlib/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ChainConfig> = {
Expand All @@ -17,8 +17,8 @@ export const chainConfigMappings: ConfigMappingsType<ChainConfig> = {
defaultValue: 31337,
description: 'The chain ID of the ethereum host.',
},
version: {
env: 'VERSION',
rollupVersion: {
env: 'ROLLUP_VERSION',
description: 'The version of the rollup.',
...numberConfigHelper(1),
},
Expand All @@ -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 */
Expand Down
Loading