@aztec/sequencer-client 3.0.0-nightly.20251221 → 3.0.0-nightly.20251223
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/dest/client/sequencer-client.d.ts +9 -8
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +28 -24
- package/dest/config.d.ts +7 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +63 -26
- package/dest/global_variable_builder/global_builder.d.ts +16 -8
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +35 -26
- 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/config.js +2 -2
- package/dest/publisher/sequencer-publisher-factory.d.ts +3 -3
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-factory.js +1 -1
- package/dest/publisher/sequencer-publisher-metrics.d.ts +3 -3
- package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.d.ts +11 -24
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +50 -62
- package/dest/sequencer/block_builder.d.ts +1 -3
- package/dest/sequencer/block_builder.d.ts.map +1 -1
- package/dest/sequencer/block_builder.js +4 -2
- package/dest/sequencer/checkpoint_builder.d.ts +63 -0
- package/dest/sequencer/checkpoint_builder.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_builder.js +131 -0
- package/dest/sequencer/checkpoint_proposal_job.d.ts +73 -0
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_proposal_job.js +638 -0
- package/dest/sequencer/checkpoint_voter.d.ts +34 -0
- package/dest/sequencer/checkpoint_voter.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_voter.js +85 -0
- package/dest/sequencer/events.d.ts +46 -0
- package/dest/sequencer/events.d.ts.map +1 -0
- package/dest/sequencer/events.js +1 -0
- package/dest/sequencer/index.d.ts +5 -1
- package/dest/sequencer/index.d.ts.map +1 -1
- package/dest/sequencer/index.js +4 -0
- package/dest/sequencer/metrics.d.ts +3 -1
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +9 -0
- package/dest/sequencer/sequencer.d.ts +87 -127
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +179 -596
- package/dest/sequencer/timetable.d.ts +33 -13
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +73 -39
- package/dest/sequencer/types.d.ts +3 -0
- package/dest/sequencer/types.d.ts.map +1 -0
- package/dest/sequencer/types.js +1 -0
- package/dest/sequencer/utils.d.ts +14 -8
- package/dest/sequencer/utils.d.ts.map +1 -1
- package/dest/sequencer/utils.js +7 -4
- package/dest/test/index.d.ts +3 -1
- package/dest/test/index.d.ts.map +1 -1
- package/package.json +27 -27
- package/src/client/sequencer-client.ts +24 -31
- package/src/config.ts +68 -25
- package/src/global_variable_builder/global_builder.ts +45 -39
- package/src/index.ts +2 -0
- package/src/publisher/config.ts +3 -3
- package/src/publisher/sequencer-publisher-factory.ts +3 -3
- package/src/publisher/sequencer-publisher-metrics.ts +2 -2
- package/src/publisher/sequencer-publisher.ts +71 -74
- package/src/sequencer/block_builder.ts +4 -1
- package/src/sequencer/checkpoint_builder.ts +217 -0
- package/src/sequencer/checkpoint_proposal_job.ts +701 -0
- package/src/sequencer/checkpoint_voter.ts +105 -0
- package/src/sequencer/events.ts +27 -0
- package/src/sequencer/index.ts +4 -0
- package/src/sequencer/metrics.ts +11 -0
- package/src/sequencer/sequencer.ts +275 -804
- package/src/sequencer/timetable.ts +84 -49
- package/src/sequencer/types.ts +6 -0
- package/src/sequencer/utils.ts +18 -9
- package/src/test/index.ts +2 -0
package/src/config.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { type KeyStoreConfig, keyStoreConfigMappings } from '@aztec/node-keystor
|
|
|
12
12
|
import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
|
|
13
13
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
14
14
|
import { type ChainConfig, type SequencerConfig, chainConfigMappings } from '@aztec/stdlib/config';
|
|
15
|
+
import type { ResolvedSequencerConfig } from '@aztec/stdlib/interfaces/server';
|
|
15
16
|
import { type ValidatorClientConfig, validatorClientConfigMappings } from '@aztec/validator-client/config';
|
|
16
17
|
|
|
17
18
|
import {
|
|
@@ -26,6 +27,31 @@ export type { SequencerConfig };
|
|
|
26
27
|
|
|
27
28
|
export const DEFAULT_ATTESTATION_PROPAGATION_TIME = 2;
|
|
28
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Default values for SequencerConfig.
|
|
32
|
+
* Centralized location for all sequencer configuration defaults.
|
|
33
|
+
*/
|
|
34
|
+
export const DefaultSequencerConfig: ResolvedSequencerConfig = {
|
|
35
|
+
sequencerPollingIntervalMS: 500,
|
|
36
|
+
maxTxsPerBlock: 32,
|
|
37
|
+
minTxsPerBlock: 1,
|
|
38
|
+
buildCheckpointIfEmpty: false,
|
|
39
|
+
publishTxsWithProposals: false,
|
|
40
|
+
maxL2BlockGas: 10e9,
|
|
41
|
+
maxDABlockGas: 10e9,
|
|
42
|
+
maxBlockSizeInBytes: 1024 * 1024,
|
|
43
|
+
enforceTimeTable: true,
|
|
44
|
+
attestationPropagationTime: DEFAULT_ATTESTATION_PROPAGATION_TIME,
|
|
45
|
+
secondsBeforeInvalidatingBlockAsCommitteeMember: 144, // 12 L1 blocks
|
|
46
|
+
secondsBeforeInvalidatingBlockAsNonCommitteeMember: 432, // 36 L1 blocks
|
|
47
|
+
skipCollectingAttestations: false,
|
|
48
|
+
skipInvalidateBlockAsProposer: false,
|
|
49
|
+
broadcastInvalidBlockProposal: false,
|
|
50
|
+
injectFakeAttestation: false,
|
|
51
|
+
fishermanMode: false,
|
|
52
|
+
shuffleAttestationOrdering: false,
|
|
53
|
+
};
|
|
54
|
+
|
|
29
55
|
/**
|
|
30
56
|
* Configuration settings for the SequencerClient.
|
|
31
57
|
*/
|
|
@@ -40,35 +66,39 @@ export type SequencerClientConfig = PublisherConfig &
|
|
|
40
66
|
Pick<L1ContractsConfig, 'ethereumSlotDuration' | 'aztecSlotDuration' | 'aztecEpochDuration'>;
|
|
41
67
|
|
|
42
68
|
export const sequencerConfigMappings: ConfigMappingsType<SequencerConfig> = {
|
|
43
|
-
|
|
44
|
-
env: '
|
|
45
|
-
description: 'The number of ms to wait between polling for
|
|
46
|
-
...numberConfigHelper(
|
|
69
|
+
sequencerPollingIntervalMS: {
|
|
70
|
+
env: 'SEQ_POLLING_INTERVAL_MS',
|
|
71
|
+
description: 'The number of ms to wait between polling for checking to build on the next slot.',
|
|
72
|
+
...numberConfigHelper(DefaultSequencerConfig.sequencerPollingIntervalMS),
|
|
47
73
|
},
|
|
48
74
|
maxTxsPerBlock: {
|
|
49
75
|
env: 'SEQ_MAX_TX_PER_BLOCK',
|
|
50
76
|
description: 'The maximum number of txs to include in a block.',
|
|
51
|
-
...numberConfigHelper(
|
|
77
|
+
...numberConfigHelper(DefaultSequencerConfig.maxTxsPerBlock),
|
|
52
78
|
},
|
|
53
79
|
minTxsPerBlock: {
|
|
54
80
|
env: 'SEQ_MIN_TX_PER_BLOCK',
|
|
55
81
|
description: 'The minimum number of txs to include in a block.',
|
|
56
|
-
...numberConfigHelper(
|
|
82
|
+
...numberConfigHelper(DefaultSequencerConfig.minTxsPerBlock),
|
|
83
|
+
},
|
|
84
|
+
minValidTxsPerBlock: {
|
|
85
|
+
description:
|
|
86
|
+
'The minimum number of valid txs (after execution) to include in a block. If not set, falls back to minTxsPerBlock.',
|
|
57
87
|
},
|
|
58
88
|
publishTxsWithProposals: {
|
|
59
89
|
env: 'SEQ_PUBLISH_TXS_WITH_PROPOSALS',
|
|
60
90
|
description: 'Whether to publish txs with proposals.',
|
|
61
|
-
...booleanConfigHelper(
|
|
91
|
+
...booleanConfigHelper(DefaultSequencerConfig.publishTxsWithProposals),
|
|
62
92
|
},
|
|
63
93
|
maxL2BlockGas: {
|
|
64
94
|
env: 'SEQ_MAX_L2_BLOCK_GAS',
|
|
65
95
|
description: 'The maximum L2 block gas.',
|
|
66
|
-
...numberConfigHelper(
|
|
96
|
+
...numberConfigHelper(DefaultSequencerConfig.maxL2BlockGas),
|
|
67
97
|
},
|
|
68
98
|
maxDABlockGas: {
|
|
69
99
|
env: 'SEQ_MAX_DA_BLOCK_GAS',
|
|
70
100
|
description: 'The maximum DA block gas.',
|
|
71
|
-
...numberConfigHelper(
|
|
101
|
+
...numberConfigHelper(DefaultSequencerConfig.maxDABlockGas),
|
|
72
102
|
},
|
|
73
103
|
coinbase: {
|
|
74
104
|
env: 'COINBASE',
|
|
@@ -91,73 +121,86 @@ export const sequencerConfigMappings: ConfigMappingsType<SequencerConfig> = {
|
|
|
91
121
|
maxBlockSizeInBytes: {
|
|
92
122
|
env: 'SEQ_MAX_BLOCK_SIZE_IN_BYTES',
|
|
93
123
|
description: 'Max block size',
|
|
94
|
-
...numberConfigHelper(
|
|
124
|
+
...numberConfigHelper(DefaultSequencerConfig.maxBlockSizeInBytes),
|
|
95
125
|
},
|
|
96
126
|
enforceTimeTable: {
|
|
97
127
|
env: 'SEQ_ENFORCE_TIME_TABLE',
|
|
98
128
|
description: 'Whether to enforce the time table when building blocks',
|
|
99
|
-
...booleanConfigHelper(),
|
|
100
|
-
defaultValue: true,
|
|
129
|
+
...booleanConfigHelper(DefaultSequencerConfig.enforceTimeTable),
|
|
101
130
|
},
|
|
102
131
|
governanceProposerPayload: {
|
|
103
132
|
env: 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS',
|
|
104
133
|
description: 'The address of the payload for the governanceProposer',
|
|
105
134
|
parseEnv: (val: string) => EthAddress.fromString(val),
|
|
106
|
-
defaultValue: EthAddress.ZERO,
|
|
107
135
|
},
|
|
108
|
-
|
|
109
|
-
env: '
|
|
110
|
-
description: 'How
|
|
136
|
+
l1PublishingTime: {
|
|
137
|
+
env: 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT',
|
|
138
|
+
description: 'How much time (in seconds) we allow in the slot for publishing the L1 tx (defaults to 1 L1 slot).',
|
|
111
139
|
parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
|
|
112
140
|
},
|
|
113
141
|
attestationPropagationTime: {
|
|
114
142
|
env: 'SEQ_ATTESTATION_PROPAGATION_TIME',
|
|
115
143
|
description: 'How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way)',
|
|
116
|
-
...numberConfigHelper(
|
|
144
|
+
...numberConfigHelper(DefaultSequencerConfig.attestationPropagationTime),
|
|
117
145
|
},
|
|
118
146
|
fakeProcessingDelayPerTxMs: {
|
|
119
147
|
description: 'Used for testing to introduce a fake delay after processing each tx',
|
|
120
148
|
},
|
|
149
|
+
fakeThrowAfterProcessingTxCount: {
|
|
150
|
+
description: 'Used for testing to throw an error after processing N txs',
|
|
151
|
+
},
|
|
121
152
|
secondsBeforeInvalidatingBlockAsCommitteeMember: {
|
|
122
153
|
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER',
|
|
123
154
|
description:
|
|
124
155
|
'How many seconds to wait before trying to invalidate a block from the pending chain as a committee member (zero to never invalidate).' +
|
|
125
156
|
' The next proposer is expected to invalidate, so the committee acts as a fallback.',
|
|
126
|
-
...numberConfigHelper(
|
|
157
|
+
...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsCommitteeMember),
|
|
127
158
|
},
|
|
128
159
|
secondsBeforeInvalidatingBlockAsNonCommitteeMember: {
|
|
129
160
|
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER',
|
|
130
161
|
description:
|
|
131
162
|
'How many seconds to wait before trying to invalidate a block from the pending chain as a non-committee member (zero to never invalidate).' +
|
|
132
163
|
' The next proposer is expected to invalidate, then the committee, so other sequencers act as a fallback.',
|
|
133
|
-
...numberConfigHelper(
|
|
164
|
+
...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsNonCommitteeMember),
|
|
134
165
|
},
|
|
135
166
|
skipCollectingAttestations: {
|
|
136
167
|
description:
|
|
137
168
|
'Whether to skip collecting attestations from validators and only use self-attestations (for testing only)',
|
|
138
|
-
...booleanConfigHelper(
|
|
169
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipCollectingAttestations),
|
|
139
170
|
},
|
|
140
171
|
skipInvalidateBlockAsProposer: {
|
|
141
172
|
description: 'Do not invalidate the previous block if invalid when we are the proposer (for testing only)',
|
|
142
|
-
...booleanConfigHelper(
|
|
173
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipInvalidateBlockAsProposer),
|
|
143
174
|
},
|
|
144
175
|
broadcastInvalidBlockProposal: {
|
|
145
176
|
description: 'Broadcast invalid block proposals with corrupted state (for testing only)',
|
|
146
|
-
...booleanConfigHelper(
|
|
177
|
+
...booleanConfigHelper(DefaultSequencerConfig.broadcastInvalidBlockProposal),
|
|
147
178
|
},
|
|
148
179
|
injectFakeAttestation: {
|
|
149
180
|
description: 'Inject a fake attestation (for testing only)',
|
|
150
|
-
...booleanConfigHelper(
|
|
181
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectFakeAttestation),
|
|
151
182
|
},
|
|
152
183
|
fishermanMode: {
|
|
153
184
|
env: 'FISHERMAN_MODE',
|
|
154
185
|
description:
|
|
155
186
|
'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
|
|
156
|
-
...booleanConfigHelper(
|
|
187
|
+
...booleanConfigHelper(DefaultSequencerConfig.fishermanMode),
|
|
157
188
|
},
|
|
158
189
|
shuffleAttestationOrdering: {
|
|
159
190
|
description: 'Shuffle attestation ordering to create invalid ordering (for testing only)',
|
|
160
|
-
...booleanConfigHelper(
|
|
191
|
+
...booleanConfigHelper(DefaultSequencerConfig.shuffleAttestationOrdering),
|
|
192
|
+
},
|
|
193
|
+
blockDurationMs: {
|
|
194
|
+
env: 'SEQ_BLOCK_DURATION_MS',
|
|
195
|
+
description:
|
|
196
|
+
'Duration per block in milliseconds when building multiple blocks per slot. ' +
|
|
197
|
+
'If undefined (default), builds a single block per slot using the full slot duration.',
|
|
198
|
+
parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
|
|
199
|
+
},
|
|
200
|
+
buildCheckpointIfEmpty: {
|
|
201
|
+
env: 'SEQ_BUILD_CHECKPOINT_IF_EMPTY',
|
|
202
|
+
description: 'Have sequencer build and publish an empty checkpoint if there are no txs',
|
|
203
|
+
...booleanConfigHelper(DefaultSequencerConfig.buildCheckpointIfEmpty),
|
|
161
204
|
},
|
|
162
205
|
...pickConfigMappings(p2pConfigMappings, ['txPublicSetupAllowList']),
|
|
163
206
|
};
|
|
@@ -8,8 +8,12 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
8
8
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
9
9
|
import { createLogger } from '@aztec/foundation/log';
|
|
10
10
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
11
|
+
import { type L1RollupConstants, getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
11
12
|
import { GasFees } from '@aztec/stdlib/gas';
|
|
12
|
-
import type {
|
|
13
|
+
import type {
|
|
14
|
+
CheckpointGlobalVariables,
|
|
15
|
+
GlobalVariableBuilder as GlobalVariableBuilderInterface,
|
|
16
|
+
} from '@aztec/stdlib/tx';
|
|
13
17
|
import { GlobalVariables } from '@aztec/stdlib/tx';
|
|
14
18
|
|
|
15
19
|
import { createPublicClient, fallback, http } from 'viem';
|
|
@@ -25,20 +29,31 @@ export class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
|
|
|
25
29
|
private readonly rollupContract: RollupContract;
|
|
26
30
|
private readonly publicClient: ViemPublicClient;
|
|
27
31
|
private readonly ethereumSlotDuration: number;
|
|
32
|
+
private readonly aztecSlotDuration: number;
|
|
33
|
+
private readonly l1GenesisTime: bigint;
|
|
28
34
|
|
|
29
|
-
private chainId
|
|
30
|
-
private version
|
|
35
|
+
private chainId: Fr;
|
|
36
|
+
private version: Fr;
|
|
31
37
|
|
|
32
|
-
constructor(
|
|
38
|
+
constructor(
|
|
39
|
+
config: L1ReaderConfig &
|
|
40
|
+
Pick<L1ContractsConfig, 'ethereumSlotDuration'> &
|
|
41
|
+
Pick<L1RollupConstants, 'slotDuration' | 'l1GenesisTime'> & { rollupVersion: bigint },
|
|
42
|
+
) {
|
|
33
43
|
const { l1RpcUrls, l1ChainId: chainId, l1Contracts } = config;
|
|
34
44
|
|
|
35
45
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
36
46
|
|
|
47
|
+
this.version = new Fr(config.rollupVersion);
|
|
48
|
+
this.chainId = new Fr(chainId);
|
|
49
|
+
|
|
37
50
|
this.ethereumSlotDuration = config.ethereumSlotDuration;
|
|
51
|
+
this.aztecSlotDuration = config.slotDuration;
|
|
52
|
+
this.l1GenesisTime = config.l1GenesisTime;
|
|
38
53
|
|
|
39
54
|
this.publicClient = createPublicClient({
|
|
40
55
|
chain: chain.chainInfo,
|
|
41
|
-
transport: fallback(chain.rpcUrls.map(url => http(url))),
|
|
56
|
+
transport: fallback(chain.rpcUrls.map(url => http(url, { batch: false }))),
|
|
42
57
|
pollingInterval: config.viemPollingIntervalMS,
|
|
43
58
|
});
|
|
44
59
|
|
|
@@ -76,18 +91,8 @@ export class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
|
|
|
76
91
|
return this.currentBaseFees;
|
|
77
92
|
}
|
|
78
93
|
|
|
79
|
-
public async getGlobalConstantVariables(): Promise<Pick<GlobalVariables, 'chainId' | 'version'>> {
|
|
80
|
-
if (!this.chainId) {
|
|
81
|
-
this.chainId = new Fr(this.publicClient.chain.id);
|
|
82
|
-
}
|
|
83
|
-
if (!this.version) {
|
|
84
|
-
this.version = new Fr(await this.rollupContract.getVersion());
|
|
85
|
-
}
|
|
86
|
-
return { chainId: this.chainId, version: this.version };
|
|
87
|
-
}
|
|
88
|
-
|
|
89
94
|
/**
|
|
90
|
-
* Simple builder of global variables
|
|
95
|
+
* Simple builder of global variables.
|
|
91
96
|
* @param blockNumber - The block number to build global variables for.
|
|
92
97
|
* @param coinbase - The address to receive block reward.
|
|
93
98
|
* @param feeRecipient - The address to receive fees.
|
|
@@ -98,34 +103,35 @@ export class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
|
|
|
98
103
|
blockNumber: BlockNumber,
|
|
99
104
|
coinbase: EthAddress,
|
|
100
105
|
feeRecipient: AztecAddress,
|
|
101
|
-
|
|
106
|
+
maybeSlot?: SlotNumber,
|
|
102
107
|
): Promise<GlobalVariables> {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
const slot: SlotNumber =
|
|
109
|
+
maybeSlot ??
|
|
110
|
+
(await this.rollupContract.getSlotAt(
|
|
111
|
+
BigInt((await this.publicClient.getBlock()).timestamp + BigInt(this.ethereumSlotDuration)),
|
|
112
|
+
));
|
|
113
|
+
|
|
114
|
+
const checkpointGlobalVariables = await this.buildCheckpointGlobalVariables(coinbase, feeRecipient, slot);
|
|
115
|
+
return GlobalVariables.from({ blockNumber, ...checkpointGlobalVariables });
|
|
116
|
+
}
|
|
112
117
|
|
|
113
|
-
|
|
118
|
+
/** Builds global variables that are constant throughout a checkpoint. */
|
|
119
|
+
public async buildCheckpointGlobalVariables(
|
|
120
|
+
coinbase: EthAddress,
|
|
121
|
+
feeRecipient: AztecAddress,
|
|
122
|
+
slotNumber: SlotNumber,
|
|
123
|
+
): Promise<CheckpointGlobalVariables & { timestamp: bigint }> {
|
|
124
|
+
const { chainId, version } = this;
|
|
125
|
+
|
|
126
|
+
const timestamp = getTimestampForSlot(slotNumber, {
|
|
127
|
+
slotDuration: this.aztecSlotDuration,
|
|
128
|
+
l1GenesisTime: this.l1GenesisTime,
|
|
129
|
+
});
|
|
114
130
|
|
|
115
131
|
// We can skip much of the logic in getCurrentBaseFees since it we already check that we are not within a slot elsewhere.
|
|
132
|
+
// TODO(palla/mbps): Can we use a cached value here?
|
|
116
133
|
const gasFees = new GasFees(0, await this.rollupContract.getManaBaseFeeAt(timestamp, true));
|
|
117
134
|
|
|
118
|
-
|
|
119
|
-
chainId,
|
|
120
|
-
version,
|
|
121
|
-
blockNumber,
|
|
122
|
-
slot,
|
|
123
|
-
timestamp,
|
|
124
|
-
coinbase,
|
|
125
|
-
feeRecipient,
|
|
126
|
-
gasFees,
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
return globalVariables;
|
|
135
|
+
return { chainId, version, slotNumber, timestamp, coinbase, feeRecipient, gasFees };
|
|
130
136
|
}
|
|
131
137
|
}
|
package/src/index.ts
CHANGED
package/src/publisher/config.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type BlobClientConfig, blobClientConfigMapping } from '@aztec/blob-client/client/config';
|
|
2
2
|
import { type L1ReaderConfig, l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
3
3
|
import { type L1TxUtilsConfig, l1TxUtilsConfigMappings } from '@aztec/ethereum/l1-tx-utils/config';
|
|
4
4
|
import {
|
|
@@ -28,7 +28,7 @@ export type TxSenderConfig = L1ReaderConfig & {
|
|
|
28
28
|
* Configuration of the L1Publisher.
|
|
29
29
|
*/
|
|
30
30
|
export type PublisherConfig = L1TxUtilsConfig &
|
|
31
|
-
|
|
31
|
+
BlobClientConfig & {
|
|
32
32
|
/** True to use publishers in invalid states (timed out, cancelled, etc) if no other is available */
|
|
33
33
|
publisherAllowInvalidStates?: boolean;
|
|
34
34
|
/** Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1 */
|
|
@@ -80,7 +80,7 @@ export const getPublisherConfigMappings: (
|
|
|
80
80
|
parseEnv: (val: string) => (val ? EthAddress.fromString(val) : undefined),
|
|
81
81
|
},
|
|
82
82
|
...l1TxUtilsConfigMappings,
|
|
83
|
-
...
|
|
83
|
+
...blobClientConfigMapping,
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
export function getPublisherConfigFromEnv(scope: 'PROVER' | 'SEQ'): PublisherConfig {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
2
2
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
3
|
-
import type {
|
|
3
|
+
import type { BlobClientInterface } from '@aztec/blob-client/client';
|
|
4
4
|
import type { EpochCache } from '@aztec/epoch-cache';
|
|
5
5
|
import type { GovernanceProposerContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
6
6
|
import type { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs';
|
|
@@ -33,7 +33,7 @@ export class SequencerPublisherFactory {
|
|
|
33
33
|
private deps: {
|
|
34
34
|
telemetry: TelemetryClient;
|
|
35
35
|
publisherManager: PublisherManager<L1TxUtilsWithBlobs>;
|
|
36
|
-
|
|
36
|
+
blobClient?: BlobClientInterface;
|
|
37
37
|
dateProvider: DateProvider;
|
|
38
38
|
epochCache: EpochCache;
|
|
39
39
|
rollupContract: RollupContract;
|
|
@@ -72,7 +72,7 @@ export class SequencerPublisherFactory {
|
|
|
72
72
|
const publisher = new SequencerPublisher(this.sequencerConfig, {
|
|
73
73
|
l1TxUtils: l1Publisher,
|
|
74
74
|
telemetry: this.deps.telemetry,
|
|
75
|
-
|
|
75
|
+
blobClient: this.deps.blobClient,
|
|
76
76
|
rollupContract: this.deps.rollupContract,
|
|
77
77
|
epochCache: this.deps.epochCache,
|
|
78
78
|
governanceProposerContract: this.deps.governanceProposerContract,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
2
|
-
import type {
|
|
2
|
+
import type { L1PublishCheckpointStats, L1PublishStats } from '@aztec/stdlib/stats';
|
|
3
3
|
import {
|
|
4
4
|
Attributes,
|
|
5
5
|
type Gauge,
|
|
@@ -135,7 +135,7 @@ export class SequencerPublisherMetrics {
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
recordProcessBlockTx(durationMs: number, stats:
|
|
138
|
+
recordProcessBlockTx(durationMs: number, stats: L1PublishCheckpointStats) {
|
|
139
139
|
this.recordTx('process', durationMs, stats);
|
|
140
140
|
|
|
141
141
|
if (stats.blobCount && stats.blobCount > 0) {
|