@aztec/sequencer-client 6.0.0-nightly.20260604 → 6.0.0-nightly.20260721
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -27
- package/dest/client/sequencer-client.d.ts +16 -3
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +17 -12
- package/dest/config.d.ts +6 -2
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +23 -14
- package/dest/global_variable_builder/fee_predictor.d.ts +1 -1
- package/dest/global_variable_builder/fee_predictor.d.ts.map +1 -1
- package/dest/global_variable_builder/fee_predictor.js +11 -1
- package/dest/global_variable_builder/fee_provider.d.ts +1 -1
- package/dest/global_variable_builder/fee_provider.d.ts.map +1 -1
- package/dest/global_variable_builder/fee_provider.js +27 -5
- package/dest/global_variable_builder/global_builder.d.ts +3 -16
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +2 -25
- package/dest/index.d.ts +2 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/publisher/config.d.ts +5 -1
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +11 -1
- package/dest/publisher/l1_to_l2_messaging.d.ts +21 -0
- package/dest/publisher/l1_to_l2_messaging.d.ts.map +1 -0
- package/dest/publisher/l1_to_l2_messaging.js +70 -0
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts +48 -8
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts.map +1 -1
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.js +68 -1
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts +2 -2
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts.map +1 -1
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.js +4 -2
- package/dest/publisher/l1_tx_failed_store/index.d.ts +2 -2
- package/dest/publisher/l1_tx_failed_store/index.d.ts.map +1 -1
- package/dest/publisher/l1_tx_failed_store/index.js +1 -0
- package/dest/publisher/sequencer-publisher.d.ts +34 -6
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +364 -60
- package/dest/publisher/write_json.d.ts +11 -0
- package/dest/publisher/write_json.d.ts.map +1 -0
- package/dest/publisher/write_json.js +57 -0
- package/dest/sequencer/automine/automine_factory.d.ts +5 -3
- package/dest/sequencer/automine/automine_factory.d.ts.map +1 -1
- package/dest/sequencer/automine/automine_factory.js +2 -1
- package/dest/sequencer/automine/automine_sequencer.d.ts +43 -5
- package/dest/sequencer/automine/automine_sequencer.d.ts.map +1 -1
- package/dest/sequencer/automine/automine_sequencer.js +199 -18
- package/dest/sequencer/automine/index.d.ts +3 -0
- package/dest/sequencer/automine/index.d.ts.map +1 -0
- package/dest/sequencer/automine/index.js +2 -0
- package/dest/sequencer/checkpoint_proposal_job.d.ts +28 -15
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +140 -96
- package/dest/sequencer/events.d.ts +16 -5
- package/dest/sequencer/events.d.ts.map +1 -1
- package/dest/sequencer/index.d.ts +1 -3
- package/dest/sequencer/index.d.ts.map +1 -1
- package/dest/sequencer/index.js +0 -2
- package/dest/sequencer/requests_tracker.d.ts +22 -0
- package/dest/sequencer/requests_tracker.d.ts.map +1 -0
- package/dest/sequencer/requests_tracker.js +33 -0
- package/dest/sequencer/sequencer.d.ts +110 -36
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +330 -174
- package/dest/test/index.d.ts +3 -3
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/utils.d.ts +15 -1
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +18 -1
- package/package.json +30 -28
- package/src/client/sequencer-client.ts +20 -13
- package/src/config.ts +25 -12
- package/src/global_variable_builder/fee_predictor.ts +11 -1
- package/src/global_variable_builder/fee_provider.ts +27 -5
- package/src/global_variable_builder/global_builder.ts +2 -34
- package/src/index.ts +1 -10
- package/src/publisher/config.ts +22 -1
- package/src/publisher/l1_to_l2_messaging.ts +85 -0
- package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +114 -7
- package/src/publisher/l1_tx_failed_store/file_store_failed_tx_store.ts +4 -3
- package/src/publisher/l1_tx_failed_store/index.ts +1 -1
- package/src/publisher/sequencer-publisher.ts +385 -71
- package/src/publisher/write_json.ts +78 -0
- package/src/sequencer/automine/README.md +18 -4
- package/src/sequencer/automine/automine_factory.ts +8 -1
- package/src/sequencer/automine/automine_sequencer.ts +221 -20
- package/src/sequencer/automine/index.ts +6 -0
- package/src/sequencer/checkpoint_proposal_job.ts +163 -111
- package/src/sequencer/events.ts +16 -4
- package/src/sequencer/index.ts +0 -2
- package/src/sequencer/requests_tracker.ts +43 -0
- package/src/sequencer/sequencer.ts +361 -187
- package/src/test/index.ts +2 -2
- package/src/test/utils.ts +33 -0
- package/dest/sequencer/chain_state_overrides.d.ts +0 -61
- package/dest/sequencer/chain_state_overrides.d.ts.map +0 -1
- package/dest/sequencer/chain_state_overrides.js +0 -98
- package/dest/sequencer/timetable.d.ts +0 -98
- package/dest/sequencer/timetable.d.ts.map +0 -1
- package/dest/sequencer/timetable.js +0 -227
- package/src/sequencer/chain_state_overrides.ts +0 -162
- package/src/sequencer/timetable.ts +0 -288
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Sequencer Client
|
|
2
2
|
|
|
3
|
-
The sequencer client is the proposer-side counterpart to the [validator client](../validator-client/README.md): it builds checkpoints, broadcasts the block and checkpoint proposals that validators attest to, and publishes the resulting checkpoint to L1. It runs on any node whose configured validator address has been selected as proposer for the
|
|
3
|
+
The sequencer client is the proposer-side counterpart to the [validator client](../validator-client/README.md): it builds checkpoints, broadcasts the block and checkpoint proposals that validators attest to, and publishes the resulting checkpoint to L1. It runs on any node whose configured validator address has been selected as proposer for the target slot.
|
|
4
4
|
|
|
5
|
-
A single instance owns the
|
|
5
|
+
A single instance owns the proposer flow for one slot: deciding whether to propose, building several L2 blocks one after another, signing them, gossiping them, collecting attestations from the committee, and submitting the final checkpoint to L1 in one Multicall3 transaction together with governance and slashing votes.
|
|
6
6
|
|
|
7
|
-
The sequencer does **not** decide what is in the next block on its own. It composes the work of several
|
|
7
|
+
The sequencer does **not** decide what is in the next block on its own. It composes the work of several subsystems: the [tx pool](../p2p/README.md) supplies transactions, the [validator client](../validator-client/README.md) owns operator keys and contains the `CheckpointBuilder` that actually executes them, the [archiver](../archiver/README.md) provides the L2 chain state needed to anchor each block, the [epoch cache](../epoch-cache/README.md) answers proposer/committee lookups, and the [slasher](../slasher/README.md) supplies offenses to vote on.
|
|
8
8
|
|
|
9
9
|
## Key Concepts
|
|
10
10
|
|
|
@@ -14,8 +14,8 @@ The Aztec consensus design splits each Aztec slot into multiple L2 blocks. This
|
|
|
14
14
|
|
|
15
15
|
- **Slot** — a fixed time window (e.g. 72 s) during which one proposer is allowed to build.
|
|
16
16
|
- **Block** — a single batch of transactions, executed and validated as a unit, with its own header.
|
|
17
|
-
- **Checkpoint** — the collection of all blocks built
|
|
18
|
-
- **Sub-slot** — a fixed-duration window
|
|
17
|
+
- **Checkpoint** — the collection of all blocks built for one target slot. The proposer commits to a checkpoint on L1 by submitting a `propose` transaction containing the aggregated header, the blocks' tx effects (as blobs), and the committee attestations.
|
|
18
|
+
- **Sub-slot** — a fixed-duration window during which one block is built. Sub-slots are equal in length and have deadlines fixed relative to the build frame.
|
|
19
19
|
|
|
20
20
|
Several blocks per slot is intentional: it amortizes the fixed L1 cost of a checkpoint over more transactions, and it lets the rest of the network reach a usable state-root much sooner than the full L1 confirmation latency.
|
|
21
21
|
|
|
@@ -26,24 +26,25 @@ There are two tips the sequencer cares about:
|
|
|
26
26
|
- The **proposed chain** is the set of blocks that have been broadcast over p2p but not yet committed to L1. Both the sequencer and validators push these blocks into the archiver so the rest of the node can serve them.
|
|
27
27
|
- The **checkpointed chain** is the set of checkpoints that have landed on L1, recovered from `CheckpointProposed` events.
|
|
28
28
|
|
|
29
|
-
Within a slot, the proposer adds blocks to the proposed chain as it goes. Only the last block
|
|
29
|
+
Within a slot, the proposer adds blocks to the proposed chain as it goes. Only the last block is bundled with a `CheckpointProposal` that committee members attest to; intermediate blocks are accepted onto the proposed chain by virtue of the proposer's signature alone, and every node that wants to follow the proposed chain re-executes them. See the [validator client README](../validator-client/README.md) for the consumer side.
|
|
30
30
|
|
|
31
31
|
### Proposer Pipelining
|
|
32
32
|
|
|
33
|
-
Pipelining ([proposed in this discussion](https://github.com/AztecProtocol/governance/discussions/8)) is the only mode the production sequencer runs in. The proposer for slot `N` builds blocks
|
|
33
|
+
Pipelining ([proposed in this discussion](https://github.com/AztecProtocol/governance/discussions/8)) is the only mode the production sequencer runs in. The proposer for slot `N` builds blocks and broadcasts the checkpoint proposal during slot `N - 1`; the committee re-executes the final block, sends attestations back, and the proposer targets L1 submission for the start of slot `N`. This removes the long idle window a naive flow would have inside slot `N`, where the proposer would otherwise spend most of the slot collecting attestations and waiting for the L1 transaction to mine.
|
|
34
34
|
|
|
35
35
|
Each phase lands in this slot:
|
|
36
36
|
|
|
37
37
|
| Phase | Slot |
|
|
38
38
|
| ----------------------- | ------------ |
|
|
39
39
|
| Block building | slot `N - 1` |
|
|
40
|
-
|
|
|
40
|
+
| Checkpoint proposal | slot `N - 1` |
|
|
41
|
+
| Committee validation | slot `N - 1` |
|
|
41
42
|
| Attestation collection | slot `N - 1` \* |
|
|
42
43
|
| L1 submission | slot `N` |
|
|
43
44
|
|
|
44
|
-
\* The timing
|
|
45
|
+
\* The ideal timing path reserves enough budget for attestations to be in hand before the ideal L1 send time. The hard `attestation_deadline` is also the latest useful L1 publish time; validators must finish validation and sign by then for inactivity/slashing purposes.
|
|
45
46
|
|
|
46
|
-
`EpochCache` always looks up the
|
|
47
|
+
`EpochCache` always looks up the pipelined target proposer, so the sequencer asks the cache for the proposer of `slot + 1` (`PROPOSER_PIPELINING_SLOT_OFFSET = 1`) rather than `slot`. Building runs during the wall-clock slot; the checkpoint commits to the target slot.
|
|
47
48
|
|
|
48
49
|
This flow introduces two failure modes that block building has to handle:
|
|
49
50
|
|
|
@@ -101,7 +102,7 @@ This flow introduces two failure modes that block building has to handle:
|
|
|
101
102
|
- Calls `publisher.canProposeAt(...)` — if L1 rejects the simulated propose, abort early.
|
|
102
103
|
3. Constructs a `CheckpointProposalJob` and calls `.execute()`, parking the returned `pendingL1Submission` on the sequencer so `stop()` can await it without re-entering the loop.
|
|
103
104
|
|
|
104
|
-
Each state transition flows through `setState()`, which
|
|
105
|
+
Each state transition flows through `setState()`, which records the state, emits `state-changed`, and updates metrics — nothing else. Timing is not enforced through states: the work loop and the job query explicit deadlines from the `ProposerTimetable` (the build-entry gate via `getBuildStartDeadline`, sub-slot selection via `selectNextSubslot`, attestation collection and L1 publishing bounded by `getAttestationDeadline`). When a deadline is hit, the slot is abandoned and marked as attempted so it is not retried.
|
|
105
106
|
|
|
106
107
|
The sequencer is a `TypedEventEmitter<SequencerEvents>`. The most useful events are:
|
|
107
108
|
|
|
@@ -150,7 +151,7 @@ Inside `execute()`:
|
|
|
150
151
|
- Transitions to `COLLECTING_ATTESTATIONS`. Reads the committee from `EpochCache`, computes the quorum (`2/3 + 1`), and waits for that many attestations on p2p. The validator client adds the proposer's own signature.
|
|
151
152
|
- `waitForValidParentCheckpointOnL1()` waits for the archiver to confirm the parent we built on top of has landed on L1 with matching hash and valid attestations. If not, the work is dropped (`pipelined-checkpoint-discarded`) and we enqueue an invalidation for the parent so the next proposer doesn't repeat the same mistake.
|
|
152
153
|
- Computes `submitAfter` as `getTimestampForSlot(targetSlot)` so the Multicall3 mines inside the target slot — EIP-712 signatures are bound to a slot and would silently fail if mined outside it.
|
|
153
|
-
- Calls `publisher.sendRequestsAt(submitAfter)`, which
|
|
154
|
+
- Calls `publisher.sendRequestsAt(submitAfter)`, which targets the ideal L1 send time, re-runs each request's `preCheck` against fresh L1 state, and submits the bundled Multicall3.
|
|
154
155
|
|
|
155
156
|
### Per-block loop (`buildBlocksForCheckpoint`)
|
|
156
157
|
|
|
@@ -158,7 +159,7 @@ The per-block loop is the heart of the building flow:
|
|
|
158
159
|
|
|
159
160
|
```
|
|
160
161
|
loop:
|
|
161
|
-
timing = timetable.
|
|
162
|
+
timing = timetable.selectNextSubslot(targetSlot, now)
|
|
162
163
|
if !timing.canStart: break
|
|
163
164
|
if blocksBuilt >= maxBlocksPerCheckpoint: break
|
|
164
165
|
|
|
@@ -170,7 +171,7 @@ loop:
|
|
|
170
171
|
|
|
171
172
|
if result is 'insufficient-txs' or 'insufficient-valid-txs':
|
|
172
173
|
if isLastBlock or no deadline: break
|
|
173
|
-
else: continue (try next sub-slot)
|
|
174
|
+
else: wait until this sub-slot deadline, then continue (try next sub-slot)
|
|
174
175
|
if result is error: halt
|
|
175
176
|
|
|
176
177
|
blockProposal = validatorClient.createBlockProposal(block)
|
|
@@ -184,18 +185,19 @@ loop:
|
|
|
184
185
|
waitUntilNextSubSlot(timing.deadline)
|
|
185
186
|
```
|
|
186
187
|
|
|
187
|
-
The deadlines passed to `CheckpointBuilder.buildBlock` are absolute timestamps
|
|
188
|
+
The deadlines passed to `CheckpointBuilder.buildBlock` are absolute timestamps. The builder uses these as hard caps on tx execution, so a slow block cannot eat into the next sub-slot.
|
|
188
189
|
|
|
189
|
-
`maxBlocksPerCheckpoint` (the timetable's `
|
|
190
|
+
`maxBlocksPerCheckpoint` (bounded by the timetable's `getMaxBlocksPerCheckpoint()` and the configured cap) and `perBlockAllocationMultiplier` (default 1.2) are passed in opts so that the builder can redistribute the remaining checkpoint budget (L2 gas, DA gas, blob fields, tx count) across the remaining blocks. See [validator-client/README.md § Block Building Limits](../validator-client/README.md#block-building-limits) for the redistribution math; the sequencer only sets the inputs.
|
|
190
191
|
|
|
191
192
|
### Timetable
|
|
192
193
|
|
|
193
|
-
|
|
194
|
+
The sequencer builds a `ProposerTimetable` (from `@aztec/stdlib/timetable`) directly from its config and the L1 constants. Key getters:
|
|
194
195
|
|
|
195
|
-
- **Sub-slot scheduling**: `
|
|
196
|
-
- **
|
|
196
|
+
- **Sub-slot scheduling**: `selectNextSubslot(slot, now)` finds the next sub-slot with at least `minBlockDuration` remaining and returns its absolute deadline and whether it is the last sub-slot. If we are running late, sub-slots are skipped; we never start a block we cannot finish.
|
|
197
|
+
- **Build-entry gate**: `getBuildStartDeadline(slot)` is the latest useful time to start building for a target slot; past it, the work loop abandons the slot without building.
|
|
198
|
+
- **Consensus bounds**: the inherited `ConsensusTimetable` getters (`getAttestationDeadline`, the proposal/attestation receive windows) bound attestation collection, L1 publishing, and p2p ingress.
|
|
197
199
|
|
|
198
|
-
See [
|
|
200
|
+
See the [Block Building Timetable Spec](../stdlib/src/timetable/README.md) for the full timing model, including the ideal/deadline split for checkpoint proposals, the consensus-only receive deadline, and the failure-mode walkthroughs.
|
|
199
201
|
|
|
200
202
|
### SequencerPublisher
|
|
201
203
|
|
|
@@ -207,7 +209,7 @@ Key entry points:
|
|
|
207
209
|
- `enqueueProposeCheckpoint(checkpoint, attestations, attestationsSignature, opts)` — adds the propose call, with a `preCheck` that re-validates the proposal against real L1 state when it is finally sent (catches drift between build time and submit time).
|
|
208
210
|
- `enqueueInvalidateCheckpoint`, `enqueueGovernanceCastSignal`, `enqueueSlashingActions` — the rest of the actions a proposer may bundle.
|
|
209
211
|
- `sendRequests(targetSlot?)` — immediately flushes the queue as one Multicall3 transaction. Used by the `AutomineSequencer` for synchronous in-slot publishing.
|
|
210
|
-
- `sendRequestsAt(targetSlot)` — the production (pipelined) path: sleeps (cancellable) until
|
|
212
|
+
- `sendRequestsAt(targetSlot)` — the production (pipelined) path: sleeps (cancellable) until the ideal L1 send time, runs each request's `preCheck` (dropping those that fail), and then calls `sendRequests(targetSlot)`, which filters expired requests, sorts the remainder, and submits one Multicall3 that mines inside the target slot.
|
|
211
213
|
|
|
212
214
|
`SequencerPublisherFactory` produces one publisher per attempt, wrapping an L1 publisher (EOA + `L1TxUtils`) leased from `PublisherManager`. Leases free the publisher when the job completes so multiple validator addresses on the same node can take turns without conflicts.
|
|
213
215
|
|
|
@@ -243,10 +245,8 @@ The configuration object is `SequencerConfig` (`src/sequencer/config.ts` + `src/
|
|
|
243
245
|
|
|
244
246
|
| Option / env var | Default | Purpose |
|
|
245
247
|
| --- | --- | --- |
|
|
246
|
-
| `blockDurationMs` / `SEQ_BLOCK_DURATION_MS` |
|
|
247
|
-
| `enforceTimeTable` / `SEQ_ENFORCE_TIME_TABLE` | true | If false, deadlines are not enforced and a single block is built with unbounded time. |
|
|
248
|
+
| `blockDurationMs` / `SEQ_BLOCK_DURATION_MS` | 3000 ms | Length of one sub-slot in ms. Required: the sequencer always runs the enforced timetable. The derived `maxBlocksPerCheckpoint = floor((aztecSlotDuration − checkpointInitializationTime − (checkpointAssembleTime + 2·p2pPropagationTime + blockDuration)) / blockDuration)`; a slot may legitimately fit a single block when that floor is 1. |
|
|
248
249
|
| `attestationPropagationTime` / `SEQ_ATTESTATION_PROPAGATION_TIME` | 2 s | One-way p2p estimate fed to the timetable. |
|
|
249
|
-
| `l1PublishingTime` / `SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT` | full L1 slot | Time reserved for the L1 tx to land. |
|
|
250
250
|
| `sequencerPollingIntervalMS` / `SEQ_POLLING_INTERVAL_MS` | 500 | Work-loop tick rate. |
|
|
251
251
|
|
|
252
252
|
### Behavior
|
|
@@ -270,7 +270,7 @@ The full list (including test/fault-injection hooks like `pauseProposingForSlots
|
|
|
270
270
|
- **Out of sync**: `checkSync` fails → governance/slashing votes still go out via `tryVoteWhenSyncFails`, but no block is built.
|
|
271
271
|
- **Insufficient txs in a sub-slot**: `CheckpointBuilder.buildBlock` returns `insufficient-txs`. The sub-slot is skipped without committing state; the next sub-slot retries. On the last sub-slot, if `buildCheckpointIfEmpty` is true, the block is still built with whatever is available (possibly zero txs).
|
|
272
272
|
- **Sub-slot deadline exceeded**: `CheckpointBuilder` enforces the deadline and stops executing further txs. The block is finalized with whatever fit.
|
|
273
|
-
- **
|
|
273
|
+
- **Build start deadline exceeded**: the work loop abandons the slot before building and marks it as attempted so the same checkpoint is not retried. Inside the job, sub-slot and attestation deadlines bound their own phases.
|
|
274
274
|
- **Pipelined parent fails on L1**: `waitForValidParentCheckpointOnL1` returns false. The whole proposal is discarded (`pipelined-checkpoint-discarded`), the parent is enqueued for invalidation, and the L1 submission for *this* checkpoint is not sent.
|
|
275
275
|
- **L1 submission reverts or expires**: `checkpoint-publish-failed` is emitted with the individual action results so observability can break down which actions in the Multicall3 went through and which didn't.
|
|
276
276
|
|
|
@@ -280,7 +280,7 @@ The full list (including test/fault-injection hooks like `pauseProposingForSlots
|
|
|
280
280
|
| --- | --- |
|
|
281
281
|
| How does the work loop decide whether to propose? | `src/sequencer/sequencer.ts` → `prepareCheckpointProposal`, `checkCanPropose` |
|
|
282
282
|
| How does a checkpoint get built block-by-block? | `src/sequencer/checkpoint_proposal_job.ts` → `proposeCheckpoint`, `buildBlocksForCheckpoint` |
|
|
283
|
-
| How do sub-slot deadlines work? |
|
|
283
|
+
| How do sub-slot deadlines work? | `@aztec/stdlib` `ProposerTimetable` + [`stdlib/src/timetable/README.md`](../stdlib/src/timetable/README.md) |
|
|
284
284
|
| How does an L1 transaction get scheduled and submitted? | `src/publisher/sequencer-publisher.ts` → `sendRequestsAt` |
|
|
285
285
|
| How does pipelining wait for the parent to land? | `src/sequencer/checkpoint_proposal_job.ts` → `waitForValidParentCheckpointOnL1` |
|
|
286
286
|
| How do governance and slashing votes get into the L1 tx? | `src/sequencer/checkpoint_voter.ts` |
|
|
@@ -301,5 +301,5 @@ The integration tests of interest are:
|
|
|
301
301
|
- `src/sequencer/sequencer.test.ts` — work-loop behavior, escape-hatch and invalidation fallbacks.
|
|
302
302
|
- `src/sequencer/checkpoint_proposal_job.test.ts` — full per-slot job, including pipelined parent validation and discard paths.
|
|
303
303
|
- `src/sequencer/checkpoint_proposal_job.timing.test.ts` — sub-slot timing and skip behavior under simulated clock drift.
|
|
304
|
-
- `src/
|
|
304
|
+
- `stdlib/src/timetable/*.test.ts` — pure math against `ConsensusTimetable` / `ProposerTimetable`.
|
|
305
305
|
- `src/publisher/sequencer-publisher.test.ts` — request ordering, `sendRequestsAt`, preCheck re-runs.
|
|
@@ -62,12 +62,25 @@ export declare class SequencerClient {
|
|
|
62
62
|
* @param config - New parameters.
|
|
63
63
|
*/
|
|
64
64
|
updateConfig(config: SequencerConfig & Partial<ValidatorClientFullConfig>): void;
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Starts (or resumes) the sequencer, validator, publishers, and metrics. Each underlying start is
|
|
67
|
+
* idempotent, so this is safe to call after a previous {@link pause} to resume building and publishing.
|
|
68
|
+
* The publisher manager is started before the sequencer's poll loop so publishing is ready before the
|
|
69
|
+
* sequencer first tries to publish to L1.
|
|
70
|
+
*/
|
|
66
71
|
start(): Promise<void>;
|
|
67
72
|
/**
|
|
68
|
-
* Stops the sequencer
|
|
73
|
+
* Stops the sequencer, validator, publishers, and metrics for good, draining in-flight work. This is the
|
|
74
|
+
* final teardown path: stopping the validator client closes its slashing-protection database. For a
|
|
75
|
+
* restartable pause (e.g. around a test clock warp) use {@link pause} instead.
|
|
69
76
|
*/
|
|
70
77
|
stop(): Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* Gracefully pauses block production, waiting for in-flight work to finish rather than interrupting it,
|
|
80
|
+
* while leaving the validator, publishers, and metrics running so the sequencer can be resumed with
|
|
81
|
+
* {@link start}. Used by tests that pause sequencers around an L1 clock warp.
|
|
82
|
+
*/
|
|
83
|
+
pause(): Promise<void>;
|
|
71
84
|
/** Triggers an immediate run of the sequencer, bypassing the polling interval. */
|
|
72
85
|
trigger(): Promise<void> | undefined;
|
|
73
86
|
getSequencer(): Sequencer;
|
|
@@ -78,4 +91,4 @@ export declare class SequencerClient {
|
|
|
78
91
|
get validatorAddresses(): EthAddress[] | undefined;
|
|
79
92
|
get maxL2BlockGas(): number | undefined;
|
|
80
93
|
}
|
|
81
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
94
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VxdWVuY2VyLWNsaWVudC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaWVudC9zZXF1ZW5jZXItY2xpZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFckUsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBR2hELE9BQU8sRUFBRSxLQUFLLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUN0RSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUNyRSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFM0QsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDNUQsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDNUQsT0FBTyxLQUFLLEVBQUUsR0FBRyxFQUFFLE1BQU0sWUFBWSxDQUFDO0FBQ3RDLE9BQU8sS0FBSyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDN0QsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLGFBQWEsRUFBRSxzQkFBc0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQzlGLE9BQU8sS0FBSyxFQUFFLHlCQUF5QixFQUFFLHNCQUFzQixFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDekcs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RUQscUZBQXFGO0lBQzlFLDJCQUEyQixDQUFDLE9BQU8sRUFBRSxtQkFBbUIsR0FBRyxJQUFJLENBRXJFO0lBRUQsaUZBQWlGO0lBQ2pGLFVBQVUsSUFBSSxPQUFPLEdBQUcsU0FBUyxDQUVoQztJQUVELElBQUksa0JBQWtCLElBQUksVUFBVSxFQUFFLEdBQUcsU0FBUyxDQUVqRDtJQUVELElBQUksYUFBYSxJQUFJLE1BQU0sR0FBRyxTQUFTLENBRXRDO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer-client.d.ts","sourceRoot":"","sources":["../../src/client/sequencer-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"sequencer-client.d.ts","sourceRoot":"","sources":["../../src/client/sequencer-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,KAAK,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC9F,O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AC;QAC/C,aAAa,EAAE,aAAa,GAAG,WAAW,GAAG,sBAAsB,CAAC;QACpE,mBAAmB,EAAE,mBAAmB,CAAC;QACzC,SAAS,EAAE,eAAe,CAAC;QAC3B,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;QAC7C,UAAU,EAAE,mBAAmB,CAAC;QAChC,YAAY,EAAE,YAAY,CAAC;QAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,SAAS,EAAE,SAAS,EAAE,CAAC;QACvB,eAAe,CAAC,EAAE,SAAS,CAAC;QAC5B,YAAY,EAAE,eAAe,CAAC;QAC9B,qBAAqB,EAAE,qBAAqB,CAAC;KAC9C,4BAsGF;IAED;;;OAGG;IACI,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC,QAI/E;IAED;;;;;OAKG;IACU,KAAK,kBAKjB;IAED;;;;OAIG;IACU,IAAI,kBAKhB;IAED;;;;OAIG;IACU,KAAK,kBAEjB;IAED,kFAAkF;IAC3E,OAAO,8BAEb;IAEM,YAAY,IAAI,SAAS,CAE/B;IAED,qFAAqF;IAC9E,2BAA2B,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAErE;IAED,iFAAiF;IACjF,UAAU,IAAI,OAAO,GAAG,SAAS,CAEhC;IAED,IAAI,kBAAkB,IAAI,UAAU,EAAE,GAAG,SAAS,CAEjD;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;CACF"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT } from '@aztec/constants';
|
|
2
2
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
3
|
-
import { isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
4
3
|
import { getPublicClient } from '@aztec/ethereum/client';
|
|
5
4
|
import { GovernanceProposerContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
6
5
|
import { PublisherManager } from '@aztec/ethereum/publisher-manager';
|
|
@@ -77,13 +76,6 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
77
76
|
});
|
|
78
77
|
const ethereumSlotDuration = config.ethereumSlotDuration;
|
|
79
78
|
const globalsBuilder = deps.globalVariableBuilder;
|
|
80
|
-
// When running in anvil, assume we can post a tx up until one second before the end of an L1 slot.
|
|
81
|
-
// Otherwise, we need the full L1 slot duration for publishing to ensure inclusion.
|
|
82
|
-
// In theory, the L1 slot has an initial 4s phase where the block is propagated, so we could
|
|
83
|
-
// reduce the publishing time allowance. However, we prefer being conservative.
|
|
84
|
-
// See https://www.blocknative.com/blog/anatomy-of-a-slot#7 for more info.
|
|
85
|
-
const l1PublishingTimeBasedOnChain = isAnvilTestChain(config.l1ChainId) ? 1 : ethereumSlotDuration;
|
|
86
|
-
const l1PublishingTime = config.l1PublishingTime ?? l1PublishingTimeBasedOnChain;
|
|
87
79
|
const { maxL2BlockGas, maxDABlockGas, maxTxsPerBlock } = capPerBlockLimits(config, rollupManaLimit, log);
|
|
88
80
|
const l1Constants = {
|
|
89
81
|
l1GenesisTime,
|
|
@@ -94,7 +86,6 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
94
86
|
};
|
|
95
87
|
const sequencer = new Sequencer(publisherFactory, validatorClient, globalsBuilder, p2pClient, worldStateSynchronizer, slasherClient, l2BlockSource, l1ToL2MessageSource, checkpointsBuilder, l1Constants, deps.dateProvider, epochCache, rollupContract, {
|
|
96
88
|
...config,
|
|
97
|
-
l1PublishingTime,
|
|
98
89
|
maxL2BlockGas,
|
|
99
90
|
maxDABlockGas,
|
|
100
91
|
maxTxsPerBlock
|
|
@@ -112,20 +103,34 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
112
103
|
this.checkpointsBuilder.updateConfig(config);
|
|
113
104
|
this.validatorClient?.updateConfig(config);
|
|
114
105
|
}
|
|
115
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Starts (or resumes) the sequencer, validator, publishers, and metrics. Each underlying start is
|
|
108
|
+
* idempotent, so this is safe to call after a previous {@link pause} to resume building and publishing.
|
|
109
|
+
* The publisher manager is started before the sequencer's poll loop so publishing is ready before the
|
|
110
|
+
* sequencer first tries to publish to L1.
|
|
111
|
+
*/ async start() {
|
|
116
112
|
await this.validatorClient?.start();
|
|
113
|
+
await this.publisherManager.start();
|
|
117
114
|
this.sequencer.start();
|
|
118
115
|
this.l1Metrics?.start();
|
|
119
|
-
await this.publisherManager.start();
|
|
120
116
|
}
|
|
121
117
|
/**
|
|
122
|
-
* Stops the sequencer
|
|
118
|
+
* Stops the sequencer, validator, publishers, and metrics for good, draining in-flight work. This is the
|
|
119
|
+
* final teardown path: stopping the validator client closes its slashing-protection database. For a
|
|
120
|
+
* restartable pause (e.g. around a test clock warp) use {@link pause} instead.
|
|
123
121
|
*/ async stop() {
|
|
124
122
|
await this.sequencer.stop();
|
|
125
123
|
await this.validatorClient?.stop();
|
|
126
124
|
await this.publisherManager.stop();
|
|
127
125
|
this.l1Metrics?.stop();
|
|
128
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Gracefully pauses block production, waiting for in-flight work to finish rather than interrupting it,
|
|
129
|
+
* while leaving the validator, publishers, and metrics running so the sequencer can be resumed with
|
|
130
|
+
* {@link start}. Used by tests that pause sequencers around an L1 clock warp.
|
|
131
|
+
*/ async pause() {
|
|
132
|
+
await this.sequencer.pause();
|
|
133
|
+
}
|
|
129
134
|
/** Triggers an immediate run of the sequencer, bypassing the polling interval. */ trigger() {
|
|
130
135
|
return this.sequencer.trigger();
|
|
131
136
|
}
|
package/dest/config.d.ts
CHANGED
|
@@ -18,8 +18,11 @@ export declare const DefaultSequencerConfig: {
|
|
|
18
18
|
buildCheckpointIfEmpty: false;
|
|
19
19
|
publishTxsWithProposals: false;
|
|
20
20
|
perBlockAllocationMultiplier: number;
|
|
21
|
+
perBlockDAAllocationMultiplier: number;
|
|
21
22
|
redistributeCheckpointBudget: true;
|
|
22
|
-
|
|
23
|
+
blockDurationMs: number;
|
|
24
|
+
l1PublishingTime: number;
|
|
25
|
+
checkpointProposalSyncGraceSeconds: number;
|
|
23
26
|
attestationPropagationTime: number;
|
|
24
27
|
secondsBeforeInvalidatingBlockAsCommitteeMember: number;
|
|
25
28
|
secondsBeforeInvalidatingBlockAsNonCommitteeMember: number;
|
|
@@ -31,6 +34,7 @@ export declare const DefaultSequencerConfig: {
|
|
|
31
34
|
injectFakeAttestation: false;
|
|
32
35
|
injectHighSValueAttestation: false;
|
|
33
36
|
injectUnrecoverableSignatureAttestation: false;
|
|
37
|
+
injectYParityAttestation: false;
|
|
34
38
|
fishermanMode: false;
|
|
35
39
|
shuffleAttestationOrdering: false;
|
|
36
40
|
skipPushProposedBlocksToArchiver: false;
|
|
@@ -47,4 +51,4 @@ export declare const sequencerClientConfigMappings: ConfigMappingsType<Sequencer
|
|
|
47
51
|
* Creates an instance of SequencerClientConfig out of environment variables using sensible defaults for integration testing if not set.
|
|
48
52
|
*/
|
|
49
53
|
export declare function getConfigEnvVars(): SequencerClientConfig;
|
|
50
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
54
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLGlCQUFpQixFQUE2QixNQUFNLHdCQUF3QixDQUFDO0FBQzNGLE9BQU8sRUFBRSxLQUFLLGNBQWMsRUFBMEIsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RixPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFPeEIsTUFBTSwwQkFBMEIsQ0FBQztBQUVsQyxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQTBCLE1BQU0sNkJBQTZCLENBQUM7QUFDMUYsT0FBTyxFQUFFLEtBQUssU0FBUyxFQUFxQixNQU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eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CASnF,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
|
package/dest/config.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { l1ContractsConfigMappings } from '@aztec/ethereum/config';
|
|
2
2
|
import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
3
|
-
import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper, optionalNumberConfigHelper, pickConfigMappings } from '@aztec/foundation/config';
|
|
3
|
+
import { booleanConfigHelper, floatConfigHelper, getConfigFromMappings, numberConfigHelper, optionalNumberConfigHelper, pickConfigMappings } from '@aztec/foundation/config';
|
|
4
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
5
|
import { keyStoreConfigMappings } from '@aztec/node-keystore/config';
|
|
6
6
|
import { p2pConfigMappings } from '@aztec/p2p/config';
|
|
7
7
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
-
import { DEFAULT_MAX_BLOCKS_PER_CHECKPOINT, chainConfigMappings, sharedSequencerConfigMappings } from '@aztec/stdlib/config';
|
|
8
|
+
import { DEFAULT_BLOCK_DURATION_MS, DEFAULT_MAX_BLOCKS_PER_CHECKPOINT, chainConfigMappings, sharedSequencerConfigMappings } from '@aztec/stdlib/config';
|
|
9
|
+
import { MIN_PER_BLOCK_ALLOCATION_MULTIPLIER, MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER } from '@aztec/stdlib/gas';
|
|
9
10
|
import { DEFAULT_P2P_PROPAGATION_TIME } from '@aztec/stdlib/timetable';
|
|
10
11
|
import { validatorClientConfigMappings } from '@aztec/validator-client/config';
|
|
11
12
|
import { sequencerPublisherConfigMappings, sequencerTxSenderConfigMappings } from './publisher/config.js';
|
|
@@ -18,9 +19,12 @@ export * from './publisher/config.js';
|
|
|
18
19
|
minTxsPerBlock: 1,
|
|
19
20
|
buildCheckpointIfEmpty: false,
|
|
20
21
|
publishTxsWithProposals: false,
|
|
21
|
-
perBlockAllocationMultiplier:
|
|
22
|
+
perBlockAllocationMultiplier: MIN_PER_BLOCK_ALLOCATION_MULTIPLIER,
|
|
23
|
+
perBlockDAAllocationMultiplier: MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER,
|
|
22
24
|
redistributeCheckpointBudget: true,
|
|
23
|
-
|
|
25
|
+
blockDurationMs: DEFAULT_BLOCK_DURATION_MS,
|
|
26
|
+
l1PublishingTime: 12,
|
|
27
|
+
checkpointProposalSyncGraceSeconds: 2 * (DEFAULT_BLOCK_DURATION_MS / 1000),
|
|
24
28
|
attestationPropagationTime: DEFAULT_P2P_PROPAGATION_TIME,
|
|
25
29
|
secondsBeforeInvalidatingBlockAsCommitteeMember: 144,
|
|
26
30
|
secondsBeforeInvalidatingBlockAsNonCommitteeMember: 432,
|
|
@@ -32,6 +36,7 @@ export * from './publisher/config.js';
|
|
|
32
36
|
injectFakeAttestation: false,
|
|
33
37
|
injectHighSValueAttestation: false,
|
|
34
38
|
injectUnrecoverableSignatureAttestation: false,
|
|
39
|
+
injectYParityAttestation: false,
|
|
35
40
|
fishermanMode: false,
|
|
36
41
|
shuffleAttestationOrdering: false,
|
|
37
42
|
skipPushProposedBlocksToArchiver: false,
|
|
@@ -75,7 +80,12 @@ export const sequencerConfigMappings = {
|
|
|
75
80
|
perBlockAllocationMultiplier: {
|
|
76
81
|
env: 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER',
|
|
77
82
|
description: 'Per-block gas budget multiplier for both L2 and DA gas. Budget per block is (checkpointLimit / maxBlocks) * multiplier.' + ' Values greater than one allow early blocks to use more than their even share, relying on checkpoint-level capping for later blocks.',
|
|
78
|
-
...
|
|
83
|
+
...floatConfigHelper(DefaultSequencerConfig.perBlockAllocationMultiplier)
|
|
84
|
+
},
|
|
85
|
+
perBlockDAAllocationMultiplier: {
|
|
86
|
+
env: 'SEQ_PER_BLOCK_DA_ALLOCATION_MULTIPLIER',
|
|
87
|
+
description: 'Per-block budget multiplier applied to DA gas and blob fields in place of perBlockAllocationMultiplier.' + ' Defaults higher than the general multiplier so the largest contract class deploy fits a single block.',
|
|
88
|
+
...floatConfigHelper(DefaultSequencerConfig.perBlockDAAllocationMultiplier)
|
|
79
89
|
},
|
|
80
90
|
redistributeCheckpointBudget: {
|
|
81
91
|
env: 'SEQ_REDISTRIBUTE_CHECKPOINT_BUDGET',
|
|
@@ -89,7 +99,7 @@ export const sequencerConfigMappings = {
|
|
|
89
99
|
},
|
|
90
100
|
feeRecipient: {
|
|
91
101
|
env: 'FEE_RECIPIENT',
|
|
92
|
-
parseEnv: (val)=>AztecAddress.
|
|
102
|
+
parseEnv: (val)=>AztecAddress.fromStringUnsafe(val),
|
|
93
103
|
description: 'Address to receive fees.'
|
|
94
104
|
},
|
|
95
105
|
acvmWorkingDirectory: {
|
|
@@ -100,11 +110,6 @@ export const sequencerConfigMappings = {
|
|
|
100
110
|
env: 'ACVM_BINARY_PATH',
|
|
101
111
|
description: 'The path to the ACVM binary'
|
|
102
112
|
},
|
|
103
|
-
enforceTimeTable: {
|
|
104
|
-
env: 'SEQ_ENFORCE_TIME_TABLE',
|
|
105
|
-
description: 'Whether to enforce the time table when building blocks',
|
|
106
|
-
...booleanConfigHelper(DefaultSequencerConfig.enforceTimeTable)
|
|
107
|
-
},
|
|
108
113
|
governanceProposerPayload: {
|
|
109
114
|
env: 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS',
|
|
110
115
|
description: 'The address of the payload for the governanceProposer',
|
|
@@ -112,8 +117,8 @@ export const sequencerConfigMappings = {
|
|
|
112
117
|
},
|
|
113
118
|
l1PublishingTime: {
|
|
114
119
|
env: 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT',
|
|
115
|
-
description: 'How much time
|
|
116
|
-
...
|
|
120
|
+
description: 'How much time in seconds to allow in the slot for publishing the L1 transaction.',
|
|
121
|
+
...numberConfigHelper(DefaultSequencerConfig.l1PublishingTime)
|
|
117
122
|
},
|
|
118
123
|
fakeProcessingDelayPerTxMs: {
|
|
119
124
|
description: 'Used for testing to introduce a fake delay after processing each tx'
|
|
@@ -167,6 +172,10 @@ export const sequencerConfigMappings = {
|
|
|
167
172
|
description: 'Inject an attestation with an unrecoverable signature (for testing only)',
|
|
168
173
|
...booleanConfigHelper(DefaultSequencerConfig.injectUnrecoverableSignatureAttestation)
|
|
169
174
|
},
|
|
175
|
+
injectYParityAttestation: {
|
|
176
|
+
description: 'Inject a non-proposer attestation slot in yParity form in the packed L1 tuple (for testing only)',
|
|
177
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectYParityAttestation)
|
|
178
|
+
},
|
|
170
179
|
fishermanMode: {
|
|
171
180
|
env: 'FISHERMAN_MODE',
|
|
172
181
|
description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
|
|
@@ -183,7 +192,7 @@ export const sequencerConfigMappings = {
|
|
|
183
192
|
...booleanConfigHelper(DefaultSequencerConfig.buildCheckpointIfEmpty)
|
|
184
193
|
},
|
|
185
194
|
skipPushProposedBlocksToArchiver: {
|
|
186
|
-
description: 'Skip pushing proposed blocks to archiver (
|
|
195
|
+
description: 'Skip pushing proposed blocks to archiver (test only)',
|
|
187
196
|
...booleanConfigHelper(DefaultSequencerConfig.skipPushProposedBlocksToArchiver)
|
|
188
197
|
},
|
|
189
198
|
minBlocksForCheckpoint: {
|
|
@@ -34,4 +34,4 @@ export declare class FeePredictor {
|
|
|
34
34
|
private getAssumedManaUsed;
|
|
35
35
|
private computeGasFees;
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlX3ByZWRpY3Rvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dsb2JhbF92YXJpYWJsZV9idWlsZGVyL2ZlZ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OAAO,CAAC,kBAAkB;IAuB1B,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,cAAc;CAmBvB"}
|
|
@@ -35,7 +35,17 @@ import { FEE_ORACLE_LAG, GasFees, MIN_ETH_PER_FEE_ASSET, ManaUsageEstimate, comp
|
|
|
35
35
|
});
|
|
36
36
|
if (this.cachedL1BlockNumber === undefined || blockNumber > this.cachedL1BlockNumber) {
|
|
37
37
|
this.cachedL1BlockNumber = blockNumber;
|
|
38
|
-
|
|
38
|
+
// Reset the cached block number on failure so a transient L1 RPC error does not leave a
|
|
39
|
+
// rejected promise cached for this block, which would replay the same rejection on every
|
|
40
|
+
// subsequent call until the next L1 block arrives. Only clear it if it still points at the
|
|
41
|
+
// block this attempt was for, so a stale rejection from an older block cannot wipe a marker
|
|
42
|
+
// a newer call already advanced (which would also defeat the monotonic block-number guard).
|
|
43
|
+
this.cachedState = this.fetchState(blockNumber).catch((err)=>{
|
|
44
|
+
if (this.cachedL1BlockNumber === blockNumber) {
|
|
45
|
+
this.cachedL1BlockNumber = undefined;
|
|
46
|
+
}
|
|
47
|
+
throw err;
|
|
48
|
+
});
|
|
39
49
|
}
|
|
40
50
|
return this.cachedState;
|
|
41
51
|
}
|
|
@@ -18,4 +18,4 @@ export declare class FeeProviderImpl implements FeeProvider {
|
|
|
18
18
|
getCurrentMinFees(): Promise<GasFees>;
|
|
19
19
|
getPredictedMinFees(manaUsage?: ManaUsageEstimate): Promise<GasFees[]>;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlX3Byb3ZpZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZ2xvYmFsX3ZhcmlhYmxlX2J1aWxkZXIvZmVlX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE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@@
|
|
|
1
|
-
{"version":3,"file":"fee_provider.d.ts","sourceRoot":"","sources":["../../src/global_variable_builder/fee_provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAEvE,8EAA8E;AAC9E,qBAAa,eAAgB,YAAW,WAAW;IAU/C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAV/B,OAAO,CAAC,cAAc,CAAwD;IAC9E,OAAO,CAAC,oBAAoB,CAAiC;IAE7D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IAEvC,YACmB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,gBAAgB,EAC/C,MAAM,EAAE,2BAA2B,EAWpC;YAMa,qBAAqB;IAkBtB,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"fee_provider.d.ts","sourceRoot":"","sources":["../../src/global_variable_builder/fee_provider.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAEvE,8EAA8E;AAC9E,qBAAa,eAAgB,YAAW,WAAW;IAU/C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAV/B,OAAO,CAAC,cAAc,CAAwD;IAC9E,OAAO,CAAC,oBAAoB,CAAiC;IAE7D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IAEvC,YACmB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,gBAAgB,EAC/C,MAAM,EAAE,2BAA2B,EAWpC;YAMa,qBAAqB;IAkBtB,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CA2BjD;IAEY,mBAAmB,CAAC,SAAS,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAOlF;CACF"}
|
|
@@ -44,15 +44,37 @@ import { FeePredictor } from './fee_predictor.js';
|
|
|
44
44
|
}
|
|
45
45
|
async getCurrentMinFees() {
|
|
46
46
|
// Get the current block number
|
|
47
|
-
const blockNumber = await this.publicClient.getBlockNumber(
|
|
48
|
-
|
|
47
|
+
const blockNumber = await this.publicClient.getBlockNumber({
|
|
48
|
+
cacheTime: 0
|
|
49
|
+
});
|
|
50
|
+
// If the L1 block number has changed then chain a new promise to get the current min fees.
|
|
51
|
+
// We chain off the previous promise's settlement (via a swallowing catch) rather than its
|
|
52
|
+
// fulfillment, so a prior rejection does not short-circuit the new computation. If the new
|
|
53
|
+
// computation fails (e.g. a transient L1 RPC error), reset the cached block number so the
|
|
54
|
+
// next call recomputes instead of permanently replaying the rejected promise — otherwise a
|
|
55
|
+
// single transient failure would wedge fee estimation until the next L1 block arrives. Only
|
|
56
|
+
// clear it if it still points at the block this attempt was for, so a stale rejection from an
|
|
57
|
+
// older block cannot wipe a marker a newer call already advanced (which would also defeat the
|
|
58
|
+
// monotonic block-number guard).
|
|
49
59
|
if (this.currentL1BlockNumber === undefined || blockNumber > this.currentL1BlockNumber) {
|
|
50
60
|
this.currentL1BlockNumber = blockNumber;
|
|
51
|
-
this.currentMinFees = this.currentMinFees.then(()=>this.computeCurrentMinFees())
|
|
61
|
+
this.currentMinFees = this.currentMinFees.catch(()=>undefined).then(()=>this.computeCurrentMinFees().catch((err)=>{
|
|
62
|
+
if (this.currentL1BlockNumber === blockNumber) {
|
|
63
|
+
this.currentL1BlockNumber = undefined;
|
|
64
|
+
}
|
|
65
|
+
throw err;
|
|
66
|
+
}));
|
|
52
67
|
}
|
|
53
68
|
return this.currentMinFees;
|
|
54
69
|
}
|
|
55
|
-
getPredictedMinFees(manaUsage) {
|
|
56
|
-
|
|
70
|
+
async getPredictedMinFees(manaUsage) {
|
|
71
|
+
const [currentMinFees, predictedMinFees] = await Promise.all([
|
|
72
|
+
this.getCurrentMinFees(),
|
|
73
|
+
this.feePredictor.getPredictedMinFees(manaUsage ?? ManaUsageEstimate.Target)
|
|
74
|
+
]);
|
|
75
|
+
return [
|
|
76
|
+
currentMinFees,
|
|
77
|
+
...predictedMinFees
|
|
78
|
+
];
|
|
57
79
|
}
|
|
58
80
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { type SimulationOverridesPlan } from '@aztec/ethereum/contracts';
|
|
2
2
|
import type { ViemPublicClient } from '@aztec/ethereum/types';
|
|
3
|
-
import {
|
|
3
|
+
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
4
4
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
-
import type { DateProvider } from '@aztec/foundation/timer';
|
|
6
5
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
6
|
import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
8
7
|
import type { CheckpointGlobalVariables, GlobalVariableBuilder as GlobalVariableBuilderInterface } from '@aztec/stdlib/tx';
|
|
9
|
-
import { GlobalVariables } from '@aztec/stdlib/tx';
|
|
10
8
|
/** Configuration for the GlobalVariableBuilder (excludes L1 client config). */
|
|
11
9
|
export type GlobalVariableBuilderConfig = {
|
|
12
10
|
rollupAddress: EthAddress;
|
|
@@ -17,25 +15,14 @@ export type GlobalVariableBuilderConfig = {
|
|
|
17
15
|
* Simple global variables builder.
|
|
18
16
|
*/
|
|
19
17
|
export declare class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
|
|
20
|
-
private readonly dateProvider;
|
|
21
18
|
private readonly publicClient;
|
|
22
19
|
private readonly rollupContract;
|
|
23
|
-
private readonly ethereumSlotDuration;
|
|
24
20
|
private readonly aztecSlotDuration;
|
|
25
21
|
private readonly l1GenesisTime;
|
|
26
22
|
private chainId;
|
|
27
23
|
private version;
|
|
28
|
-
constructor(
|
|
29
|
-
/**
|
|
30
|
-
* Simple builder of global variables.
|
|
31
|
-
* @param blockNumber - The block number to build global variables for.
|
|
32
|
-
* @param coinbase - The address to receive block reward.
|
|
33
|
-
* @param feeRecipient - The address to receive fees.
|
|
34
|
-
* @param slotNumber - The slot number to use for the global variables, if undefined it will be calculated.
|
|
35
|
-
* @returns The global variables for the given block number.
|
|
36
|
-
*/
|
|
37
|
-
buildGlobalVariables(blockNumber: BlockNumber, coinbase: EthAddress, feeRecipient: AztecAddress, maybeSlot?: SlotNumber): Promise<GlobalVariables>;
|
|
24
|
+
constructor(publicClient: ViemPublicClient, config: GlobalVariableBuilderConfig);
|
|
38
25
|
/** Builds global variables that are constant throughout a checkpoint. */
|
|
39
26
|
buildCheckpointGlobalVariables(coinbase: EthAddress, feeRecipient: AztecAddress, slotNumber: SlotNumber, simulationOverridesPlan?: SimulationOverridesPlan): Promise<CheckpointGlobalVariables>;
|
|
40
27
|
}
|
|
41
|
-
//# sourceMappingURL=data:application/json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