@aztec/sequencer-client 0.0.1-commit.3469e52 → 0.0.1-commit.54489865
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/client/sequencer-client.js +1 -1
- package/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +1 -3
- package/dest/global_variable_builder/global_builder.js +2 -2
- package/dest/publisher/sequencer-publisher-metrics.d.ts +1 -1
- package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-metrics.js +12 -4
- package/dest/sequencer/checkpoint_proposal_job.d.ts +4 -4
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +17 -7
- package/dest/sequencer/metrics.d.ts +2 -2
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +27 -17
- package/dest/sequencer/sequencer.d.ts +3 -3
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +2 -2
- package/dest/test/mock_checkpoint_builder.d.ts +11 -8
- package/dest/test/mock_checkpoint_builder.d.ts.map +1 -1
- package/dest/test/mock_checkpoint_builder.js +18 -4
- package/dest/test/utils.d.ts +8 -8
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +5 -5
- package/package.json +28 -28
- package/src/client/sequencer-client.ts +1 -1
- package/src/config.ts +1 -3
- package/src/global_variable_builder/global_builder.ts +2 -2
- package/src/publisher/sequencer-publisher-metrics.ts +7 -3
- package/src/sequencer/checkpoint_proposal_job.ts +24 -15
- package/src/sequencer/metrics.ts +36 -18
- package/src/sequencer/sequencer.ts +4 -4
- package/src/test/mock_checkpoint_builder.ts +33 -17
- package/src/test/utils.ts +17 -11
|
@@ -16,6 +16,7 @@ import { makeAppendOnlyTreeSnapshot } from '@aztec/stdlib/testing';
|
|
|
16
16
|
blockIndex;
|
|
17
17
|
/** Optional function to dynamically provide the block (alternative to seedBlocks) */ blockProvider;
|
|
18
18
|
/** Track calls for assertions */ buildBlockCalls;
|
|
19
|
+
/** Track all consumed transaction hashes across buildBlock calls */ consumedTxHashes;
|
|
19
20
|
completeCheckpointCalled;
|
|
20
21
|
getCheckpointCalled;
|
|
21
22
|
/** Set to an error to make buildBlock throw on next call */ errorOnBuild;
|
|
@@ -28,6 +29,7 @@ import { makeAppendOnlyTreeSnapshot } from '@aztec/stdlib/testing';
|
|
|
28
29
|
this.blockIndex = 0;
|
|
29
30
|
this.blockProvider = undefined;
|
|
30
31
|
this.buildBlockCalls = [];
|
|
32
|
+
this.consumedTxHashes = new Set();
|
|
31
33
|
this.completeCheckpointCalled = false;
|
|
32
34
|
this.getCheckpointCalled = false;
|
|
33
35
|
this.errorOnBuild = undefined;
|
|
@@ -50,14 +52,14 @@ import { makeAppendOnlyTreeSnapshot } from '@aztec/stdlib/testing';
|
|
|
50
52
|
getConstantData() {
|
|
51
53
|
return this.constants;
|
|
52
54
|
}
|
|
53
|
-
buildBlock(
|
|
55
|
+
async buildBlock(pendingTxs, blockNumber, timestamp, opts) {
|
|
54
56
|
this.buildBlockCalls.push({
|
|
55
57
|
blockNumber,
|
|
56
58
|
timestamp,
|
|
57
59
|
opts
|
|
58
60
|
});
|
|
59
61
|
if (this.errorOnBuild) {
|
|
60
|
-
|
|
62
|
+
throw this.errorOnBuild;
|
|
61
63
|
}
|
|
62
64
|
let block;
|
|
63
65
|
let usedTxs;
|
|
@@ -73,7 +75,18 @@ import { makeAppendOnlyTreeSnapshot } from '@aztec/stdlib/testing';
|
|
|
73
75
|
this.blockIndex++;
|
|
74
76
|
this.builtBlocks.push(block);
|
|
75
77
|
}
|
|
76
|
-
|
|
78
|
+
// Check that no pending tx has already been consumed
|
|
79
|
+
for await (const tx of pendingTxs){
|
|
80
|
+
const hash = tx.getTxHash().toString();
|
|
81
|
+
if (this.consumedTxHashes.has(hash)) {
|
|
82
|
+
throw new Error(`Transaction ${hash} was already consumed in a previous block`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// Add used txs to consumed set
|
|
86
|
+
for (const tx of usedTxs){
|
|
87
|
+
this.consumedTxHashes.add(tx.getTxHash().toString());
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
77
90
|
block,
|
|
78
91
|
publicGas: Gas.empty(),
|
|
79
92
|
publicProcessorDuration: 0,
|
|
@@ -82,7 +95,7 @@ import { makeAppendOnlyTreeSnapshot } from '@aztec/stdlib/testing';
|
|
|
82
95
|
usedTxs,
|
|
83
96
|
failedTxs: [],
|
|
84
97
|
usedTxBlobFields: block?.body?.txEffects?.reduce((sum, tx)=>sum + tx.getNumBlobFields(), 0) ?? 0
|
|
85
|
-
}
|
|
98
|
+
};
|
|
86
99
|
}
|
|
87
100
|
completeCheckpoint() {
|
|
88
101
|
this.completeCheckpointCalled = true;
|
|
@@ -126,6 +139,7 @@ import { makeAppendOnlyTreeSnapshot } from '@aztec/stdlib/testing';
|
|
|
126
139
|
this.usedTxsPerBlock = [];
|
|
127
140
|
this.blockIndex = 0;
|
|
128
141
|
this.buildBlockCalls = [];
|
|
142
|
+
this.consumedTxHashes.clear();
|
|
129
143
|
this.completeCheckpointCalled = false;
|
|
130
144
|
this.getCheckpointCalled = false;
|
|
131
145
|
this.errorOnBuild = undefined;
|
package/dest/test/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
5
5
|
import type { P2P } from '@aztec/p2p';
|
|
6
|
-
import { CommitteeAttestation,
|
|
6
|
+
import { CommitteeAttestation, L2Block } from '@aztec/stdlib/block';
|
|
7
7
|
import { BlockProposal, CheckpointAttestation, CheckpointProposal } from '@aztec/stdlib/p2p';
|
|
8
8
|
import { GlobalVariables, type Tx } from '@aztec/stdlib/tx';
|
|
9
9
|
import type { MockProxy } from 'jest-mock-extended';
|
|
@@ -13,9 +13,9 @@ export { MockCheckpointBuilder, MockCheckpointsBuilder } from './mock_checkpoint
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function makeTx(seed?: number, chainId?: Fr): Promise<Tx>;
|
|
15
15
|
/**
|
|
16
|
-
* Creates an
|
|
16
|
+
* Creates an L2Block from transactions and global variables
|
|
17
17
|
*/
|
|
18
|
-
export declare function makeBlock(txs: Tx[], globalVariables: GlobalVariables): Promise<
|
|
18
|
+
export declare function makeBlock(txs: Tx[], globalVariables: GlobalVariables): Promise<L2Block>;
|
|
19
19
|
/**
|
|
20
20
|
* Mocks the P2P client to return specific pending transactions
|
|
21
21
|
*/
|
|
@@ -31,23 +31,23 @@ export declare function createMockSignatures(signer: Secp256k1Signer): Committee
|
|
|
31
31
|
/**
|
|
32
32
|
* Creates a block proposal from a block and signature
|
|
33
33
|
*/
|
|
34
|
-
export declare function createBlockProposal(block:
|
|
34
|
+
export declare function createBlockProposal(block: L2Block, signature: Signature): BlockProposal;
|
|
35
35
|
/**
|
|
36
36
|
* Creates a checkpoint proposal from a block and signature
|
|
37
37
|
*/
|
|
38
|
-
export declare function createCheckpointProposal(block:
|
|
38
|
+
export declare function createCheckpointProposal(block: L2Block, checkpointSignature: Signature, blockSignature?: Signature): CheckpointProposal;
|
|
39
39
|
/**
|
|
40
40
|
* Creates a checkpoint attestation from a block and signature.
|
|
41
41
|
* Note: We manually set the sender since we use random signatures in tests.
|
|
42
42
|
* In production, the sender is recovered from the signature.
|
|
43
43
|
*/
|
|
44
|
-
export declare function createCheckpointAttestation(block:
|
|
44
|
+
export declare function createCheckpointAttestation(block: L2Block, signature: Signature, sender: EthAddress): CheckpointAttestation;
|
|
45
45
|
/**
|
|
46
46
|
* Creates transactions and a block, and mocks P2P to return them.
|
|
47
47
|
* Helper for tests that need to set up a block with transactions.
|
|
48
48
|
*/
|
|
49
49
|
export declare function setupTxsAndBlock(p2p: MockProxy<P2P>, globalVariables: GlobalVariables, txCount: number, chainId: Fr): Promise<{
|
|
50
50
|
txs: Tx[];
|
|
51
|
-
block:
|
|
51
|
+
block: L2Block;
|
|
52
52
|
}>;
|
|
53
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0L3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUdBLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSwyQ0FBMkMsQ0FBQztBQUM1RSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDaEUsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzVELE9BQU8sS0FBSyxFQUFFLEdBQUcsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUV0QyxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsT0FBTyxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDcEUsT0FBTyxFQUFFLGFBQWEsRUFBRSxxQkFBcUIsRUFBRSxrQkFBa0IsRUFBb0IsTUFBTSxtQkFBbUIsQ0FBQztBQUcvRyxPQUFPLEVBQWUsZUFBZSxFQUFFLEtBQUssRUFBRSxFQUFvQyxNQUFNLGtCQUFrQixDQUFDO0FBRTNHLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBR3BELE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxzQkFBc0IsRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBRTdGOztHQUVHO0FBQ0gsd0JBQXNCLE1BQU0sQ0FBQyxJQUFJLENBQUMsRUFBRSxNQUFNLEVBQUUsT0FBTyxDQUFDLEVBQUUsRUFBRSxHQUFHLE9BQU8sQ0FBQyxFQUFFLENBQUMsQ0FNckU7QUFFRDs7R0FFRztBQUNILHdCQUFzQixTQUFTLENBQUMsR0FBRyxFQUFFLEVBQUUsRUFBRSxFQUFFLGVBQWUsRUFBRSxlQUFlLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQWdCN0Y7QUFFRDs7R0FFRztBQUNILHdCQUFnQixjQUFjLENBQUMsR0FBRyxFQUFFLFNBQVMsQ0FBQyxHQUFHLENBQUMsRUFBRSxHQUFHLEVBQUUsRUFBRSxFQUFFLEdBQUcsSUFBSSxDQUduRTtBQUVEOztHQUVHO0FBQ0gsd0JBQXVCLGNBQWMsQ0FBQyxHQUFHLEVBQUUsT0FBTyxDQUFDLEVBQUUsRUFBRSxDQUFDLEdBQUcscUJBQXFCLENBQUMsRUFBRSxDQUFDLENBSW5GO0FBRUQ7O0dBRUc7QUFDSCx3QkFBZ0Isb0JBQW9CLENBQUMsTUFBTSxFQUFFLGVBQWUsR0FBRyxvQkFBb0IsRUFBRSxDQUdwRjtBQXVCRDs7R0FFRztBQUNILHdCQUFnQixtQkFBbUIsQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLFNBQVMsRUFBRSxTQUFTLEdBQUcsYUFBYSxDQVV2RjtBQUVEOztHQUVHO0FBQ0gsd0JBQWdCLHdCQUF3QixDQUN0QyxLQUFLLEVBQUUsT0FBTyxFQUNkLG1CQUFtQixFQUFFLFNBQVMsRUFDOUIsY0FBYyxDQUFDLEVBQUUsU0FBUyxHQUN6QixrQkFBa0IsQ0FTcEI7QUFFRDs7OztHQUlHO0FBQ0gsd0JBQWdCLDJCQUEyQixDQUN6QyxLQUFLLEVBQUUsT0FBTyxFQUNkLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLE1BQU0sRUFBRSxVQUFVLEdBQ2pCLHFCQUFxQixDQU92QjtBQUVEOzs7R0FHRztBQUNILHdCQUFzQixnQkFBZ0IsQ0FDcEMsR0FBRyxFQUFFLFNBQVMsQ0FBQyxHQUFHLENBQUMsRUFDbkIsZUFBZSxFQUFFLGVBQWUsRUFDaEMsT0FBTyxFQUFFLE1BQU0sRUFDZixPQUFPLEVBQUUsRUFBRSxHQUNWLE9BQU8sQ0FBQztJQUFFLEdBQUcsRUFBRSxFQUFFLEVBQUUsQ0FBQztJQUFDLEtBQUssRUFBRSxPQUFPLENBQUE7Q0FBRSxDQUFDLENBS3hDIn0=
|
package/dest/test/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAoB,MAAM,mBAAmB,CAAC;AAG/G,OAAO,EAAe,eAAe,EAAE,KAAK,EAAE,EAAoC,MAAM,kBAAkB,CAAC;AAE3G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAE7F;;GAEG;AACH,wBAAsB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAMrE;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAgB7F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,IAAI,CAGnE;AAED;;GAEG;AACH,wBAAuB,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,qBAAqB,CAAC,EAAE,CAAC,CAInF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,oBAAoB,EAAE,CAGpF;AAuBD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,aAAa,CAUvF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,OAAO,EACd,mBAAmB,EAAE,SAAS,EAC9B,cAAc,CAAC,EAAE,SAAS,GACzB,kBAAkB,CASpB;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,UAAU,GACjB,qBAAqB,CAOvB;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,EACnB,eAAe,EAAE,eAAe,EAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,EAAE,GACV,OAAO,CAAC;IAAE,GAAG,EAAE,EAAE,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAKxC"}
|
package/dest/test/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ import { times } from '@aztec/foundation/collection';
|
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
6
6
|
import { PublicDataWrite } from '@aztec/stdlib/avm';
|
|
7
|
-
import { CommitteeAttestation,
|
|
7
|
+
import { CommitteeAttestation, L2Block } from '@aztec/stdlib/block';
|
|
8
8
|
import { BlockProposal, CheckpointAttestation, CheckpointProposal, ConsensusPayload } from '@aztec/stdlib/p2p';
|
|
9
9
|
import { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
10
10
|
import { makeAppendOnlyTreeSnapshot, mockTxForRollup } from '@aztec/stdlib/testing';
|
|
@@ -21,7 +21,7 @@ export { MockCheckpointBuilder, MockCheckpointsBuilder } from './mock_checkpoint
|
|
|
21
21
|
return tx;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Creates an
|
|
24
|
+
* Creates an L2Block from transactions and global variables
|
|
25
25
|
*/ export async function makeBlock(txs, globalVariables) {
|
|
26
26
|
const processedTxs = await Promise.all(txs.map((tx)=>makeProcessedTxFromPrivateOnlyTx(tx, Fr.ZERO, new PublicDataWrite(Fr.random(), Fr.random()), globalVariables)));
|
|
27
27
|
const body = new Body(processedTxs.map((tx)=>tx.txEffect));
|
|
@@ -29,7 +29,7 @@ export { MockCheckpointBuilder, MockCheckpointsBuilder } from './mock_checkpoint
|
|
|
29
29
|
globalVariables
|
|
30
30
|
});
|
|
31
31
|
const archive = makeAppendOnlyTreeSnapshot(globalVariables.blockNumber + 1);
|
|
32
|
-
return new
|
|
32
|
+
return new L2Block(archive, header, body, CheckpointNumber.fromBlockNumber(globalVariables.blockNumber), IndexWithinCheckpoint(0));
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Mocks the P2P client to return specific pending transactions
|
|
@@ -53,8 +53,8 @@ export { MockCheckpointBuilder, MockCheckpointsBuilder } from './mock_checkpoint
|
|
|
53
53
|
];
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* Creates a CheckpointHeader from an
|
|
57
|
-
* Uses mock values for blockHeadersHash, blobsHash and inHash since
|
|
56
|
+
* Creates a CheckpointHeader from an L2Block for testing purposes.
|
|
57
|
+
* Uses mock values for blockHeadersHash, blobsHash and inHash since L2Block doesn't have these fields.
|
|
58
58
|
*/ function createCheckpointHeaderFromBlock(block) {
|
|
59
59
|
const gv = block.header.globalVariables;
|
|
60
60
|
return new CheckpointHeader(block.header.lastArchive.root, Fr.random(), Fr.random(), Fr.random(), Fr.random(), gv.slotNumber, gv.timestamp, gv.coinbase, gv.feeRecipient, gv.gasFees, block.header.totalManaUsed);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/sequencer-client",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.54489865",
|
|
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": "0.0.1-commit.
|
|
30
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
31
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
32
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
33
|
-
"@aztec/constants": "0.0.1-commit.
|
|
34
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
35
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
36
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
37
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
38
|
-
"@aztec/merkle-tree": "0.0.1-commit.
|
|
39
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
40
|
-
"@aztec/noir-acvm_js": "0.0.1-commit.
|
|
41
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
42
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
43
|
-
"@aztec/noir-types": "0.0.1-commit.
|
|
44
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
45
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
46
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
47
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
48
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
49
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
50
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
51
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
52
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.
|
|
53
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
29
|
+
"@aztec/aztec.js": "0.0.1-commit.54489865",
|
|
30
|
+
"@aztec/bb-prover": "0.0.1-commit.54489865",
|
|
31
|
+
"@aztec/blob-client": "0.0.1-commit.54489865",
|
|
32
|
+
"@aztec/blob-lib": "0.0.1-commit.54489865",
|
|
33
|
+
"@aztec/constants": "0.0.1-commit.54489865",
|
|
34
|
+
"@aztec/epoch-cache": "0.0.1-commit.54489865",
|
|
35
|
+
"@aztec/ethereum": "0.0.1-commit.54489865",
|
|
36
|
+
"@aztec/foundation": "0.0.1-commit.54489865",
|
|
37
|
+
"@aztec/l1-artifacts": "0.0.1-commit.54489865",
|
|
38
|
+
"@aztec/merkle-tree": "0.0.1-commit.54489865",
|
|
39
|
+
"@aztec/node-keystore": "0.0.1-commit.54489865",
|
|
40
|
+
"@aztec/noir-acvm_js": "0.0.1-commit.54489865",
|
|
41
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.54489865",
|
|
42
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.54489865",
|
|
43
|
+
"@aztec/noir-types": "0.0.1-commit.54489865",
|
|
44
|
+
"@aztec/p2p": "0.0.1-commit.54489865",
|
|
45
|
+
"@aztec/protocol-contracts": "0.0.1-commit.54489865",
|
|
46
|
+
"@aztec/prover-client": "0.0.1-commit.54489865",
|
|
47
|
+
"@aztec/simulator": "0.0.1-commit.54489865",
|
|
48
|
+
"@aztec/slasher": "0.0.1-commit.54489865",
|
|
49
|
+
"@aztec/stdlib": "0.0.1-commit.54489865",
|
|
50
|
+
"@aztec/telemetry-client": "0.0.1-commit.54489865",
|
|
51
|
+
"@aztec/validator-client": "0.0.1-commit.54489865",
|
|
52
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.54489865",
|
|
53
|
+
"@aztec/world-state": "0.0.1-commit.54489865",
|
|
54
54
|
"lodash.chunk": "^4.2.0",
|
|
55
55
|
"tslib": "^2.4.0",
|
|
56
56
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
60
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
59
|
+
"@aztec/archiver": "0.0.1-commit.54489865",
|
|
60
|
+
"@aztec/kv-store": "0.0.1-commit.54489865",
|
|
61
61
|
"@electric-sql/pglite": "^0.3.14",
|
|
62
62
|
"@jest/globals": "^30.0.0",
|
|
63
63
|
"@types/jest": "^30.0.0",
|
|
@@ -85,7 +85,7 @@ export class SequencerClient {
|
|
|
85
85
|
publicClient,
|
|
86
86
|
l1TxUtils.map(x => x.getSenderAddress()),
|
|
87
87
|
);
|
|
88
|
-
const publisherManager = new PublisherManager(l1TxUtils, config);
|
|
88
|
+
const publisherManager = new PublisherManager(l1TxUtils, config, log.getBindings());
|
|
89
89
|
const rollupContract = new RollupContract(publicClient, config.l1Contracts.rollupAddress.toString());
|
|
90
90
|
const [l1GenesisTime, slotDuration, rollupVersion, rollupManaLimit] = await Promise.all([
|
|
91
91
|
rollupContract.getL1GenesisTime(),
|
package/src/config.ts
CHANGED
|
@@ -50,8 +50,7 @@ export const DefaultSequencerConfig: ResolvedSequencerConfig = {
|
|
|
50
50
|
injectFakeAttestation: false,
|
|
51
51
|
fishermanMode: false,
|
|
52
52
|
shuffleAttestationOrdering: false,
|
|
53
|
-
|
|
54
|
-
skipPushProposedBlocksToArchiver: true,
|
|
53
|
+
skipPushProposedBlocksToArchiver: false,
|
|
55
54
|
};
|
|
56
55
|
|
|
57
56
|
/**
|
|
@@ -204,7 +203,6 @@ export const sequencerConfigMappings: ConfigMappingsType<SequencerConfig> = {
|
|
|
204
203
|
description: 'Have sequencer build and publish an empty checkpoint if there are no txs',
|
|
205
204
|
...booleanConfigHelper(DefaultSequencerConfig.buildCheckpointIfEmpty),
|
|
206
205
|
},
|
|
207
|
-
// TODO(palla/mbps): Change default to false once block sync is stable
|
|
208
206
|
skipPushProposedBlocksToArchiver: {
|
|
209
207
|
description: 'Skip pushing proposed blocks to archiver (default: true)',
|
|
210
208
|
...booleanConfigHelper(DefaultSequencerConfig.skipPushProposedBlocksToArchiver),
|
|
@@ -69,9 +69,9 @@ export class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
|
|
|
69
69
|
// we need to fetch the last block written, and estimate the earliest timestamp for the next block.
|
|
70
70
|
// The timestamp of that last block will act as a lower bound for the next block.
|
|
71
71
|
|
|
72
|
-
const
|
|
72
|
+
const lastCheckpoint = await this.rollupContract.getPendingCheckpoint();
|
|
73
73
|
const earliestTimestamp = await this.rollupContract.getTimestampForSlot(
|
|
74
|
-
SlotNumber.fromBigInt(BigInt(
|
|
74
|
+
SlotNumber.fromBigInt(BigInt(lastCheckpoint.slotNumber) + 1n),
|
|
75
75
|
);
|
|
76
76
|
const nextEthTimestamp = BigInt((await this.publicClient.getBlock()).timestamp + BigInt(this.ethereumSlotDuration));
|
|
77
77
|
const timestamp = earliestTimestamp > nextEthTimestamp ? earliestTimestamp : nextEthTimestamp;
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
Metrics,
|
|
8
8
|
type TelemetryClient,
|
|
9
9
|
type UpDownCounter,
|
|
10
|
+
createUpDownCounterWithDefault,
|
|
10
11
|
} from '@aztec/telemetry-client';
|
|
11
12
|
|
|
12
13
|
import { formatEther } from 'viem/utils';
|
|
@@ -41,7 +42,10 @@ export class SequencerPublisherMetrics {
|
|
|
41
42
|
|
|
42
43
|
this.gasPrice = meter.createHistogram(Metrics.L1_PUBLISHER_GAS_PRICE);
|
|
43
44
|
|
|
44
|
-
this.txCount = meter
|
|
45
|
+
this.txCount = createUpDownCounterWithDefault(meter, Metrics.L1_PUBLISHER_TX_COUNT, {
|
|
46
|
+
[Attributes.L1_TX_TYPE]: ['process'],
|
|
47
|
+
[Attributes.OK]: [true, false],
|
|
48
|
+
});
|
|
45
49
|
|
|
46
50
|
this.txDuration = meter.createHistogram(Metrics.L1_PUBLISHER_TX_DURATION);
|
|
47
51
|
|
|
@@ -59,9 +63,9 @@ export class SequencerPublisherMetrics {
|
|
|
59
63
|
|
|
60
64
|
this.blobInclusionBlocksHistogram = meter.createHistogram(Metrics.L1_PUBLISHER_BLOB_INCLUSION_BLOCKS);
|
|
61
65
|
|
|
62
|
-
this.blobTxSuccessCounter = meter
|
|
66
|
+
this.blobTxSuccessCounter = createUpDownCounterWithDefault(meter, Metrics.L1_PUBLISHER_BLOB_TX_SUCCESS);
|
|
63
67
|
|
|
64
|
-
this.blobTxFailureCounter = meter
|
|
68
|
+
this.blobTxFailureCounter = createUpDownCounterWithDefault(meter, Metrics.L1_PUBLISHER_BLOB_TX_FAILURE);
|
|
65
69
|
|
|
66
70
|
this.txTotalFee = meter.createHistogram(Metrics.L1_PUBLISHER_TX_TOTAL_FEE);
|
|
67
71
|
|
|
@@ -7,7 +7,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
7
7
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
8
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
9
9
|
import { filter } from '@aztec/foundation/iterator';
|
|
10
|
-
import type
|
|
10
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
11
11
|
import { sleep, sleepUntil } from '@aztec/foundation/sleep';
|
|
12
12
|
import { type DateProvider, Timer } from '@aztec/foundation/timer';
|
|
13
13
|
import { type TypedEventEmitter, unfreeze } from '@aztec/foundation/types';
|
|
@@ -16,7 +16,7 @@ import type { SlasherClientInterface } from '@aztec/slasher';
|
|
|
16
16
|
import {
|
|
17
17
|
CommitteeAttestation,
|
|
18
18
|
CommitteeAttestationsAndSigners,
|
|
19
|
-
|
|
19
|
+
L2Block,
|
|
20
20
|
type L2BlockSink,
|
|
21
21
|
type L2BlockSource,
|
|
22
22
|
MaliciousCommitteeAttestationsAndSigners,
|
|
@@ -59,6 +59,8 @@ const TXS_POLLING_MS = 500;
|
|
|
59
59
|
* the Sequencer once the check for being the proposer for the slot has succeeded.
|
|
60
60
|
*/
|
|
61
61
|
export class CheckpointProposalJob implements Traceable {
|
|
62
|
+
protected readonly log: Logger;
|
|
63
|
+
|
|
62
64
|
constructor(
|
|
63
65
|
private readonly epoch: EpochNumber,
|
|
64
66
|
private readonly slot: SlotNumber,
|
|
@@ -86,9 +88,11 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
86
88
|
private readonly metrics: SequencerMetrics,
|
|
87
89
|
private readonly eventEmitter: TypedEventEmitter<SequencerEvents>,
|
|
88
90
|
private readonly setStateFn: (state: SequencerState, slot?: SlotNumber) => void,
|
|
89
|
-
protected readonly log: Logger,
|
|
90
91
|
public readonly tracer: Tracer,
|
|
91
|
-
|
|
92
|
+
bindings?: LoggerBindings,
|
|
93
|
+
) {
|
|
94
|
+
this.log = createLogger('sequencer:checkpoint-proposal', { ...bindings, instanceId: `slot-${slot}` });
|
|
95
|
+
}
|
|
92
96
|
|
|
93
97
|
/**
|
|
94
98
|
* Executes the checkpoint proposal job.
|
|
@@ -190,6 +194,7 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
190
194
|
l1ToL2Messages,
|
|
191
195
|
previousCheckpointOutHashes,
|
|
192
196
|
fork,
|
|
197
|
+
this.log.getBindings(),
|
|
193
198
|
);
|
|
194
199
|
|
|
195
200
|
// Options for the validator client when creating block and checkpoint proposals
|
|
@@ -203,8 +208,8 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
203
208
|
broadcastInvalidCheckpointProposal: this.config.broadcastInvalidBlockProposal,
|
|
204
209
|
};
|
|
205
210
|
|
|
206
|
-
let blocksInCheckpoint:
|
|
207
|
-
let blockPendingBroadcast: { block:
|
|
211
|
+
let blocksInCheckpoint: L2Block[] = [];
|
|
212
|
+
let blockPendingBroadcast: { block: L2Block; txs: Tx[] } | undefined = undefined;
|
|
208
213
|
|
|
209
214
|
try {
|
|
210
215
|
// Main loop: build blocks for the checkpoint
|
|
@@ -352,10 +357,10 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
352
357
|
inHash: Fr,
|
|
353
358
|
blockProposalOptions: BlockProposalOptions,
|
|
354
359
|
): Promise<{
|
|
355
|
-
blocksInCheckpoint:
|
|
356
|
-
blockPendingBroadcast: { block:
|
|
360
|
+
blocksInCheckpoint: L2Block[];
|
|
361
|
+
blockPendingBroadcast: { block: L2Block; txs: Tx[] } | undefined;
|
|
357
362
|
}> {
|
|
358
|
-
const blocksInCheckpoint:
|
|
363
|
+
const blocksInCheckpoint: L2Block[] = [];
|
|
359
364
|
const txHashesAlreadyIncluded = new Set<string>();
|
|
360
365
|
const initialBlockNumber = BlockNumber(this.syncedToBlockNumber + 1);
|
|
361
366
|
|
|
@@ -363,7 +368,7 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
363
368
|
let remainingBlobFields = BLOBS_PER_CHECKPOINT * FIELDS_PER_BLOB - NUM_CHECKPOINT_END_MARKER_FIELDS;
|
|
364
369
|
|
|
365
370
|
// Last block in the checkpoint will usually be flagged as pending broadcast, so we send it along with the checkpoint proposal
|
|
366
|
-
let blockPendingBroadcast: { block:
|
|
371
|
+
let blockPendingBroadcast: { block: L2Block; txs: Tx[] } | undefined = undefined;
|
|
367
372
|
|
|
368
373
|
while (true) {
|
|
369
374
|
const blocksBuilt = blocksInCheckpoint.length;
|
|
@@ -428,7 +433,12 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
428
433
|
// Sync the proposed block to the archiver to make it available
|
|
429
434
|
// Note that the checkpoint builder uses its own fork so it should not need to wait for this syncing
|
|
430
435
|
// Eventually we should refactor the checkpoint builder to not need a separate long-lived fork
|
|
431
|
-
|
|
436
|
+
// Fire and forget - don't block the critical path, but log errors
|
|
437
|
+
this.syncProposedBlockToArchiver(block).catch(err => {
|
|
438
|
+
this.log.error(`Failed to sync proposed block ${block.number} to archiver`, { blockNumber: block.number, err });
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
usedTxs.forEach(tx => txHashesAlreadyIncluded.add(tx.txHash.toString()));
|
|
432
442
|
|
|
433
443
|
// If this is the last block, exit the loop now so we start collecting attestations
|
|
434
444
|
if (timingInfo.isLastBlock) {
|
|
@@ -489,7 +499,7 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
489
499
|
txHashesAlreadyIncluded: Set<string>;
|
|
490
500
|
remainingBlobFields: number;
|
|
491
501
|
},
|
|
492
|
-
): Promise<{ block:
|
|
502
|
+
): Promise<{ block: L2Block; usedTxs: Tx[]; remainingBlobFields: number } | { error: Error } | undefined> {
|
|
493
503
|
const {
|
|
494
504
|
blockTimestamp,
|
|
495
505
|
forceCreate,
|
|
@@ -681,7 +691,7 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
681
691
|
const attestationTimeAllowed = this.config.enforceTimeTable
|
|
682
692
|
? this.timetable.getMaxAllowedTime(SequencerState.PUBLISHING_CHECKPOINT)!
|
|
683
693
|
: this.l1Constants.slotDuration;
|
|
684
|
-
const attestationDeadline = new Date(this.
|
|
694
|
+
const attestationDeadline = new Date((this.getSlotStartBuildTimestamp() + attestationTimeAllowed) * 1000);
|
|
685
695
|
|
|
686
696
|
this.metrics.recordRequiredAttestations(numberOfRequiredAttestations, attestationTimeAllowed);
|
|
687
697
|
|
|
@@ -777,8 +787,7 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
777
787
|
* Gossip doesn't echo messages back to the sender, so the proposer's archiver/world-state
|
|
778
788
|
* would never receive its own block without this explicit sync.
|
|
779
789
|
*/
|
|
780
|
-
private async syncProposedBlockToArchiver(block:
|
|
781
|
-
// TODO(palla/mbps): Change default to false once block sync is stable.
|
|
790
|
+
private async syncProposedBlockToArchiver(block: L2Block): Promise<void> {
|
|
782
791
|
if (this.config.skipPushProposedBlocksToArchiver !== false) {
|
|
783
792
|
this.log.warn(`Skipping push of proposed block ${block.number} to archiver`, {
|
|
784
793
|
blockNumber: block.number,
|
package/src/sequencer/metrics.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type TelemetryClient,
|
|
12
12
|
type Tracer,
|
|
13
13
|
type UpDownCounter,
|
|
14
|
+
createUpDownCounterWithDefault,
|
|
14
15
|
} from '@aztec/telemetry-client';
|
|
15
16
|
|
|
16
17
|
import { type Hex, formatUnits } from 'viem';
|
|
@@ -67,7 +68,9 @@ export class SequencerMetrics {
|
|
|
67
68
|
this.meter = client.getMeter(name);
|
|
68
69
|
this.tracer = client.getTracer(name);
|
|
69
70
|
|
|
70
|
-
this.blockCounter = this.meter
|
|
71
|
+
this.blockCounter = createUpDownCounterWithDefault(this.meter, Metrics.SEQUENCER_BLOCK_COUNT, {
|
|
72
|
+
[Attributes.STATUS]: ['failed', 'built'],
|
|
73
|
+
});
|
|
71
74
|
|
|
72
75
|
this.blockBuildDuration = this.meter.createHistogram(Metrics.SEQUENCER_BLOCK_BUILD_DURATION);
|
|
73
76
|
|
|
@@ -77,23 +80,15 @@ export class SequencerMetrics {
|
|
|
77
80
|
|
|
78
81
|
this.checkpointAttestationDelay = this.meter.createHistogram(Metrics.SEQUENCER_CHECKPOINT_ATTESTATION_DELAY);
|
|
79
82
|
|
|
80
|
-
// Init gauges and counters
|
|
81
|
-
this.blockCounter.add(0, {
|
|
82
|
-
[Attributes.STATUS]: 'failed',
|
|
83
|
-
});
|
|
84
|
-
this.blockCounter.add(0, {
|
|
85
|
-
[Attributes.STATUS]: 'built',
|
|
86
|
-
});
|
|
87
|
-
|
|
88
83
|
this.rewards = this.meter.createGauge(Metrics.SEQUENCER_CURRENT_BLOCK_REWARDS);
|
|
89
84
|
|
|
90
|
-
this.slots = this.meter
|
|
85
|
+
this.slots = createUpDownCounterWithDefault(this.meter, Metrics.SEQUENCER_SLOT_COUNT);
|
|
91
86
|
|
|
92
87
|
/**
|
|
93
88
|
* NOTE: we do not track missed slots as a separate metric. That would be difficult to determine
|
|
94
89
|
* Instead, use a computed metric, `slots - filledSlots` to get the number of slots a sequencer has missed.
|
|
95
90
|
*/
|
|
96
|
-
this.filledSlots = this.meter
|
|
91
|
+
this.filledSlots = createUpDownCounterWithDefault(this.meter, Metrics.SEQUENCER_FILLED_SLOT_COUNT);
|
|
97
92
|
|
|
98
93
|
this.timeToCollectAttestations = this.meter.createGauge(Metrics.SEQUENCER_COLLECT_ATTESTATIONS_DURATION);
|
|
99
94
|
|
|
@@ -103,20 +98,41 @@ export class SequencerMetrics {
|
|
|
103
98
|
|
|
104
99
|
this.collectedAttestions = this.meter.createGauge(Metrics.SEQUENCER_COLLECTED_ATTESTATIONS_COUNT);
|
|
105
100
|
|
|
106
|
-
this.blockProposalFailed =
|
|
101
|
+
this.blockProposalFailed = createUpDownCounterWithDefault(
|
|
102
|
+
this.meter,
|
|
103
|
+
Metrics.SEQUENCER_BLOCK_PROPOSAL_FAILED_COUNT,
|
|
104
|
+
);
|
|
107
105
|
|
|
108
|
-
this.blockProposalSuccess =
|
|
106
|
+
this.blockProposalSuccess = createUpDownCounterWithDefault(
|
|
107
|
+
this.meter,
|
|
108
|
+
Metrics.SEQUENCER_BLOCK_PROPOSAL_SUCCESS_COUNT,
|
|
109
|
+
);
|
|
109
110
|
|
|
110
|
-
this.checkpointSuccess = this.meter
|
|
111
|
+
this.checkpointSuccess = createUpDownCounterWithDefault(this.meter, Metrics.SEQUENCER_CHECKPOINT_SUCCESS_COUNT);
|
|
111
112
|
|
|
112
|
-
this.blockProposalPrecheckFailed =
|
|
113
|
+
this.blockProposalPrecheckFailed = createUpDownCounterWithDefault(
|
|
114
|
+
this.meter,
|
|
113
115
|
Metrics.SEQUENCER_BLOCK_PROPOSAL_PRECHECK_FAILED_COUNT,
|
|
116
|
+
{
|
|
117
|
+
[Attributes.ERROR_TYPE]: [
|
|
118
|
+
'slot_already_taken',
|
|
119
|
+
'rollup_contract_check_failed',
|
|
120
|
+
'slot_mismatch',
|
|
121
|
+
'block_number_mismatch',
|
|
122
|
+
],
|
|
123
|
+
},
|
|
114
124
|
);
|
|
115
125
|
|
|
116
|
-
this.slashingAttempts = this.meter
|
|
126
|
+
this.slashingAttempts = createUpDownCounterWithDefault(this.meter, Metrics.SEQUENCER_SLASHING_ATTEMPTS_COUNT);
|
|
117
127
|
|
|
118
128
|
// Fisherman fee analysis metrics
|
|
119
|
-
this.fishermanWouldBeIncluded =
|
|
129
|
+
this.fishermanWouldBeIncluded = createUpDownCounterWithDefault(
|
|
130
|
+
this.meter,
|
|
131
|
+
Metrics.FISHERMAN_FEE_ANALYSIS_WOULD_BE_INCLUDED,
|
|
132
|
+
{
|
|
133
|
+
[Attributes.OK]: [true, false],
|
|
134
|
+
},
|
|
135
|
+
);
|
|
120
136
|
|
|
121
137
|
this.fishermanTimeBeforeBlock = this.meter.createHistogram(Metrics.FISHERMAN_FEE_ANALYSIS_TIME_BEFORE_BLOCK);
|
|
122
138
|
|
|
@@ -231,7 +247,9 @@ export class SequencerMetrics {
|
|
|
231
247
|
this.blockProposalSuccess.add(1);
|
|
232
248
|
}
|
|
233
249
|
|
|
234
|
-
recordBlockProposalPrecheckFailed(
|
|
250
|
+
recordBlockProposalPrecheckFailed(
|
|
251
|
+
checkType: 'slot_already_taken' | 'rollup_contract_check_failed' | 'slot_mismatch' | 'block_number_mismatch',
|
|
252
|
+
) {
|
|
235
253
|
this.blockProposalPrecheckFailed.add(1, {
|
|
236
254
|
[Attributes.ERROR_TYPE]: checkType,
|
|
237
255
|
});
|
|
@@ -12,7 +12,7 @@ import type { DateProvider } from '@aztec/foundation/timer';
|
|
|
12
12
|
import type { TypedEventEmitter } from '@aztec/foundation/types';
|
|
13
13
|
import type { P2P } from '@aztec/p2p';
|
|
14
14
|
import type { SlasherClientInterface } from '@aztec/slasher';
|
|
15
|
-
import type {
|
|
15
|
+
import type { L2Block, L2BlockSink, L2BlockSource, ValidateCheckpointResult } from '@aztec/stdlib/block';
|
|
16
16
|
import type { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
17
17
|
import { getSlotAtTimestamp, getSlotStartBuildTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
18
18
|
import {
|
|
@@ -424,8 +424,8 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
424
424
|
this.metrics,
|
|
425
425
|
this,
|
|
426
426
|
this.setState.bind(this),
|
|
427
|
-
this.log,
|
|
428
427
|
this.tracer,
|
|
428
|
+
this.log.getBindings(),
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
431
|
|
|
@@ -529,7 +529,7 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
529
529
|
};
|
|
530
530
|
}
|
|
531
531
|
|
|
532
|
-
const block = await this.l2BlockSource.
|
|
532
|
+
const block = await this.l2BlockSource.getL2Block(blockNumber);
|
|
533
533
|
if (!block) {
|
|
534
534
|
// this shouldn't really happen because a moment ago we checked that all components were in sync
|
|
535
535
|
this.log.error(`Failed to get L2 block ${blockNumber} from the archiver with all components in sync`);
|
|
@@ -870,7 +870,7 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
870
870
|
}
|
|
871
871
|
|
|
872
872
|
type SequencerSyncCheckResult = {
|
|
873
|
-
block?:
|
|
873
|
+
block?: L2Block;
|
|
874
874
|
checkpointNumber: CheckpointNumber;
|
|
875
875
|
blockNumber: BlockNumber;
|
|
876
876
|
archive: Fr;
|