Skip to content
Closed
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
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
4 changes: 4 additions & 0 deletions docs/docs/migration_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion noir-projects/aztec-nr/aztec/src/oracle/execution.nr
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
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'
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.getRollupVersion().toNumber(),
});
}
}
12 changes: 6 additions & 6 deletions yarn-project/accounts/src/defaults/account_interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, '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.rollupVersion = new Fr(nodeInfo.rollupVersion);
}

createTxExecutionRequest(
Expand All @@ -58,7 +58,7 @@ export class DefaultAccountInterface implements AccountInterface {
return this.chainId;
}

getVersion(): Fr {
return this.version;
getRollupVersion(): Fr {
return this.rollupVersion;
}
}
37 changes: 18 additions & 19 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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.
Expand All @@ -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}).`,
);
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -325,20 +325,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.getRollupVersion(),
this.getChainId(),
this.getEncodedEnr(),
this.getL1ContractAddresses(),
this.getProtocolContractAddresses(),
]);

const nodeInfo: NodeInfo = {
nodeVersion,
l1ChainId: chainId,
protocolVersion,
rollupVersion,
enr,
l1ContractAddresses: contractAddresses,
protocolContractAddresses: protocolContractAddresses,
Expand Down Expand Up @@ -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<number> {
return Promise.resolve(this.version);
public getRollupVersion(): Promise<number> {
return Promise.resolve(this.rollupVersion);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/src/account/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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(),
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
6 changes: 3 additions & 3 deletions yarn-project/aztec.js/src/wallet/account_wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down Expand Up @@ -120,7 +120,7 @@ export class AccountWallet extends BaseWallet {
*/
private getMessageHash(intent: IntentInnerHash | IntentAction): Promise<Fr> {
const chainId = this.getChainId();
const version = this.getVersion();
const version = this.getRollupVersion();
return computeAuthWitMessageHash(intent, { chainId, version });
}

Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec.js/src/wallet/base_wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export abstract class BaseWallet implements Wallet {

abstract getChainId(): Fr;

abstract getVersion(): Fr;
abstract getRollupVersion(): Fr;

abstract createTxExecutionRequest(
exec: ExecutionPayload,
Expand Down
8 changes: 4 additions & 4 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 All @@ -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 {
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 @@ -160,15 +160,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 @@ -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');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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: {
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
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`);
Expand All @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`);
Expand All @@ -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 });
Expand Down
Loading
Loading