@aztec/sequencer-client 2.0.3-rc.19 → 2.0.3-rc.20
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/publisher/sequencer-publisher.d.ts +5 -7
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +22 -33
- package/dest/sequencer/sequencer.d.ts +4 -3
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +11 -7
- package/package.json +27 -27
- package/src/publisher/sequencer-publisher.ts +30 -43
- package/src/sequencer/sequencer.ts +36 -22
|
@@ -4,13 +4,14 @@ import type { EpochCache } from '@aztec/epoch-cache';
|
|
|
4
4
|
import { type EmpireSlashingProposerContract, FormattedViemError, type GasPrice, type GovernanceProposerContract, type L1BlobInputs, type L1ContractsConfig, type L1GasConfig, type L1TxRequest, RollupContract, type TallySlashingProposerContract, type TransactionStats } from '@aztec/ethereum';
|
|
5
5
|
import type { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs';
|
|
6
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
7
8
|
import type { Fr } from '@aztec/foundation/fields';
|
|
8
9
|
import { type Logger } from '@aztec/foundation/log';
|
|
9
10
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
10
11
|
import { type ProposerSlashAction } from '@aztec/slasher';
|
|
11
|
-
import {
|
|
12
|
+
import { CommitteeAttestationsAndSigners, type ValidateBlockResult } from '@aztec/stdlib/block';
|
|
12
13
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
13
|
-
import { type ProposedBlockHeader
|
|
14
|
+
import { type ProposedBlockHeader } from '@aztec/stdlib/tx';
|
|
14
15
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
15
16
|
import { type TransactionReceipt, type TypedDataDefinition } from 'viem';
|
|
16
17
|
import type { PublisherConfig, TxSenderConfig } from './config.js';
|
|
@@ -138,10 +139,7 @@ export declare class SequencerPublisher {
|
|
|
138
139
|
* @param attestationData - The block's attestation data
|
|
139
140
|
*
|
|
140
141
|
*/
|
|
141
|
-
validateBlockForSubmission(block: L2Block,
|
|
142
|
-
digest: Buffer;
|
|
143
|
-
attestations: CommitteeAttestation[];
|
|
144
|
-
} | undefined, options: {
|
|
142
|
+
validateBlockForSubmission(block: L2Block, attestationsAndSigners: CommitteeAttestationsAndSigners, attestationsAndSignersSignature: Signature, options: {
|
|
145
143
|
forcePendingBlockNumber?: number;
|
|
146
144
|
}): Promise<bigint>;
|
|
147
145
|
private enqueueCastSignalHelper;
|
|
@@ -160,7 +158,7 @@ export declare class SequencerPublisher {
|
|
|
160
158
|
* @param block - L2 block to propose.
|
|
161
159
|
* @returns True if the tx has been enqueued, throws otherwise. See #9315
|
|
162
160
|
*/
|
|
163
|
-
enqueueProposeL2Block(block: L2Block,
|
|
161
|
+
enqueueProposeL2Block(block: L2Block, attestationsAndSigners: CommitteeAttestationsAndSigners, attestationsAndSignersSignature: Signature, opts?: {
|
|
164
162
|
txTimeoutAt?: Date;
|
|
165
163
|
forcePendingBlockNumber?: number;
|
|
166
164
|
}): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer-publisher.d.ts","sourceRoot":"","sources":["../../src/publisher/sequencer-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,KAAK,8BAA8B,EACnC,kBAAkB,EAClB,KAAK,QAAQ,EACb,KAAK,0BAA0B,EAE/B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAGh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B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,UAAU,EACzB,MAAM,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,GAC3D,OAAO,CAAC,OAAO,CAAC;IAYnB,uEAAuE;IAC1D,sBAAsB,CACjC,OAAO,EAAE,mBAAmB,EAAE,EAC9B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,UAAU,EACzB,MAAM,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,GAC3D,OAAO,CAAC,OAAO,CAAC;IAoHnB;;;;;OAKG;IACU,qBAAqB,CAChC,KAAK,EAAE,OAAO,EACd,sBAAsB,EAAE,+BAA+B,EACvD,+BAA+B,EAAE,SAAS,EAC1C,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAC;QAAC,uBAAuB,CAAC,EAAE,MAAM,CAAA;KAAO,GAClE,OAAO,CAAC,OAAO,CAAC;IAqCZ,sBAAsB,CAAC,OAAO,EAAE,sBAAsB,GAAG,SAAS,EAAE,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAA;KAAO;YA+B9F,yBAAyB;IAoDvC;;;;;OAKG;IACI,SAAS;IAKhB,wDAAwD;IACjD,OAAO;YAKA,gBAAgB;IAsD9B;;;;;OAKG;YACW,iBAAiB;YAoEjB,YAAY;CA+E3B"}
|
|
@@ -4,13 +4,13 @@ import { FormattedViemError, MULTI_CALL_3_ADDRESS, Multicall3, RollupContract, f
|
|
|
4
4
|
import { sumBigint } from '@aztec/foundation/bigint';
|
|
5
5
|
import { toHex as toPaddedHex } from '@aztec/foundation/bigint-buffer';
|
|
6
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
7
8
|
import { createLogger } from '@aztec/foundation/log';
|
|
8
9
|
import { bufferToHex } from '@aztec/foundation/string';
|
|
9
10
|
import { Timer } from '@aztec/foundation/timer';
|
|
10
11
|
import { EmpireBaseAbi, ErrorsAbi, RollupAbi } from '@aztec/l1-artifacts';
|
|
11
12
|
import { encodeSlashConsensusVotes } from '@aztec/slasher';
|
|
12
|
-
import { CommitteeAttestation } from '@aztec/stdlib/block';
|
|
13
|
-
import { ConsensusPayload, SignatureDomainSeparator, getHashedSignaturePayload } from '@aztec/stdlib/p2p';
|
|
13
|
+
import { CommitteeAttestation, CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
|
|
14
14
|
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
15
15
|
import pick from 'lodash.pick';
|
|
16
16
|
import { encodeFunctionData, toHex } from 'viem';
|
|
@@ -243,8 +243,9 @@ export class SequencerPublisher {
|
|
|
243
243
|
};
|
|
244
244
|
const args = [
|
|
245
245
|
header.toViem(),
|
|
246
|
-
|
|
246
|
+
CommitteeAttestationsAndSigners.empty().getPackedAttestations(),
|
|
247
247
|
[],
|
|
248
|
+
Signature.empty().toViemSignature(),
|
|
248
249
|
`0x${'0'.repeat(64)}`,
|
|
249
250
|
header.contentCommitment.blobsHash.toString(),
|
|
250
251
|
flags
|
|
@@ -352,10 +353,11 @@ export class SequencerPublisher {
|
|
|
352
353
|
reason
|
|
353
354
|
};
|
|
354
355
|
this.log.debug(`Simulating invalidate block ${block.blockNumber}`, logData);
|
|
356
|
+
const attestationsAndSigners = new CommitteeAttestationsAndSigners(attestations).getPackedAttestations();
|
|
355
357
|
if (reason === 'invalid-attestation') {
|
|
356
|
-
return this.rollupContract.buildInvalidateBadAttestationRequest(block.blockNumber,
|
|
358
|
+
return this.rollupContract.buildInvalidateBadAttestationRequest(block.blockNumber, attestationsAndSigners, committee, validationResult.invalidIndex);
|
|
357
359
|
} else if (reason === 'insufficient-attestations') {
|
|
358
|
-
return this.rollupContract.buildInvalidateInsufficientAttestationsRequest(block.blockNumber,
|
|
360
|
+
return this.rollupContract.buildInvalidateInsufficientAttestationsRequest(block.blockNumber, attestationsAndSigners, committee);
|
|
359
361
|
} else {
|
|
360
362
|
const _ = reason;
|
|
361
363
|
throw new Error(`Unknown reason for invalidation`);
|
|
@@ -369,38 +371,33 @@ export class SequencerPublisher {
|
|
|
369
371
|
* @param block - The block to propose
|
|
370
372
|
* @param attestationData - The block's attestation data
|
|
371
373
|
*
|
|
372
|
-
*/ async validateBlockForSubmission(block,
|
|
373
|
-
digest: Buffer.alloc(32),
|
|
374
|
-
attestations: []
|
|
375
|
-
}, options) {
|
|
374
|
+
*/ async validateBlockForSubmission(block, attestationsAndSigners, attestationsAndSignersSignature, options) {
|
|
376
375
|
const ts = BigInt((await this.l1TxUtils.getBlock()).timestamp + this.ethereumSlotDuration);
|
|
377
376
|
// If we have no attestations, we still need to provide the empty attestations
|
|
378
377
|
// so that the committee is recalculated correctly
|
|
379
|
-
const ignoreSignatures =
|
|
378
|
+
const ignoreSignatures = attestationsAndSigners.attestations.length === 0;
|
|
380
379
|
if (ignoreSignatures) {
|
|
381
380
|
const { committee } = await this.epochCache.getCommittee(block.header.globalVariables.slotNumber.toBigInt());
|
|
382
381
|
if (!committee) {
|
|
383
382
|
this.log.warn(`No committee found for slot ${block.header.globalVariables.slotNumber.toBigInt()}`);
|
|
384
383
|
throw new Error(`No committee found for slot ${block.header.globalVariables.slotNumber.toBigInt()}`);
|
|
385
384
|
}
|
|
386
|
-
|
|
385
|
+
attestationsAndSigners.attestations = committee.map((committeeMember)=>CommitteeAttestation.fromAddress(committeeMember));
|
|
387
386
|
}
|
|
388
387
|
const blobs = await Blob.getBlobsPerBlock(block.body.toBlobFields());
|
|
389
388
|
const blobInput = Blob.getPrefixedEthBlobCommitments(blobs);
|
|
390
|
-
const formattedAttestations = attestationData.attestations.map((attest)=>attest.toViem());
|
|
391
|
-
const signers = attestationData.attestations.filter((attest)=>!attest.signature.isEmpty()).map((attest)=>attest.address.toString());
|
|
392
389
|
const args = [
|
|
393
390
|
{
|
|
394
391
|
header: block.header.toPropose().toViem(),
|
|
395
392
|
archive: toHex(block.archive.root.toBuffer()),
|
|
396
393
|
stateReference: block.header.state.toViem(),
|
|
397
|
-
txHashes: block.body.txEffects.map((txEffect)=>txEffect.txHash.toString()),
|
|
398
394
|
oracleInput: {
|
|
399
395
|
feeAssetPriceModifier: 0n
|
|
400
396
|
}
|
|
401
397
|
},
|
|
402
|
-
|
|
403
|
-
|
|
398
|
+
attestationsAndSigners.getPackedAttestations(),
|
|
399
|
+
attestationsAndSigners.getSigners().map((signer)=>signer.toString()),
|
|
400
|
+
attestationsAndSignersSignature.toViemSignature(),
|
|
404
401
|
blobInput
|
|
405
402
|
];
|
|
406
403
|
await this.simulateProposeTx(args, ts, options);
|
|
@@ -572,10 +569,8 @@ export class SequencerPublisher {
|
|
|
572
569
|
*
|
|
573
570
|
* @param block - L2 block to propose.
|
|
574
571
|
* @returns True if the tx has been enqueued, throws otherwise. See #9315
|
|
575
|
-
*/ async enqueueProposeL2Block(block,
|
|
572
|
+
*/ async enqueueProposeL2Block(block, attestationsAndSigners, attestationsAndSignersSignature, opts = {}) {
|
|
576
573
|
const proposedBlockHeader = block.header.toPropose();
|
|
577
|
-
const consensusPayload = ConsensusPayload.fromBlock(block);
|
|
578
|
-
const digest = getHashedSignaturePayload(consensusPayload, SignatureDomainSeparator.blockAttestation);
|
|
579
574
|
const blobs = await Blob.getBlobsPerBlock(block.body.toBlobFields());
|
|
580
575
|
const proposeTxArgs = {
|
|
581
576
|
header: proposedBlockHeader,
|
|
@@ -583,8 +578,8 @@ export class SequencerPublisher {
|
|
|
583
578
|
stateReference: block.header.state,
|
|
584
579
|
body: block.body.toBuffer(),
|
|
585
580
|
blobs,
|
|
586
|
-
|
|
587
|
-
|
|
581
|
+
attestationsAndSigners,
|
|
582
|
+
attestationsAndSignersSignature
|
|
588
583
|
};
|
|
589
584
|
let ts;
|
|
590
585
|
try {
|
|
@@ -592,12 +587,8 @@ export class SequencerPublisher {
|
|
|
592
587
|
// This means that we can avoid the simulation issues in later checks.
|
|
593
588
|
// By simulation issue, I mean the fact that the block.timestamp is equal to the last block, not the next, which
|
|
594
589
|
// make time consistency checks break.
|
|
595
|
-
const attestationData = {
|
|
596
|
-
digest: digest.toBuffer(),
|
|
597
|
-
attestations: attestations ?? []
|
|
598
|
-
};
|
|
599
590
|
// TODO(palla): Check whether we're validating twice, once here and once within addProposeTx, since we call simulateProposeTx in both places.
|
|
600
|
-
ts = await this.validateBlockForSubmission(block,
|
|
591
|
+
ts = await this.validateBlockForSubmission(block, attestationsAndSigners, attestationsAndSignersSignature, opts);
|
|
601
592
|
} catch (err) {
|
|
602
593
|
this.log.error(`Block validation failed. ${err instanceof Error ? err.message : 'No error message'}`, err, {
|
|
603
594
|
...block.getStats(),
|
|
@@ -746,9 +737,7 @@ export class SequencerPublisher {
|
|
|
746
737
|
});
|
|
747
738
|
throw new Error('Failed to validate blobs');
|
|
748
739
|
});
|
|
749
|
-
const
|
|
750
|
-
const txHashes = encodedData.txHashes ? encodedData.txHashes.map((txHash)=>txHash.toString()) : [];
|
|
751
|
-
const signers = encodedData.attestations?.filter((attest)=>!attest.signature.isEmpty()).map((attest)=>attest.address.toString());
|
|
740
|
+
const signers = encodedData.attestationsAndSigners.getSigners().map((signer)=>signer.toString());
|
|
752
741
|
const args = [
|
|
753
742
|
{
|
|
754
743
|
header: encodedData.header.toViem(),
|
|
@@ -757,11 +746,11 @@ export class SequencerPublisher {
|
|
|
757
746
|
oracleInput: {
|
|
758
747
|
// We are currently not modifying these. See #9963
|
|
759
748
|
feeAssetPriceModifier: 0n
|
|
760
|
-
}
|
|
761
|
-
txHashes
|
|
749
|
+
}
|
|
762
750
|
},
|
|
763
|
-
|
|
764
|
-
signers
|
|
751
|
+
encodedData.attestationsAndSigners.getPackedAttestations(),
|
|
752
|
+
signers,
|
|
753
|
+
encodedData.attestationsAndSignersSignature.toViemSignature(),
|
|
765
754
|
blobInput
|
|
766
755
|
];
|
|
767
756
|
const { rollupData, simulationResult } = await this.simulateProposeTx(args, timestamp, options);
|
|
@@ -2,16 +2,17 @@ import type { L2Block } from '@aztec/aztec.js';
|
|
|
2
2
|
import type { EpochCache } from '@aztec/epoch-cache';
|
|
3
3
|
import { type RollupContract } from '@aztec/ethereum';
|
|
4
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
5
6
|
import { Fr } from '@aztec/foundation/fields';
|
|
6
7
|
import { type DateProvider } from '@aztec/foundation/timer';
|
|
7
8
|
import type { TypedEventEmitter } from '@aztec/foundation/types';
|
|
8
9
|
import type { P2P } from '@aztec/p2p';
|
|
9
10
|
import type { SlasherClientInterface } from '@aztec/slasher';
|
|
10
|
-
import type
|
|
11
|
+
import { type CommitteeAttestation, CommitteeAttestationsAndSigners, type L2BlockSource, type ValidateBlockResult } from '@aztec/stdlib/block';
|
|
11
12
|
import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
12
13
|
import { type IFullNodeBlockBuilder, type PublicProcessorLimits, type WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
13
14
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
14
|
-
import { Tx
|
|
15
|
+
import { Tx } from '@aztec/stdlib/tx';
|
|
15
16
|
import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
|
|
16
17
|
import type { ValidatorClient } from '@aztec/validator-client';
|
|
17
18
|
import type { GlobalVariableBuilder } from '../global_variable_builder/global_builder.js';
|
|
@@ -160,7 +161,7 @@ export declare class Sequencer extends Sequencer_base {
|
|
|
160
161
|
* Publishes the L2Block to the rollup contract.
|
|
161
162
|
* @param block - The L2Block to be published.
|
|
162
163
|
*/
|
|
163
|
-
protected enqueuePublishL2Block(block: L2Block,
|
|
164
|
+
protected enqueuePublishL2Block(block: L2Block, attestationsAndSigners: CommitteeAttestationsAndSigners, attestationsAndSignersSignature: Signature, invalidateBlock: InvalidateBlockRequest | undefined, publisher: SequencerPublisher): Promise<void>;
|
|
164
165
|
/**
|
|
165
166
|
* Returns whether all dependencies have caught up.
|
|
166
167
|
* We don't check against the previous block submitted since it may have been reorg'd out.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAwC,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5F,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,yBAAyB,CAA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,eAAe,EAAE,sBAAsB,GAAG,SAAS,EACnD,SAAS,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC;IAuBhB;;;;OAIG;cACa,WAAW,IAAI,OAAO,CAClC;QACE,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,EAAE,CAAC;QACZ,WAAW,EAAE,MAAM,CAAC;QACpB,4BAA4B,EAAE,mBAAmB,CAAC;KACnD,GACD,SAAS,CACZ;IAsDD;;;;;OAKG;cACa,yBAAyB,CACvC,QAAQ,EAAE,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EACpE,WAAW,EAAE,MAAM,EACnB,qBAAqB,EAAE,UAAU,EAAE,EACnC,SAAS,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC;IA6DhB,OAAO,CAAC,0BAA0B;IAQlC,OAAO,CAAC,kBAAkB;IAK1B,IAAI,iBAAiB,WAEpB;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;IAEM,gBAAgB,IAAI,sBAAsB,GAAG,SAAS;CAG9D"}
|
|
@@ -8,10 +8,12 @@ import { BLOBS_PER_BLOCK, FIELDS_PER_BLOB, INITIAL_L2_BLOCK_NUM } from '@aztec/c
|
|
|
8
8
|
import { FormattedViemError, NoCommitteeError } from '@aztec/ethereum';
|
|
9
9
|
import { omit, pick } from '@aztec/foundation/collection';
|
|
10
10
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
11
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
11
12
|
import { Fr } from '@aztec/foundation/fields';
|
|
12
13
|
import { createLogger } from '@aztec/foundation/log';
|
|
13
14
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
14
15
|
import { Timer } from '@aztec/foundation/timer';
|
|
16
|
+
import { CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
|
|
15
17
|
import { getSlotAtTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
16
18
|
import { Gas } from '@aztec/stdlib/gas';
|
|
17
19
|
import { SequencerConfigSchema } from '@aztec/stdlib/interfaces/server';
|
|
@@ -510,7 +512,9 @@ export { SequencerState };
|
|
|
510
512
|
blockNumber
|
|
511
513
|
});
|
|
512
514
|
}
|
|
513
|
-
|
|
515
|
+
const attestationsAndSigners = new CommitteeAttestationsAndSigners(attestations ?? []);
|
|
516
|
+
const attestationsAndSignersSignature = this.validatorClient ? await this.validatorClient.signAttestationsAndSigners(attestationsAndSigners, proposerAddress) : Signature.empty();
|
|
517
|
+
await this.enqueuePublishL2Block(block, attestationsAndSigners, attestationsAndSignersSignature, invalidateBlock, publisher);
|
|
514
518
|
this.metrics.recordBuiltBlock(blockBuildDuration, publicGas.l2Gas);
|
|
515
519
|
return block;
|
|
516
520
|
} catch (err) {
|
|
@@ -556,32 +560,32 @@ export { SequencerState };
|
|
|
556
560
|
const attestationTimeAllowed = this.enforceTimeTable ? this.timetable.getMaxAllowedTime(SequencerState.PUBLISHING_BLOCK) : this.aztecSlotDuration;
|
|
557
561
|
this.metrics.recordRequiredAttestations(numberOfRequiredAttestations, attestationTimeAllowed);
|
|
558
562
|
const timer = new Timer();
|
|
559
|
-
let
|
|
563
|
+
let collectedAttestationsCount = 0;
|
|
560
564
|
try {
|
|
561
565
|
const attestationDeadline = new Date(this.dateProvider.now() + attestationTimeAllowed * 1000);
|
|
562
566
|
const attestations = await this.validatorClient.collectAttestations(proposal, numberOfRequiredAttestations, attestationDeadline);
|
|
563
|
-
|
|
567
|
+
collectedAttestationsCount = attestations.length;
|
|
564
568
|
// note: the smart contract requires that the signatures are provided in the order of the committee
|
|
565
569
|
return orderAttestations(attestations, committee);
|
|
566
570
|
} catch (err) {
|
|
567
571
|
if (err && err instanceof AttestationTimeoutError) {
|
|
568
|
-
|
|
572
|
+
collectedAttestationsCount = err.collectedCount;
|
|
569
573
|
}
|
|
570
574
|
throw err;
|
|
571
575
|
} finally{
|
|
572
|
-
this.metrics.recordCollectedAttestations(
|
|
576
|
+
this.metrics.recordCollectedAttestations(collectedAttestationsCount, timer.ms());
|
|
573
577
|
}
|
|
574
578
|
}
|
|
575
579
|
/**
|
|
576
580
|
* Publishes the L2Block to the rollup contract.
|
|
577
581
|
* @param block - The L2Block to be published.
|
|
578
|
-
*/ async enqueuePublishL2Block(block,
|
|
582
|
+
*/ async enqueuePublishL2Block(block, attestationsAndSigners, attestationsAndSignersSignature, invalidateBlock, publisher) {
|
|
579
583
|
// Publishes new block to the network and awaits the tx to be mined
|
|
580
584
|
this.setState(SequencerState.PUBLISHING_BLOCK, block.header.globalVariables.slotNumber.toBigInt());
|
|
581
585
|
// Time out tx at the end of the slot
|
|
582
586
|
const slot = block.header.globalVariables.slotNumber.toNumber();
|
|
583
587
|
const txTimeoutAt = new Date((this.getSlotStartBuildTimestamp(slot) + this.aztecSlotDuration) * 1000);
|
|
584
|
-
const enqueued = await publisher.enqueueProposeL2Block(block,
|
|
588
|
+
const enqueued = await publisher.enqueueProposeL2Block(block, attestationsAndSigners, attestationsAndSignersSignature, {
|
|
585
589
|
txTimeoutAt,
|
|
586
590
|
forcePendingBlockNumber: invalidateBlock?.forcePendingBlockNumber
|
|
587
591
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/sequencer-client",
|
|
3
|
-
"version": "2.0.3-rc.
|
|
3
|
+
"version": "2.0.3-rc.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -26,38 +26,38 @@
|
|
|
26
26
|
"test:integration:run": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --config jest.integration.config.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@aztec/aztec.js": "2.0.3-rc.
|
|
30
|
-
"@aztec/bb-prover": "2.0.3-rc.
|
|
31
|
-
"@aztec/blob-lib": "2.0.3-rc.
|
|
32
|
-
"@aztec/blob-sink": "2.0.3-rc.
|
|
33
|
-
"@aztec/constants": "2.0.3-rc.
|
|
34
|
-
"@aztec/epoch-cache": "2.0.3-rc.
|
|
35
|
-
"@aztec/ethereum": "2.0.3-rc.
|
|
36
|
-
"@aztec/foundation": "2.0.3-rc.
|
|
37
|
-
"@aztec/l1-artifacts": "2.0.3-rc.
|
|
38
|
-
"@aztec/merkle-tree": "2.0.3-rc.
|
|
39
|
-
"@aztec/node-keystore": "2.0.3-rc.
|
|
40
|
-
"@aztec/noir-acvm_js": "2.0.3-rc.
|
|
41
|
-
"@aztec/noir-contracts.js": "2.0.3-rc.
|
|
42
|
-
"@aztec/noir-protocol-circuits-types": "2.0.3-rc.
|
|
43
|
-
"@aztec/noir-types": "2.0.3-rc.
|
|
44
|
-
"@aztec/p2p": "2.0.3-rc.
|
|
45
|
-
"@aztec/protocol-contracts": "2.0.3-rc.
|
|
46
|
-
"@aztec/prover-client": "2.0.3-rc.
|
|
47
|
-
"@aztec/simulator": "2.0.3-rc.
|
|
48
|
-
"@aztec/slasher": "2.0.3-rc.
|
|
49
|
-
"@aztec/stdlib": "2.0.3-rc.
|
|
50
|
-
"@aztec/telemetry-client": "2.0.3-rc.
|
|
51
|
-
"@aztec/validator-client": "2.0.3-rc.
|
|
52
|
-
"@aztec/world-state": "2.0.3-rc.
|
|
29
|
+
"@aztec/aztec.js": "2.0.3-rc.20",
|
|
30
|
+
"@aztec/bb-prover": "2.0.3-rc.20",
|
|
31
|
+
"@aztec/blob-lib": "2.0.3-rc.20",
|
|
32
|
+
"@aztec/blob-sink": "2.0.3-rc.20",
|
|
33
|
+
"@aztec/constants": "2.0.3-rc.20",
|
|
34
|
+
"@aztec/epoch-cache": "2.0.3-rc.20",
|
|
35
|
+
"@aztec/ethereum": "2.0.3-rc.20",
|
|
36
|
+
"@aztec/foundation": "2.0.3-rc.20",
|
|
37
|
+
"@aztec/l1-artifacts": "2.0.3-rc.20",
|
|
38
|
+
"@aztec/merkle-tree": "2.0.3-rc.20",
|
|
39
|
+
"@aztec/node-keystore": "2.0.3-rc.20",
|
|
40
|
+
"@aztec/noir-acvm_js": "2.0.3-rc.20",
|
|
41
|
+
"@aztec/noir-contracts.js": "2.0.3-rc.20",
|
|
42
|
+
"@aztec/noir-protocol-circuits-types": "2.0.3-rc.20",
|
|
43
|
+
"@aztec/noir-types": "2.0.3-rc.20",
|
|
44
|
+
"@aztec/p2p": "2.0.3-rc.20",
|
|
45
|
+
"@aztec/protocol-contracts": "2.0.3-rc.20",
|
|
46
|
+
"@aztec/prover-client": "2.0.3-rc.20",
|
|
47
|
+
"@aztec/simulator": "2.0.3-rc.20",
|
|
48
|
+
"@aztec/slasher": "2.0.3-rc.20",
|
|
49
|
+
"@aztec/stdlib": "2.0.3-rc.20",
|
|
50
|
+
"@aztec/telemetry-client": "2.0.3-rc.20",
|
|
51
|
+
"@aztec/validator-client": "2.0.3-rc.20",
|
|
52
|
+
"@aztec/world-state": "2.0.3-rc.20",
|
|
53
53
|
"lodash.chunk": "^4.2.0",
|
|
54
54
|
"lodash.pick": "^4.4.0",
|
|
55
55
|
"tslib": "^2.4.0",
|
|
56
56
|
"viem": "2.23.7"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@aztec/archiver": "2.0.3-rc.
|
|
60
|
-
"@aztec/kv-store": "2.0.3-rc.
|
|
59
|
+
"@aztec/archiver": "2.0.3-rc.20",
|
|
60
|
+
"@aztec/kv-store": "2.0.3-rc.20",
|
|
61
61
|
"@jest/globals": "^30.0.0",
|
|
62
62
|
"@types/jest": "^30.0.0",
|
|
63
63
|
"@types/lodash.chunk": "^4.2.7",
|
|
@@ -27,17 +27,17 @@ import type { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs'
|
|
|
27
27
|
import { sumBigint } from '@aztec/foundation/bigint';
|
|
28
28
|
import { toHex as toPaddedHex } from '@aztec/foundation/bigint-buffer';
|
|
29
29
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
30
|
+
import { Signature, type ViemSignature } from '@aztec/foundation/eth-signature';
|
|
30
31
|
import type { Fr } from '@aztec/foundation/fields';
|
|
31
32
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
32
33
|
import { bufferToHex } from '@aztec/foundation/string';
|
|
33
34
|
import { DateProvider, Timer } from '@aztec/foundation/timer';
|
|
34
35
|
import { EmpireBaseAbi, ErrorsAbi, RollupAbi } from '@aztec/l1-artifacts';
|
|
35
36
|
import { type ProposerSlashAction, encodeSlashConsensusVotes } from '@aztec/slasher';
|
|
36
|
-
import { CommitteeAttestation, type ValidateBlockResult } from '@aztec/stdlib/block';
|
|
37
|
+
import { CommitteeAttestation, CommitteeAttestationsAndSigners, type ValidateBlockResult } from '@aztec/stdlib/block';
|
|
37
38
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
38
|
-
import { ConsensusPayload, SignatureDomainSeparator, getHashedSignaturePayload } from '@aztec/stdlib/p2p';
|
|
39
39
|
import type { L1PublishBlockStats } from '@aztec/stdlib/stats';
|
|
40
|
-
import { type ProposedBlockHeader, StateReference
|
|
40
|
+
import { type ProposedBlockHeader, StateReference } from '@aztec/stdlib/tx';
|
|
41
41
|
import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
|
|
42
42
|
|
|
43
43
|
import pick from 'lodash.pick';
|
|
@@ -56,10 +56,10 @@ type L1ProcessArgs = {
|
|
|
56
56
|
stateReference: StateReference;
|
|
57
57
|
/** L2 block blobs containing all tx effects. */
|
|
58
58
|
blobs: Blob[];
|
|
59
|
-
/** L2 block tx hashes */
|
|
60
|
-
txHashes: TxHash[];
|
|
61
59
|
/** Attestations */
|
|
62
|
-
|
|
60
|
+
attestationsAndSigners: CommitteeAttestationsAndSigners;
|
|
61
|
+
/** Attestations and signers signature */
|
|
62
|
+
attestationsAndSignersSignature: Signature;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export const Actions = [
|
|
@@ -355,8 +355,9 @@ export class SequencerPublisher {
|
|
|
355
355
|
|
|
356
356
|
const args = [
|
|
357
357
|
header.toViem(),
|
|
358
|
-
|
|
358
|
+
CommitteeAttestationsAndSigners.empty().getPackedAttestations(),
|
|
359
359
|
[], // no signers
|
|
360
|
+
Signature.empty().toViemSignature(),
|
|
360
361
|
`0x${'0'.repeat(64)}`, // 32 empty bytes
|
|
361
362
|
header.contentCommitment.blobsHash.toString(),
|
|
362
363
|
flags,
|
|
@@ -455,17 +456,19 @@ export class SequencerPublisher {
|
|
|
455
456
|
const logData = { ...block, reason };
|
|
456
457
|
this.log.debug(`Simulating invalidate block ${block.blockNumber}`, logData);
|
|
457
458
|
|
|
459
|
+
const attestationsAndSigners = new CommitteeAttestationsAndSigners(attestations).getPackedAttestations();
|
|
460
|
+
|
|
458
461
|
if (reason === 'invalid-attestation') {
|
|
459
462
|
return this.rollupContract.buildInvalidateBadAttestationRequest(
|
|
460
463
|
block.blockNumber,
|
|
461
|
-
|
|
464
|
+
attestationsAndSigners,
|
|
462
465
|
committee,
|
|
463
466
|
validationResult.invalidIndex,
|
|
464
467
|
);
|
|
465
468
|
} else if (reason === 'insufficient-attestations') {
|
|
466
469
|
return this.rollupContract.buildInvalidateInsufficientAttestationsRequest(
|
|
467
470
|
block.blockNumber,
|
|
468
|
-
|
|
471
|
+
attestationsAndSigners,
|
|
469
472
|
committee,
|
|
470
473
|
);
|
|
471
474
|
} else {
|
|
@@ -485,24 +488,22 @@ export class SequencerPublisher {
|
|
|
485
488
|
*/
|
|
486
489
|
public async validateBlockForSubmission(
|
|
487
490
|
block: L2Block,
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
attestations: [],
|
|
491
|
-
},
|
|
491
|
+
attestationsAndSigners: CommitteeAttestationsAndSigners,
|
|
492
|
+
attestationsAndSignersSignature: Signature,
|
|
492
493
|
options: { forcePendingBlockNumber?: number },
|
|
493
494
|
): Promise<bigint> {
|
|
494
495
|
const ts = BigInt((await this.l1TxUtils.getBlock()).timestamp + this.ethereumSlotDuration);
|
|
495
496
|
|
|
496
497
|
// If we have no attestations, we still need to provide the empty attestations
|
|
497
498
|
// so that the committee is recalculated correctly
|
|
498
|
-
const ignoreSignatures =
|
|
499
|
+
const ignoreSignatures = attestationsAndSigners.attestations.length === 0;
|
|
499
500
|
if (ignoreSignatures) {
|
|
500
501
|
const { committee } = await this.epochCache.getCommittee(block.header.globalVariables.slotNumber.toBigInt());
|
|
501
502
|
if (!committee) {
|
|
502
503
|
this.log.warn(`No committee found for slot ${block.header.globalVariables.slotNumber.toBigInt()}`);
|
|
503
504
|
throw new Error(`No committee found for slot ${block.header.globalVariables.slotNumber.toBigInt()}`);
|
|
504
505
|
}
|
|
505
|
-
|
|
506
|
+
attestationsAndSigners.attestations = committee.map(committeeMember =>
|
|
506
507
|
CommitteeAttestation.fromAddress(committeeMember),
|
|
507
508
|
);
|
|
508
509
|
}
|
|
@@ -510,23 +511,18 @@ export class SequencerPublisher {
|
|
|
510
511
|
const blobs = await Blob.getBlobsPerBlock(block.body.toBlobFields());
|
|
511
512
|
const blobInput = Blob.getPrefixedEthBlobCommitments(blobs);
|
|
512
513
|
|
|
513
|
-
const formattedAttestations = attestationData.attestations.map(attest => attest.toViem());
|
|
514
|
-
const signers = attestationData.attestations
|
|
515
|
-
.filter(attest => !attest.signature.isEmpty())
|
|
516
|
-
.map(attest => attest.address.toString());
|
|
517
|
-
|
|
518
514
|
const args = [
|
|
519
515
|
{
|
|
520
516
|
header: block.header.toPropose().toViem(),
|
|
521
517
|
archive: toHex(block.archive.root.toBuffer()),
|
|
522
518
|
stateReference: block.header.state.toViem(),
|
|
523
|
-
txHashes: block.body.txEffects.map(txEffect => txEffect.txHash.toString()),
|
|
524
519
|
oracleInput: {
|
|
525
520
|
feeAssetPriceModifier: 0n,
|
|
526
521
|
},
|
|
527
522
|
},
|
|
528
|
-
|
|
529
|
-
|
|
523
|
+
attestationsAndSigners.getPackedAttestations(),
|
|
524
|
+
attestationsAndSigners.getSigners().map(signer => signer.toString()),
|
|
525
|
+
attestationsAndSignersSignature.toViemSignature(),
|
|
530
526
|
blobInput,
|
|
531
527
|
] as const;
|
|
532
528
|
|
|
@@ -775,15 +771,12 @@ export class SequencerPublisher {
|
|
|
775
771
|
*/
|
|
776
772
|
public async enqueueProposeL2Block(
|
|
777
773
|
block: L2Block,
|
|
778
|
-
|
|
779
|
-
|
|
774
|
+
attestationsAndSigners: CommitteeAttestationsAndSigners,
|
|
775
|
+
attestationsAndSignersSignature: Signature,
|
|
780
776
|
opts: { txTimeoutAt?: Date; forcePendingBlockNumber?: number } = {},
|
|
781
777
|
): Promise<boolean> {
|
|
782
778
|
const proposedBlockHeader = block.header.toPropose();
|
|
783
779
|
|
|
784
|
-
const consensusPayload = ConsensusPayload.fromBlock(block);
|
|
785
|
-
const digest = getHashedSignaturePayload(consensusPayload, SignatureDomainSeparator.blockAttestation);
|
|
786
|
-
|
|
787
780
|
const blobs = await Blob.getBlobsPerBlock(block.body.toBlobFields());
|
|
788
781
|
const proposeTxArgs = {
|
|
789
782
|
header: proposedBlockHeader,
|
|
@@ -791,8 +784,8 @@ export class SequencerPublisher {
|
|
|
791
784
|
stateReference: block.header.state,
|
|
792
785
|
body: block.body.toBuffer(),
|
|
793
786
|
blobs,
|
|
794
|
-
|
|
795
|
-
|
|
787
|
+
attestationsAndSigners,
|
|
788
|
+
attestationsAndSignersSignature,
|
|
796
789
|
};
|
|
797
790
|
|
|
798
791
|
let ts: bigint;
|
|
@@ -802,9 +795,8 @@ export class SequencerPublisher {
|
|
|
802
795
|
// This means that we can avoid the simulation issues in later checks.
|
|
803
796
|
// By simulation issue, I mean the fact that the block.timestamp is equal to the last block, not the next, which
|
|
804
797
|
// make time consistency checks break.
|
|
805
|
-
const attestationData = { digest: digest.toBuffer(), attestations: attestations ?? [] };
|
|
806
798
|
// TODO(palla): Check whether we're validating twice, once here and once within addProposeTx, since we call simulateProposeTx in both places.
|
|
807
|
-
ts = await this.validateBlockForSubmission(block,
|
|
799
|
+
ts = await this.validateBlockForSubmission(block, attestationsAndSigners, attestationsAndSignersSignature, opts);
|
|
808
800
|
} catch (err: any) {
|
|
809
801
|
this.log.error(`Block validation failed. ${err instanceof Error ? err.message : 'No error message'}`, err, {
|
|
810
802
|
...block.getStats(),
|
|
@@ -950,12 +942,7 @@ export class SequencerPublisher {
|
|
|
950
942
|
throw new Error('Failed to validate blobs');
|
|
951
943
|
});
|
|
952
944
|
|
|
953
|
-
const
|
|
954
|
-
const txHashes = encodedData.txHashes ? encodedData.txHashes.map(txHash => txHash.toString()) : [];
|
|
955
|
-
|
|
956
|
-
const signers = encodedData.attestations
|
|
957
|
-
?.filter(attest => !attest.signature.isEmpty())
|
|
958
|
-
.map(attest => attest.address.toString());
|
|
945
|
+
const signers = encodedData.attestationsAndSigners.getSigners().map(signer => signer.toString());
|
|
959
946
|
|
|
960
947
|
const args = [
|
|
961
948
|
{
|
|
@@ -966,10 +953,10 @@ export class SequencerPublisher {
|
|
|
966
953
|
// We are currently not modifying these. See #9963
|
|
967
954
|
feeAssetPriceModifier: 0n,
|
|
968
955
|
},
|
|
969
|
-
txHashes,
|
|
970
956
|
},
|
|
971
|
-
|
|
972
|
-
signers
|
|
957
|
+
encodedData.attestationsAndSigners.getPackedAttestations(),
|
|
958
|
+
signers,
|
|
959
|
+
encodedData.attestationsAndSignersSignature.toViemSignature(),
|
|
973
960
|
blobInput,
|
|
974
961
|
] as const;
|
|
975
962
|
|
|
@@ -990,13 +977,13 @@ export class SequencerPublisher {
|
|
|
990
977
|
readonly header: ViemHeader;
|
|
991
978
|
readonly archive: `0x${string}`;
|
|
992
979
|
readonly stateReference: ViemStateReference;
|
|
993
|
-
readonly txHashes: `0x${string}`[];
|
|
994
980
|
readonly oracleInput: {
|
|
995
981
|
readonly feeAssetPriceModifier: 0n;
|
|
996
982
|
};
|
|
997
983
|
},
|
|
998
984
|
ViemCommitteeAttestations,
|
|
999
|
-
`0x${string}`[],
|
|
985
|
+
`0x${string}`[], // Signers
|
|
986
|
+
ViemSignature,
|
|
1000
987
|
`0x${string}`,
|
|
1001
988
|
],
|
|
1002
989
|
timestamp: bigint,
|
|
@@ -4,6 +4,7 @@ import type { EpochCache } from '@aztec/epoch-cache';
|
|
|
4
4
|
import { FormattedViemError, NoCommitteeError, type RollupContract } from '@aztec/ethereum';
|
|
5
5
|
import { omit, pick } from '@aztec/foundation/collection';
|
|
6
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
|
+
import { Signature } from '@aztec/foundation/eth-signature';
|
|
7
8
|
import { Fr } from '@aztec/foundation/fields';
|
|
8
9
|
import { createLogger } from '@aztec/foundation/log';
|
|
9
10
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
@@ -11,7 +12,12 @@ import { type DateProvider, Timer } from '@aztec/foundation/timer';
|
|
|
11
12
|
import type { TypedEventEmitter } from '@aztec/foundation/types';
|
|
12
13
|
import type { P2P } from '@aztec/p2p';
|
|
13
14
|
import type { SlasherClientInterface } from '@aztec/slasher';
|
|
14
|
-
import
|
|
15
|
+
import {
|
|
16
|
+
type CommitteeAttestation,
|
|
17
|
+
CommitteeAttestationsAndSigners,
|
|
18
|
+
type L2BlockSource,
|
|
19
|
+
type ValidateBlockResult,
|
|
20
|
+
} from '@aztec/stdlib/block';
|
|
15
21
|
import { type L1RollupConstants, getSlotAtTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
16
22
|
import { Gas } from '@aztec/stdlib/gas';
|
|
17
23
|
import {
|
|
@@ -21,19 +27,11 @@ import {
|
|
|
21
27
|
type WorldStateSynchronizer,
|
|
22
28
|
} from '@aztec/stdlib/interfaces/server';
|
|
23
29
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
24
|
-
import type
|
|
25
|
-
import { orderAttestations } from '@aztec/stdlib/p2p';
|
|
30
|
+
import { type BlockProposalOptions, orderAttestations } from '@aztec/stdlib/p2p';
|
|
26
31
|
import { pickFromSchema } from '@aztec/stdlib/schemas';
|
|
27
32
|
import type { L2BlockBuiltStats } from '@aztec/stdlib/stats';
|
|
28
33
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
29
|
-
import {
|
|
30
|
-
ContentCommitment,
|
|
31
|
-
type FailedTx,
|
|
32
|
-
GlobalVariables,
|
|
33
|
-
ProposedBlockHeader,
|
|
34
|
-
Tx,
|
|
35
|
-
type TxHash,
|
|
36
|
-
} from '@aztec/stdlib/tx';
|
|
34
|
+
import { ContentCommitment, type FailedTx, GlobalVariables, ProposedBlockHeader, Tx } from '@aztec/stdlib/tx';
|
|
37
35
|
import { AttestationTimeoutError } from '@aztec/stdlib/validators';
|
|
38
36
|
import { Attributes, type TelemetryClient, type Tracer, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
39
37
|
import type { ValidatorClient } from '@aztec/validator-client';
|
|
@@ -665,7 +663,18 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
665
663
|
this.log.verbose(`Collected ${attestations.length} attestations`, { blockHash, blockNumber });
|
|
666
664
|
}
|
|
667
665
|
|
|
668
|
-
|
|
666
|
+
const attestationsAndSigners = new CommitteeAttestationsAndSigners(attestations ?? []);
|
|
667
|
+
const attestationsAndSignersSignature = this.validatorClient
|
|
668
|
+
? await this.validatorClient.signAttestationsAndSigners(attestationsAndSigners, proposerAddress)
|
|
669
|
+
: Signature.empty();
|
|
670
|
+
|
|
671
|
+
await this.enqueuePublishL2Block(
|
|
672
|
+
block,
|
|
673
|
+
attestationsAndSigners,
|
|
674
|
+
attestationsAndSignersSignature,
|
|
675
|
+
invalidateBlock,
|
|
676
|
+
publisher,
|
|
677
|
+
);
|
|
669
678
|
this.metrics.recordBuiltBlock(blockBuildDuration, publicGas.l2Gas);
|
|
670
679
|
return block;
|
|
671
680
|
} catch (err) {
|
|
@@ -741,7 +750,7 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
741
750
|
this.metrics.recordRequiredAttestations(numberOfRequiredAttestations, attestationTimeAllowed);
|
|
742
751
|
|
|
743
752
|
const timer = new Timer();
|
|
744
|
-
let
|
|
753
|
+
let collectedAttestationsCount: number = 0;
|
|
745
754
|
try {
|
|
746
755
|
const attestationDeadline = new Date(this.dateProvider.now() + attestationTimeAllowed * 1000);
|
|
747
756
|
const attestations = await this.validatorClient.collectAttestations(
|
|
@@ -750,17 +759,17 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
750
759
|
attestationDeadline,
|
|
751
760
|
);
|
|
752
761
|
|
|
753
|
-
|
|
762
|
+
collectedAttestationsCount = attestations.length;
|
|
754
763
|
|
|
755
764
|
// note: the smart contract requires that the signatures are provided in the order of the committee
|
|
756
765
|
return orderAttestations(attestations, committee);
|
|
757
766
|
} catch (err) {
|
|
758
767
|
if (err && err instanceof AttestationTimeoutError) {
|
|
759
|
-
|
|
768
|
+
collectedAttestationsCount = err.collectedCount;
|
|
760
769
|
}
|
|
761
770
|
throw err;
|
|
762
771
|
} finally {
|
|
763
|
-
this.metrics.recordCollectedAttestations(
|
|
772
|
+
this.metrics.recordCollectedAttestations(collectedAttestationsCount, timer.ms());
|
|
764
773
|
}
|
|
765
774
|
}
|
|
766
775
|
|
|
@@ -773,8 +782,8 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
773
782
|
}))
|
|
774
783
|
protected async enqueuePublishL2Block(
|
|
775
784
|
block: L2Block,
|
|
776
|
-
|
|
777
|
-
|
|
785
|
+
attestationsAndSigners: CommitteeAttestationsAndSigners,
|
|
786
|
+
attestationsAndSignersSignature: Signature,
|
|
778
787
|
invalidateBlock: InvalidateBlockRequest | undefined,
|
|
779
788
|
publisher: SequencerPublisher,
|
|
780
789
|
): Promise<void> {
|
|
@@ -785,10 +794,15 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
785
794
|
const slot = block.header.globalVariables.slotNumber.toNumber();
|
|
786
795
|
const txTimeoutAt = new Date((this.getSlotStartBuildTimestamp(slot) + this.aztecSlotDuration) * 1000);
|
|
787
796
|
|
|
788
|
-
const enqueued = await publisher.enqueueProposeL2Block(
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
797
|
+
const enqueued = await publisher.enqueueProposeL2Block(
|
|
798
|
+
block,
|
|
799
|
+
attestationsAndSigners,
|
|
800
|
+
attestationsAndSignersSignature,
|
|
801
|
+
{
|
|
802
|
+
txTimeoutAt,
|
|
803
|
+
forcePendingBlockNumber: invalidateBlock?.forcePendingBlockNumber,
|
|
804
|
+
},
|
|
805
|
+
);
|
|
792
806
|
|
|
793
807
|
if (!enqueued) {
|
|
794
808
|
throw new Error(`Failed to enqueue publish of block ${block.number}`);
|