@aztec/sequencer-client 0.86.0 → 0.87.0
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/config.d.ts.map +1 -1
- package/dest/config.js +5 -0
- package/dest/global_variable_builder/global_builder.d.ts +6 -3
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +15 -2
- package/dest/publisher/sequencer-publisher-metrics.js +2 -2
- package/dest/publisher/sequencer-publisher.d.ts +4 -6
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +15 -12
- package/dest/sequencer/metrics.d.ts +1 -0
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +3 -0
- package/dest/sequencer/sequencer.d.ts +23 -7
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +47 -22
- package/dest/sequencer/timetable.d.ts +4 -4
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +14 -4
- package/dest/slasher/factory.d.ts.map +1 -1
- package/dest/tx_validator/nullifier_cache.d.ts +0 -2
- package/dest/tx_validator/nullifier_cache.d.ts.map +1 -1
- package/dest/tx_validator/tx_validator_factory.d.ts.map +1 -1
- package/dest/tx_validator/tx_validator_factory.js +16 -3
- package/package.json +30 -30
- package/src/client/sequencer-client.ts +1 -1
- package/src/config.ts +5 -0
- package/src/global_variable_builder/global_builder.ts +17 -5
- package/src/publisher/sequencer-publisher-metrics.ts +2 -2
- package/src/publisher/sequencer-publisher.ts +19 -14
- package/src/sequencer/metrics.ts +4 -0
- package/src/sequencer/sequencer.ts +60 -35
- package/src/sequencer/timetable.ts +16 -4
- package/src/slasher/slasher_client.ts +1 -1
- package/src/test/index.ts +4 -4
- package/src/tx_validator/tx_validator_factory.ts +16 -3
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAGpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAuB,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,KAAK,qBAAqB,EAAiC,MAAM,yBAAyB,CAAC;AAEpG,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAGpB,MAAM,uBAAuB,CAAC;AAE/B,cAAc,uBAAuB,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GACjD,qBAAqB,GACrB,cAAc,GACd,eAAe,GACf,cAAc,GACd,WAAW,GACX,IAAI,CAAC,SAAS,EAAE,wBAAwB,CAAC,GACzC,IAAI,CACF,iBAAiB,EACjB,sBAAsB,GAAG,mBAAmB,GAAG,oBAAoB,GAAG,4BAA4B,CACnG,CAAC;AAEJ,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAGpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,YAAY,CAAC;AAE/D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAuB,MAAM,sBAAsB,CAAC;AACnG,OAAO,EAAE,KAAK,qBAAqB,EAAiC,MAAM,yBAAyB,CAAC;AAEpG,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EAGpB,MAAM,uBAAuB,CAAC;AAE/B,cAAc,uBAAuB,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GACjD,qBAAqB,GACrB,cAAc,GACd,eAAe,GACf,cAAc,GACd,WAAW,GACX,IAAI,CAAC,SAAS,EAAE,wBAAwB,CAAC,GACzC,IAAI,CACF,iBAAiB,EACjB,sBAAsB,GAAG,mBAAmB,GAAG,oBAAoB,GAAG,4BAA4B,CACnG,CAAC;AAEJ,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,CAAC,eAAe,CAwEvE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CAanF,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
|
package/dest/config.js
CHANGED
|
@@ -23,6 +23,11 @@ export const sequencerConfigMappings = {
|
|
|
23
23
|
description: 'The minimum number of txs to include in a block.',
|
|
24
24
|
...numberConfigHelper(1)
|
|
25
25
|
},
|
|
26
|
+
publishTxsWithProposals: {
|
|
27
|
+
env: 'SEQ_PUBLISH_TXS_WITH_PROPOSALS',
|
|
28
|
+
description: 'Whether to publish txs with proposals.',
|
|
29
|
+
...booleanConfigHelper(false)
|
|
30
|
+
},
|
|
26
31
|
maxL2BlockGas: {
|
|
27
32
|
env: 'SEQ_MAX_L2_BLOCK_GAS',
|
|
28
33
|
description: 'The maximum L2 block gas.',
|
|
@@ -10,15 +10,18 @@ import { GlobalVariables } from '@aztec/stdlib/tx';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
|
|
12
12
|
private log;
|
|
13
|
-
private rollupContract;
|
|
14
|
-
private publicClient;
|
|
15
|
-
private ethereumSlotDuration;
|
|
13
|
+
private readonly rollupContract;
|
|
14
|
+
private readonly publicClient;
|
|
15
|
+
private readonly ethereumSlotDuration;
|
|
16
|
+
private chainId?;
|
|
17
|
+
private version?;
|
|
16
18
|
constructor(config: L1ReaderConfig & Pick<L1ContractsConfig, 'ethereumSlotDuration'>);
|
|
17
19
|
/**
|
|
18
20
|
* Computes the "current" base fees, e.g., the price that you currently should pay to get include in the next block
|
|
19
21
|
* @returns Base fees for the expected next block
|
|
20
22
|
*/
|
|
21
23
|
getCurrentBaseFees(): Promise<GasFees>;
|
|
24
|
+
getGlobalConstantVariables(): Promise<Pick<GlobalVariables, 'chainId' | 'version'>>;
|
|
22
25
|
/**
|
|
23
26
|
* Simple builder of global variables that use the minimum time possible.
|
|
24
27
|
* @param blockNumber - The block number to build global variables for.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global_builder.d.ts","sourceRoot":"","sources":["../../src/global_variable_builder/global_builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAIpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,IAAI,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInD;;GAEG;AACH,qBAAa,qBAAsB,YAAW,8BAA8B;IAC1E,OAAO,CAAC,GAAG,CAAqD;IAEhE,OAAO,CAAC,cAAc,CAAiB;
|
|
1
|
+
{"version":3,"file":"global_builder.d.ts","sourceRoot":"","sources":["../../src/global_variable_builder/global_builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAIpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,IAAI,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInD;;GAEG;AACH,qBAAa,qBAAsB,YAAW,8BAA8B;IAC1E,OAAO,CAAC,GAAG,CAAqD;IAEhE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAmB;IAChD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAE9C,OAAO,CAAC,OAAO,CAAC,CAAK;IACrB,OAAO,CAAC,OAAO,CAAC,CAAK;gBAET,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IAgBpF;;;OAGG;IACU,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAatC,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;IAUhG;;;;;;;OAOG;IACU,oBAAoB,CAC/B,WAAW,EAAE,EAAE,EACf,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,EAC1B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC;CA6B5B"}
|
|
@@ -11,6 +11,8 @@ import { createPublicClient, fallback, http } from 'viem';
|
|
|
11
11
|
rollupContract;
|
|
12
12
|
publicClient;
|
|
13
13
|
ethereumSlotDuration;
|
|
14
|
+
chainId;
|
|
15
|
+
version;
|
|
14
16
|
constructor(config){
|
|
15
17
|
const { l1RpcUrls, l1ChainId: chainId, l1Contracts } = config;
|
|
16
18
|
const chain = createEthereumChain(l1RpcUrls, chainId);
|
|
@@ -35,6 +37,18 @@ import { createPublicClient, fallback, http } from 'viem';
|
|
|
35
37
|
const timestamp = earliestTimestamp > nextEthTimestamp ? earliestTimestamp : nextEthTimestamp;
|
|
36
38
|
return new GasFees(Fr.ZERO, new Fr(await this.rollupContract.getManaBaseFeeAt(timestamp, true)));
|
|
37
39
|
}
|
|
40
|
+
async getGlobalConstantVariables() {
|
|
41
|
+
if (!this.chainId) {
|
|
42
|
+
this.chainId = new Fr(this.publicClient.chain.id);
|
|
43
|
+
}
|
|
44
|
+
if (!this.version) {
|
|
45
|
+
this.version = new Fr(await this.rollupContract.getVersion());
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
chainId: this.chainId,
|
|
49
|
+
version: this.version
|
|
50
|
+
};
|
|
51
|
+
}
|
|
38
52
|
/**
|
|
39
53
|
* Simple builder of global variables that use the minimum time possible.
|
|
40
54
|
* @param blockNumber - The block number to build global variables for.
|
|
@@ -43,8 +57,7 @@ import { createPublicClient, fallback, http } from 'viem';
|
|
|
43
57
|
* @param slotNumber - The slot number to use for the global variables, if undefined it will be calculated.
|
|
44
58
|
* @returns The global variables for the given block number.
|
|
45
59
|
*/ async buildGlobalVariables(blockNumber, coinbase, feeRecipient, slotNumber) {
|
|
46
|
-
const version =
|
|
47
|
-
const chainId = new Fr(this.publicClient.chain.id);
|
|
60
|
+
const { chainId, version } = await this.getGlobalConstantVariables();
|
|
48
61
|
if (slotNumber === undefined) {
|
|
49
62
|
const ts = BigInt((await this.publicClient.getBlock()).timestamp + BigInt(this.ethereumSlotDuration));
|
|
50
63
|
slotNumber = await this.rollupContract.getSlotAt(ts);
|
|
@@ -149,7 +149,7 @@ export class SequencerPublisherMetrics {
|
|
|
149
149
|
this.txBlobDataGasUsed.record(Number(stats.blobGasUsed), attributes);
|
|
150
150
|
try {
|
|
151
151
|
this.gasPrice.record(parseInt(formatEther(stats.gasPrice, 'gwei'), 10));
|
|
152
|
-
} catch
|
|
152
|
+
} catch {
|
|
153
153
|
// ignore
|
|
154
154
|
}
|
|
155
155
|
const executionFee = stats.gasUsed * stats.gasPrice;
|
|
@@ -157,7 +157,7 @@ export class SequencerPublisherMetrics {
|
|
|
157
157
|
const totalFee = executionFee + blobFee;
|
|
158
158
|
try {
|
|
159
159
|
this.txTotalFee.record(parseFloat(formatEther(totalFee)));
|
|
160
|
-
} catch
|
|
160
|
+
} catch {
|
|
161
161
|
// ignore
|
|
162
162
|
}
|
|
163
163
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { L2Block } from '@aztec/aztec.js';
|
|
4
2
|
import { Blob } from '@aztec/blob-lib';
|
|
5
3
|
import { type BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
@@ -8,7 +6,7 @@ import { type ForwarderContract, type GasPrice, type GovernanceProposerContract,
|
|
|
8
6
|
import type { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs';
|
|
9
7
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
10
8
|
import type { Signature } from '@aztec/foundation/eth-signature';
|
|
11
|
-
import { type
|
|
9
|
+
import { type ProposedBlockHeader, TxHash } from '@aztec/stdlib/tx';
|
|
12
10
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
13
11
|
import { type TransactionReceipt } from 'viem';
|
|
14
12
|
import type { PublisherConfig, TxSenderConfig } from './config.js';
|
|
@@ -79,12 +77,12 @@ export declare class SequencerPublisher {
|
|
|
79
77
|
*/
|
|
80
78
|
sendRequests(): Promise<{
|
|
81
79
|
result: {
|
|
82
|
-
receipt:
|
|
80
|
+
receipt: import("viem").TransactionReceipt;
|
|
83
81
|
gasPrice: GasPrice;
|
|
84
82
|
stats: TransactionStats | undefined;
|
|
85
83
|
errorMsg?: undefined;
|
|
86
84
|
} | {
|
|
87
|
-
receipt:
|
|
85
|
+
receipt: import("viem").TransactionReceipt;
|
|
88
86
|
gasPrice: GasPrice;
|
|
89
87
|
errorMsg: string | undefined;
|
|
90
88
|
stats?: undefined;
|
|
@@ -108,7 +106,7 @@ export declare class SequencerPublisher {
|
|
|
108
106
|
* @param digest - The digest that attestations are signing over
|
|
109
107
|
*
|
|
110
108
|
*/
|
|
111
|
-
validateBlockForSubmission(header:
|
|
109
|
+
validateBlockForSubmission(header: ProposedBlockHeader, attestationData?: {
|
|
112
110
|
digest: Buffer;
|
|
113
111
|
signatures: Signature[];
|
|
114
112
|
}): Promise<bigint>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer-publisher.d.ts","sourceRoot":"","sources":["../../src/publisher/sequencer-publisher.ts"],"names":[],"mappings":"
|
|
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;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,0BAA0B,EAE/B,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,cAAc,EACd,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EAEtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,S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BAA0B,CACrC,MAAM,EAAE,mBAAmB,EAC3B,eAAe,GAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,SAAS,EAAE,CAAA;KAGzD,GACA,OAAO,CAAC,MAAM,CAAC;IAmBL,wBAAwB,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YAKhD,qBAAqB;YA8CrB,aAAa;IAmB3B;;;;;;OAMG;IACU,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IASzG;;;;;OAKG;IACU,qBAAqB,CAChC,KAAK,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,SAAS,EAAE,EAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,EACnB,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAA;KAAO,GAChC,OAAO,CAAC,OAAO,CAAC;IA+BnB;;;;;OAKG;IACI,SAAS;IAKhB,wDAAwD;IACjD,OAAO;YAKA,gBAAgB;YAoGhB,YAAY;IAoE1B;;;;;;;OAOG;IACH,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Blob } from '@aztec/blob-lib';
|
|
2
2
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
3
3
|
import { FormattedViemError, RollupContract, formatViemError } from '@aztec/ethereum';
|
|
4
|
-
import { toHex } from '@aztec/foundation/bigint-buffer';
|
|
4
|
+
import { toHex as toPaddedHex } from '@aztec/foundation/bigint-buffer';
|
|
5
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
6
|
import { createLogger } from '@aztec/foundation/log';
|
|
7
7
|
import { Timer } from '@aztec/foundation/timer';
|
|
@@ -9,7 +9,7 @@ import { ForwarderAbi, RollupAbi } from '@aztec/l1-artifacts';
|
|
|
9
9
|
import { ConsensusPayload, SignatureDomainSeparator, getHashedSignaturePayload } from '@aztec/stdlib/p2p';
|
|
10
10
|
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
11
11
|
import pick from 'lodash.pick';
|
|
12
|
-
import { encodeFunctionData } from 'viem';
|
|
12
|
+
import { encodeFunctionData, toHex } from 'viem';
|
|
13
13
|
import { SequencerPublisherMetrics } from './sequencer-publisher-metrics.js';
|
|
14
14
|
export var VoteType = /*#__PURE__*/ function(VoteType) {
|
|
15
15
|
VoteType[VoteType["GOVERNANCE"] = 0] = "GOVERNANCE";
|
|
@@ -195,11 +195,11 @@ export class SequencerPublisher {
|
|
|
195
195
|
ignoreSignatures: formattedSignatures.length == 0
|
|
196
196
|
};
|
|
197
197
|
const args = [
|
|
198
|
-
|
|
198
|
+
toHex(header.toBuffer()),
|
|
199
199
|
formattedSignatures,
|
|
200
|
-
|
|
200
|
+
toHex(attestationData.digest),
|
|
201
201
|
ts,
|
|
202
|
-
|
|
202
|
+
toHex(header.contentCommitment.blobsHash),
|
|
203
203
|
flags
|
|
204
204
|
];
|
|
205
205
|
await this.rollupContract.validateHeader(args, this.getForwarderAddress().toString());
|
|
@@ -285,12 +285,14 @@ export class SequencerPublisher {
|
|
|
285
285
|
* @param block - L2 block to propose.
|
|
286
286
|
* @returns True if the tx has been enqueued, throws otherwise. See #9315
|
|
287
287
|
*/ async enqueueProposeL2Block(block, attestations, txHashes, opts = {}) {
|
|
288
|
-
const
|
|
288
|
+
const proposedBlockHeader = block.header.toPropose();
|
|
289
|
+
const consensusPayload = ConsensusPayload.fromBlock(block);
|
|
289
290
|
const digest = getHashedSignaturePayload(consensusPayload, SignatureDomainSeparator.blockAttestation);
|
|
290
291
|
const blobs = await Blob.getBlobs(block.body.toBlobFields());
|
|
291
292
|
const proposeTxArgs = {
|
|
292
|
-
header:
|
|
293
|
+
header: proposedBlockHeader.toBuffer(),
|
|
293
294
|
archive: block.archive.root.toBuffer(),
|
|
295
|
+
stateReference: block.header.state.toBuffer(),
|
|
294
296
|
body: block.body.toBuffer(),
|
|
295
297
|
blobs,
|
|
296
298
|
attestations,
|
|
@@ -300,7 +302,7 @@ export class SequencerPublisher {
|
|
|
300
302
|
// This means that we can avoid the simulation issues in later checks.
|
|
301
303
|
// By simulation issue, I mean the fact that the block.timestamp is equal to the last block, not the next, which
|
|
302
304
|
// make time consistency checks break.
|
|
303
|
-
const ts = await this.validateBlockForSubmission(
|
|
305
|
+
const ts = await this.validateBlockForSubmission(proposedBlockHeader, {
|
|
304
306
|
digest: digest.toBuffer(),
|
|
305
307
|
signatures: attestations ?? []
|
|
306
308
|
});
|
|
@@ -353,8 +355,9 @@ export class SequencerPublisher {
|
|
|
353
355
|
const txHashes = encodedData.txHashes ? encodedData.txHashes.map((txHash)=>txHash.toString()) : [];
|
|
354
356
|
const args = [
|
|
355
357
|
{
|
|
356
|
-
header:
|
|
357
|
-
archive:
|
|
358
|
+
header: toHex(encodedData.header),
|
|
359
|
+
archive: toHex(encodedData.archive),
|
|
360
|
+
stateReference: toHex(encodedData.stateReference),
|
|
358
361
|
oracleInput: {
|
|
359
362
|
// We are currently not modifying these. See #9963
|
|
360
363
|
feeAssetPriceModifier: 0n
|
|
@@ -396,8 +399,8 @@ export class SequencerPublisher {
|
|
|
396
399
|
// @note we override checkBlob to false since blobs are not part simulate()
|
|
397
400
|
stateDiff: [
|
|
398
401
|
{
|
|
399
|
-
slot:
|
|
400
|
-
value:
|
|
402
|
+
slot: toPaddedHex(RollupContract.checkBlobStorageSlot, true),
|
|
403
|
+
value: toPaddedHex(0n, true)
|
|
401
404
|
}
|
|
402
405
|
]
|
|
403
406
|
}
|
|
@@ -21,6 +21,7 @@ export declare class SequencerMetrics {
|
|
|
21
21
|
private missedSlots;
|
|
22
22
|
private lastSeenSlot?;
|
|
23
23
|
constructor(client: TelemetryClient, getState: SequencerStateCallback, coinbase: EthAddress, rollup: RollupContract, name?: string);
|
|
24
|
+
setCoinbase(coinbase: EthAddress): void;
|
|
24
25
|
start(): void;
|
|
25
26
|
stop(): void;
|
|
26
27
|
private observe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../src/sequencer/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAQL,KAAK,eAAe,EACpB,KAAK,MAAM,EAGZ,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,sBAAsB,EAA0B,MAAM,YAAY,CAAC;AAEtG,qBAAa,gBAAgB;IAyBzB,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;IAzBhB,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,KAAK,CAAQ;IAErB,OAAO,CAAC,YAAY,CAAgB;IACpC,OAAO,CAAC,kBAAkB,CAAY;IACtC,OAAO,CAAC,uBAAuB,CAAQ;IACvC,OAAO,CAAC,6BAA6B,CAAY;IACjD,OAAO,CAAC,kBAAkB,CAAQ;IAClC,OAAO,CAAC,gBAAgB,CAAQ;IAChC,OAAO,CAAC,sBAAsB,CAAY;IAE1C,OAAO,CAAC,yBAAyB,CAAQ;IAEzC,OAAO,CAAC,OAAO,CAAkB;IAEjC,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,WAAW,CAAgB;IAEnC,OAAO,CAAC,YAAY,CAAC,CAAS;gBAG5B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,sBAAsB,EACxB,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,cAAc,EAC9B,IAAI,SAAc;IA2Fb,KAAK;IAIL,IAAI;IAIX,OAAO,CAAC,OAAO,CAQb;IAEF,gCAAgC,I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EzC,OAAO,CAAC,OAAO,CAAkB;IAEjC,OAAO,CAAC,KAAK,CAAgB;IAC7B,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,WAAW,CAAgB;IAEnC,OAAO,CAAC,YAAY,CAAC,CAAS;gBAG5B,MAAM,EAAE,eAAe,EACvB,QAAQ,EAAE,sBAAsB,EACxB,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,cAAc,EAC9B,IAAI,SAAc;IA2Fb,WAAW,CAAC,QAAQ,EAAE,UAAU;IAIhC,KAAK;IAIL,IAAI;IAIX,OAAO,CAAC,OAAO,CAQb;IAEF,gCAAgC,IAAI,MAAM,IAAI;IAS9C,+BAA+B,CAAC,IAAI,EAAE,MAAM;IAI5C,gCAAgC,CAAC,MAAM,EAAE,MAAM;IAI/C,oBAAoB;IAOpB,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAQ3D,iBAAiB;IAOjB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAInD,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc;IAMvE,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM;IAqB5D,aAAa,CAAC,QAAQ,EAAE,MAAM;IAO9B,OAAO,CAAC,eAAe;CAIxB"}
|
|
@@ -99,6 +99,9 @@ export class SequencerMetrics {
|
|
|
99
99
|
description: 'The number of slots this sequencer has missed to fill'
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
+
setCoinbase(coinbase) {
|
|
103
|
+
this.coinbase = coinbase;
|
|
104
|
+
}
|
|
102
105
|
start() {
|
|
103
106
|
this.meter.addBatchObservableCallback(this.observe, [
|
|
104
107
|
this.rewards
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { type L2Block } from '@aztec/aztec.js';
|
|
4
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
3
|
import type { Signature } from '@aztec/foundation/eth-signature';
|
|
@@ -15,7 +13,7 @@ import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
|
15
13
|
import { Gas } from '@aztec/stdlib/gas';
|
|
16
14
|
import { type WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
17
15
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
18
|
-
import {
|
|
16
|
+
import { GlobalVariables, ProposedBlockHeader, Tx, type TxHash } from '@aztec/stdlib/tx';
|
|
19
17
|
import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
|
|
20
18
|
import type { ValidatorClient } from '@aztec/validator-client';
|
|
21
19
|
import type { GlobalVariableBuilder } from '../global_variable_builder/global_builder.js';
|
|
@@ -130,11 +128,8 @@ export declare class Sequencer {
|
|
|
130
128
|
/**
|
|
131
129
|
* Build a block
|
|
132
130
|
*
|
|
133
|
-
* Shared between the sequencer and the validator for re-execution
|
|
134
|
-
*
|
|
135
131
|
* @param pendingTxs - The pending transactions to construct the block from
|
|
136
132
|
* @param newGlobalVariables - The global variables for the new block
|
|
137
|
-
* @param historicalHeader - The historical header of the parent
|
|
138
133
|
* @param opts - Whether to just validate the block as a validator, as opposed to building it as a proposal
|
|
139
134
|
*/
|
|
140
135
|
protected buildBlock(pendingTxs: Iterable<Tx> | AsyncIterable<Tx>, newGlobalVariables: GlobalVariables, opts?: {
|
|
@@ -147,6 +142,27 @@ export declare class Sequencer {
|
|
|
147
142
|
numTxs: number;
|
|
148
143
|
numFailedTxs: number;
|
|
149
144
|
blockBuildingTimer: Timer;
|
|
145
|
+
usedTxs: Tx[];
|
|
146
|
+
}>;
|
|
147
|
+
/**
|
|
148
|
+
* Build a block from a proposal. Used by the validator to re-execute transactions.
|
|
149
|
+
*
|
|
150
|
+
* @param blockNumber - The block number of the proposal.
|
|
151
|
+
* @param header - The header of the proposal.
|
|
152
|
+
* @param pendingTxs - The pending transactions to construct the block from.
|
|
153
|
+
* @param opts - Whether to just validate the block as a validator, as opposed to building it as a proposal.
|
|
154
|
+
*/
|
|
155
|
+
buildBlockFromProposal(blockNumber: Fr, header: ProposedBlockHeader, pendingTxs: Iterable<Tx> | AsyncIterable<Tx>, opts?: {
|
|
156
|
+
validateOnly?: boolean;
|
|
157
|
+
}): Promise<{
|
|
158
|
+
block: L2Block;
|
|
159
|
+
publicGas: Gas;
|
|
160
|
+
publicProcessorDuration: number;
|
|
161
|
+
numMsgs: number;
|
|
162
|
+
numTxs: number;
|
|
163
|
+
numFailedTxs: number;
|
|
164
|
+
blockBuildingTimer: Timer;
|
|
165
|
+
usedTxs: Tx[];
|
|
150
166
|
}>;
|
|
151
167
|
/**
|
|
152
168
|
* @notice Build and propose a block to the chain
|
|
@@ -158,7 +174,7 @@ export declare class Sequencer {
|
|
|
158
174
|
* @param proposalHeader - The partial header constructed for the proposal
|
|
159
175
|
*/
|
|
160
176
|
private buildBlockAndEnqueuePublish;
|
|
161
|
-
protected collectAttestations(block: L2Block,
|
|
177
|
+
protected collectAttestations(block: L2Block, txs: Tx[]): Promise<Signature[] | undefined>;
|
|
162
178
|
/**
|
|
163
179
|
* Publishes the L2Block to the rollup contract.
|
|
164
180
|
* @param block - The L2Block to be published.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/sequencer/sequencer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,iBAAiB,CAAC;AAI3D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,EAAE,EAAE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E,eAAe,EACnC,IAAI,GAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAO;;;;;;;;;;IAwIvC;;;;;;;OAOG;IACG,sBAAsB,CAC1B,WAAW,EAAE,EAAE,EACf,MAAM,EAAE,mBAAmB,EAC3B,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,EAAE,CAAC,EAC5C,IAAI,GAAE;QAAE,YAAY,CAAC,EAAE,OAAO,CAAA;KAAO;;;;;;;;;;IAavC;;;;;;;;OAQG;YAIW,2BAA2B;cAkEzB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC;IAqDhG;;;OAGG;cAIa,qBAAqB,CACnC,KAAK,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,SAAS,EAAE,EAC1B,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,IAAI,CAAC;IAiBhB;;;;OAIG;cACa,WAAW,IAAI,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,EAAE,CAAA;KAAE,GAAG,SAAS,CAAC;IA+CxF,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,kBAAkB;IAK1B,IAAI,iBAAiB,WAEpB;IAED,IAAI,QAAQ,IAAI,UAAU,CAEzB;IAED,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;CACF"}
|
|
@@ -17,8 +17,8 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
17
17
|
import { Gas } from '@aztec/stdlib/gas';
|
|
18
18
|
import { SequencerConfigSchema } from '@aztec/stdlib/interfaces/server';
|
|
19
19
|
import { pickFromSchema } from '@aztec/stdlib/schemas';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
20
|
+
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
21
|
+
import { ContentCommitment, GlobalVariables, ProposedBlockHeader, Tx } from '@aztec/stdlib/tx';
|
|
22
22
|
import { Attributes, L1Metrics, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
23
23
|
import { VoteType } from '../publisher/sequencer-publisher.js';
|
|
24
24
|
import { createValidatorForBlockBuilding } from '../tx_validator/tx_validator_factory.js';
|
|
@@ -95,12 +95,12 @@ export { SequencerState };
|
|
|
95
95
|
this.maxBlockGas = new Gas(100e9, 100e9);
|
|
96
96
|
this.isFlushing = false;
|
|
97
97
|
this.enforceTimeTable = false;
|
|
98
|
-
this.metrics = new SequencerMetrics(telemetry, ()=>this.state, this.
|
|
98
|
+
this.metrics = new SequencerMetrics(telemetry, ()=>this.state, this.config.coinbase ?? this.publisher.getSenderAddress(), this.publisher.getRollupContract(), 'Sequencer');
|
|
99
99
|
this.l1Metrics = new L1Metrics(telemetry.getMeter('SequencerL1Metrics'), publisher.l1TxUtils.client, [
|
|
100
100
|
publisher.getSenderAddress()
|
|
101
101
|
]);
|
|
102
102
|
// Register the block builder with the validator client for re-execution
|
|
103
|
-
this.validatorClient?.registerBlockBuilder(this.
|
|
103
|
+
this.validatorClient?.registerBlockBuilder(this.buildBlockFromProposal.bind(this));
|
|
104
104
|
// Register the slasher on the publisher to fetch slashing payloads
|
|
105
105
|
this.publisher.registerSlashPayloadGetter(this.slasherClient.getSlashPayload.bind(this.slasherClient));
|
|
106
106
|
}
|
|
@@ -132,6 +132,7 @@ export { SequencerState };
|
|
|
132
132
|
}
|
|
133
133
|
if (config.coinbase) {
|
|
134
134
|
this._coinbase = config.coinbase;
|
|
135
|
+
this.metrics.setCoinbase(this._coinbase);
|
|
135
136
|
}
|
|
136
137
|
if (config.feeRecipient) {
|
|
137
138
|
this._feeRecipient = config.feeRecipient;
|
|
@@ -242,14 +243,20 @@ export { SequencerState };
|
|
|
242
243
|
slot
|
|
243
244
|
});
|
|
244
245
|
// If I created a "partial" header here that should make our job much easier.
|
|
245
|
-
const proposalHeader =
|
|
246
|
+
const proposalHeader = ProposedBlockHeader.from({
|
|
247
|
+
...newGlobalVariables,
|
|
248
|
+
timestamp: newGlobalVariables.timestamp.toBigInt(),
|
|
249
|
+
lastArchiveRoot: chainTipArchive,
|
|
250
|
+
contentCommitment: ContentCommitment.empty(),
|
|
251
|
+
totalManaUsed: Fr.ZERO
|
|
252
|
+
});
|
|
246
253
|
let finishedFlushing = false;
|
|
247
254
|
const pendingTxCount = await this.p2pClient.getPendingTxCount();
|
|
248
255
|
if (pendingTxCount >= this.minTxsPerBlock || this.isFlushing) {
|
|
249
256
|
// We don't fetch exactly maxTxsPerBlock txs here because we may not need all of them if we hit a limit before,
|
|
250
257
|
// and also we may need to fetch more if we don't have enough valid txs.
|
|
251
258
|
const pendingTxs = this.p2pClient.iteratePendingTxs();
|
|
252
|
-
await this.buildBlockAndEnqueuePublish(pendingTxs, proposalHeader).catch((err)=>{
|
|
259
|
+
await this.buildBlockAndEnqueuePublish(pendingTxs, proposalHeader, newGlobalVariables).catch((err)=>{
|
|
253
260
|
this.log.error(`Error building/enqueuing block`, err, {
|
|
254
261
|
blockNumber: newBlockNumber,
|
|
255
262
|
slot
|
|
@@ -343,11 +350,8 @@ export { SequencerState };
|
|
|
343
350
|
/**
|
|
344
351
|
* Build a block
|
|
345
352
|
*
|
|
346
|
-
* Shared between the sequencer and the validator for re-execution
|
|
347
|
-
*
|
|
348
353
|
* @param pendingTxs - The pending transactions to construct the block from
|
|
349
354
|
* @param newGlobalVariables - The global variables for the new block
|
|
350
|
-
* @param historicalHeader - The historical header of the parent
|
|
351
355
|
* @param opts - Whether to just validate the block as a validator, as opposed to building it as a proposal
|
|
352
356
|
*/ async buildBlock(pendingTxs, newGlobalVariables, opts = {}) {
|
|
353
357
|
const blockNumber = newGlobalVariables.blockNumber.toNumber();
|
|
@@ -401,7 +405,7 @@ export { SequencerState };
|
|
|
401
405
|
deadline,
|
|
402
406
|
...proposerLimits
|
|
403
407
|
};
|
|
404
|
-
const [publicProcessorDuration, [processedTxs, failedTxs]] = await elapsed(()=>processor.process(pendingTxs, limits, validator));
|
|
408
|
+
const [publicProcessorDuration, [processedTxs, failedTxs, usedTxs]] = await elapsed(()=>processor.process(pendingTxs, limits, validator));
|
|
405
409
|
if (!opts.validateOnly && failedTxs.length > 0) {
|
|
406
410
|
const failedTxData = failedTxs.map((fail)=>fail.tx);
|
|
407
411
|
const failedTxHashes = await Tx.getHashes(failedTxData);
|
|
@@ -434,7 +438,8 @@ export { SequencerState };
|
|
|
434
438
|
numMsgs: l1ToL2Messages.length,
|
|
435
439
|
numTxs: processedTxs.length,
|
|
436
440
|
numFailedTxs: failedTxs.length,
|
|
437
|
-
blockBuildingTimer
|
|
441
|
+
blockBuildingTimer,
|
|
442
|
+
usedTxs
|
|
438
443
|
};
|
|
439
444
|
} finally{
|
|
440
445
|
// We create a fresh processor each time to reset any cached state (eg storage writes)
|
|
@@ -453,6 +458,24 @@ export { SequencerState };
|
|
|
453
458
|
}
|
|
454
459
|
}
|
|
455
460
|
/**
|
|
461
|
+
* Build a block from a proposal. Used by the validator to re-execute transactions.
|
|
462
|
+
*
|
|
463
|
+
* @param blockNumber - The block number of the proposal.
|
|
464
|
+
* @param header - The header of the proposal.
|
|
465
|
+
* @param pendingTxs - The pending transactions to construct the block from.
|
|
466
|
+
* @param opts - Whether to just validate the block as a validator, as opposed to building it as a proposal.
|
|
467
|
+
*/ async buildBlockFromProposal(blockNumber, header, pendingTxs, opts = {}) {
|
|
468
|
+
const { chainId, version } = await this.globalsBuilder.getGlobalConstantVariables();
|
|
469
|
+
const globalVariables = GlobalVariables.from({
|
|
470
|
+
...header,
|
|
471
|
+
blockNumber,
|
|
472
|
+
timestamp: new Fr(header.timestamp),
|
|
473
|
+
chainId,
|
|
474
|
+
version
|
|
475
|
+
});
|
|
476
|
+
return await this.buildBlock(pendingTxs, globalVariables, opts);
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
456
479
|
* @notice Build and propose a block to the chain
|
|
457
480
|
*
|
|
458
481
|
* @dev MUST throw instead of exiting early to ensure that world-state
|
|
@@ -460,21 +483,20 @@ export { SequencerState };
|
|
|
460
483
|
*
|
|
461
484
|
* @param pendingTxs - Iterable of pending transactions to construct the block from
|
|
462
485
|
* @param proposalHeader - The partial header constructed for the proposal
|
|
463
|
-
*/ async buildBlockAndEnqueuePublish(pendingTxs, proposalHeader) {
|
|
486
|
+
*/ async buildBlockAndEnqueuePublish(pendingTxs, proposalHeader, newGlobalVariables) {
|
|
464
487
|
await this.publisher.validateBlockForSubmission(proposalHeader);
|
|
465
|
-
const newGlobalVariables = proposalHeader.globalVariables;
|
|
466
488
|
const blockNumber = newGlobalVariables.blockNumber.toNumber();
|
|
467
|
-
const slot =
|
|
489
|
+
const slot = proposalHeader.slotNumber.toBigInt();
|
|
468
490
|
// this.metrics.recordNewBlock(blockNumber, validTxs.length);
|
|
469
491
|
const workTimer = new Timer();
|
|
470
492
|
this.setState(SequencerState.CREATING_BLOCK, slot);
|
|
471
493
|
try {
|
|
472
494
|
const buildBlockRes = await this.buildBlock(pendingTxs, newGlobalVariables);
|
|
473
|
-
const { publicGas, block, publicProcessorDuration, numTxs, numMsgs, blockBuildingTimer } = buildBlockRes;
|
|
495
|
+
const { publicGas, block, publicProcessorDuration, numTxs, numMsgs, blockBuildingTimer, usedTxs } = buildBlockRes;
|
|
474
496
|
this.metrics.recordBuiltBlock(workTimer.ms(), publicGas.l2Gas);
|
|
475
497
|
// TODO(@PhilWindle) We should probably periodically check for things like another
|
|
476
498
|
// block being published before ours instead of just waiting on our block
|
|
477
|
-
await this.publisher.validateBlockForSubmission(block.header);
|
|
499
|
+
await this.publisher.validateBlockForSubmission(block.header.toPropose());
|
|
478
500
|
const blockStats = {
|
|
479
501
|
eventName: 'l2-block-built',
|
|
480
502
|
creator: this.publisher.getSenderAddress().toString(),
|
|
@@ -493,7 +515,7 @@ export { SequencerState };
|
|
|
493
515
|
});
|
|
494
516
|
this.log.debug('Collecting attestations');
|
|
495
517
|
const stopCollectingAttestationsTimer = this.metrics.startCollectingAttestationsTimer();
|
|
496
|
-
const attestations = await this.collectAttestations(block,
|
|
518
|
+
const attestations = await this.collectAttestations(block, usedTxs);
|
|
497
519
|
if (attestations !== undefined) {
|
|
498
520
|
this.log.verbose(`Collected ${attestations.length} attestations`, {
|
|
499
521
|
blockHash,
|
|
@@ -507,7 +529,7 @@ export { SequencerState };
|
|
|
507
529
|
throw err;
|
|
508
530
|
}
|
|
509
531
|
}
|
|
510
|
-
async collectAttestations(block,
|
|
532
|
+
async collectAttestations(block, txs) {
|
|
511
533
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/7962): inefficient to have a round trip in here - this should be cached
|
|
512
534
|
const committee = await this.publisher.getCurrentEpochCommittee();
|
|
513
535
|
if (committee.length === 0) {
|
|
@@ -525,13 +547,16 @@ export { SequencerState };
|
|
|
525
547
|
const slotNumber = block.header.globalVariables.slotNumber.toBigInt();
|
|
526
548
|
this.setState(SequencerState.COLLECTING_ATTESTATIONS, slotNumber);
|
|
527
549
|
this.log.debug('Creating block proposal for validators');
|
|
528
|
-
const
|
|
550
|
+
const blockProposalOptions = {
|
|
551
|
+
publishFullTxs: !!this.config.publishTxsWithProposals
|
|
552
|
+
};
|
|
553
|
+
const proposal = await this.validatorClient.createBlockProposal(block.header.globalVariables.blockNumber, block.header.toPropose(), block.archive.root, block.header.state, txs, blockProposalOptions);
|
|
529
554
|
if (!proposal) {
|
|
530
555
|
const msg = `Failed to create block proposal`;
|
|
531
556
|
throw new Error(msg);
|
|
532
557
|
}
|
|
533
558
|
this.log.debug('Broadcasting block proposal to validators');
|
|
534
|
-
this.validatorClient.broadcastBlockProposal(proposal);
|
|
559
|
+
await this.validatorClient.broadcastBlockProposal(proposal);
|
|
535
560
|
const attestationTimeAllowed = this.enforceTimeTable ? this.timetable.getMaxAllowedTime(SequencerState.PUBLISHING_BLOCK) : this.aztecSlotDuration;
|
|
536
561
|
const attestationDeadline = new Date(this.dateProvider.now() + attestationTimeAllowed * 1000);
|
|
537
562
|
const attestations = await this.validatorClient.collectAttestations(proposal, numberOfRequiredAttestations, attestationDeadline);
|
|
@@ -623,8 +648,8 @@ _ts_decorate([
|
|
|
623
648
|
trackSpan('Sequencer.work')
|
|
624
649
|
], Sequencer.prototype, "work", null);
|
|
625
650
|
_ts_decorate([
|
|
626
|
-
trackSpan('Sequencer.buildBlockAndEnqueuePublish', (_validTxs,
|
|
627
|
-
[Attributes.BLOCK_NUMBER]:
|
|
651
|
+
trackSpan('Sequencer.buildBlockAndEnqueuePublish', (_validTxs, _proposalHeader, newGlobalVariables)=>({
|
|
652
|
+
[Attributes.BLOCK_NUMBER]: newGlobalVariables.blockNumber.toNumber()
|
|
628
653
|
}))
|
|
629
654
|
], Sequencer.prototype, "buildBlockAndEnqueuePublish", null);
|
|
630
655
|
_ts_decorate([
|
|
@@ -20,13 +20,13 @@ export declare class SequencerTimetable {
|
|
|
20
20
|
*/
|
|
21
21
|
readonly l1PublishingTime: number;
|
|
22
22
|
/** What's the minimum time we want to leave available for execution and reexecution (used to derive init deadline) */
|
|
23
|
-
readonly minExecutionTime
|
|
23
|
+
readonly minExecutionTime: number;
|
|
24
24
|
/** How long it takes to get ready to start building */
|
|
25
|
-
readonly blockPrepareTime
|
|
25
|
+
readonly blockPrepareTime: number;
|
|
26
26
|
/** How long it takes to for proposals and attestations to travel across the p2p layer (one-way) */
|
|
27
|
-
readonly attestationPropagationTime
|
|
27
|
+
readonly attestationPropagationTime: number;
|
|
28
28
|
/** How much time we spend validating and processing a block after building it, and assembling the proposal to send to attestors */
|
|
29
|
-
readonly blockValidationTime
|
|
29
|
+
readonly blockValidationTime: number;
|
|
30
30
|
constructor(ethereumSlotDuration: number, aztecSlotDuration: number, maxL1TxInclusionTimeIntoSlot: number, enforce?: boolean, metrics?: SequencerMetrics | undefined, log?: import("@aztec/aztec.js").Logger);
|
|
31
31
|
private get afterBlockBuildingTimeNeededWithoutReexec();
|
|
32
32
|
getBlockProposalExecTimeEnd(secondsIntoSlot: number): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timetable.d.ts","sourceRoot":"","sources":["../../src/sequencer/timetable.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"timetable.d.ts","sourceRoot":"","sources":["../../src/sequencer/timetable.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAO5C,qBAAa,kBAAkB;IA4B3B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,4BAA4B;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAhCtB;;;;OAIG;IACH,SAAgB,kBAAkB,EAAE,MAAM,CAAC;IAE3C;;;;OAIG;IACH,SAAgB,gBAAgB,SAAC;IAEjC,sHAAsH;IACtH,SAAgB,gBAAgB,EAAE,MAAM,CAAsB;IAE9D,uDAAuD;IACvD,SAAgB,gBAAgB,EAAE,MAAM,CAAsB;IAE9D,mGAAmG;IACnG,SAAgB,0BAA0B,EAAE,MAAM,CAAgC;IAElF,mIAAmI;IACnI,SAAgB,mBAAmB,EAAE,MAAM,CAAyB;gBAGjD,oBAAoB,EAAE,MAAM,EAC5B,iBAAiB,EAAE,MAAM,EACzB,4BAA4B,EAAE,MAAM,EACpC,OAAO,GAAE,OAAc,EACvB,OAAO,CAAC,EAAE,gBAAgB,YAAA,EAC1B,GAAG,mCAAsC;IA0B5D,OAAO,KAAK,yCAAyC,GAEpD;IAEM,2BAA2B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;IAenE,OAAO,KAAK,0BAA0B,GAErC;IAEM,yBAAyB,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM;IAU3D,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS;IAsB5D,cAAc,CAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM;CAkBxE;AAED,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,aAAa,EAAE,cAAc;aAC7B,cAAc,EAAE,MAAM;aACtB,WAAW,EAAE,MAAM;gBAFnB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM;CAOtC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { createLogger } from '@aztec/aztec.js';
|
|
2
2
|
import { SequencerState } from './utils.js';
|
|
3
|
+
const MIN_EXECUTION_TIME = 1;
|
|
4
|
+
const BLOCK_PREPARE_TIME = 1;
|
|
5
|
+
const BLOCK_VALIDATION_TIME = 1;
|
|
6
|
+
const ATTESTATION_PROPAGATION_TIME = 2;
|
|
3
7
|
export class SequencerTimetable {
|
|
4
8
|
ethereumSlotDuration;
|
|
5
9
|
aztecSlotDuration;
|
|
@@ -28,11 +32,17 @@ export class SequencerTimetable {
|
|
|
28
32
|
this.enforce = enforce;
|
|
29
33
|
this.metrics = metrics;
|
|
30
34
|
this.log = log;
|
|
31
|
-
this.minExecutionTime =
|
|
32
|
-
this.blockPrepareTime =
|
|
33
|
-
this.attestationPropagationTime =
|
|
34
|
-
this.blockValidationTime =
|
|
35
|
+
this.minExecutionTime = MIN_EXECUTION_TIME;
|
|
36
|
+
this.blockPrepareTime = BLOCK_PREPARE_TIME;
|
|
37
|
+
this.attestationPropagationTime = ATTESTATION_PROPAGATION_TIME;
|
|
38
|
+
this.blockValidationTime = BLOCK_VALIDATION_TIME;
|
|
35
39
|
this.l1PublishingTime = this.ethereumSlotDuration - this.maxL1TxInclusionTimeIntoSlot;
|
|
40
|
+
// Assume zero-cost propagation time and faster runs in test environments where L1 slot duration is shortened
|
|
41
|
+
if (this.ethereumSlotDuration < 8) {
|
|
42
|
+
this.attestationPropagationTime = 0;
|
|
43
|
+
this.blockValidationTime = 0.5;
|
|
44
|
+
this.blockPrepareTime = 0.5;
|
|
45
|
+
}
|
|
36
46
|
const allWorkToDo = this.blockPrepareTime + this.minExecutionTime * 2 + this.attestationPropagationTime * 2 + this.blockValidationTime + this.l1PublishingTime;
|
|
37
47
|
const initializeDeadline = this.aztecSlotDuration - allWorkToDo;
|
|
38
48
|
if (initializeDeadline <= 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/slasher/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/slasher/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,eAAO,MAAM,mBAAmB,GAC9B,SAAS,aAAa,GAAG,iBAAiB,GAAG,cAAc,EAC3D,eAAe,yBAAyB,EACxC,YAAW,eAAsC,kBAIlD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nullifier_cache.d.ts","sourceRoot":"","sources":["../../src/tx_validator/nullifier_cache.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nullifier_cache.d.ts","sourceRoot":"","sources":["../../src/tx_validator/nullifier_cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;;GAGG;AACH,qBAAa,cAAe,YAAW,eAAe;IAGxC,OAAO,CAAC,EAAE;IAFtB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;gBAEJ,EAAE,EAAE,wBAAwB;IAInC,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAS/D,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE;CAK1C"}
|