Skip to content

Commit adf587b

Browse files
authored
feat: merge-train/spartan (#22457)
BEGIN_COMMIT_OVERRIDE fix(p2p): back off on repeated auth handshake failures (#22435) chore(pipeline): add metrics for pipeling building timelines (#21591) fix: no division by zero in sentinel (#22467) chore(pipelining): update next net (#22466) feat(claude): add skill to read gists (#22471) feat(node): add fee prediction API for upcoming L2 slots (#22116) fix: lower EXPECTED_BLOCKS_PER_CHECKPOINT for CI stability (#22480) END_COMMIT_OVERRIDE
2 parents 0daa54d + ff86736 commit adf587b

56 files changed

Lines changed: 1910 additions & 127 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

spartan/environments/mbps-pipeline.env

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,15 @@ VERIFY_CONTRACTS=false
2323
DESTROY_AZTEC_INFRA=true
2424

2525
SEQ_BUILD_CHECKPOINT_IF_EMPTY=true
26-
SEQ_BLOCK_DURATION_MS=6000
26+
SEQ_BLOCK_DURATION_MS=5500
27+
SEQ_MAX_TX_PER_CHECKPOINT=96
2728
SEQ_ENABLE_PROPOSER_PIPELINING=true
28-
SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER=1.1
29+
SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER=1
2930
LOG_LEVEL=verbose
3031

3132
AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET=2
3233
AZTEC_LAG_IN_EPOCHS_FOR_RANDAO=2
34+
AZTEC_INBOX_LAG=2
3335

3436
AZTEC_TARGET_COMMITTEE_SIZE=24
3537

spartan/environments/next-net.env

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ L1_TX_FAILED_STORE=gs://aztec-develop/next-net/failed-l1-txs
2929
TEST_ACCOUNTS=true
3030
SPONSORED_FPC=true
3131

32+
SEQ_ENABLE_PROPOSER_PIPELINING=true
3233
SEQ_MIN_TX_PER_BLOCK=1
33-
34-
SEQ_MAX_TX_PER_CHECKPOINT=7
34+
SEQ_MAX_TX_PER_CHECKPOINT=12
3535

3636
# Build checkpoint even if block is empty.
3737
SEQ_BUILD_CHECKPOINT_IF_EMPTY=true
38-
SEQ_BLOCK_DURATION_MS=6000
38+
SEQ_BLOCK_DURATION_MS=5500
3939

4040
AZTEC_LAG_IN_EPOCHS_FOR_VALIDATOR_SET=2
4141
AZTEC_LAG_IN_EPOCHS_FOR_RANDAO=2
42+
AZTEC_INBOX_LAG=2
4243

4344
VALIDATOR_REPLICAS=4
4445
VALIDATORS_PER_NODE=12

spartan/scripts/deploy_network.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ SEQ_BLOCK_DURATION_MS=${SEQ_BLOCK_DURATION_MS:-}
126126
SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT=${SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT:-}
127127
SEQ_BUILD_CHECKPOINT_IF_EMPTY=${SEQ_BUILD_CHECKPOINT_IF_EMPTY:-}
128128
SEQ_ENABLE_PROPOSER_PIPELINING=${SEQ_ENABLE_PROPOSER_PIPELINING:-false}
129+
AZTEC_EPOCHS_LAG=${AZTEC_EPOCHS_LAG:-}
129130
SEQ_ENFORCE_TIME_TABLE=${SEQ_ENFORCE_TIME_TABLE:-}
130131
SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT=${SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT:-0}
131132
PROVER_REPLICAS=${PROVER_REPLICAS:-4}
@@ -420,6 +421,7 @@ AZTEC_LAG_IN_EPOCHS_FOR_RANDAO = ${AZTEC_LAG_IN_EPOCHS_FOR_RANDAO:-null}
420421
AZTEC_SLOT_DURATION = ${AZTEC_SLOT_DURATION:-null}
421422
AZTEC_EPOCH_DURATION = ${AZTEC_EPOCH_DURATION:-null}
422423
AZTEC_TARGET_COMMITTEE_SIZE = ${AZTEC_TARGET_COMMITTEE_SIZE:-null}
424+
AZTEC_INBOX_LAG = ${AZTEC_INBOX_LAG:-null}
423425
AZTEC_PROOF_SUBMISSION_EPOCHS = ${AZTEC_PROOF_SUBMISSION_EPOCHS:-null}
424426
AZTEC_ACTIVATION_THRESHOLD = ${AZTEC_ACTIVATION_THRESHOLD:-null}
425427
AZTEC_EJECTION_THRESHOLD = ${AZTEC_EJECTION_THRESHOLD:-null}
@@ -558,6 +560,7 @@ SEQ_BLOCK_DURATION_MS = ${SEQ_BLOCK_DURATION_MS:-null}
558560
SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT = ${SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT:-null}
559561
SEQ_BUILD_CHECKPOINT_IF_EMPTY = ${SEQ_BUILD_CHECKPOINT_IF_EMPTY:-null}
560562
SEQ_ENABLE_PROPOSER_PIPELINING = ${SEQ_ENABLE_PROPOSER_PIPELINING}
563+
AZTEC_EPOCHS_LAG = ${AZTEC_EPOCHS_LAG:-null}
561564
SEQ_ENFORCE_TIME_TABLE = ${SEQ_ENFORCE_TIME_TABLE:-null}
562565
SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT = ${SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT}
563566
PROVER_MNEMONIC = "${LABS_INFRA_MNEMONIC}"
@@ -729,4 +732,3 @@ echo "${BENCH_JSON}" | jq '.' > "${BENCH_OUTPUT}"
729732
log "Benchmark JSON written to ${BENCH_OUTPUT}"
730733

731734
log "Total deployment time: ${TOTAL_DEPLOY_TIME} seconds"
732-

spartan/terraform/deploy-aztec-infra/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ locals {
225225
"validator.node.env.SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT" = var.SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT
226226
"validator.node.env.SEQ_BUILD_CHECKPOINT_IF_EMPTY" = var.SEQ_BUILD_CHECKPOINT_IF_EMPTY
227227
"validator.node.env.SEQ_ENABLE_PROPOSER_PIPELINING" = var.SEQ_ENABLE_PROPOSER_PIPELINING
228+
"validator.node.env.AZTEC_EPOCHS_LAG" = var.AZTEC_EPOCHS_LAG
228229
"validator.node.env.SEQ_ENFORCE_TIME_TABLE" = var.SEQ_ENFORCE_TIME_TABLE
229230
"validator.node.env.P2P_TX_POOL_DELETE_TXS_AFTER_REORG" = var.P2P_TX_POOL_DELETE_TXS_AFTER_REORG
230231
"validator.node.env.L1_PRIORITY_FEE_BUMP_PERCENTAGE" = var.VALIDATOR_L1_PRIORITY_FEE_BUMP_PERCENTAGE

spartan/terraform/deploy-aztec-infra/variables.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,13 @@ variable "SEQ_ENABLE_PROPOSER_PIPELINING" {
435435
default = "false"
436436
}
437437

438+
variable "AZTEC_EPOCHS_LAG" {
439+
description = "Epoch lag override for validator nodes"
440+
type = string
441+
nullable = true
442+
default = null
443+
}
444+
438445
variable "SENTINEL_ENABLED" {
439446
description = "Whether to enable sentinel"
440447
type = string

spartan/terraform/deploy-rollup-contracts/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ locals {
4242
AZTEC_SLOT_DURATION = var.AZTEC_SLOT_DURATION
4343
AZTEC_EPOCH_DURATION = var.AZTEC_EPOCH_DURATION
4444
AZTEC_TARGET_COMMITTEE_SIZE = var.AZTEC_TARGET_COMMITTEE_SIZE
45+
AZTEC_INBOX_LAG = var.AZTEC_INBOX_LAG
4546
AZTEC_PROOF_SUBMISSION_EPOCHS = var.AZTEC_PROOF_SUBMISSION_EPOCHS
4647
AZTEC_ACTIVATION_THRESHOLD = var.AZTEC_ACTIVATION_THRESHOLD
4748
AZTEC_EJECTION_THRESHOLD = var.AZTEC_EJECTION_THRESHOLD

spartan/terraform/deploy-rollup-contracts/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ variable "AZTEC_PROOF_SUBMISSION_EPOCHS" {
8686
nullable = true
8787
}
8888

89+
variable "AZTEC_INBOX_LAG" {
90+
description = "Checkpoints to lag in inbox (prevents sequencer DOS attacks)"
91+
type = string
92+
nullable = true
93+
}
94+
8995
variable "AZTEC_ACTIVATION_THRESHOLD" {
9096
description = "Aztec activation threshold"
9197
type = string
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: read-gist
3+
description: Fetch and display a GitHub gist. Triggers when the user asks to read, fetch, or view a URL from gist.github.com.
4+
argument-hint: "<gist URL or ID>"
5+
allowed-tools: Bash(gh gist *), WebFetch
6+
---
7+
8+
# Read Gist
9+
10+
Fetch and display the contents of a GitHub gist.
11+
12+
## Trigger
13+
14+
Activate this skill when the user provides a URL matching `gist.github.com` or asks to fetch/read a gist by ID.
15+
16+
## Parameters
17+
18+
The argument is a gist URL or gist ID: $ARGUMENTS
19+
20+
## Steps
21+
22+
1. **Extract the gist ID** from the input. It can be:
23+
- A full URL like `https://gist.github.com/<user>/<id>` -> extract `<id>`
24+
- A full URL like `https://gist.github.com/<id>` -> extract `<id>`
25+
- A raw URL like `https://gist.githubusercontent.com/...` -> extract the gist ID segment
26+
- A bare gist ID (hex string)
27+
28+
2. **Try `gh gist view`** first (preferred):
29+
30+
```bash
31+
gh gist view <id> --raw
32+
```
33+
34+
If the gist has multiple files, list them first with `gh gist view <id>` (without `--raw`) to show filenames, then fetch with `--raw` or specify a filename with `-f <filename>` if the user asked for a specific file.
35+
36+
3. **Fallback to WebFetch** only if `gh` is not available or the command fails with an auth/install error:
37+
- Fetch `https://gist.githubusercontent.com/<user>/<id>/raw` for single-file gists
38+
- Or fetch the gist API endpoint `https://api.github.com/gists/<id>` and extract file contents from the JSON response
39+
40+
4. **Return the contents** to the caller. If there are multiple files, show each file with its filename as a header.

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import type { L2LogsSource, MerkleTreeReadOperations, WorldStateSynchronizer } f
2525
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
2626
import { mockTx } from '@aztec/stdlib/testing';
2727
import { MerkleTreeId, PublicDataTreeLeaf, PublicDataTreeLeafPreimage } from '@aztec/stdlib/trees';
28+
import type { FeeProvider } from '@aztec/stdlib/tx';
2829
import {
2930
BlockHeader,
3031
GlobalVariables,
@@ -73,6 +74,7 @@ class TestAztecNodeService extends AztecNodeService {
7374
describe('aztec node', () => {
7475
let p2p: MockProxy<P2P>;
7576
let globalVariablesBuilder: MockProxy<GlobalVariableBuilder>;
77+
let feeProvider: MockProxy<FeeProvider>;
7678
let merkleTreeOps: MockProxy<MerkleTreeReadOperations>;
7779
let worldState: MockProxy<WorldStateSynchronizer>;
7880
let l2BlockSource: MockProxy<L2BlockSource>;
@@ -108,7 +110,8 @@ describe('aztec node', () => {
108110
p2p = mock<P2P>();
109111

110112
globalVariablesBuilder = mock<GlobalVariableBuilder>();
111-
globalVariablesBuilder.getCurrentMinFees.mockResolvedValue(new GasFees(0, BlockNumber.ZERO));
113+
feeProvider = mock<FeeProvider>();
114+
feeProvider.getCurrentMinFees.mockResolvedValue(new GasFees(0, BlockNumber.ZERO));
112115

113116
merkleTreeOps = mock<MerkleTreeReadOperations>();
114117
merkleTreeOps.findLeafIndices.mockImplementation((treeId: MerkleTreeId, _value: any[]) => {
@@ -196,6 +199,7 @@ describe('aztec node', () => {
196199
12345,
197200
rollupVersion.toNumber(),
198201
globalVariablesBuilder,
202+
feeProvider,
199203
epochCache,
200204
getPackageVersion() ?? '',
201205
new TestCircuitVerifier(),
@@ -738,6 +742,7 @@ describe('aztec node', () => {
738742
12345,
739743
rollupVersion.toNumber(),
740744
globalVariablesBuilder,
745+
feeProvider,
741746
epochCache,
742747
getPackageVersion() ?? '',
743748
new TestCircuitVerifier(),
@@ -927,6 +932,7 @@ describe('aztec node', () => {
927932
12345,
928933
rollupVersion.toNumber(),
929934
globalVariablesBuilder,
935+
feeProvider,
930936
epochCache,
931937
getPackageVersion() ?? '',
932938
new TestCircuitVerifier(),
@@ -997,6 +1003,7 @@ describe('aztec node', () => {
9971003
12345,
9981004
rollupVersion.toNumber(),
9991005
globalVariablesBuilder,
1006+
mock<FeeProvider>(),
10001007
epochCache,
10011008
getPackageVersion() ?? '',
10021009
new TestCircuitVerifier(),

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

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ import {
3333
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
3434
import { type ProverNode, type ProverNodeDeps, createProverNode } from '@aztec/prover-node';
3535
import { createKeyStoreForProver } from '@aztec/prover-node/config';
36-
import { GlobalVariableBuilder, SequencerClient, type SequencerPublisher } from '@aztec/sequencer-client';
36+
import {
37+
FeeProviderImpl,
38+
GlobalVariableBuilder,
39+
SequencerClient,
40+
type SequencerPublisher,
41+
} from '@aztec/sequencer-client';
3742
import { PublicProcessorFactory } from '@aztec/simulator/server';
3843
import {
3944
AttestationsBlockWatcher,
@@ -60,7 +65,7 @@ import type {
6065
NodeInfo,
6166
ProtocolContractAddresses,
6267
} from '@aztec/stdlib/contract';
63-
import { GasFees } from '@aztec/stdlib/gas';
68+
import { GasFees, type ManaUsageEstimate } from '@aztec/stdlib/gas';
6469
import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
6570
import {
6671
type AztecNode,
@@ -88,6 +93,7 @@ import type { NullifierLeafPreimage, PublicDataTreeLeafPreimage } from '@aztec/s
8893
import { MerkleTreeId, NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
8994
import {
9095
type BlockHeader,
96+
type FeeProvider,
9197
type GlobalVariableBuilder as GlobalVariableBuilderInterface,
9298
type IndexedTxEffect,
9399
PublicSimulationOutput,
@@ -154,6 +160,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
154160
protected readonly l1ChainId: number,
155161
protected readonly version: number,
156162
protected readonly globalVariableBuilder: GlobalVariableBuilderInterface,
163+
protected readonly feeProvider: FeeProvider,
157164
protected readonly epochCache: EpochCacheInterface,
158165
protected readonly packageVersion: string,
159166
private peerProofVerifier: ClientProtocolCircuitVerifier,
@@ -475,13 +482,16 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
475482
})
476483
.catch(err => log.error('Failed to start p2p services after archiver sync', err));
477484

478-
const globalVariableBuilder = new GlobalVariableBuilder(dateProvider, publicClient, {
485+
const globalVariableBuilderConfig = {
479486
l1Contracts: config.l1Contracts,
480487
ethereumSlotDuration: config.ethereumSlotDuration,
481488
rollupVersion: BigInt(config.rollupVersion),
482489
l1GenesisTime,
483490
slotDuration: Number(slotDuration),
484-
});
491+
};
492+
493+
const globalVariableBuilder = new GlobalVariableBuilder(dateProvider, publicClient, globalVariableBuilderConfig);
494+
const feeProvider = new FeeProviderImpl(dateProvider, publicClient, globalVariableBuilderConfig);
485495

486496
// Validator enabled, create/start relevant service
487497
let sequencer: SequencerClient | undefined;
@@ -609,6 +619,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
609619
ethereumChain.chainInfo.id,
610620
config.rollupVersion,
611621
globalVariableBuilder,
622+
feeProvider,
612623
epochCache,
613624
packageVersion,
614625
peerProofVerifier,
@@ -761,12 +772,13 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
761772
return this.blockSource.getCheckpointsDataForEpoch(epochNumber);
762773
}
763774

764-
/**
765-
* Method to fetch the current min L2 fees.
766-
* @returns The current min L2 fees.
767-
*/
768775
public async getCurrentMinFees(): Promise<GasFees> {
769-
return await this.globalVariableBuilder.getCurrentMinFees();
776+
return await this.feeProvider.getCurrentMinFees();
777+
}
778+
779+
/** Returns predicted min fees for the current slot and next N slots. */
780+
public async getPredictedMinFees(manaUsage?: ManaUsageEstimate): Promise<GasFees[]> {
781+
return await this.feeProvider.getPredictedMinFees(manaUsage);
770782
}
771783

772784
public async getMaxPriorityFees(): Promise<GasFees> {

0 commit comments

Comments
 (0)