@aztec/sequencer-client 0.47.1 → 0.49.2
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/block_builder/index.d.ts +26 -0
- package/dest/block_builder/index.d.ts.map +1 -0
- package/dest/block_builder/index.js +40 -0
- package/dest/client/sequencer-client.d.ts +1 -2
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +5 -4
- package/dest/config.d.ts +6 -2
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +91 -31
- package/dest/global_variable_builder/global_builder.d.ts +14 -8
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +10 -16
- package/dest/global_variable_builder/index.d.ts +2 -3
- package/dest/global_variable_builder/index.d.ts.map +1 -1
- package/dest/global_variable_builder/index.js +1 -1
- package/dest/global_variable_builder/viem-reader.d.ts +5 -4
- package/dest/global_variable_builder/viem-reader.d.ts.map +1 -1
- package/dest/global_variable_builder/viem-reader.js +11 -8
- package/dest/publisher/config.d.ts +7 -15
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +38 -11
- package/dest/publisher/index.d.ts +3 -2
- package/dest/publisher/index.d.ts.map +1 -1
- package/dest/publisher/index.js +4 -4
- package/dest/publisher/l1-publisher-metrics.d.ts +17 -0
- package/dest/publisher/l1-publisher-metrics.d.ts.map +1 -0
- package/dest/publisher/l1-publisher-metrics.js +75 -0
- package/dest/publisher/l1-publisher.d.ts +33 -5
- package/dest/publisher/l1-publisher.d.ts.map +1 -1
- package/dest/publisher/l1-publisher.js +44 -36
- package/dest/publisher/viem-tx-sender.d.ts +9 -2
- package/dest/publisher/viem-tx-sender.d.ts.map +1 -1
- package/dest/publisher/viem-tx-sender.js +85 -16
- package/dest/receiver.d.ts +2 -8
- package/dest/receiver.d.ts.map +1 -1
- package/dest/sequencer/metrics.d.ts +17 -0
- package/dest/sequencer/metrics.d.ts.map +1 -0
- package/dest/sequencer/metrics.js +56 -0
- package/dest/sequencer/sequencer.d.ts +9 -7
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +66 -37
- package/dest/tx_validator/gas_validator.d.ts +1 -1
- package/dest/tx_validator/gas_validator.js +11 -11
- package/dest/tx_validator/tx_validator_factory.js +2 -2
- package/package.json +17 -15
- package/src/block_builder/index.ts +51 -0
- package/src/client/sequencer-client.ts +3 -4
- package/src/config.ts +106 -54
- package/src/global_variable_builder/global_builder.ts +35 -25
- package/src/global_variable_builder/index.ts +3 -3
- package/src/global_variable_builder/viem-reader.ts +14 -11
- package/src/publisher/config.ts +43 -31
- package/src/publisher/index.ts +5 -3
- package/src/publisher/l1-publisher-metrics.ts +108 -0
- package/src/publisher/l1-publisher.ts +78 -43
- package/src/publisher/viem-tx-sender.ts +89 -14
- package/src/receiver.ts +3 -8
- package/src/sequencer/metrics.ts +86 -0
- package/src/sequencer/sequencer.ts +89 -52
- package/src/tx_validator/gas_validator.ts +9 -9
- package/src/tx_validator/tx_validator_factory.ts +2 -2
- package/dest/global_variable_builder/config.d.ts +0 -19
- package/dest/global_variable_builder/config.d.ts.map +0 -1
- package/dest/global_variable_builder/config.js +0 -2
- package/src/global_variable_builder/config.ts +0 -20
|
@@ -6,14 +6,9 @@ import {
|
|
|
6
6
|
Tx,
|
|
7
7
|
type TxValidator,
|
|
8
8
|
} from '@aztec/circuit-types';
|
|
9
|
-
import {
|
|
10
|
-
type AllowedElement,
|
|
11
|
-
BlockProofError,
|
|
12
|
-
type BlockProver,
|
|
13
|
-
PROVING_STATUS,
|
|
14
|
-
} from '@aztec/circuit-types/interfaces';
|
|
9
|
+
import { type AllowedElement, BlockProofError, PROVING_STATUS } from '@aztec/circuit-types/interfaces';
|
|
15
10
|
import { type L2BlockBuiltStats } from '@aztec/circuit-types/stats';
|
|
16
|
-
import { AztecAddress, EthAddress, type GlobalVariables, type Header } from '@aztec/circuits.js';
|
|
11
|
+
import { AztecAddress, EthAddress, type GlobalVariables, type Header, IS_DEV_NET } from '@aztec/circuits.js';
|
|
17
12
|
import { Fr } from '@aztec/foundation/fields';
|
|
18
13
|
import { createDebugLogger } from '@aztec/foundation/log';
|
|
19
14
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
@@ -23,10 +18,12 @@ import { type PublicProcessorFactory } from '@aztec/simulator';
|
|
|
23
18
|
import { Attributes, type TelemetryClient, type Tracer, trackSpan } from '@aztec/telemetry-client';
|
|
24
19
|
import { type WorldStateStatus, type WorldStateSynchronizer } from '@aztec/world-state';
|
|
25
20
|
|
|
21
|
+
import { type BlockBuilderFactory } from '../block_builder/index.js';
|
|
26
22
|
import { type GlobalVariableBuilder } from '../global_variable_builder/global_builder.js';
|
|
27
|
-
import { type L1Publisher } from '../publisher/l1-publisher.js';
|
|
23
|
+
import { type Attestation, type L1Publisher } from '../publisher/l1-publisher.js';
|
|
28
24
|
import { type TxValidatorFactory } from '../tx_validator/tx_validator_factory.js';
|
|
29
25
|
import { type SequencerConfig } from './config.js';
|
|
26
|
+
import { SequencerMetrics } from './metrics.js';
|
|
30
27
|
|
|
31
28
|
/**
|
|
32
29
|
* Sequencer client
|
|
@@ -52,29 +49,31 @@ export class Sequencer {
|
|
|
52
49
|
private allowedInSetup: AllowedElement[] = [];
|
|
53
50
|
private allowedInTeardown: AllowedElement[] = [];
|
|
54
51
|
private maxBlockSizeInBytes: number = 1024 * 1024;
|
|
55
|
-
private
|
|
56
|
-
|
|
57
|
-
public readonly tracer: Tracer;
|
|
52
|
+
private metrics: SequencerMetrics;
|
|
58
53
|
|
|
59
54
|
constructor(
|
|
60
55
|
private publisher: L1Publisher,
|
|
61
56
|
private globalsBuilder: GlobalVariableBuilder,
|
|
62
57
|
private p2pClient: P2P,
|
|
63
58
|
private worldState: WorldStateSynchronizer,
|
|
64
|
-
private
|
|
59
|
+
private blockBuilderFactory: BlockBuilderFactory,
|
|
65
60
|
private l2BlockSource: L2BlockSource,
|
|
66
61
|
private l1ToL2MessageSource: L1ToL2MessageSource,
|
|
67
62
|
private publicProcessorFactory: PublicProcessorFactory,
|
|
68
63
|
private txValidatorFactory: TxValidatorFactory,
|
|
69
64
|
telemetry: TelemetryClient,
|
|
70
|
-
config: SequencerConfig = {},
|
|
65
|
+
private config: SequencerConfig = {},
|
|
71
66
|
private log = createDebugLogger('aztec:sequencer'),
|
|
72
67
|
) {
|
|
73
68
|
this.updateConfig(config);
|
|
74
|
-
this.
|
|
69
|
+
this.metrics = new SequencerMetrics(telemetry, () => this.state, 'Sequencer');
|
|
75
70
|
this.log.verbose(`Initialized sequencer with ${this.minTxsPerBLock}-${this.maxTxsPerBlock} txs per block.`);
|
|
76
71
|
}
|
|
77
72
|
|
|
73
|
+
get tracer(): Tracer {
|
|
74
|
+
return this.metrics.tracer;
|
|
75
|
+
}
|
|
76
|
+
|
|
78
77
|
/**
|
|
79
78
|
* Updates sequencer config.
|
|
80
79
|
* @param config - New parameters.
|
|
@@ -111,10 +110,8 @@ export class Sequencer {
|
|
|
111
110
|
if (config.allowedInTeardown) {
|
|
112
111
|
this.allowedInTeardown = config.allowedInTeardown;
|
|
113
112
|
}
|
|
114
|
-
// TODO
|
|
115
|
-
|
|
116
|
-
// proofs or not.
|
|
117
|
-
this.skipSubmitProofs = !!config.sequencerSkipSubmitProofs;
|
|
113
|
+
// TODO: Just read everything from the config object as needed instead of copying everything into local vars.
|
|
114
|
+
this.config = config;
|
|
118
115
|
}
|
|
119
116
|
|
|
120
117
|
/**
|
|
@@ -170,16 +167,17 @@ export class Sequencer {
|
|
|
170
167
|
try {
|
|
171
168
|
// Update state when the previous block has been synced
|
|
172
169
|
const prevBlockSynced = await this.isBlockSynced();
|
|
173
|
-
if (prevBlockSynced && this.state === SequencerState.PUBLISHING_BLOCK) {
|
|
174
|
-
this.log.debug(`Block has been synced`);
|
|
175
|
-
this.state = SequencerState.IDLE;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
170
|
// Do not go forward with new block if the previous one has not been mined and processed
|
|
179
171
|
if (!prevBlockSynced) {
|
|
172
|
+
this.log.debug('Previous block has not been mined and processed yet');
|
|
180
173
|
return;
|
|
181
174
|
}
|
|
182
175
|
|
|
176
|
+
if (prevBlockSynced && this.state === SequencerState.PUBLISHING_BLOCK) {
|
|
177
|
+
this.log.debug(`Block has been synced`);
|
|
178
|
+
this.state = SequencerState.IDLE;
|
|
179
|
+
}
|
|
180
|
+
|
|
183
181
|
const historicalHeader = (await this.l2BlockSource.getBlock(-1))?.header;
|
|
184
182
|
const newBlockNumber =
|
|
185
183
|
(historicalHeader === undefined
|
|
@@ -196,11 +194,14 @@ export class Sequencer {
|
|
|
196
194
|
const lastBlockTime = historicalHeader?.globalVariables.timestamp.toNumber() || 0;
|
|
197
195
|
const currentTime = Math.floor(Date.now() / 1000);
|
|
198
196
|
const elapsedSinceLastBlock = currentTime - lastBlockTime;
|
|
197
|
+
this.log.debug(
|
|
198
|
+
`Last block mined at ${lastBlockTime} current time is ${currentTime} (elapsed ${elapsedSinceLastBlock})`,
|
|
199
|
+
);
|
|
199
200
|
|
|
200
201
|
// Do not go forward with new block if not enough time has passed since last block
|
|
201
202
|
if (this.minSecondsBetweenBlocks > 0 && elapsedSinceLastBlock < this.minSecondsBetweenBlocks) {
|
|
202
203
|
this.log.debug(
|
|
203
|
-
`Not creating block because not enough time has passed since last block
|
|
204
|
+
`Not creating block because not enough time ${this.minSecondsBetweenBlocks} has passed since last block`,
|
|
204
205
|
);
|
|
205
206
|
return;
|
|
206
207
|
}
|
|
@@ -231,6 +232,8 @@ export class Sequencer {
|
|
|
231
232
|
this._feeRecipient,
|
|
232
233
|
);
|
|
233
234
|
|
|
235
|
+
// @todo @LHerskind Include some logic to consider slots
|
|
236
|
+
|
|
234
237
|
// TODO: It should be responsibility of the P2P layer to validate txs before passing them on here
|
|
235
238
|
const allValidTxs = await this.takeValidTxs(
|
|
236
239
|
pendingTxs,
|
|
@@ -260,8 +263,6 @@ export class Sequencer {
|
|
|
260
263
|
await this.p2pClient.deleteTxs(txHashes);
|
|
261
264
|
}
|
|
262
265
|
this.log.error(`Rolling back world state DB due to error assembling block`, (err as any).stack);
|
|
263
|
-
// Cancel any further proving on the block
|
|
264
|
-
this.prover?.cancelBlock();
|
|
265
266
|
await this.worldState.getLatest().rollback();
|
|
266
267
|
}
|
|
267
268
|
}
|
|
@@ -280,6 +281,7 @@ export class Sequencer {
|
|
|
280
281
|
historicalHeader: Header | undefined,
|
|
281
282
|
elapsedSinceLastBlock: number,
|
|
282
283
|
): Promise<void> {
|
|
284
|
+
this.metrics.recordNewBlock(newGlobalVariables.blockNumber.toNumber(), validTxs.length);
|
|
283
285
|
const workTimer = new Timer();
|
|
284
286
|
this.state = SequencerState.CREATING_BLOCK;
|
|
285
287
|
this.log.info(`Building block ${newGlobalVariables.blockNumber.toNumber()} with ${validTxs.length} transactions`);
|
|
@@ -287,12 +289,15 @@ export class Sequencer {
|
|
|
287
289
|
const assertBlockHeight = async () => {
|
|
288
290
|
const currentBlockNumber = await this.l2BlockSource.getBlockNumber();
|
|
289
291
|
if (currentBlockNumber + 1 !== newGlobalVariables.blockNumber.toNumber()) {
|
|
292
|
+
this.metrics.recordCancelledBlock();
|
|
290
293
|
throw new Error('New block was emitted while building block');
|
|
291
294
|
}
|
|
292
295
|
|
|
293
296
|
if (!(await this.publisher.isItMyTurnToSubmit())) {
|
|
294
297
|
throw new Error(`Not this sequencer turn to submit block`);
|
|
295
298
|
}
|
|
299
|
+
|
|
300
|
+
// @todo @LHerskind Should take into account, block number, proposer and slot number
|
|
296
301
|
};
|
|
297
302
|
|
|
298
303
|
// Get l1 to l2 messages from the contract
|
|
@@ -309,10 +314,11 @@ export class Sequencer {
|
|
|
309
314
|
const blockSize = Math.max(2, numRealTxs);
|
|
310
315
|
|
|
311
316
|
const blockBuildingTimer = new Timer();
|
|
312
|
-
const
|
|
317
|
+
const blockBuilder = this.blockBuilderFactory.create(this.worldState.getLatest());
|
|
318
|
+
const blockTicket = await blockBuilder.startNewBlock(blockSize, newGlobalVariables, l1ToL2Messages);
|
|
313
319
|
|
|
314
320
|
const [publicProcessorDuration, [processedTxs, failedTxs]] = await elapsed(() =>
|
|
315
|
-
processor.process(validTxs, blockSize,
|
|
321
|
+
processor.process(validTxs, blockSize, blockBuilder, this.txValidatorFactory.validatorForProcessedTxs()),
|
|
316
322
|
);
|
|
317
323
|
if (failedTxs.length > 0) {
|
|
318
324
|
const failedTxData = failedTxs.map(fail => fail.tx);
|
|
@@ -324,16 +330,16 @@ export class Sequencer {
|
|
|
324
330
|
// less txs than the minimum. But that'd cause the entire block to be aborted and retried. Instead, we should
|
|
325
331
|
// go back to the p2p pool and load more txs until we hit our minTxsPerBLock target. Only if there are no txs
|
|
326
332
|
// we should bail.
|
|
327
|
-
if (processedTxs.length === 0 && !this.skipMinTxsPerBlockCheck(elapsedSinceLastBlock)) {
|
|
333
|
+
if (processedTxs.length === 0 && !this.skipMinTxsPerBlockCheck(elapsedSinceLastBlock) && this.minTxsPerBLock > 0) {
|
|
328
334
|
this.log.verbose('No txs processed correctly to build block. Exiting');
|
|
329
|
-
|
|
335
|
+
blockBuilder.cancelBlock();
|
|
330
336
|
return;
|
|
331
337
|
}
|
|
332
338
|
|
|
333
339
|
await assertBlockHeight();
|
|
334
340
|
|
|
335
341
|
// All real transactions have been added, set the block as full and complete the proving.
|
|
336
|
-
await
|
|
342
|
+
await blockBuilder.setBlockCompleted();
|
|
337
343
|
|
|
338
344
|
// Here we are now waiting for the block to be proven.
|
|
339
345
|
// TODO(@PhilWindle) We should probably periodically check for things like another
|
|
@@ -345,29 +351,60 @@ export class Sequencer {
|
|
|
345
351
|
|
|
346
352
|
await assertBlockHeight();
|
|
347
353
|
|
|
348
|
-
// Block is
|
|
349
|
-
const { block
|
|
354
|
+
// Block is ready, now finalise and publish!
|
|
355
|
+
const { block } = await blockBuilder.finaliseBlock();
|
|
350
356
|
|
|
351
357
|
await assertBlockHeight();
|
|
352
358
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
await this.
|
|
369
|
-
this.
|
|
359
|
+
const workDuration = workTimer.ms();
|
|
360
|
+
this.log.verbose(
|
|
361
|
+
`Assembled block ${block.number} (txEffectsHash: ${block.header.contentCommitment.txsEffectsHash.toString(
|
|
362
|
+
'hex',
|
|
363
|
+
)})`,
|
|
364
|
+
{
|
|
365
|
+
eventName: 'l2-block-built',
|
|
366
|
+
duration: workDuration,
|
|
367
|
+
publicProcessDuration: publicProcessorDuration,
|
|
368
|
+
rollupCircuitsDuration: blockBuildingTimer.ms(),
|
|
369
|
+
...block.getStats(),
|
|
370
|
+
} satisfies L2BlockBuiltStats,
|
|
371
|
+
);
|
|
372
|
+
|
|
373
|
+
try {
|
|
374
|
+
const attestations = await this.collectAttestations(block);
|
|
375
|
+
await this.publishL2Block(block, attestations);
|
|
376
|
+
this.metrics.recordPublishedBlock(workDuration);
|
|
377
|
+
this.log.info(
|
|
378
|
+
`Submitted rollup block ${block.number} with ${
|
|
379
|
+
processedTxs.length
|
|
380
|
+
} transactions duration=${workDuration}ms (Submitter: ${await this.publisher.senderAddress()})`,
|
|
381
|
+
);
|
|
382
|
+
} catch (err) {
|
|
383
|
+
this.metrics.recordFailedBlock();
|
|
384
|
+
throw err;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
protected async collectAttestations(block: L2Block): Promise<Attestation[] | undefined> {
|
|
389
|
+
// @todo This should collect attestations properly and fix the ordering of them to make sense
|
|
390
|
+
// the current implementation is a PLACEHOLDER and should be nuked from orbit.
|
|
391
|
+
// It is assuming that there will only be ONE (1) validator, so only one attestation
|
|
392
|
+
// is needed.
|
|
393
|
+
// @note This is quite a sin, but I'm committing war crimes in this code already.
|
|
394
|
+
// _ ._ _ , _ ._
|
|
395
|
+
// (_ ' ( ` )_ .__)
|
|
396
|
+
// ( ( ( ) `) ) _)
|
|
397
|
+
// (__ (_ (_ . _) _) ,__)
|
|
398
|
+
// `~~`\ ' . /`~~`
|
|
399
|
+
// ; ;
|
|
400
|
+
// / \
|
|
401
|
+
// _____________/_ __ \_____________
|
|
402
|
+
if (IS_DEV_NET) {
|
|
403
|
+
return undefined;
|
|
370
404
|
}
|
|
405
|
+
|
|
406
|
+
const myAttestation = await this.publisher.attest(block.archive.root.toString());
|
|
407
|
+
return [myAttestation];
|
|
371
408
|
}
|
|
372
409
|
|
|
373
410
|
/**
|
|
@@ -377,10 +414,10 @@ export class Sequencer {
|
|
|
377
414
|
@trackSpan('Sequencer.publishL2Block', block => ({
|
|
378
415
|
[Attributes.BLOCK_NUMBER]: block.number,
|
|
379
416
|
}))
|
|
380
|
-
protected async publishL2Block(block: L2Block) {
|
|
417
|
+
protected async publishL2Block(block: L2Block, attestations?: Attestation[]) {
|
|
381
418
|
// Publishes new block to the network and awaits the tx to be mined
|
|
382
419
|
this.state = SequencerState.PUBLISHING_BLOCK;
|
|
383
|
-
const publishedL2Block = await this.publisher.processL2Block(block);
|
|
420
|
+
const publishedL2Block = await this.publisher.processL2Block(block, attestations);
|
|
384
421
|
if (publishedL2Block) {
|
|
385
422
|
this.lastPublishedBlock = block.number;
|
|
386
423
|
} else {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PublicKernelType, type Tx, type TxValidator } from '@aztec/circuit-types';
|
|
2
2
|
import { type AztecAddress, type Fr } from '@aztec/circuits.js';
|
|
3
3
|
import { createDebugLogger } from '@aztec/foundation/log';
|
|
4
|
-
import {
|
|
4
|
+
import { FeeJuiceArtifact } from '@aztec/protocol-contracts/fee-juice';
|
|
5
5
|
import { AbstractPhaseManager, computeFeePayerBalanceStorageSlot } from '@aztec/simulator';
|
|
6
6
|
|
|
7
7
|
/** Provides a view into public contract state */
|
|
@@ -12,11 +12,11 @@ export interface PublicStateSource {
|
|
|
12
12
|
export class GasTxValidator implements TxValidator<Tx> {
|
|
13
13
|
#log = createDebugLogger('aztec:sequencer:tx_validator:tx_gas');
|
|
14
14
|
#publicDataSource: PublicStateSource;
|
|
15
|
-
#
|
|
15
|
+
#feeJuiceAddress: AztecAddress;
|
|
16
16
|
|
|
17
|
-
constructor(publicDataSource: PublicStateSource,
|
|
17
|
+
constructor(publicDataSource: PublicStateSource, feeJuiceAddress: AztecAddress, public enforceFees: boolean) {
|
|
18
18
|
this.#publicDataSource = publicDataSource;
|
|
19
|
-
this.#
|
|
19
|
+
this.#feeJuiceAddress = feeJuiceAddress;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async validateTxs(txs: Tx[]): Promise<[validTxs: Tx[], invalidTxs: Tx[]]> {
|
|
@@ -50,18 +50,18 @@ export class GasTxValidator implements TxValidator<Tx> {
|
|
|
50
50
|
|
|
51
51
|
// Read current balance of the feePayer
|
|
52
52
|
const initialBalance = await this.#publicDataSource.storageRead(
|
|
53
|
-
this.#
|
|
53
|
+
this.#feeJuiceAddress,
|
|
54
54
|
computeFeePayerBalanceStorageSlot(feePayer),
|
|
55
55
|
);
|
|
56
56
|
|
|
57
|
-
// If there is a claim in this tx that increases the fee payer balance in
|
|
57
|
+
// If there is a claim in this tx that increases the fee payer balance in Fee Juice, add it to balance
|
|
58
58
|
const { [PublicKernelType.SETUP]: setupFns } = AbstractPhaseManager.extractEnqueuedPublicCallsByPhase(tx);
|
|
59
59
|
const claimFunctionCall = setupFns.find(
|
|
60
60
|
fn =>
|
|
61
|
-
fn.contractAddress.equals(this.#
|
|
62
|
-
fn.callContext.msgSender.equals(this.#
|
|
61
|
+
fn.contractAddress.equals(this.#feeJuiceAddress) &&
|
|
62
|
+
fn.callContext.msgSender.equals(this.#feeJuiceAddress) &&
|
|
63
63
|
fn.callContext.functionSelector.equals(
|
|
64
|
-
|
|
64
|
+
FeeJuiceArtifact.functions.find(f => f.name === '_increase_public_balance')!,
|
|
65
65
|
) &&
|
|
66
66
|
fn.args[0].equals(feePayer) &&
|
|
67
67
|
!fn.callContext.isStaticCall &&
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AllowedElement, type ProcessedTx, type Tx, type TxValidator } from '@aztec/circuit-types';
|
|
2
2
|
import { type GlobalVariables } from '@aztec/circuits.js';
|
|
3
|
-
import {
|
|
3
|
+
import { FeeJuiceAddress } from '@aztec/protocol-contracts/fee-juice';
|
|
4
4
|
import { WorldStateDB, WorldStatePublicDB } from '@aztec/simulator';
|
|
5
5
|
import { type ContractDataSource } from '@aztec/types/contracts';
|
|
6
6
|
import { type MerkleTreeOperations } from '@aztec/world-state';
|
|
@@ -25,7 +25,7 @@ export class TxValidatorFactory {
|
|
|
25
25
|
new MetadataTxValidator(globalVariables),
|
|
26
26
|
new DoubleSpendTxValidator(new WorldStateDB(this.merkleTreeDb)),
|
|
27
27
|
new PhasesTxValidator(this.contractDataSource, setupAllowList),
|
|
28
|
-
new GasTxValidator(new WorldStatePublicDB(this.merkleTreeDb),
|
|
28
|
+
new GasTxValidator(new WorldStatePublicDB(this.merkleTreeDb), FeeJuiceAddress, this.enforceFees),
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { type L1ContractAddresses } from '@aztec/ethereum';
|
|
2
|
-
/**
|
|
3
|
-
* Configuration of the L1GlobalReader.
|
|
4
|
-
*/
|
|
5
|
-
export interface GlobalReaderConfig {
|
|
6
|
-
/**
|
|
7
|
-
* The RPC Url of the ethereum host.
|
|
8
|
-
*/
|
|
9
|
-
rpcUrl: string;
|
|
10
|
-
/**
|
|
11
|
-
* The chain ID of the ethereum host.
|
|
12
|
-
*/
|
|
13
|
-
l1ChainId: number;
|
|
14
|
-
/**
|
|
15
|
-
* The deployed l1 contract addresses
|
|
16
|
-
*/
|
|
17
|
-
l1Contracts: L1ContractAddresses;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/global_variable_builder/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,WAAW,EAAE,mBAAmB,CAAC;CAClC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type L1ContractAddresses } from '@aztec/ethereum';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Configuration of the L1GlobalReader.
|
|
5
|
-
*/
|
|
6
|
-
export interface GlobalReaderConfig {
|
|
7
|
-
/**
|
|
8
|
-
* The RPC Url of the ethereum host.
|
|
9
|
-
*/
|
|
10
|
-
rpcUrl: string;
|
|
11
|
-
/**
|
|
12
|
-
* The chain ID of the ethereum host.
|
|
13
|
-
*/
|
|
14
|
-
l1ChainId: number;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The deployed l1 contract addresses
|
|
18
|
-
*/
|
|
19
|
-
l1Contracts: L1ContractAddresses;
|
|
20
|
-
}
|