@aztec/sequencer-client 0.0.1-commit.b2a5d0dd1 → 0.0.1-commit.b3d3157a
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 +281 -21
- package/dest/client/sequencer-client.d.ts +3 -3
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +6 -6
- package/dest/config.d.ts +6 -3
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +33 -10
- package/dest/global_variable_builder/fee_provider.js +1 -1
- package/dest/global_variable_builder/global_builder.d.ts +2 -3
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +1 -1
- 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 +3 -3
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/sequencer-bundle-simulator.d.ts +96 -0
- package/dest/publisher/sequencer-bundle-simulator.d.ts.map +1 -0
- package/dest/publisher/sequencer-bundle-simulator.js +198 -0
- package/dest/publisher/sequencer-publisher.d.ts +36 -36
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +271 -500
- package/dest/sequencer/automine/automine_factory.d.ts +54 -0
- package/dest/sequencer/automine/automine_factory.d.ts.map +1 -0
- package/dest/sequencer/automine/automine_factory.js +84 -0
- package/dest/sequencer/automine/automine_sequencer.d.ts +151 -0
- package/dest/sequencer/automine/automine_sequencer.d.ts.map +1 -0
- package/dest/sequencer/automine/automine_sequencer.js +509 -0
- package/dest/sequencer/chain_state_overrides.d.ts +52 -16
- package/dest/sequencer/chain_state_overrides.d.ts.map +1 -1
- package/dest/sequencer/chain_state_overrides.js +86 -27
- package/dest/sequencer/checkpoint_proposal_job.d.ts +24 -6
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +373 -83
- package/dest/sequencer/events.d.ts +42 -2
- package/dest/sequencer/events.d.ts.map +1 -1
- package/dest/sequencer/index.d.ts +3 -1
- package/dest/sequencer/index.d.ts.map +1 -1
- package/dest/sequencer/index.js +2 -0
- package/dest/sequencer/metrics.d.ts +3 -1
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +7 -0
- package/dest/sequencer/sequencer.d.ts +44 -9
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +256 -79
- package/dest/sequencer/timetable.d.ts +3 -6
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +3 -7
- package/dest/sequencer/types.d.ts +2 -2
- package/dest/sequencer/types.d.ts.map +1 -1
- package/dest/test/utils.d.ts +1 -1
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +7 -6
- package/package.json +27 -27
- package/src/client/sequencer-client.ts +12 -7
- package/src/config.ts +38 -10
- package/src/global_variable_builder/fee_provider.ts +1 -1
- package/src/global_variable_builder/global_builder.ts +2 -3
- package/src/index.ts +10 -1
- package/src/publisher/config.ts +2 -2
- package/src/publisher/sequencer-bundle-simulator.ts +254 -0
- package/src/publisher/sequencer-publisher.ts +286 -521
- package/src/sequencer/README.md +162 -520
- package/src/sequencer/automine/README.md +46 -0
- package/src/sequencer/automine/automine_factory.ts +145 -0
- package/src/sequencer/automine/automine_sequencer.ts +595 -0
- package/src/sequencer/chain_state_overrides.ts +133 -58
- package/src/sequencer/checkpoint_proposal_job.ts +420 -100
- package/src/sequencer/events.ts +46 -2
- package/src/sequencer/index.ts +2 -0
- package/src/sequencer/metrics.ts +9 -0
- package/src/sequencer/sequencer.ts +284 -95
- package/src/sequencer/timetable.ts +2 -9
- package/src/sequencer/types.ts +1 -1
- package/src/test/utils.ts +28 -10
|
@@ -74,12 +74,9 @@ export class SequencerTimetable {
|
|
|
74
74
|
/** Maximum number of blocks that can be built in this slot configuration */
|
|
75
75
|
public readonly maxNumberOfBlocks: number;
|
|
76
76
|
|
|
77
|
-
/** Whether pipelining is enabled (checkpoint finalization deferred to next slot). */
|
|
78
|
-
public readonly pipelining: boolean;
|
|
79
|
-
|
|
80
77
|
/**
|
|
81
|
-
* How far into the target slot attestation collection can
|
|
82
|
-
*
|
|
78
|
+
* How far into the target slot assembly and attestation collection can start when pipelining.
|
|
79
|
+
* Production-like timing keeps this at zero; fast local publishing profiles can use the attestation window.
|
|
83
80
|
*/
|
|
84
81
|
public readonly pipeliningAttestationGracePeriod: number;
|
|
85
82
|
|
|
@@ -91,7 +88,6 @@ export class SequencerTimetable {
|
|
|
91
88
|
p2pPropagationTime?: number;
|
|
92
89
|
blockDurationMs?: number;
|
|
93
90
|
enforce: boolean;
|
|
94
|
-
pipelining?: boolean;
|
|
95
91
|
},
|
|
96
92
|
private readonly metrics?: SequencerMetrics,
|
|
97
93
|
private readonly log?: Logger,
|
|
@@ -101,7 +97,6 @@ export class SequencerTimetable {
|
|
|
101
97
|
this.l1PublishingTime = opts.l1PublishingTime;
|
|
102
98
|
this.blockDuration = opts.blockDurationMs ? opts.blockDurationMs / 1000 : undefined;
|
|
103
99
|
this.enforce = opts.enforce;
|
|
104
|
-
this.pipelining = opts.pipelining ?? false;
|
|
105
100
|
|
|
106
101
|
this.checkpointTiming = createCheckpointTimingModel({
|
|
107
102
|
aztecSlotDuration: this.aztecSlotDuration,
|
|
@@ -109,7 +104,6 @@ export class SequencerTimetable {
|
|
|
109
104
|
blockDuration: this.blockDuration,
|
|
110
105
|
l1PublishingTime: this.l1PublishingTime,
|
|
111
106
|
p2pPropagationTime: opts.p2pPropagationTime ?? DEFAULT_P2P_PROPAGATION_TIME,
|
|
112
|
-
pipelining: this.pipelining,
|
|
113
107
|
});
|
|
114
108
|
|
|
115
109
|
this.p2pPropagationTime = this.checkpointTiming.p2pPropagationTime;
|
|
@@ -137,7 +131,6 @@ export class SequencerTimetable {
|
|
|
137
131
|
blockAssembleTime: this.checkpointAssembleTime,
|
|
138
132
|
initializeDeadline: this.initializeDeadline,
|
|
139
133
|
enforce: this.enforce,
|
|
140
|
-
pipelining: this.pipelining,
|
|
141
134
|
pipeliningAttestationGracePeriod: this.pipeliningAttestationGracePeriod,
|
|
142
135
|
minWorkToDo: this.checkpointTiming.minimumBuildSlotWork,
|
|
143
136
|
blockDuration: this.blockDuration,
|
package/src/sequencer/types.ts
CHANGED
|
@@ -2,5 +2,5 @@ import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
|
2
2
|
|
|
3
3
|
export type SequencerRollupConstants = Pick<
|
|
4
4
|
L1RollupConstants,
|
|
5
|
-
'ethereumSlotDuration' | 'l1GenesisTime' | 'slotDuration' | 'rollupManaLimit'
|
|
5
|
+
'ethereumSlotDuration' | 'l1GenesisTime' | 'slotDuration' | 'rollupManaLimit' | 'epochDuration'
|
|
6
6
|
>;
|
package/src/test/utils.ts
CHANGED
|
@@ -10,7 +10,11 @@ import { PublicDataWrite } from '@aztec/stdlib/avm';
|
|
|
10
10
|
import { CommitteeAttestation, L2Block } from '@aztec/stdlib/block';
|
|
11
11
|
import { BlockProposal, CheckpointAttestation, CheckpointProposal, ConsensusPayload } from '@aztec/stdlib/p2p';
|
|
12
12
|
import { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
TEST_COORDINATION_SIGNATURE_CONTEXT,
|
|
15
|
+
makeAppendOnlyTreeSnapshot,
|
|
16
|
+
mockTxForRollup,
|
|
17
|
+
} from '@aztec/stdlib/testing';
|
|
14
18
|
import { BlockHeader, GlobalVariables, type Tx, makeProcessedTxFromPrivateOnlyTx } from '@aztec/stdlib/tx';
|
|
15
19
|
|
|
16
20
|
import type { MockProxy } from 'jest-mock-extended';
|
|
@@ -109,6 +113,7 @@ export function createBlockProposal(block: L2Block, signature: Signature): Block
|
|
|
109
113
|
block.archive.root,
|
|
110
114
|
txHashes,
|
|
111
115
|
signature,
|
|
116
|
+
TEST_COORDINATION_SIGNATURE_CONTEXT,
|
|
112
117
|
);
|
|
113
118
|
}
|
|
114
119
|
|
|
@@ -123,12 +128,19 @@ export function createCheckpointProposal(
|
|
|
123
128
|
): CheckpointProposal {
|
|
124
129
|
const txHashes = block.body.txEffects.map(tx => tx.txHash);
|
|
125
130
|
const checkpointHeader = createCheckpointHeaderFromBlock(block);
|
|
126
|
-
return new CheckpointProposal(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
return new CheckpointProposal(
|
|
132
|
+
checkpointHeader,
|
|
133
|
+
block.archive.root,
|
|
134
|
+
feeAssetPriceModifier,
|
|
135
|
+
checkpointSignature,
|
|
136
|
+
TEST_COORDINATION_SIGNATURE_CONTEXT,
|
|
137
|
+
{
|
|
138
|
+
blockHeader: block.header,
|
|
139
|
+
indexWithinCheckpoint: block.indexWithinCheckpoint,
|
|
140
|
+
txHashes,
|
|
141
|
+
signature: blockSignature ?? checkpointSignature, // Use checkpoint signature as block signature if not provided
|
|
142
|
+
},
|
|
143
|
+
);
|
|
132
144
|
}
|
|
133
145
|
|
|
134
146
|
/**
|
|
@@ -143,10 +155,16 @@ export function createCheckpointAttestation(
|
|
|
143
155
|
feeAssetPriceModifier: bigint = 0n,
|
|
144
156
|
): CheckpointAttestation {
|
|
145
157
|
const checkpointHeader = createCheckpointHeaderFromBlock(block);
|
|
146
|
-
const payload = new ConsensusPayload(
|
|
158
|
+
const payload = new ConsensusPayload(
|
|
159
|
+
checkpointHeader,
|
|
160
|
+
block.archive.root,
|
|
161
|
+
feeAssetPriceModifier,
|
|
162
|
+
TEST_COORDINATION_SIGNATURE_CONTEXT,
|
|
163
|
+
);
|
|
147
164
|
const attestation = new CheckpointAttestation(payload, signature, signature);
|
|
148
|
-
//
|
|
149
|
-
(attestation as any).
|
|
165
|
+
// Bypass signature recovery for testing since we use random signatures
|
|
166
|
+
(attestation as any).getSender = () => sender;
|
|
167
|
+
(attestation as any).getProposer = () => sender;
|
|
150
168
|
return attestation;
|
|
151
169
|
}
|
|
152
170
|
|