@aztec/sequencer-client 1.1.3 → 1.2.1
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.
|
@@ -15,7 +15,8 @@ export declare enum VoteType {
|
|
|
15
15
|
SLASHING = 1
|
|
16
16
|
}
|
|
17
17
|
type GetSlashPayloadCallBack = (slotNumber: bigint) => Promise<EthAddress | undefined>;
|
|
18
|
-
|
|
18
|
+
declare const Actions: readonly ["propose", "governance-vote", "slashing-vote"];
|
|
19
|
+
export type Action = (typeof Actions)[number];
|
|
19
20
|
interface RequestWithExpiry {
|
|
20
21
|
action: Action;
|
|
21
22
|
request: L1TxRequest;
|
|
@@ -45,6 +46,7 @@ export declare class SequencerPublisher {
|
|
|
45
46
|
protected ethereumSlotDuration: bigint;
|
|
46
47
|
private blobSinkClient;
|
|
47
48
|
static PROPOSE_GAS_GUESS: bigint;
|
|
49
|
+
static MULTICALL_OVERHEAD_GAS_GUESS: bigint;
|
|
48
50
|
static VOTE_GAS_GUESS: bigint;
|
|
49
51
|
l1TxUtils: L1TxUtilsWithBlobs;
|
|
50
52
|
rollupContract: RollupContract;
|
|
@@ -86,8 +88,8 @@ export declare class SequencerPublisher {
|
|
|
86
88
|
errorMsg: string | undefined;
|
|
87
89
|
stats?: undefined;
|
|
88
90
|
};
|
|
89
|
-
expiredActions:
|
|
90
|
-
validActions:
|
|
91
|
+
expiredActions: ("propose" | "governance-vote" | "slashing-vote")[];
|
|
92
|
+
validActions: ("propose" | "governance-vote" | "slashing-vote")[];
|
|
91
93
|
} | undefined>;
|
|
92
94
|
private callbackBundledTransactions;
|
|
93
95
|
/**
|
|
@@ -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;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,i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M,EAAE,EACnB,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAA;KAAO,GAChC,OAAO,CAAC,OAAO,CAAC;IAyCnB;;;;;OAKG;IACI,SAAS;IAKhB,wDAAwD;IACjD,OAAO;YAKA,gBAAgB;IAoD9B;;;;;OAKG;YACW,iBAAiB;YAmEjB,YAAY;IAoE1B;;;;;;;OAOG;IACH,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlF"}
|
|
@@ -18,6 +18,13 @@ export var VoteType = /*#__PURE__*/ function(VoteType) {
|
|
|
18
18
|
VoteType[VoteType["SLASHING"] = 1] = "SLASHING";
|
|
19
19
|
return VoteType;
|
|
20
20
|
}({});
|
|
21
|
+
const Actions = [
|
|
22
|
+
'propose',
|
|
23
|
+
'governance-vote',
|
|
24
|
+
'slashing-vote'
|
|
25
|
+
];
|
|
26
|
+
// Sorting for actions such that proposals always go first
|
|
27
|
+
const compareActions = (a, b)=>Actions.indexOf(b) - Actions.indexOf(a);
|
|
21
28
|
export class SequencerPublisher {
|
|
22
29
|
config;
|
|
23
30
|
interrupted;
|
|
@@ -37,8 +44,10 @@ export class SequencerPublisher {
|
|
|
37
44
|
// Total used for full block from int_l1_pub e2e test: 1m (of which 86k is 1x blob)
|
|
38
45
|
// Total used for emptier block from above test: 429k (of which 84k is 1x blob)
|
|
39
46
|
static PROPOSE_GAS_GUESS = 12_000_000n;
|
|
40
|
-
//
|
|
41
|
-
static
|
|
47
|
+
// A CALL to a cold address is 2700 gas
|
|
48
|
+
static MULTICALL_OVERHEAD_GAS_GUESS = 5000n;
|
|
49
|
+
// Gas report for VotingWithSigTest shows a max gas of 100k, but we've seen it cost 700k+ in testnet
|
|
50
|
+
static VOTE_GAS_GUESS = 800_000n;
|
|
42
51
|
l1TxUtils;
|
|
43
52
|
rollupContract;
|
|
44
53
|
govProposerContract;
|
|
@@ -143,6 +152,9 @@ export class SequencerPublisher {
|
|
|
143
152
|
gasLimit,
|
|
144
153
|
txTimeoutAt
|
|
145
154
|
};
|
|
155
|
+
// Sort the requests so that proposals always go first
|
|
156
|
+
// This ensures the committee gets precomputed correctly
|
|
157
|
+
validRequests.sort((a, b)=>compareActions(a.action, b.action));
|
|
146
158
|
try {
|
|
147
159
|
this.log.debug('Forwarding transactions', {
|
|
148
160
|
validRequests: validRequests.map((request)=>request.action)
|
|
@@ -360,6 +372,10 @@ export class SequencerPublisher {
|
|
|
360
372
|
if (!voteConfig) {
|
|
361
373
|
return false;
|
|
362
374
|
}
|
|
375
|
+
if (signerAddress.equals(EthAddress.ZERO)) {
|
|
376
|
+
this.log.warn(`Cannot enqueue vote cast signal ${voteType} for address zero at slot ${slotNumber}`);
|
|
377
|
+
return false;
|
|
378
|
+
}
|
|
363
379
|
const { payload, base } = voteConfig;
|
|
364
380
|
return this.enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base, signerAddress, signer);
|
|
365
381
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/sequencer-client",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -26,37 +26,37 @@
|
|
|
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": "1.1
|
|
30
|
-
"@aztec/bb-prover": "1.1
|
|
31
|
-
"@aztec/blob-lib": "1.1
|
|
32
|
-
"@aztec/blob-sink": "1.1
|
|
33
|
-
"@aztec/constants": "1.1
|
|
34
|
-
"@aztec/epoch-cache": "1.1
|
|
35
|
-
"@aztec/ethereum": "1.1
|
|
36
|
-
"@aztec/foundation": "1.1
|
|
37
|
-
"@aztec/l1-artifacts": "1.1
|
|
38
|
-
"@aztec/merkle-tree": "1.1
|
|
39
|
-
"@aztec/noir-acvm_js": "1.1
|
|
40
|
-
"@aztec/noir-contracts.js": "1.1
|
|
41
|
-
"@aztec/noir-protocol-circuits-types": "1.1
|
|
42
|
-
"@aztec/noir-types": "1.1
|
|
43
|
-
"@aztec/p2p": "1.1
|
|
44
|
-
"@aztec/protocol-contracts": "1.1
|
|
45
|
-
"@aztec/prover-client": "1.1
|
|
46
|
-
"@aztec/simulator": "1.1
|
|
47
|
-
"@aztec/slasher": "1.1
|
|
48
|
-
"@aztec/stdlib": "1.1
|
|
49
|
-
"@aztec/telemetry-client": "1.1
|
|
50
|
-
"@aztec/validator-client": "1.1
|
|
51
|
-
"@aztec/world-state": "1.1
|
|
29
|
+
"@aztec/aztec.js": "1.2.1",
|
|
30
|
+
"@aztec/bb-prover": "1.2.1",
|
|
31
|
+
"@aztec/blob-lib": "1.2.1",
|
|
32
|
+
"@aztec/blob-sink": "1.2.1",
|
|
33
|
+
"@aztec/constants": "1.2.1",
|
|
34
|
+
"@aztec/epoch-cache": "1.2.1",
|
|
35
|
+
"@aztec/ethereum": "1.2.1",
|
|
36
|
+
"@aztec/foundation": "1.2.1",
|
|
37
|
+
"@aztec/l1-artifacts": "1.2.1",
|
|
38
|
+
"@aztec/merkle-tree": "1.2.1",
|
|
39
|
+
"@aztec/noir-acvm_js": "1.2.1",
|
|
40
|
+
"@aztec/noir-contracts.js": "1.2.1",
|
|
41
|
+
"@aztec/noir-protocol-circuits-types": "1.2.1",
|
|
42
|
+
"@aztec/noir-types": "1.2.1",
|
|
43
|
+
"@aztec/p2p": "1.2.1",
|
|
44
|
+
"@aztec/protocol-contracts": "1.2.1",
|
|
45
|
+
"@aztec/prover-client": "1.2.1",
|
|
46
|
+
"@aztec/simulator": "1.2.1",
|
|
47
|
+
"@aztec/slasher": "1.2.1",
|
|
48
|
+
"@aztec/stdlib": "1.2.1",
|
|
49
|
+
"@aztec/telemetry-client": "1.2.1",
|
|
50
|
+
"@aztec/validator-client": "1.2.1",
|
|
51
|
+
"@aztec/world-state": "1.2.1",
|
|
52
52
|
"lodash.chunk": "^4.2.0",
|
|
53
53
|
"lodash.pick": "^4.4.0",
|
|
54
54
|
"tslib": "^2.4.0",
|
|
55
55
|
"viem": "2.23.7"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@aztec/archiver": "1.1
|
|
59
|
-
"@aztec/kv-store": "1.1
|
|
58
|
+
"@aztec/archiver": "1.2.1",
|
|
59
|
+
"@aztec/kv-store": "1.2.1",
|
|
60
60
|
"@jest/globals": "^30.0.0",
|
|
61
61
|
"@types/jest": "^30.0.0",
|
|
62
62
|
"@types/lodash.chunk": "^4.2.7",
|
|
@@ -63,7 +63,11 @@ export enum VoteType {
|
|
|
63
63
|
|
|
64
64
|
type GetSlashPayloadCallBack = (slotNumber: bigint) => Promise<EthAddress | undefined>;
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
const Actions = ['propose', 'governance-vote', 'slashing-vote'] as const;
|
|
67
|
+
export type Action = (typeof Actions)[number];
|
|
68
|
+
|
|
69
|
+
// Sorting for actions such that proposals always go first
|
|
70
|
+
const compareActions = (a: Action, b: Action) => Actions.indexOf(b) - Actions.indexOf(a);
|
|
67
71
|
|
|
68
72
|
interface RequestWithExpiry {
|
|
69
73
|
action: Action;
|
|
@@ -104,8 +108,11 @@ export class SequencerPublisher {
|
|
|
104
108
|
// Total used for emptier block from above test: 429k (of which 84k is 1x blob)
|
|
105
109
|
public static PROPOSE_GAS_GUESS: bigint = 12_000_000n;
|
|
106
110
|
|
|
107
|
-
//
|
|
108
|
-
public static
|
|
111
|
+
// A CALL to a cold address is 2700 gas
|
|
112
|
+
public static MULTICALL_OVERHEAD_GAS_GUESS = 5000n;
|
|
113
|
+
|
|
114
|
+
// Gas report for VotingWithSigTest shows a max gas of 100k, but we've seen it cost 700k+ in testnet
|
|
115
|
+
public static VOTE_GAS_GUESS: bigint = 800_000n;
|
|
109
116
|
|
|
110
117
|
public l1TxUtils: L1TxUtilsWithBlobs;
|
|
111
118
|
public rollupContract: RollupContract;
|
|
@@ -228,6 +235,10 @@ export class SequencerPublisher {
|
|
|
228
235
|
const txTimeoutAt = txTimeoutAts.length > 0 ? new Date(Math.min(...txTimeoutAts.map(g => g.getTime()))) : undefined; // earliest
|
|
229
236
|
const gasConfig: RequestWithExpiry['gasConfig'] = { gasLimit, txTimeoutAt };
|
|
230
237
|
|
|
238
|
+
// Sort the requests so that proposals always go first
|
|
239
|
+
// This ensures the committee gets precomputed correctly
|
|
240
|
+
validRequests.sort((a, b) => compareActions(a.action, b.action));
|
|
241
|
+
|
|
231
242
|
try {
|
|
232
243
|
this.log.debug('Forwarding transactions', {
|
|
233
244
|
validRequests: validRequests.map(request => request.action),
|
|
@@ -490,6 +501,10 @@ export class SequencerPublisher {
|
|
|
490
501
|
if (!voteConfig) {
|
|
491
502
|
return false;
|
|
492
503
|
}
|
|
504
|
+
if (signerAddress.equals(EthAddress.ZERO)) {
|
|
505
|
+
this.log.warn(`Cannot enqueue vote cast signal ${voteType} for address zero at slot ${slotNumber}`);
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
493
508
|
const { payload, base } = voteConfig;
|
|
494
509
|
return this.enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base, signerAddress, signer);
|
|
495
510
|
}
|