Skip to content

Commit 4f0f951

Browse files
committed
chore: Slash for inactivity network test
1 parent 3a5f63b commit 4f0f951

File tree

30 files changed

+468
-145
lines changed

30 files changed

+468
-145
lines changed

yarn-project/aztec-node/src/aztec-node/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
11221122

11231123
public async setConfig(config: Partial<AztecNodeAdminConfig>): Promise<void> {
11241124
const newConfig = { ...this.config, ...config };
1125-
this.sequencer?.updateSequencerConfig(config);
1125+
this.sequencer?.updateConfig(config);
11261126
this.slasherClient?.updateConfig(config);
11271127
this.validatorsSentinel?.updateConfig(config);
11281128
// this.blockBuilder.updateConfig(config); // TODO: Spyros has a PR to add the builder to `this`, so we can do this

yarn-project/end-to-end/src/bench/bench_build_block.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ describe('benchmarks/build_block', () => {
3535

3636
const TX_COUNT = 32;
3737
it(`builds a block with ${TX_COUNT} standard txs`, async () => {
38-
sequencer.updateSequencerConfig({ minTxsPerBlock: TX_COUNT });
38+
sequencer.updateConfig({ minTxsPerBlock: TX_COUNT });
3939
const sentTxs = await sendTxs(TX_COUNT, context, contract);
4040
await waitTxs(sentTxs, context);
4141
});
4242

4343
const TX_COUNT_HEAVY_COMPUTE = 8;
4444
it(`builds a block with ${TX_COUNT_HEAVY_COMPUTE} compute-heavy txs`, async () => {
45-
sequencer.updateSequencerConfig({ minTxsPerBlock: TX_COUNT_HEAVY_COMPUTE });
45+
sequencer.updateConfig({ minTxsPerBlock: TX_COUNT_HEAVY_COMPUTE });
4646
const sentTxs = await sendTxs(TX_COUNT_HEAVY_COMPUTE, context, contract, /*heavyPublicComput=*/ true);
4747
await waitTxs(sentTxs, context);
4848
});

yarn-project/end-to-end/src/e2e_block_building.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ describe('e2e_block_building', () => {
555555
logger.warn(`Test contract deployed at ${testContract.address}`);
556556

557557
// Send two txs that emit two nullifiers each, one from private and one from public.
558-
context.sequencer?.updateSequencerConfig({ minTxsPerBlock: 2 });
558+
context.sequencer?.updateConfig({ minTxsPerBlock: 2 });
559559
const makeBatch = () =>
560560
new BatchCall(context.wallets[0], [
561561
testContract.methods.emit_nullifier(Fr.random()),
@@ -573,7 +573,7 @@ describe('e2e_block_building', () => {
573573
const spy = jest.spyOn(Set.prototype, 'execute').mockImplementation(async function (...args: any[]) {
574574
setCount++;
575575
if (setCount === 1) {
576-
context.sequencer?.updateSequencerConfig({ minTxsPerBlock: 1 });
576+
context.sequencer?.updateConfig({ minTxsPerBlock: 1 });
577577
} else if (setCount === 48) {
578578
throw new Error('Simulated failure in AVM opcode SET');
579579
}

yarn-project/end-to-end/src/e2e_epochs/epochs_empty_blocks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('e2e_epochs/epochs_empty_blocks', () => {
3030
});
3131

3232
it('submits proof even if there are no txs to build a block', async () => {
33-
context.sequencer?.updateSequencerConfig({ minTxsPerBlock: 1 });
33+
context.sequencer?.updateConfig({ minTxsPerBlock: 1 });
3434
await test.waitUntilEpochStarts(1);
3535

3636
// Sleep to make sure any pending blocks are published

yarn-project/end-to-end/src/e2e_epochs/epochs_invalidate_block.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe('e2e_epochs/epochs_invalidate_block', () => {
9393
// Configure all sequencers to skip collecting attestations before starting
9494
logger.warn('Configuring all sequencers to skip attestation collection');
9595
sequencers.forEach(sequencer => {
96-
sequencer.updateSequencerConfig({ skipCollectingAttestations: true });
96+
sequencer.updateConfig({ skipCollectingAttestations: true });
9797
});
9898

9999
// Send a transaction so the sequencer builds a block
@@ -104,7 +104,7 @@ describe('e2e_epochs/epochs_invalidate_block', () => {
104104
test.monitor.once('l2-block', ({ l2BlockNumber }) => {
105105
logger.warn(`Disabling skipCollectingAttestations after L2 block ${l2BlockNumber} has been mined`);
106106
sequencers.forEach(sequencer => {
107-
sequencer.updateSequencerConfig({ skipCollectingAttestations: false });
107+
sequencer.updateConfig({ skipCollectingAttestations: false });
108108
});
109109
});
110110

@@ -173,14 +173,14 @@ describe('e2e_epochs/epochs_invalidate_block', () => {
173173
// Configure all sequencers to skip collecting attestations before starting
174174
logger.warn('Configuring all sequencers to skip attestation collection and always publish blocks');
175175
sequencers.forEach(sequencer => {
176-
sequencer.updateSequencerConfig({ skipCollectingAttestations: true, minTxsPerBlock: 0 });
176+
sequencer.updateConfig({ skipCollectingAttestations: true, minTxsPerBlock: 0 });
177177
});
178178

179179
// Disable skipCollectingAttestations after the first block is mined and prevent sequencers from publishing any more blocks
180180
test.monitor.once('l2-block', ({ l2BlockNumber }) => {
181181
logger.warn(`Disabling skipCollectingAttestations after L2 block ${l2BlockNumber} has been mined`);
182182
sequencers.forEach(sequencer => {
183-
sequencer.updateSequencerConfig({ skipCollectingAttestations: false, minTxsPerBlock: 100 });
183+
sequencer.updateConfig({ skipCollectingAttestations: false, minTxsPerBlock: 100 });
184184
});
185185
});
186186

@@ -226,7 +226,7 @@ describe('e2e_epochs/epochs_invalidate_block', () => {
226226
logger.warn('Configuring all sequencers to skip attestation collection and invalidation as proposer');
227227
const invalidationDelay = test.L1_BLOCK_TIME_IN_S * 4;
228228
sequencers.forEach(sequencer => {
229-
sequencer.updateSequencerConfig({
229+
sequencer.updateConfig({
230230
skipCollectingAttestations: true,
231231
minTxsPerBlock: 0,
232232
skipInvalidateBlockAsProposer: true,
@@ -240,7 +240,7 @@ describe('e2e_epochs/epochs_invalidate_block', () => {
240240
logger.warn(`Disabling skipCollectingAttestations after L2 block ${l2BlockNumber} has been mined`);
241241
invalidBlockTimestamp = timestamp;
242242
sequencers.forEach(sequencer => {
243-
sequencer.updateSequencerConfig({ skipCollectingAttestations: false });
243+
sequencer.updateConfig({ skipCollectingAttestations: false });
244244
});
245245
});
246246

yarn-project/end-to-end/src/e2e_epochs/epochs_manual_rollback.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ describe('e2e_epochs/manual_rollback', () => {
3434

3535
it('manually rolls back', async () => {
3636
logger.info(`Starting manual rollback test to unfinalized block`);
37-
context.sequencer?.updateSequencerConfig({ minTxsPerBlock: 0 });
37+
context.sequencer?.updateConfig({ minTxsPerBlock: 0 });
3838
await test.waitUntilL2BlockNumber(4, test.L2_SLOT_DURATION_IN_S * 6);
3939
await retryUntil(async () => await node.getBlockNumber().then(b => b >= 4), 'sync to 4', 10, 0.1);
4040

4141
logger.info(`Synced to block 4. Pausing syncing and rolling back the chain.`);
4242
await context.aztecNodeAdmin!.pauseSync();
43-
context.sequencer?.updateSequencerConfig({ minTxsPerBlock: 100 }); // Ensure no new blocks are produced
43+
context.sequencer?.updateConfig({ minTxsPerBlock: 100 }); // Ensure no new blocks are produced
4444
await context.cheatCodes.eth.reorg(2);
4545
const blockAfterReorg = Number(await rollup.getBlockNumber());
4646
expect(blockAfterReorg).toBeLessThan(4);

yarn-project/end-to-end/src/e2e_fees/gas_estimation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('e2e_fees gas_estimation', () => {
7373
});
7474
logGasEstimate(estimatedGas);
7575

76-
(t.aztecNode as AztecNodeService).getSequencer()!.updateSequencerConfig({ minTxsPerBlock: 2, maxTxsPerBlock: 2 });
76+
(t.aztecNode as AztecNodeService).getSequencer()!.updateConfig({ minTxsPerBlock: 2, maxTxsPerBlock: 2 });
7777

7878
const [withEstimate, withoutEstimate] = await sendTransfers(paymentMethod);
7979

yarn-project/end-to-end/src/e2e_p2p/reex.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,11 @@ describe('e2e_p2p_reex', () => {
112112

113113
// Hold off sequencers from building a block
114114
const pauseProposals = () =>
115-
Promise.all(
116-
nodes.map(node => node.getSequencer()?.updateSequencerConfig({ minTxsPerBlock: NUM_TXS_PER_NODE + 1 })),
117-
);
115+
Promise.all(nodes.map(node => node.getSequencer()?.updateConfig({ minTxsPerBlock: NUM_TXS_PER_NODE + 1 })));
118116

119117
// Reenable them
120118
const resumeProposals = () =>
121-
Promise.all(nodes.map(node => node.getSequencer()?.updateSequencerConfig({ minTxsPerBlock: NUM_TXS_PER_NODE })));
119+
Promise.all(nodes.map(node => node.getSequencer()?.updateConfig({ minTxsPerBlock: NUM_TXS_PER_NODE })));
122120

123121
// Make sure the nodes submit faulty proposals, in this case a faulty proposal is one where we remove one of the transactions
124122
// Such that the calculated archive will be different!

yarn-project/end-to-end/src/e2e_sequencer_config.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('e2e_sequencer_config', () => {
5252
});
5353

5454
it('respects maxL2BlockGas', async () => {
55-
sequencer!.updateSequencerConfig({
55+
sequencer!.updateConfig({
5656
maxTxsPerBlock: 1,
5757
minTxsPerBlock: 0,
5858
});
@@ -73,7 +73,7 @@ describe('e2e_sequencer_config', () => {
7373
});
7474

7575
// Set the maxL2BlockGas to the total mana used
76-
sequencer!.updateSequencerConfig({
76+
sequencer!.updateConfig({
7777
maxL2BlockGas: Number(totalManaUsed),
7878
});
7979

@@ -83,7 +83,7 @@ describe('e2e_sequencer_config', () => {
8383
expect(receipt2.status).toBe('success');
8484

8585
// Set the maxL2BlockGas to the total mana used - 1
86-
sequencer!.updateSequencerConfig({
86+
sequencer!.updateConfig({
8787
maxL2BlockGas: Number(totalManaUsed) - 1,
8888
});
8989

yarn-project/end-to-end/src/e2e_synching.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ describe('e2e_synching', () => {
343343

344344
// Now we create all of our interesting blocks.
345345
// Alter the block requirements for the sequencer such that we ensure blocks sizes as desired.
346-
sequencer?.updateSequencerConfig({ minTxsPerBlock: variant.txCount, maxTxsPerBlock: variant.txCount });
346+
sequencer?.updateConfig({ minTxsPerBlock: variant.txCount, maxTxsPerBlock: variant.txCount });
347347

348348
// The setup will mint tokens (private and public)
349349
const accountsToBeDeployed = initialFundedAccounts.slice(1); // The first one has been deployed in setup.
@@ -685,7 +685,7 @@ describe('e2e_synching', () => {
685685

686686
const blockBefore = await aztecNode.getBlock(await aztecNode.getBlockNumber());
687687

688-
sequencer?.updateSequencerConfig({ minTxsPerBlock: variant.txCount, maxTxsPerBlock: variant.txCount });
688+
sequencer?.updateConfig({ minTxsPerBlock: variant.txCount, maxTxsPerBlock: variant.txCount });
689689
const txs = await variant.createAndSendTxs();
690690
await Promise.all(txs.map(tx => tx.wait({ timeout: 1200 })));
691691

@@ -744,7 +744,7 @@ describe('e2e_synching', () => {
744744

745745
const blockBefore = await aztecNode.getBlock(await aztecNode.getBlockNumber());
746746

747-
sequencer?.updateSequencerConfig({ minTxsPerBlock: variant.txCount, maxTxsPerBlock: variant.txCount });
747+
sequencer?.updateConfig({ minTxsPerBlock: variant.txCount, maxTxsPerBlock: variant.txCount });
748748
const txs = await variant.createAndSendTxs();
749749
await Promise.all(txs.map(tx => tx.wait({ timeout: 1200 })));
750750

0 commit comments

Comments
 (0)