From 5bb169cb5c45abec1a31eb240b64bc0dfd9c3797 Mon Sep 17 00:00:00 2001 From: Amin Sammara <84764772+aminsammara@users.noreply.github.com> Date: Fri, 13 Mar 2026 11:45:24 +0000 Subject: [PATCH 1/6] chore: tune mainnet slasher penalties and sequencer allocation (#21451) ## Summary - Lower `SLASH_INACTIVITY_TARGET_PERCENTAGE` from 0.8 to 0.7 - Disable `SLASH_DUPLICATE_PROPOSAL_PENALTY` and `SLASH_DUPLICATE_ATTESTATION_PENALTY` (set to 0) - Increase `SLASH_GRACE_PERIOD_L2_SLOTS` from 1200 to 8400 - Reduce `perBlockAllocationMultiplier` from 2 to 1.2 ## Test plan - Verify generated config files are updated after running `yarn generate` in relevant packages - Deploy to devnet/testnet and confirm slasher behavior matches new parameters --------- Co-authored-by: Aztec Bot <49558828+AztecBot@users.noreply.github.com> --- spartan/environments/network-defaults.yml | 29 +++++++++---------- .../e2e_deploy_contract/deploy_method.test.ts | 2 +- .../src/e2e_p2p/gossip_network.test.ts | 10 +++++-- .../src/client/sequencer-client.test.ts | 22 +++++++------- yarn-project/sequencer-client/src/config.ts | 2 +- 5 files changed, 34 insertions(+), 31 deletions(-) diff --git a/spartan/environments/network-defaults.yml b/spartan/environments/network-defaults.yml index 6618a189e3cf..4b1f05acf5c2 100644 --- a/spartan/environments/network-defaults.yml +++ b/spartan/environments/network-defaults.yml @@ -112,8 +112,7 @@ l1-contracts: &l1-contracts-defaults # These configure the slasher node's operational behavior. # Used by yarn-project/slasher for penalty calculation and offense tracking. -slasher: &slasher - # Minimum penalty percentage multiplier. +slasher: &slasher # Minimum penalty percentage multiplier. SLASH_MIN_PENALTY_PERCENTAGE: 0.5 # Maximum penalty percentage multiplier. SLASH_MAX_PENALTY_PERCENTAGE: 2.0 @@ -215,16 +214,16 @@ networks: AZTEC_LAG_IN_EPOCHS_FOR_RANDAO: 1 AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS: 1 # Network identity - L1_CHAIN_ID: 11155111 # Sepolia + L1_CHAIN_ID: 11155111 # Sepolia # Genesis state - TEST_ACCOUNTS: true # Fund test accounts with fee juice - SPONSORED_FPC: true # Fund sponsored FPC with fee juice + TEST_ACCOUNTS: true # Fund test accounts with fee juice + SPONSORED_FPC: true # Fund sponsored FPC with fee juice TRANSACTIONS_DISABLED: false # Sequencer SEQ_MAX_TX_PER_BLOCK: 18 # Prover - PROVER_REAL_PROOFS: false # Use mock proofs - PXE_PROVER_ENABLED: false # Disable PXE proving + PROVER_REAL_PROOFS: false # Use mock proofs + PXE_PROVER_ENABLED: false # Disable PXE proving # Sync SYNC_SNAPSHOTS_URLS: "" SKIP_ARCHIVER_INITIAL_SYNC: false @@ -269,7 +268,7 @@ networks: AZTEC_SLASH_AMOUNT_MEDIUM: 100000e18 AZTEC_SLASH_AMOUNT_LARGE: 100000e18 # Network identity - L1_CHAIN_ID: 11155111 # Sepolia + L1_CHAIN_ID: 11155111 # Sepolia # Genesis state TEST_ACCOUNTS: false SPONSORED_FPC: false @@ -314,15 +313,15 @@ networks: AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 1000 AZTEC_MANA_TARGET: 75000000 AZTEC_PROVING_COST_PER_MANA: 25000000 - AZTEC_EXIT_DELAY_SECONDS: 345600 # 4 days - AZTEC_SLASHING_DISABLE_DURATION: 259200 # 3 days + AZTEC_EXIT_DELAY_SECONDS: 345600 # 4 days + AZTEC_SLASHING_DISABLE_DURATION: 259200 # 3 days AZTEC_ENTRY_QUEUE_BOOTSTRAP_VALIDATOR_SET_SIZE: 500 AZTEC_ENTRY_QUEUE_BOOTSTRAP_FLUSH_SIZE: 500 AZTEC_ENTRY_QUEUE_FLUSH_SIZE_MIN: 1 AZTEC_ENTRY_QUEUE_FLUSH_SIZE_QUOTIENT: 400 AZTEC_ENTRY_QUEUE_MAX_FLUSH_SIZE: 4 # Network identity - L1_CHAIN_ID: 1 # Ethereum mainnet + L1_CHAIN_ID: 1 # Ethereum mainnet # Genesis state - no test accounts, no sponsored FPC TEST_ACCOUNTS: false SPONSORED_FPC: false @@ -343,13 +342,13 @@ networks: # Slasher penalties - more lenient initially SLASH_PRUNE_PENALTY: 0 SLASH_DATA_WITHHOLDING_PENALTY: 0 - SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.8 + SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.7 SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 2 SLASH_INACTIVITY_PENALTY: 2000e18 SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 2000e18 - SLASH_DUPLICATE_PROPOSAL_PENALTY: 2000e18 - SLASH_DUPLICATE_ATTESTATION_PENALTY: 2000e18 + SLASH_DUPLICATE_PROPOSAL_PENALTY: 0 + SLASH_DUPLICATE_ATTESTATION_PENALTY: 0 SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 2000e18 SLASH_UNKNOWN_PENALTY: 2000e18 SLASH_INVALID_BLOCK_PENALTY: 2000e18 - SLASH_GRACE_PERIOD_L2_SLOTS: 1200 + SLASH_GRACE_PERIOD_L2_SLOTS: 8400 diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts index ed7cfba703fb..708215460821 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts @@ -157,7 +157,7 @@ describe('e2e_deploy_contract deploy method', () => { // First send the deploy transaction // Pay priority fee to ensure the deployment transaction gets processed first. - const maxPriorityFeesPerGas = new GasFees(1n, 0n); + const maxPriorityFeesPerGas = new GasFees(0n, 1n); const deployTxPromise = deployTx.send({ from: defaultAccountAddress, fee: { gasSettings: { maxPriorityFeesPerGas } }, diff --git a/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts b/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts index ff561ecfff69..eba29fcf1e3b 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts @@ -30,6 +30,8 @@ const CHECK_ALERTS = process.env.CHECK_ALERTS === 'true'; const NUM_VALIDATORS = 4; const NUM_TXS_PER_NODE = 2; const BOOT_NODE_UDP_PORT = 4500; +const AZTEC_SLOT_DURATION = 36; +const AZTEC_EPOCH_DURATION = 4; const DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'gossip-')); @@ -61,8 +63,8 @@ describe('e2e_p2p_network', () => { startProverNode: false, // we'll start our own using p2p initialConfig: { ...SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES, - aztecSlotDuration: 36, - aztecEpochDuration: 4, + aztecSlotDuration: AZTEC_SLOT_DURATION, + aztecEpochDuration: AZTEC_EPOCH_DURATION, slashingRoundSizeInEpochs: 2, slashingQuorum: 5, listenAddress: '127.0.0.1', @@ -205,13 +207,15 @@ describe('e2e_p2p_network', () => { } // Ensure prover node did its job and collected txs from p2p + // Timeout must exceed one full epoch (aztecSlotDuration * aztecEpochDuration = 36 * 4 = 144s) + // plus time for the prover to generate and submit the proof. await retryUntil( async () => { const provenBlock = await nodes[0].getProvenBlockNumber(); return provenBlock > 0; }, 'proven block', - 120, + 300, ); }); }); diff --git a/yarn-project/sequencer-client/src/client/sequencer-client.test.ts b/yarn-project/sequencer-client/src/client/sequencer-client.test.ts index e325cefca47d..fde8ab830cfa 100644 --- a/yarn-project/sequencer-client/src/client/sequencer-client.test.ts +++ b/yarn-project/sequencer-client/src/client/sequencer-client.test.ts @@ -22,8 +22,8 @@ describe('computeBlockLimits', () => { describe('L2 gas', () => { it('derives maxL2BlockGas from rollupManaLimit when not explicitly set', () => { const rollupManaLimit = 1_000_000; - // Single block mode (maxNumberOfBlocks=1), default multiplier=2: - // min(1_000_000, ceil(1_000_000 / 1 * 2)) = min(1_000_000, 2_000_000) = 1_000_000 + // Single block mode (maxNumberOfBlocks=1), default multiplier=1.2: + // min(1_000_000, ceil(1_000_000 / 1 * 1.2)) = min(1_000_000, 1_200_000) = 1_000_000 const result = computeBlockLimits(makeConfig(), rollupManaLimit, 12, log); expect(result.maxL2BlockGas).toBe(rollupManaLimit); }); @@ -43,8 +43,8 @@ describe('computeBlockLimits', () => { const daLimit = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT; it('derives maxDABlockGas from DA checkpoint limit when not explicitly set', () => { - // Single block mode (maxNumberOfBlocks=1), default multiplier=2: - // min(daLimit, ceil(daLimit / 1 * 2)) = min(daLimit, daLimit * 2) = daLimit + // Single block mode (maxNumberOfBlocks=1), default multiplier=1.2: + // min(daLimit, ceil(daLimit / 1 * 1.2)) = min(daLimit, daLimit * 1.2) = daLimit const result = computeBlockLimits(makeConfig(), 1_000_000, 12, log); expect(result.maxDABlockGas).toBe(daLimit); }); @@ -78,14 +78,14 @@ describe('computeBlockLimits', () => { }); it('derives maxTxsPerBlock from maxTxsPerCheckpoint when per-block not set', () => { - // Multi-block mode with maxNumberOfBlocks=5, multiplier=2: - // min(100, ceil(100 / 5 * 2)) = min(100, 40) = 40 + // Multi-block mode with maxNumberOfBlocks=5, multiplier=1.2: + // min(100, ceil(100 / 5 * 1.2)) = min(100, 24) = 24 const config = makeConfig({ maxTxsPerCheckpoint: 100, blockDurationMs: 8000, }); const result = computeBlockLimits(config, 1_000_000, 12, log); - expect(result.maxTxsPerBlock).toBe(40); + expect(result.maxTxsPerBlock).toBe(24); }); }); @@ -97,14 +97,14 @@ describe('computeBlockLimits', () => { // timeReservedAtEnd = 8 + 19 = 27 // timeAvailableForBlocks = 72 - 1 - 27 = 44 // maxNumberOfBlocks = floor(44 / 8) = 5 - // With multiplier=2 and rollupManaLimit=1_000_000: - // maxL2BlockGas = min(1_000_000, ceil(1_000_000 / 5 * 2)) = min(1_000_000, 400_000) = 400_000 + // With multiplier=1.2 and rollupManaLimit=1_000_000: + // maxL2BlockGas = min(1_000_000, ceil(1_000_000 / 5 * 1.2)) = min(1_000_000, 240_000) = 240_000 const config = makeConfig({ blockDurationMs: 8000 }); const result = computeBlockLimits(config, 1_000_000, 12, log); - expect(result.maxL2BlockGas).toBe(400_000); + expect(result.maxL2BlockGas).toBe(240_000); const daLimit = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT; - expect(result.maxDABlockGas).toBe(Math.min(daLimit, Math.ceil((daLimit / 5) * 2))); + expect(result.maxDABlockGas).toBe(Math.min(daLimit, Math.ceil((daLimit / 5) * 1.2))); }); }); }); diff --git a/yarn-project/sequencer-client/src/config.ts b/yarn-project/sequencer-client/src/config.ts index 117839911491..489bbfefba01 100644 --- a/yarn-project/sequencer-client/src/config.ts +++ b/yarn-project/sequencer-client/src/config.ts @@ -40,7 +40,7 @@ export const DefaultSequencerConfig = { minTxsPerBlock: 1, buildCheckpointIfEmpty: false, publishTxsWithProposals: false, - perBlockAllocationMultiplier: 2, + perBlockAllocationMultiplier: 1.2, enforceTimeTable: true, attestationPropagationTime: DEFAULT_P2P_PROPAGATION_TIME, secondsBeforeInvalidatingBlockAsCommitteeMember: 144, // 12 L1 blocks From 45ba1c40405ba9f752cedc5cbbfcba03d975a1f0 Mon Sep 17 00:00:00 2001 From: AztecBot Date: Fri, 13 Mar 2026 12:12:35 +0000 Subject: [PATCH 2/6] fix: resolve merge conflict markers from v4 into v4-next sync --- .../sequencer-client/src/client/sequencer-client.test.ts | 3 --- yarn-project/sequencer-client/src/config.ts | 3 --- 2 files changed, 6 deletions(-) diff --git a/yarn-project/sequencer-client/src/client/sequencer-client.test.ts b/yarn-project/sequencer-client/src/client/sequencer-client.test.ts index 07edcb8de369..f2eb896e4746 100644 --- a/yarn-project/sequencer-client/src/client/sequencer-client.test.ts +++ b/yarn-project/sequencer-client/src/client/sequencer-client.test.ts @@ -105,15 +105,12 @@ describe('computeBlockLimits', () => { const daLimit = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT; expect(result.maxDABlockGas).toBe(Math.min(daLimit, Math.ceil((daLimit / 5) * 1.2))); -<<<<<<< HEAD }); it('returns maxBlocksPerCheckpoint from timetable', () => { const config = makeConfig({ blockDurationMs: 8000 }); const result = computeBlockLimits(config, 1_000_000, 12, log); expect(result.maxBlocksPerCheckpoint).toBe(5); -======= ->>>>>>> origin/v4 }); }); }); diff --git a/yarn-project/sequencer-client/src/config.ts b/yarn-project/sequencer-client/src/config.ts index 75eed0051343..e0ce28583791 100644 --- a/yarn-project/sequencer-client/src/config.ts +++ b/yarn-project/sequencer-client/src/config.ts @@ -41,10 +41,7 @@ export const DefaultSequencerConfig = { buildCheckpointIfEmpty: false, publishTxsWithProposals: false, perBlockAllocationMultiplier: 1.2, -<<<<<<< HEAD redistributeCheckpointBudget: true, -======= ->>>>>>> origin/v4 enforceTimeTable: true, attestationPropagationTime: DEFAULT_P2P_PROPAGATION_TIME, secondsBeforeInvalidatingBlockAsCommitteeMember: 144, // 12 L1 blocks From 9b997628435cefaf9c627e4b93229d1e5498f61b Mon Sep 17 00:00:00 2001 From: Nicolas Chamo Date: Wed, 18 Feb 2026 17:13:01 +0000 Subject: [PATCH 3/6] cherry-pick: feat: add optional additional scopes to wallet transaction API (#20487) (with conflicts) --- .../docs/resources/migration_notes.md | 3 ++ .../pending_note_hashes_contract/src/main.nr | 47 ++++++++++++------- .../src/contract/interaction_options.ts | 6 +++ yarn-project/bot/src/factory.ts | 4 ++ .../cli-wallet/src/cmds/create_account.ts | 2 + yarn-project/cli-wallet/src/utils/wallet.ts | 2 +- .../src/composed/docs_examples.test.ts | 6 ++- .../e2e_local_network_example.test.ts | 3 +- .../src/e2e_crowdfunding_and_claim.test.ts | 30 ++++++++++-- .../src/e2e_escrow_contract.test.ts | 17 +++++-- .../src/e2e_fees/account_init.test.ts | 17 +++++++ .../src/e2e_fees/fee_juice_payments.test.ts | 3 +- .../e2e_pending_note_hashes_contract.test.ts | 17 +++++-- .../e2e_public_testnet_transfer.test.ts | 2 + yarn-project/end-to-end/src/fixtures/setup.ts | 2 + .../end-to-end/src/fixtures/token_utils.ts | 3 +- .../src/shared/submit-transactions.ts | 9 ++++ .../src/spartan/setup_test_wallets.ts | 29 ++++++++++-- .../end-to-end/src/test-wallet/test_wallet.ts | 2 +- .../oracle/private_execution_oracle.ts | 13 +---- .../wallet-sdk/src/base-wallet/base_wallet.ts | 11 +++-- yarn-project/wallets/src/testing.ts | 2 + 22 files changed, 179 insertions(+), 51 deletions(-) diff --git a/docs/docs-developers/docs/resources/migration_notes.md b/docs/docs-developers/docs/resources/migration_notes.md index 6d599bccc6b1..3b2ba227272a 100644 --- a/docs/docs-developers/docs/resources/migration_notes.md +++ b/docs/docs-developers/docs/resources/migration_notes.md @@ -9,6 +9,7 @@ Aztec is in active development. Each version may introduce breaking changes that ## TBD +<<<<<<< HEAD ### [Aztec.js] `getPublicEvents` now returns an object instead of an array `getPublicEvents` now returns a `GetPublicEventsResult` object with `events` and `maxLogsHit` fields instead of a plain array. This enables pagination through large result sets using the new `afterLog` filter option. @@ -197,6 +198,8 @@ my_project/ - The `Nargo.toml` in the project root is now a workspace file. Contract dependencies go in `contract/Nargo.toml`. - Tests should be written in the separate `test` crate (`test/src/lib.nr`) and import the contract by package name (e.g., `use my_contract::MyContract;`) instead of using `crate::`. +======= +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) ### Scope enforcement for private state access (TXE and PXE) Scope enforcement is now active across both TXE (test environment) and PXE (client). Previously, private execution could implicitly access any account's keys and notes. Now, only the caller (`from`) address is in scope by default, and accessing another address's private state requires explicitly granting scope. diff --git a/noir-projects/noir-contracts/contracts/test/pending_note_hashes_contract/src/main.nr b/noir-projects/noir-contracts/contracts/test/pending_note_hashes_contract/src/main.nr index 7c2bd5f5fb0b..821aeaf1c1c0 100644 --- a/noir-projects/noir-contracts/contracts/test/pending_note_hashes_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/test/pending_note_hashes_contract/src/main.nr @@ -299,31 +299,35 @@ pub contract PendingNoteHashes { //} #[external("private")] - fn test_recursively_create_notes(owner: AztecAddress, how_many_recursions: u64) { + fn test_recursively_create_notes(recipients: [AztecAddress; 10], how_many_recursions: u64) { let initial_offset: u64 = 0; - self.internal.create_max_notes(owner, initial_offset); + self.internal.create_max_notes(recipients, initial_offset); let max_notes = self.internal.max_notes_per_call() as u64; - self.call_self.recursively_destroy_and_create_notes(owner, how_many_recursions, max_notes); + self.call_self.recursively_destroy_and_create_notes( + recipients, + how_many_recursions, + max_notes, + ); } #[external("private")] fn recursively_destroy_and_create_notes( - owner: AztecAddress, + recipients: [AztecAddress; 10], executions_left: u64, current_offset: u64, ) { assert(executions_left > 0); - self.internal.destroy_max_notes(owner); - self.internal.create_max_notes(owner, current_offset); + self.internal.destroy_max_notes(recipients); + self.internal.create_max_notes(recipients, current_offset); let executions_left = executions_left - 1; if executions_left > 0 { let max_notes = self.internal.max_notes_per_call() as u64; self.call_self.recursively_destroy_and_create_notes( - owner, + recipients, executions_left, current_offset + max_notes, ); @@ -331,21 +335,30 @@ pub contract PendingNoteHashes { } #[internal("private")] - fn create_max_notes(owner: AztecAddress, offset: u64) { - let owner_balance = self.storage.balances.at(owner); + fn create_max_notes(recipients: [AztecAddress; 10], offset: u64) { + // Distribute notes across recipients using global offset to ensure + // no recipient receives more than 10 notes (UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN) for i in 0..self.internal.max_notes_per_call() { - let note = FieldNote { value: (offset + i as u64) as Field }; - // Skip deliver(): notes are created and nullified in the same tx (kernel squashing), - // so tagged log delivery is unnecessary. Delivering would also exceed - // UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN for the sender-recipient pair. - let _ = owner_balance.insert(note); + let global_index = offset + i as u64; + let recipient_index = (global_index % 10) as u32; + let recipient = recipients[recipient_index]; + let recipient_balance = self.storage.balances.at(recipient); + + let note = FieldNote { value: i as Field }; + recipient_balance.insert(note).deliver(MessageDelivery.ONCHAIN_CONSTRAINED); } } #[internal("private")] - fn destroy_max_notes(owner: AztecAddress) { - let owner_balance = self.storage.balances.at(owner); - let _ = owner_balance.pop_notes(NoteGetterOptions::new()); + fn destroy_max_notes(recipients: [AztecAddress; 10]) { + // Pop notes from all recipients + for i in 0..10 { + let recipient = recipients[i]; + let recipient_balance = self.storage.balances.at(recipient); + // Note that we're relying on PXE actually returning the notes, we're not constraining that any specific + // number of notes are deleted. + let _ = recipient_balance.pop_notes(NoteGetterOptions::new()); + } } #[internal("private")] diff --git a/yarn-project/aztec.js/src/contract/interaction_options.ts b/yarn-project/aztec.js/src/contract/interaction_options.ts index 005908dd35b8..fc615b69ce1e 100644 --- a/yarn-project/aztec.js/src/contract/interaction_options.ts +++ b/yarn-project/aztec.js/src/contract/interaction_options.ts @@ -91,9 +91,15 @@ export type SendInteractionOptionsWithoutWait = RequestInteractionOptions & { /** The fee options for the transaction. */ fee?: InteractionFeeOptions; /** +<<<<<<< HEAD * Extra addresses whose private state (keys, notes) should be accessible during execution. * Use when a transaction reads or nullifies private state that is owned by a different address, * e.g. deploying contracts with private storage or withdrawing from an escrow that holds +======= + * Additional addresses whose private state and keys should be accessible during execution, + * beyond the sender's. Required when the transaction needs to access private state or keys + * belonging to an address other than `from`, e.g. withdrawing from an escrow that holds +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) * its own private notes. */ additionalScopes?: AztecAddress[]; diff --git a/yarn-project/bot/src/factory.ts b/yarn-project/bot/src/factory.ts index f37bffd1031c..425c01dbb6b5 100644 --- a/yarn-project/bot/src/factory.ts +++ b/yarn-project/bot/src/factory.ts @@ -488,11 +488,15 @@ export class BotFactory { // PrivateToken's mint accesses contract-level private storage vars (admin, total_supply). const additionalScopes = isStandardToken ? undefined : [token.address]; await this.withNoMinTxsPerBlock(async () => { +<<<<<<< HEAD const { txHash } = await new BatchCall(token.wallet, calls).send({ from: minter, additionalScopes, wait: NO_WAIT, }); +======= + const txHash = await new BatchCall(token.wallet, calls).send({ from: minter, additionalScopes, wait: NO_WAIT }); +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) this.log.info(`Sent token mint tx with hash ${txHash.toString()}`); return waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds }); }); diff --git a/yarn-project/cli-wallet/src/cmds/create_account.ts b/yarn-project/cli-wallet/src/cmds/create_account.ts index 2e317c6a7799..72a854c6fe74 100644 --- a/yarn-project/cli-wallet/src/cmds/create_account.ts +++ b/yarn-project/cli-wallet/src/cmds/create_account.ts @@ -79,6 +79,8 @@ export async function createAccount( skipInstancePublication: !publicDeploy, skipInitialization, from, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [address], fee: { paymentMethod, gasSettings }, }; diff --git a/yarn-project/cli-wallet/src/utils/wallet.ts b/yarn-project/cli-wallet/src/utils/wallet.ts index 2124b79197dd..a1493d0cc13c 100644 --- a/yarn-project/cli-wallet/src/utils/wallet.ts +++ b/yarn-project/cli-wallet/src/utils/wallet.ts @@ -87,7 +87,7 @@ export class CLIWallet extends BaseWallet { increasedFee: InteractionFeeOptions, ): Promise { const cancellationTxRequest = await this.createCancellationTxExecutionRequest(from, txNonce, increasedFee); - return await this.pxe.proveTx(cancellationTxRequest, this.scopesFor(from)); + return await this.pxe.proveTx(cancellationTxRequest, this.scopesFrom(from)); } override async getAccountFromAddress(address: AztecAddress) { diff --git a/yarn-project/end-to-end/src/composed/docs_examples.test.ts b/yarn-project/end-to-end/src/composed/docs_examples.test.ts index 45611db7c898..c9e1bbd2f7a0 100644 --- a/yarn-project/end-to-end/src/composed/docs_examples.test.ts +++ b/yarn-project/end-to-end/src/composed/docs_examples.test.ts @@ -30,7 +30,11 @@ describe('docs_examples', () => { const prefundedAccount = await wallet.createSchnorrAccount(accountData.secret, accountData.salt); const newAccountManager = await wallet.createSchnorrAccount(secretKey, Fr.random(), signingPrivateKey); const newAccountDeployMethod = await newAccountManager.getDeployMethod(); - await newAccountDeployMethod.send({ from: prefundedAccount.address }); + await newAccountDeployMethod.send({ + from: prefundedAccount.address, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [newAccountManager.address], + }); const newAccountAddress = newAccountManager.address; const defaultAccountAddress = prefundedAccount.address; diff --git a/yarn-project/end-to-end/src/composed/e2e_local_network_example.test.ts b/yarn-project/end-to-end/src/composed/e2e_local_network_example.test.ts index 7bd8d64e0fad..30b5747bcedb 100644 --- a/yarn-project/end-to-end/src/composed/e2e_local_network_example.test.ts +++ b/yarn-project/end-to-end/src/composed/e2e_local_network_example.test.ts @@ -145,7 +145,8 @@ describe('e2e_local_network_example', () => { return await Promise.all( accountManagers.map(async x => { const deployMethod = await x.getDeployMethod(); - await deployMethod.send({ from: fundedAccount }); + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + await deployMethod.send({ from: fundedAccount, additionalScopes: [x.address] }); return x; }), ); 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 7da34cf384a2..3a214f305bf0 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 @@ -94,11 +94,19 @@ describe('e2e_crowdfunding_and_claim', () => { ); const crowdfundingInstance = await crowdfundingDeployment.getInstance(); await wallet.registerContract(crowdfundingInstance, CrowdfundingContract.artifact, crowdfundingSecretKey); +<<<<<<< HEAD ({ contract: crowdfundingContract } = await crowdfundingDeployment.send({ from: operatorAddress, // The contract constructor initializes private storage vars that need the contract's own nullifier key. additionalScopes: [crowdfundingInstance.address], })); +======= + crowdfundingContract = await crowdfundingDeployment.send({ + from: operatorAddress, + // The contract constructor initializes private storage vars that need the contract's own nullifier key. + additionalScopes: [crowdfundingInstance.address], + }); +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) logger.info(`Crowdfunding contract deployed at ${crowdfundingContract.address}`); ({ contract: claimContract } = await ClaimContract.deploy( @@ -161,7 +169,10 @@ describe('e2e_crowdfunding_and_claim', () => { expect(balanceDNTBeforeWithdrawal).toEqual(0n); // 3) At last, we withdraw the raised funds from the crowdfunding contract to the operator's address - await crowdfundingContract.methods.withdraw(donationAmount).send({ from: operatorAddress }); + await crowdfundingContract.methods + .withdraw(donationAmount) + // Withdraw nullifies the contract's own token notes, which requires its nullifier key. + .send({ from: operatorAddress, additionalScopes: [crowdfundingContract.address] }); const { result: balanceDNTAfterWithdrawal } = await donationToken.methods .balance_of_private(operatorAddress) @@ -233,11 +244,19 @@ describe('e2e_crowdfunding_and_claim', () => { const otherCrowdfundingInstance = await otherCrowdfundingDeployment.getInstance(); await wallet.registerContract(otherCrowdfundingInstance, CrowdfundingContract.artifact, crowdfundingSecretKey); +<<<<<<< HEAD ({ contract: otherCrowdfundingContract } = await otherCrowdfundingDeployment.send({ from: operatorAddress, // The contract constructor initializes private storage vars that need the contract's own nullifier key. additionalScopes: [otherCrowdfundingInstance.address], })); +======= + otherCrowdfundingContract = await otherCrowdfundingDeployment.send({ + from: operatorAddress, + // The contract constructor initializes private storage vars that need the contract's own nullifier key. + additionalScopes: [otherCrowdfundingInstance.address], + }); +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) logger.info(`Crowdfunding contract deployed at ${otherCrowdfundingContract.address}`); } @@ -285,9 +304,12 @@ describe('e2e_crowdfunding_and_claim', () => { await crowdfundingContract.methods.donate(donationAmount).send({ from: donor2Address, authWitnesses: [witness] }); // The following should fail as msg_sender != operator - await expect(crowdfundingContract.methods.withdraw(donationAmount).send({ from: donor2Address })).rejects.toThrow( - 'Assertion failed: Not an operator', - ); + await expect( + crowdfundingContract.methods + .withdraw(donationAmount) + // Withdraw nullifies the contract's own token notes, which requires its nullifier key. + .send({ from: donor2Address, additionalScopes: [crowdfundingContract.address] }), + ).rejects.toThrow('Assertion failed: Not an operator'); }); it('cannot donate after a deadline', async () => { diff --git a/yarn-project/end-to-end/src/e2e_escrow_contract.test.ts b/yarn-project/end-to-end/src/e2e_escrow_contract.test.ts index c3051b449b5a..42ca30744cd3 100644 --- a/yarn-project/end-to-end/src/e2e_escrow_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_escrow_contract.test.ts @@ -42,10 +42,14 @@ describe('e2e_escrow_contract', () => { const escrowInstance = await escrowDeployment.getInstance(); await wallet.registerContract(escrowInstance, EscrowContract.artifact, escrowSecretKey); // The contract constructor initializes private storage vars that need the contract's own nullifier key. +<<<<<<< HEAD ({ contract: escrowContract } = await escrowDeployment.send({ from: owner, additionalScopes: [escrowInstance.address], })); +======= + escrowContract = await escrowDeployment.send({ from: owner, additionalScopes: [escrowInstance.address] }); +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) logger.info(`Escrow contract deployed at ${escrowContract.address}`); // Deploy Token contract and mint funds for the escrow contract @@ -66,7 +70,10 @@ describe('e2e_escrow_contract', () => { await expectTokenBalance(wallet, token, escrowContract.address, 100n, logger); logger.info(`Withdrawing funds from token contract to ${recipient}`); - await escrowContract.methods.withdraw(token.address, 30, recipient).send({ from: owner }); + await escrowContract.methods + .withdraw(token.address, 30, recipient) + // Withdraw nullifies the contract's own token notes, which requires its nullifier key. + .send({ from: owner, additionalScopes: [escrowContract.address] }); await expectTokenBalance(wallet, token, owner, 0n, logger); await expectTokenBalance(wallet, token, recipient, 30n, logger); @@ -75,7 +82,10 @@ describe('e2e_escrow_contract', () => { it('refuses to withdraw funds as a non-owner', async () => { await expect( - escrowContract.methods.withdraw(token.address, 30, recipient).simulate({ from: recipient }), + escrowContract.methods + .withdraw(token.address, 30, recipient) + // Withdraw nullifies the contract's own token notes, which requires its nullifier key. + .simulate({ from: recipient, additionalScopes: [escrowContract.address] }), ).rejects.toThrow(); }); @@ -90,7 +100,8 @@ describe('e2e_escrow_contract', () => { await new BatchCall(wallet, [ token.methods.transfer(recipient, 10), escrowContract.methods.withdraw(token.address, 20, recipient), - ]).send({ from: owner }); + // Withdraw nullifies the contract's own token notes, which requires its nullifier key. + ]).send({ from: owner, additionalScopes: [escrowContract.address] }); await expectTokenBalance(wallet, token, recipient, 30n, logger); }); }); diff --git a/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts b/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts index 1323bd1ba00a..b810722d413a 100644 --- a/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts @@ -89,7 +89,16 @@ describe('e2e_fees account_init', () => { const [bobsInitialGas] = await t.getGasBalanceFn(bobsAddress); expect(bobsInitialGas).toEqual(mintAmount); +<<<<<<< HEAD const { receipt: tx } = await bobsDeployMethod.send({ from: AztecAddress.ZERO, wait: { returnReceipt: true } }); +======= + const tx = await bobsDeployMethod.send({ + from: AztecAddress.ZERO, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [bobsAddress], + wait: { returnReceipt: true }, + }); +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) expect(tx.transactionFee!).toBeGreaterThan(0n); await expect(t.getGasBalanceFn(bobsAddress)).resolves.toEqual([bobsInitialGas - tx.transactionFee!]); @@ -100,6 +109,8 @@ describe('e2e_fees account_init', () => { const paymentMethod = new FeeJuicePaymentMethodWithClaim(bobsAddress, claim); const { receipt: tx } = await bobsDeployMethod.send({ from: AztecAddress.ZERO, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [bobsAddress], fee: { paymentMethod }, wait: { returnReceipt: true }, }); @@ -120,6 +131,8 @@ describe('e2e_fees account_init', () => { const paymentMethod = new PrivateFeePaymentMethod(bananaFPC.address, bobsAddress, wallet, gasSettings); const { receipt: tx } = await bobsDeployMethod.send({ from: AztecAddress.ZERO, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [bobsAddress], fee: { paymentMethod }, wait: { returnReceipt: true }, }); @@ -149,6 +162,8 @@ describe('e2e_fees account_init', () => { const paymentMethod = new PublicFeePaymentMethod(bananaFPC.address, bobsAddress, wallet, gasSettings); const { receipt: tx } = await bobsDeployMethod.send({ from: AztecAddress.ZERO, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [bobsAddress], skipInstancePublication: false, fee: { paymentMethod }, wait: { returnReceipt: true }, @@ -187,6 +202,8 @@ describe('e2e_fees account_init', () => { bobsSigningPubKey.y, ).send({ from: aliceAddress, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [bobsAddress], contractAddressSalt: bobsInstance.salt, skipClassPublication: true, skipInstancePublication: true, diff --git a/yarn-project/end-to-end/src/e2e_fees/fee_juice_payments.test.ts b/yarn-project/end-to-end/src/e2e_fees/fee_juice_payments.test.ts index 16889aef501f..668ddf07f18d 100644 --- a/yarn-project/end-to-end/src/e2e_fees/fee_juice_payments.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/fee_juice_payments.test.ts @@ -33,8 +33,9 @@ describe('e2e_fees Fee Juice payments', () => { // Alice pays for Bob's account contract deployment. const bobsDeployMethod = await bobsAccountManager.getDeployMethod(); - await bobsDeployMethod.send({ from: aliceAddress }); bobAddress = bobsAccountManager.address; + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + await bobsDeployMethod.send({ from: aliceAddress, additionalScopes: [bobAddress] }); }); afterAll(async () => { diff --git a/yarn-project/end-to-end/src/e2e_pending_note_hashes_contract.test.ts b/yarn-project/end-to-end/src/e2e_pending_note_hashes_contract.test.ts index 9982087e83dd..e69a176d72e7 100644 --- a/yarn-project/end-to-end/src/e2e_pending_note_hashes_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_pending_note_hashes_contract.test.ts @@ -1,5 +1,5 @@ import { AztecAddress } from '@aztec/aztec.js/addresses'; -import { Fr } from '@aztec/aztec.js/fields'; +import { Fr, GrumpkinScalar } from '@aztec/aztec.js/fields'; import type { Logger } from '@aztec/aztec.js/log'; import type { AztecNode } from '@aztec/aztec.js/node'; import { @@ -286,8 +286,19 @@ describe('e2e_pending_note_hashes_contract', () => { const minToNeedReset = Math.min(MAX_NOTE_HASHES_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX) + 1; const deployedContract = await deployContract(); + // We use 10 different recipients to send private logs to in order to avoid exceeding + // UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN logs emitted for any single sender-recipient pair. + const recipients = ( + await Promise.all( + Array.from({ length: 10 }, () => + wallet.createSchnorrAccount(Fr.random(), Fr.random(), GrumpkinScalar.random()), + ), + ) + ).map(a => a.address); + await deployedContract.methods - .test_recursively_create_notes(owner, Math.ceil(minToNeedReset / notesPerIteration)) - .send({ from: owner }); + .test_recursively_create_notes(recipients, Math.ceil(minToNeedReset / notesPerIteration)) + // Recipients need to be in scope so their keys are accessible for note creation. + .send({ from: owner, additionalScopes: recipients }); }); }); diff --git a/yarn-project/end-to-end/src/e2e_public_testnet/e2e_public_testnet_transfer.test.ts b/yarn-project/end-to-end/src/e2e_public_testnet/e2e_public_testnet_transfer.test.ts index daed07568294..551304e259bd 100644 --- a/yarn-project/end-to-end/src/e2e_public_testnet/e2e_public_testnet_transfer.test.ts +++ b/yarn-project/end-to-end/src/e2e_public_testnet/e2e_public_testnet_transfer.test.ts @@ -62,6 +62,8 @@ describe(`deploys and transfers a private only token`, () => { await wallet.registerContract(tokenInstance, PrivateTokenContract.artifact, tokenSecretKey); const { contract: token } = await tokenDeployment.send({ from: deployerAddress, + // The contract constructor initializes private storage vars that need the contract's own nullifier key. + additionalScopes: [tokenInstance.address], universalDeploy: true, skipInstancePublication: true, skipClassPublication: true, diff --git a/yarn-project/end-to-end/src/fixtures/setup.ts b/yarn-project/end-to-end/src/fixtures/setup.ts index fb9ab8d9d88f..e45a7dfffab6 100644 --- a/yarn-project/end-to-end/src/fixtures/setup.ts +++ b/yarn-project/end-to-end/src/fixtures/setup.ts @@ -842,6 +842,8 @@ export const deployAccounts = const deployMethod = await accountManager.getDeployMethod(); await deployMethod.send({ from: AztecAddress.ZERO, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [accountManager.address], skipClassPublication: i !== 0, // Publish the contract class at most once. }); } diff --git a/yarn-project/end-to-end/src/fixtures/token_utils.ts b/yarn-project/end-to-end/src/fixtures/token_utils.ts index ede82e6966c2..a0d67993b7eb 100644 --- a/yarn-project/end-to-end/src/fixtures/token_utils.ts +++ b/yarn-project/end-to-end/src/fixtures/token_utils.ts @@ -27,8 +27,9 @@ export async function mintTokensToPrivate( minter: AztecAddress, recipient: AztecAddress, amount: bigint, + additionalScopes?: AztecAddress[], ) { - await token.methods.mint_to_private(recipient, amount).send({ from: minter }); + await token.methods.mint_to_private(recipient, amount).send({ from: minter, additionalScopes }); } export async function expectTokenBalance( diff --git a/yarn-project/end-to-end/src/shared/submit-transactions.ts b/yarn-project/end-to-end/src/shared/submit-transactions.ts index b8b6c5c1a11e..9c8f0128b1b3 100644 --- a/yarn-project/end-to-end/src/shared/submit-transactions.ts +++ b/yarn-project/end-to-end/src/shared/submit-transactions.ts @@ -19,7 +19,16 @@ export const submitTxsTo = async ( times(numTxs, async () => { const accountManager = await wallet.createSchnorrAccount(Fr.random(), Fr.random(), GrumpkinScalar.random()); const deployMethod = await accountManager.getDeployMethod(); +<<<<<<< HEAD const { txHash } = await deployMethod.send({ from: submitter, wait: NO_WAIT }); +======= + const txHash = await deployMethod.send({ + from: submitter, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [accountManager.address], + wait: NO_WAIT, + }); +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) logger.info(`Tx sent with hash ${txHash}`); const receipt: TxReceipt = await wallet.getTxReceipt(txHash); diff --git a/yarn-project/end-to-end/src/spartan/setup_test_wallets.ts b/yarn-project/end-to-end/src/spartan/setup_test_wallets.ts index d2a0908c62a8..6f2aad9281ac 100644 --- a/yarn-project/end-to-end/src/spartan/setup_test_wallets.ts +++ b/yarn-project/end-to-end/src/spartan/setup_test_wallets.ts @@ -88,11 +88,23 @@ export async function deploySponsoredTestAccountsWithTokens( const paymentMethod = new SponsoredFeePaymentMethod(await getSponsoredFPCAddress()); const recipientDeployMethod = await recipientAccount.getDeployMethod(); - await recipientDeployMethod.send({ from: AztecAddress.ZERO, fee: { paymentMethod }, wait: { timeout: 2400 } }); + await recipientDeployMethod.send({ + from: AztecAddress.ZERO, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [recipientAccount.address], + fee: { paymentMethod }, + wait: { timeout: 2400 }, + }); await Promise.all( fundedAccounts.map(async a => { const deployMethod = await a.getDeployMethod(); - await deployMethod.send({ from: AztecAddress.ZERO, fee: { paymentMethod }, wait: { timeout: 2400 } }); // increase timeout on purpose in order to account for two empty epochs + await deployMethod.send({ + from: AztecAddress.ZERO, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [a.address], + fee: { paymentMethod }, + wait: { timeout: 2400 }, + }); // increase timeout on purpose in order to account for two empty epochs logger.info(`Account deployed at ${a.address}`); }), ); @@ -131,6 +143,7 @@ async function deployAccountWithDiagnostics( const deployMethod = await account.getDeployMethod(); let txHash; try { +<<<<<<< HEAD let gasSettings; if (estimateGas) { const sim = await deployMethod.simulate({ from: AztecAddress.ZERO, fee: { paymentMethod } }); @@ -143,6 +156,15 @@ async function deployAccountWithDiagnostics( wait: NO_WAIT, }); txHash = deployResult.txHash; +======= + txHash = await deployMethod.send({ + from: AztecAddress.ZERO, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [account.address], + fee: { paymentMethod }, + wait: NO_WAIT, + }); +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) await waitForTx(aztecNode, txHash, { timeout: 2400 }); logger.info(`${accountLabel} deployed at ${account.address}`); } catch (error) { @@ -261,7 +283,8 @@ export async function deployTestAccountsWithTokens( fundedAccounts.map(async (a, i) => { const paymentMethod = new FeeJuicePaymentMethodWithClaim(a.address, claims[i]); const deployMethod = await a.getDeployMethod(); - await deployMethod.send({ from: AztecAddress.ZERO, fee: { paymentMethod } }); + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + await deployMethod.send({ from: AztecAddress.ZERO, additionalScopes: [a.address], fee: { paymentMethod } }); logger.info(`Account deployed at ${a.address}`); }), ); diff --git a/yarn-project/end-to-end/src/test-wallet/test_wallet.ts b/yarn-project/end-to-end/src/test-wallet/test_wallet.ts index 9407c10950fe..24dc0adb6c85 100644 --- a/yarn-project/end-to-end/src/test-wallet/test_wallet.ts +++ b/yarn-project/end-to-end/src/test-wallet/test_wallet.ts @@ -275,7 +275,7 @@ export class TestWallet extends BaseWallet { async proveTx(exec: ExecutionPayload, opts: Omit): Promise { const fee = await this.completeFeeOptions(opts.from, exec.feePayer, opts.fee?.gasSettings); const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee); - const txProvingResult = await this.pxe.proveTx(txRequest, this.scopesFor(opts.from)); + const txProvingResult = await this.pxe.proveTx(txRequest, this.scopesFrom(opts.from, opts.additionalScopes)); return new ProvenTx( this.aztecNode, await txProvingResult.toTx(), diff --git a/yarn-project/pxe/src/contract_function_simulator/oracle/private_execution_oracle.ts b/yarn-project/pxe/src/contract_function_simulator/oracle/private_execution_oracle.ts index a1b2ada7881e..c6d33cc7244e 100644 --- a/yarn-project/pxe/src/contract_function_simulator/oracle/private_execution_oracle.ts +++ b/yarn-project/pxe/src/contract_function_simulator/oracle/private_execution_oracle.ts @@ -530,22 +530,13 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP isStaticCall = isStaticCall || this.callContext.isStaticCall; - // When scopes are set and the target contract is a registered account (has keys in the keyStore), - // expand scopes to include it so nested private calls can sync and read the contract's own notes. - // We only expand for registered accounts because the log service needs the recipient's keys to derive - // tagging secrets, which are only available for registered accounts. - const expandedScopes = - this.scopes !== 'ALL_SCOPES' && (await this.keyStore.hasAccount(targetContractAddress)) - ? [...this.scopes, targetContractAddress] - : this.scopes; - await this.contractSyncService.ensureContractSynced( targetContractAddress, functionSelector, this.utilityExecutor, this.anchorBlockHeader, this.jobId, - expandedScopes, + this.scopes, ); const targetArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata( @@ -583,7 +574,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP totalPublicCalldataCount: this.totalPublicCalldataCount, sideEffectCounter, log: this.log, - scopes: expandedScopes, + scopes: this.scopes, senderForTags: this.senderForTags, simulator: this.simulator!, }); diff --git a/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts b/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts index a769d5907f2c..4a755691c883 100644 --- a/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts +++ b/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts @@ -94,10 +94,10 @@ export abstract class BaseWallet implements Wallet { protected log = createLogger('wallet-sdk:base_wallet'), ) {} - // When `from` is the zero address (e.g. when deploying a new account contract), we return an - // empty scope list which acts as deny-all: no notes are visible and no keys are accessible. - protected scopesFor(from: AztecAddress): AztecAddress[] { - return from.isZero() ? [] : [from]; + protected scopesFrom(from: AztecAddress, additionalScopes: AztecAddress[] = []): AztecAddress[] { + const allScopes = from.isZero() ? additionalScopes : [from, ...additionalScopes]; + const scopeSet = new Set(allScopes.map(address => address.toString())); + return [...scopeSet].map(AztecAddress.fromString); } protected scopesFrom(from: AztecAddress, additionalScopes: AztecAddress[] = []): AztecAddress[] { @@ -394,7 +394,10 @@ export abstract class BaseWallet implements Wallet { const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings); const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, feeOptions); const provenTx = await this.pxe.proveTx(txRequest, this.scopesFrom(opts.from, opts.additionalScopes)); +<<<<<<< HEAD const offchainOutput = extractOffchainOutput(provenTx.getOffchainEffects()); +======= +>>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) const tx = await provenTx.toTx(); const txHash = tx.getTxHash(); if (await this.aztecNode.getTxEffect(txHash)) { diff --git a/yarn-project/wallets/src/testing.ts b/yarn-project/wallets/src/testing.ts index 3b2723cde5b6..64838bfec198 100644 --- a/yarn-project/wallets/src/testing.ts +++ b/yarn-project/wallets/src/testing.ts @@ -22,6 +22,8 @@ export async function deployFundedSchnorrAccounts( const deployMethod = await accountManager.getDeployMethod(); await deployMethod.send({ from: AztecAddress.ZERO, + // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. + additionalScopes: [accountManager.address], skipClassPublication: i !== 0, wait: waitOptions, }); From 1b1276b334a3fe8e92924372f9b0e04e6b8aa6cc Mon Sep 17 00:00:00 2001 From: AztecBot Date: Fri, 13 Mar 2026 18:25:40 +0000 Subject: [PATCH 4/6] fix: resolve cherry-pick conflicts Resolved conflicts between v4-next's destructured return types (from offchain output changes) and the additionalScopes additions. Kept v4-next's destructured forms while adding additionalScopes parameters from the original PR. --- .../docs/resources/migration_notes.md | 3 --- .../aztec.js/src/contract/interaction_options.ts | 6 ------ yarn-project/bot/src/factory.ts | 4 ---- .../src/e2e_crowdfunding_and_claim.test.ts | 16 ---------------- .../end-to-end/src/e2e_escrow_contract.test.ts | 4 ---- .../end-to-end/src/e2e_fees/account_init.test.ts | 6 +----- .../end-to-end/src/shared/submit-transactions.ts | 6 +----- .../end-to-end/src/spartan/setup_test_wallets.ts | 12 ++---------- .../wallet-sdk/src/base-wallet/base_wallet.ts | 3 --- 9 files changed, 4 insertions(+), 56 deletions(-) diff --git a/docs/docs-developers/docs/resources/migration_notes.md b/docs/docs-developers/docs/resources/migration_notes.md index 3b2ba227272a..6d599bccc6b1 100644 --- a/docs/docs-developers/docs/resources/migration_notes.md +++ b/docs/docs-developers/docs/resources/migration_notes.md @@ -9,7 +9,6 @@ Aztec is in active development. Each version may introduce breaking changes that ## TBD -<<<<<<< HEAD ### [Aztec.js] `getPublicEvents` now returns an object instead of an array `getPublicEvents` now returns a `GetPublicEventsResult` object with `events` and `maxLogsHit` fields instead of a plain array. This enables pagination through large result sets using the new `afterLog` filter option. @@ -198,8 +197,6 @@ my_project/ - The `Nargo.toml` in the project root is now a workspace file. Contract dependencies go in `contract/Nargo.toml`. - Tests should be written in the separate `test` crate (`test/src/lib.nr`) and import the contract by package name (e.g., `use my_contract::MyContract;`) instead of using `crate::`. -======= ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) ### Scope enforcement for private state access (TXE and PXE) Scope enforcement is now active across both TXE (test environment) and PXE (client). Previously, private execution could implicitly access any account's keys and notes. Now, only the caller (`from`) address is in scope by default, and accessing another address's private state requires explicitly granting scope. diff --git a/yarn-project/aztec.js/src/contract/interaction_options.ts b/yarn-project/aztec.js/src/contract/interaction_options.ts index fc615b69ce1e..005908dd35b8 100644 --- a/yarn-project/aztec.js/src/contract/interaction_options.ts +++ b/yarn-project/aztec.js/src/contract/interaction_options.ts @@ -91,15 +91,9 @@ export type SendInteractionOptionsWithoutWait = RequestInteractionOptions & { /** The fee options for the transaction. */ fee?: InteractionFeeOptions; /** -<<<<<<< HEAD * Extra addresses whose private state (keys, notes) should be accessible during execution. * Use when a transaction reads or nullifies private state that is owned by a different address, * e.g. deploying contracts with private storage or withdrawing from an escrow that holds -======= - * Additional addresses whose private state and keys should be accessible during execution, - * beyond the sender's. Required when the transaction needs to access private state or keys - * belonging to an address other than `from`, e.g. withdrawing from an escrow that holds ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) * its own private notes. */ additionalScopes?: AztecAddress[]; diff --git a/yarn-project/bot/src/factory.ts b/yarn-project/bot/src/factory.ts index 425c01dbb6b5..f37bffd1031c 100644 --- a/yarn-project/bot/src/factory.ts +++ b/yarn-project/bot/src/factory.ts @@ -488,15 +488,11 @@ export class BotFactory { // PrivateToken's mint accesses contract-level private storage vars (admin, total_supply). const additionalScopes = isStandardToken ? undefined : [token.address]; await this.withNoMinTxsPerBlock(async () => { -<<<<<<< HEAD const { txHash } = await new BatchCall(token.wallet, calls).send({ from: minter, additionalScopes, wait: NO_WAIT, }); -======= - const txHash = await new BatchCall(token.wallet, calls).send({ from: minter, additionalScopes, wait: NO_WAIT }); ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) this.log.info(`Sent token mint tx with hash ${txHash.toString()}`); return waitForTx(this.aztecNode, txHash, { timeout: this.config.txMinedWaitSeconds }); }); 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 3a214f305bf0..1b99f2b3657e 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 @@ -94,19 +94,11 @@ describe('e2e_crowdfunding_and_claim', () => { ); const crowdfundingInstance = await crowdfundingDeployment.getInstance(); await wallet.registerContract(crowdfundingInstance, CrowdfundingContract.artifact, crowdfundingSecretKey); -<<<<<<< HEAD ({ contract: crowdfundingContract } = await crowdfundingDeployment.send({ from: operatorAddress, // The contract constructor initializes private storage vars that need the contract's own nullifier key. additionalScopes: [crowdfundingInstance.address], })); -======= - crowdfundingContract = await crowdfundingDeployment.send({ - from: operatorAddress, - // The contract constructor initializes private storage vars that need the contract's own nullifier key. - additionalScopes: [crowdfundingInstance.address], - }); ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) logger.info(`Crowdfunding contract deployed at ${crowdfundingContract.address}`); ({ contract: claimContract } = await ClaimContract.deploy( @@ -244,19 +236,11 @@ describe('e2e_crowdfunding_and_claim', () => { const otherCrowdfundingInstance = await otherCrowdfundingDeployment.getInstance(); await wallet.registerContract(otherCrowdfundingInstance, CrowdfundingContract.artifact, crowdfundingSecretKey); -<<<<<<< HEAD ({ contract: otherCrowdfundingContract } = await otherCrowdfundingDeployment.send({ from: operatorAddress, // The contract constructor initializes private storage vars that need the contract's own nullifier key. additionalScopes: [otherCrowdfundingInstance.address], })); -======= - otherCrowdfundingContract = await otherCrowdfundingDeployment.send({ - from: operatorAddress, - // The contract constructor initializes private storage vars that need the contract's own nullifier key. - additionalScopes: [otherCrowdfundingInstance.address], - }); ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) logger.info(`Crowdfunding contract deployed at ${otherCrowdfundingContract.address}`); } diff --git a/yarn-project/end-to-end/src/e2e_escrow_contract.test.ts b/yarn-project/end-to-end/src/e2e_escrow_contract.test.ts index 42ca30744cd3..949e5eb6e15c 100644 --- a/yarn-project/end-to-end/src/e2e_escrow_contract.test.ts +++ b/yarn-project/end-to-end/src/e2e_escrow_contract.test.ts @@ -42,14 +42,10 @@ describe('e2e_escrow_contract', () => { const escrowInstance = await escrowDeployment.getInstance(); await wallet.registerContract(escrowInstance, EscrowContract.artifact, escrowSecretKey); // The contract constructor initializes private storage vars that need the contract's own nullifier key. -<<<<<<< HEAD ({ contract: escrowContract } = await escrowDeployment.send({ from: owner, additionalScopes: [escrowInstance.address], })); -======= - escrowContract = await escrowDeployment.send({ from: owner, additionalScopes: [escrowInstance.address] }); ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) logger.info(`Escrow contract deployed at ${escrowContract.address}`); // Deploy Token contract and mint funds for the escrow contract diff --git a/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts b/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts index b810722d413a..67733719ca76 100644 --- a/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts +++ b/yarn-project/end-to-end/src/e2e_fees/account_init.test.ts @@ -89,16 +89,12 @@ describe('e2e_fees account_init', () => { const [bobsInitialGas] = await t.getGasBalanceFn(bobsAddress); expect(bobsInitialGas).toEqual(mintAmount); -<<<<<<< HEAD - const { receipt: tx } = await bobsDeployMethod.send({ from: AztecAddress.ZERO, wait: { returnReceipt: true } }); -======= - const tx = await bobsDeployMethod.send({ + const { receipt: tx } = await bobsDeployMethod.send({ from: AztecAddress.ZERO, // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. additionalScopes: [bobsAddress], wait: { returnReceipt: true }, }); ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) expect(tx.transactionFee!).toBeGreaterThan(0n); await expect(t.getGasBalanceFn(bobsAddress)).resolves.toEqual([bobsInitialGas - tx.transactionFee!]); diff --git a/yarn-project/end-to-end/src/shared/submit-transactions.ts b/yarn-project/end-to-end/src/shared/submit-transactions.ts index 9c8f0128b1b3..04efd68cdf7e 100644 --- a/yarn-project/end-to-end/src/shared/submit-transactions.ts +++ b/yarn-project/end-to-end/src/shared/submit-transactions.ts @@ -19,16 +19,12 @@ export const submitTxsTo = async ( times(numTxs, async () => { const accountManager = await wallet.createSchnorrAccount(Fr.random(), Fr.random(), GrumpkinScalar.random()); const deployMethod = await accountManager.getDeployMethod(); -<<<<<<< HEAD - const { txHash } = await deployMethod.send({ from: submitter, wait: NO_WAIT }); -======= - const txHash = await deployMethod.send({ + const { txHash } = await deployMethod.send({ from: submitter, // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. additionalScopes: [accountManager.address], wait: NO_WAIT, }); ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) logger.info(`Tx sent with hash ${txHash}`); const receipt: TxReceipt = await wallet.getTxReceipt(txHash); diff --git a/yarn-project/end-to-end/src/spartan/setup_test_wallets.ts b/yarn-project/end-to-end/src/spartan/setup_test_wallets.ts index 6f2aad9281ac..b0e8295928f3 100644 --- a/yarn-project/end-to-end/src/spartan/setup_test_wallets.ts +++ b/yarn-project/end-to-end/src/spartan/setup_test_wallets.ts @@ -143,7 +143,6 @@ async function deployAccountWithDiagnostics( const deployMethod = await account.getDeployMethod(); let txHash; try { -<<<<<<< HEAD let gasSettings; if (estimateGas) { const sim = await deployMethod.simulate({ from: AztecAddress.ZERO, fee: { paymentMethod } }); @@ -151,20 +150,13 @@ async function deployAccountWithDiagnostics( logger.info(`${accountLabel} estimated gas: DA=${gasSettings.gasLimits.daGas} L2=${gasSettings.gasLimits.l2Gas}`); } const deployResult = await deployMethod.send({ - from: AztecAddress.ZERO, - fee: { paymentMethod, gasSettings }, - wait: NO_WAIT, - }); - txHash = deployResult.txHash; -======= - txHash = await deployMethod.send({ from: AztecAddress.ZERO, // The account constructor initializes storage vars that need the contract's own nullifier key, so we need to add it to scopes. additionalScopes: [account.address], - fee: { paymentMethod }, + fee: { paymentMethod, gasSettings }, wait: NO_WAIT, }); ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) + txHash = deployResult.txHash; await waitForTx(aztecNode, txHash, { timeout: 2400 }); logger.info(`${accountLabel} deployed at ${account.address}`); } catch (error) { diff --git a/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts b/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts index 4a755691c883..0026c7d2cfaf 100644 --- a/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts +++ b/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts @@ -394,10 +394,7 @@ export abstract class BaseWallet implements Wallet { const feeOptions = await this.completeFeeOptions(opts.from, executionPayload.feePayer, opts.fee?.gasSettings); const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(executionPayload, opts.from, feeOptions); const provenTx = await this.pxe.proveTx(txRequest, this.scopesFrom(opts.from, opts.additionalScopes)); -<<<<<<< HEAD const offchainOutput = extractOffchainOutput(provenTx.getOffchainEffects()); -======= ->>>>>>> bb33335bb0 (feat: add optional additional scopes to wallet transaction API (#20487)) const tx = await provenTx.toTx(); const txHash = tx.getTxHash(); if (await this.aztecNode.getTxEffect(txHash)) { From 67768c847283ffa98aa5989ad20104d46db08fba Mon Sep 17 00:00:00 2001 From: AztecBot Date: Fri, 13 Mar 2026 18:26:45 +0000 Subject: [PATCH 5/6] fix: remove duplicate scopesFrom method in base_wallet.ts The cherry-pick introduced a duplicate scopesFrom method since v4-next already had it. --- yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts b/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts index 0026c7d2cfaf..484ed4b37edb 100644 --- a/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts +++ b/yarn-project/wallet-sdk/src/base-wallet/base_wallet.ts @@ -100,12 +100,6 @@ export abstract class BaseWallet implements Wallet { return [...scopeSet].map(AztecAddress.fromString); } - protected scopesFrom(from: AztecAddress, additionalScopes: AztecAddress[] = []): AztecAddress[] { - const allScopes = from.isZero() ? additionalScopes : [from, ...additionalScopes]; - const scopeSet = new Set(allScopes.map(address => address.toString())); - return [...scopeSet].map(AztecAddress.fromString); - } - protected abstract getAccountFromAddress(address: AztecAddress): Promise; abstract getAccounts(): Promise[]>; From feca41217cb1d8337bb44f798850e8b7ad6d07da Mon Sep 17 00:00:00 2001 From: Nicolas Chamo Date: Fri, 13 Mar 2026 15:40:42 -0300 Subject: [PATCH 6/6] chore: undo changes to unrelated files --- spartan/environments/network-defaults.yml | 29 ++++++++++--------- .../e2e_deploy_contract/deploy_method.test.ts | 2 +- .../src/e2e_p2p/gossip_network.test.ts | 10 ++----- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/spartan/environments/network-defaults.yml b/spartan/environments/network-defaults.yml index 4b1f05acf5c2..6618a189e3cf 100644 --- a/spartan/environments/network-defaults.yml +++ b/spartan/environments/network-defaults.yml @@ -112,7 +112,8 @@ l1-contracts: &l1-contracts-defaults # These configure the slasher node's operational behavior. # Used by yarn-project/slasher for penalty calculation and offense tracking. -slasher: &slasher # Minimum penalty percentage multiplier. +slasher: &slasher + # Minimum penalty percentage multiplier. SLASH_MIN_PENALTY_PERCENTAGE: 0.5 # Maximum penalty percentage multiplier. SLASH_MAX_PENALTY_PERCENTAGE: 2.0 @@ -214,16 +215,16 @@ networks: AZTEC_LAG_IN_EPOCHS_FOR_RANDAO: 1 AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS: 1 # Network identity - L1_CHAIN_ID: 11155111 # Sepolia + L1_CHAIN_ID: 11155111 # Sepolia # Genesis state - TEST_ACCOUNTS: true # Fund test accounts with fee juice - SPONSORED_FPC: true # Fund sponsored FPC with fee juice + TEST_ACCOUNTS: true # Fund test accounts with fee juice + SPONSORED_FPC: true # Fund sponsored FPC with fee juice TRANSACTIONS_DISABLED: false # Sequencer SEQ_MAX_TX_PER_BLOCK: 18 # Prover - PROVER_REAL_PROOFS: false # Use mock proofs - PXE_PROVER_ENABLED: false # Disable PXE proving + PROVER_REAL_PROOFS: false # Use mock proofs + PXE_PROVER_ENABLED: false # Disable PXE proving # Sync SYNC_SNAPSHOTS_URLS: "" SKIP_ARCHIVER_INITIAL_SYNC: false @@ -268,7 +269,7 @@ networks: AZTEC_SLASH_AMOUNT_MEDIUM: 100000e18 AZTEC_SLASH_AMOUNT_LARGE: 100000e18 # Network identity - L1_CHAIN_ID: 11155111 # Sepolia + L1_CHAIN_ID: 11155111 # Sepolia # Genesis state TEST_ACCOUNTS: false SPONSORED_FPC: false @@ -313,15 +314,15 @@ networks: AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE: 1000 AZTEC_MANA_TARGET: 75000000 AZTEC_PROVING_COST_PER_MANA: 25000000 - AZTEC_EXIT_DELAY_SECONDS: 345600 # 4 days - AZTEC_SLASHING_DISABLE_DURATION: 259200 # 3 days + AZTEC_EXIT_DELAY_SECONDS: 345600 # 4 days + AZTEC_SLASHING_DISABLE_DURATION: 259200 # 3 days AZTEC_ENTRY_QUEUE_BOOTSTRAP_VALIDATOR_SET_SIZE: 500 AZTEC_ENTRY_QUEUE_BOOTSTRAP_FLUSH_SIZE: 500 AZTEC_ENTRY_QUEUE_FLUSH_SIZE_MIN: 1 AZTEC_ENTRY_QUEUE_FLUSH_SIZE_QUOTIENT: 400 AZTEC_ENTRY_QUEUE_MAX_FLUSH_SIZE: 4 # Network identity - L1_CHAIN_ID: 1 # Ethereum mainnet + L1_CHAIN_ID: 1 # Ethereum mainnet # Genesis state - no test accounts, no sponsored FPC TEST_ACCOUNTS: false SPONSORED_FPC: false @@ -342,13 +343,13 @@ networks: # Slasher penalties - more lenient initially SLASH_PRUNE_PENALTY: 0 SLASH_DATA_WITHHOLDING_PENALTY: 0 - SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.7 + SLASH_INACTIVITY_TARGET_PERCENTAGE: 0.8 SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD: 2 SLASH_INACTIVITY_PENALTY: 2000e18 SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY: 2000e18 - SLASH_DUPLICATE_PROPOSAL_PENALTY: 0 - SLASH_DUPLICATE_ATTESTATION_PENALTY: 0 + SLASH_DUPLICATE_PROPOSAL_PENALTY: 2000e18 + SLASH_DUPLICATE_ATTESTATION_PENALTY: 2000e18 SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY: 2000e18 SLASH_UNKNOWN_PENALTY: 2000e18 SLASH_INVALID_BLOCK_PENALTY: 2000e18 - SLASH_GRACE_PERIOD_L2_SLOTS: 8400 + SLASH_GRACE_PERIOD_L2_SLOTS: 1200 diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts index 708215460821..ed7cfba703fb 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts @@ -157,7 +157,7 @@ describe('e2e_deploy_contract deploy method', () => { // First send the deploy transaction // Pay priority fee to ensure the deployment transaction gets processed first. - const maxPriorityFeesPerGas = new GasFees(0n, 1n); + const maxPriorityFeesPerGas = new GasFees(1n, 0n); const deployTxPromise = deployTx.send({ from: defaultAccountAddress, fee: { gasSettings: { maxPriorityFeesPerGas } }, diff --git a/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts b/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts index eba29fcf1e3b..ff561ecfff69 100644 --- a/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts +++ b/yarn-project/end-to-end/src/e2e_p2p/gossip_network.test.ts @@ -30,8 +30,6 @@ const CHECK_ALERTS = process.env.CHECK_ALERTS === 'true'; const NUM_VALIDATORS = 4; const NUM_TXS_PER_NODE = 2; const BOOT_NODE_UDP_PORT = 4500; -const AZTEC_SLOT_DURATION = 36; -const AZTEC_EPOCH_DURATION = 4; const DATA_DIR = fs.mkdtempSync(path.join(os.tmpdir(), 'gossip-')); @@ -63,8 +61,8 @@ describe('e2e_p2p_network', () => { startProverNode: false, // we'll start our own using p2p initialConfig: { ...SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES, - aztecSlotDuration: AZTEC_SLOT_DURATION, - aztecEpochDuration: AZTEC_EPOCH_DURATION, + aztecSlotDuration: 36, + aztecEpochDuration: 4, slashingRoundSizeInEpochs: 2, slashingQuorum: 5, listenAddress: '127.0.0.1', @@ -207,15 +205,13 @@ describe('e2e_p2p_network', () => { } // Ensure prover node did its job and collected txs from p2p - // Timeout must exceed one full epoch (aztecSlotDuration * aztecEpochDuration = 36 * 4 = 144s) - // plus time for the prover to generate and submit the proof. await retryUntil( async () => { const provenBlock = await nodes[0].getProvenBlockNumber(); return provenBlock > 0; }, 'proven block', - 300, + 120, ); }); });