@aztec/sequencer-client 1.0.0-nightly.20250708 → 1.0.0-nightly.20250709
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 +2 -1
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +25 -15
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +3 -2
- package/package.json +26 -26
- package/src/publisher/sequencer-publisher.ts +17 -4
- package/src/sequencer/sequencer.ts +6 -0
|
@@ -31,6 +31,7 @@ interface RequestWithExpiry {
|
|
|
31
31
|
}) => void;
|
|
32
32
|
}
|
|
33
33
|
export declare class SequencerPublisher {
|
|
34
|
+
private config;
|
|
34
35
|
private interrupted;
|
|
35
36
|
private metrics;
|
|
36
37
|
epochCache: EpochCache;
|
|
@@ -133,7 +134,7 @@ export declare class SequencerPublisher {
|
|
|
133
134
|
* @param voteType - The type of vote to cast.
|
|
134
135
|
* @returns True if the vote was successfully enqueued, false otherwise.
|
|
135
136
|
*/
|
|
136
|
-
enqueueCastVote(slotNumber: bigint, timestamp: bigint, voteType: VoteType): Promise<boolean>;
|
|
137
|
+
enqueueCastVote(slotNumber: bigint, timestamp: bigint, voteType: VoteType, signerAddress: EthAddress, signer: (msg: `0x${string}`) => Promise<`0x${string}`>): Promise<boolean>;
|
|
137
138
|
/**
|
|
138
139
|
* Proposes a L2 block on L1.
|
|
139
140
|
*
|
|
@@ -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,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAC7F,OA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E,MAAM,CAAC;QAAC,YAAY,EAAE,oBAAoB,EAAE,CAAA;KAGtE,GACA,OAAO,CAAC,MAAM,CAAC;IAwCL,wBAAwB,IAAI,OAAO,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC;YAK5D,qBAAqB;YAwDrB,aAAa;IAoB3B;;;;;;OAMG;IACU,eAAe,CAC1B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,UAAU,EACzB,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,GACrD,OAAO,CAAC,OAAO,CAAC;IASnB;;;;;OAKG;IACU,qBAAqB,CAChC,KAAK,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,oBAAoB,EAAE,EACrC,QAAQ,CAAC,EAAE,MAAM,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;YA6DjB,YAAY;IAsE1B;;;;;;;OAOG;IACH,SAAS,CAAC,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlF"}
|
|
@@ -19,21 +19,19 @@ export var VoteType = /*#__PURE__*/ function(VoteType) {
|
|
|
19
19
|
return VoteType;
|
|
20
20
|
}({});
|
|
21
21
|
export class SequencerPublisher {
|
|
22
|
-
|
|
22
|
+
config;
|
|
23
|
+
interrupted;
|
|
23
24
|
metrics;
|
|
24
25
|
epochCache;
|
|
25
26
|
dateProvider;
|
|
26
|
-
governanceLog
|
|
27
|
+
governanceLog;
|
|
27
28
|
governanceProposerAddress;
|
|
28
|
-
governancePayload
|
|
29
|
-
slashingLog
|
|
29
|
+
governancePayload;
|
|
30
|
+
slashingLog;
|
|
30
31
|
slashingProposerAddress;
|
|
31
|
-
getSlashPayload
|
|
32
|
-
myLastVotes
|
|
33
|
-
|
|
34
|
-
[1]: 0n
|
|
35
|
-
};
|
|
36
|
-
log = createLogger('sequencer:publisher');
|
|
32
|
+
getSlashPayload;
|
|
33
|
+
myLastVotes;
|
|
34
|
+
log;
|
|
37
35
|
ethereumSlotDuration;
|
|
38
36
|
blobSinkClient;
|
|
39
37
|
// @note - with blobs, the below estimate seems too large.
|
|
@@ -48,8 +46,20 @@ export class SequencerPublisher {
|
|
|
48
46
|
rollupContract;
|
|
49
47
|
govProposerContract;
|
|
50
48
|
slashingProposerContract;
|
|
51
|
-
requests
|
|
49
|
+
requests;
|
|
52
50
|
constructor(config, deps){
|
|
51
|
+
this.config = config;
|
|
52
|
+
this.interrupted = false;
|
|
53
|
+
this.governanceLog = createLogger('sequencer:publisher:governance');
|
|
54
|
+
this.governancePayload = EthAddress.ZERO;
|
|
55
|
+
this.slashingLog = createLogger('sequencer:publisher:slashing');
|
|
56
|
+
this.getSlashPayload = undefined;
|
|
57
|
+
this.myLastVotes = {
|
|
58
|
+
[0]: 0n,
|
|
59
|
+
[1]: 0n
|
|
60
|
+
};
|
|
61
|
+
this.log = createLogger('sequencer:publisher');
|
|
62
|
+
this.requests = [];
|
|
53
63
|
this.ethereumSlotDuration = BigInt(config.ethereumSlotDuration);
|
|
54
64
|
this.epochCache = deps.epochCache;
|
|
55
65
|
this.dateProvider = deps.dateProvider;
|
|
@@ -280,7 +290,7 @@ export class SequencerPublisher {
|
|
|
280
290
|
const committee = await this.rollupContract.getCurrentEpochCommittee();
|
|
281
291
|
return committee?.map(EthAddress.fromString);
|
|
282
292
|
}
|
|
283
|
-
async enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base) {
|
|
293
|
+
async enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base, signerAddress, signer) {
|
|
284
294
|
if (this.myLastVotes[voteType] >= slotNumber) {
|
|
285
295
|
return false;
|
|
286
296
|
}
|
|
@@ -295,7 +305,7 @@ export class SequencerPublisher {
|
|
|
295
305
|
const cachedLastVote = this.myLastVotes[voteType];
|
|
296
306
|
this.myLastVotes[voteType] = slotNumber;
|
|
297
307
|
const action = voteType === 0 ? 'governance-vote' : 'slashing-vote';
|
|
298
|
-
const request = await base.createVoteRequestWithSignature(payload.toString(), this.
|
|
308
|
+
const request = await base.createVoteRequestWithSignature(payload.toString(), this.config.l1ChainId, signerAddress.toString(), signer);
|
|
299
309
|
this.log.debug(`Created ${action} request with signature`, {
|
|
300
310
|
request,
|
|
301
311
|
round,
|
|
@@ -347,13 +357,13 @@ export class SequencerPublisher {
|
|
|
347
357
|
* @param timestamp - The timestamp of the slot to cast a vote for.
|
|
348
358
|
* @param voteType - The type of vote to cast.
|
|
349
359
|
* @returns True if the vote was successfully enqueued, false otherwise.
|
|
350
|
-
*/ async enqueueCastVote(slotNumber, timestamp, voteType) {
|
|
360
|
+
*/ async enqueueCastVote(slotNumber, timestamp, voteType, signerAddress, signer) {
|
|
351
361
|
const voteConfig = await this.getVoteConfig(slotNumber, voteType);
|
|
352
362
|
if (!voteConfig) {
|
|
353
363
|
return false;
|
|
354
364
|
}
|
|
355
365
|
const { payload, base } = voteConfig;
|
|
356
|
-
return this.enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base);
|
|
366
|
+
return this.enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base, signerAddress, signer);
|
|
357
367
|
}
|
|
358
368
|
/**
|
|
359
369
|
* Proposes a L2 block on L1.
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"sequencer.d.ts","sourceRoot":"","sources":["../../src/s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,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,OAAO,CAAC,IAAI,CAAC;IAiBhB;;;;OAIG;cACa,WAAW,IAAI,OAAO,CACpC;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CACvF;IAmDD,OAAO,CAAC,0BAA0B;IAQlC,OAAO,CAAC,kBAAkB;IAK1B,IAAI,iBAAiB,WAEpB;IAED,IAAI,QAAQ,IAAI,UAAU,CAMzB;IAED,IAAI,YAAY,IAAI,YAAY,CAE/B;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;IAEM,gBAAgB,IAAI,aAAa;CAGzC"}
|
|
@@ -6,6 +6,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
6
6
|
}
|
|
7
7
|
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
8
8
|
import { FormattedViemError, NoCommitteeError } from '@aztec/ethereum';
|
|
9
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
9
10
|
import { omit } from '@aztec/foundation/collection';
|
|
10
11
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
11
12
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -294,8 +295,8 @@ export { SequencerState };
|
|
|
294
295
|
validatorAddresses
|
|
295
296
|
});
|
|
296
297
|
const newGlobalVariables = await this.globalsBuilder.buildGlobalVariables(newBlockNumber, this.coinbase, this._feeRecipient, slot);
|
|
297
|
-
const enqueueGovernanceVotePromise = this.publisher.enqueueCastVote(slot, newGlobalVariables.timestamp, VoteType.GOVERNANCE);
|
|
298
|
-
const enqueueSlashingVotePromise = this.publisher.enqueueCastVote(slot, newGlobalVariables.timestamp, VoteType.SLASHING);
|
|
298
|
+
const enqueueGovernanceVotePromise = this.publisher.enqueueCastVote(slot, newGlobalVariables.timestamp, VoteType.GOVERNANCE, proposerAddress, (msg)=>this.validatorClient.signWithAddress(proposerAddress, Buffer32.fromString(msg)).then((s)=>s.toString()));
|
|
299
|
+
const enqueueSlashingVotePromise = this.publisher.enqueueCastVote(slot, newGlobalVariables.timestamp, VoteType.SLASHING, proposerAddress, (msg)=>this.validatorClient.signWithAddress(proposerAddress, Buffer32.fromString(msg)).then((s)=>s.toString()));
|
|
299
300
|
this.setState(SequencerState.INITIALIZING_PROPOSAL, slot);
|
|
300
301
|
this.log.verbose(`Preparing proposal for block ${newBlockNumber} at slot ${slot}`, {
|
|
301
302
|
proposer: proposerInNextSlot?.toString(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/sequencer-client",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250709",
|
|
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.0.0-nightly.
|
|
30
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
31
|
-
"@aztec/blob-lib": "1.0.0-nightly.
|
|
32
|
-
"@aztec/blob-sink": "1.0.0-nightly.
|
|
33
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
34
|
-
"@aztec/epoch-cache": "1.0.0-nightly.
|
|
35
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
36
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
37
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
38
|
-
"@aztec/merkle-tree": "1.0.0-nightly.
|
|
39
|
-
"@aztec/noir-acvm_js": "1.0.0-nightly.
|
|
40
|
-
"@aztec/noir-contracts.js": "1.0.0-nightly.
|
|
41
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
42
|
-
"@aztec/noir-types": "1.0.0-nightly.
|
|
43
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
44
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
45
|
-
"@aztec/prover-client": "1.0.0-nightly.
|
|
46
|
-
"@aztec/simulator": "1.0.0-nightly.
|
|
47
|
-
"@aztec/slasher": "1.0.0-nightly.
|
|
48
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
49
|
-
"@aztec/telemetry-client": "1.0.0-nightly.
|
|
50
|
-
"@aztec/validator-client": "1.0.0-nightly.
|
|
51
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
29
|
+
"@aztec/aztec.js": "1.0.0-nightly.20250709",
|
|
30
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250709",
|
|
31
|
+
"@aztec/blob-lib": "1.0.0-nightly.20250709",
|
|
32
|
+
"@aztec/blob-sink": "1.0.0-nightly.20250709",
|
|
33
|
+
"@aztec/constants": "1.0.0-nightly.20250709",
|
|
34
|
+
"@aztec/epoch-cache": "1.0.0-nightly.20250709",
|
|
35
|
+
"@aztec/ethereum": "1.0.0-nightly.20250709",
|
|
36
|
+
"@aztec/foundation": "1.0.0-nightly.20250709",
|
|
37
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250709",
|
|
38
|
+
"@aztec/merkle-tree": "1.0.0-nightly.20250709",
|
|
39
|
+
"@aztec/noir-acvm_js": "1.0.0-nightly.20250709",
|
|
40
|
+
"@aztec/noir-contracts.js": "1.0.0-nightly.20250709",
|
|
41
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250709",
|
|
42
|
+
"@aztec/noir-types": "1.0.0-nightly.20250709",
|
|
43
|
+
"@aztec/p2p": "1.0.0-nightly.20250709",
|
|
44
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250709",
|
|
45
|
+
"@aztec/prover-client": "1.0.0-nightly.20250709",
|
|
46
|
+
"@aztec/simulator": "1.0.0-nightly.20250709",
|
|
47
|
+
"@aztec/slasher": "1.0.0-nightly.20250709",
|
|
48
|
+
"@aztec/stdlib": "1.0.0-nightly.20250709",
|
|
49
|
+
"@aztec/telemetry-client": "1.0.0-nightly.20250709",
|
|
50
|
+
"@aztec/validator-client": "1.0.0-nightly.20250709",
|
|
51
|
+
"@aztec/world-state": "1.0.0-nightly.20250709",
|
|
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.0.0-nightly.
|
|
59
|
-
"@aztec/kv-store": "1.0.0-nightly.
|
|
58
|
+
"@aztec/archiver": "1.0.0-nightly.20250709",
|
|
59
|
+
"@aztec/kv-store": "1.0.0-nightly.20250709",
|
|
60
60
|
"@jest/globals": "^30.0.0",
|
|
61
61
|
"@types/jest": "^30.0.0",
|
|
62
62
|
"@types/lodash.chunk": "^4.2.7",
|
|
@@ -119,7 +119,7 @@ export class SequencerPublisher {
|
|
|
119
119
|
protected requests: RequestWithExpiry[] = [];
|
|
120
120
|
|
|
121
121
|
constructor(
|
|
122
|
-
config: TxSenderConfig & PublisherConfig & Pick<L1ContractsConfig, 'ethereumSlotDuration'>,
|
|
122
|
+
private config: TxSenderConfig & PublisherConfig & Pick<L1ContractsConfig, 'ethereumSlotDuration'>,
|
|
123
123
|
deps: {
|
|
124
124
|
telemetry?: TelemetryClient;
|
|
125
125
|
blobSinkClient?: BlobSinkClientInterface;
|
|
@@ -406,6 +406,8 @@ export class SequencerPublisher {
|
|
|
406
406
|
voteType: VoteType,
|
|
407
407
|
payload: EthAddress,
|
|
408
408
|
base: IEmpireBase,
|
|
409
|
+
signerAddress: EthAddress,
|
|
410
|
+
signer: (msg: `0x${string}`) => Promise<`0x${string}`>,
|
|
409
411
|
): Promise<boolean> {
|
|
410
412
|
if (this.myLastVotes[voteType] >= slotNumber) {
|
|
411
413
|
return false;
|
|
@@ -425,7 +427,12 @@ export class SequencerPublisher {
|
|
|
425
427
|
|
|
426
428
|
const action = voteType === VoteType.GOVERNANCE ? 'governance-vote' : 'slashing-vote';
|
|
427
429
|
|
|
428
|
-
const request = await base.createVoteRequestWithSignature(
|
|
430
|
+
const request = await base.createVoteRequestWithSignature(
|
|
431
|
+
payload.toString(),
|
|
432
|
+
this.config.l1ChainId,
|
|
433
|
+
signerAddress.toString(),
|
|
434
|
+
signer,
|
|
435
|
+
);
|
|
429
436
|
this.log.debug(`Created ${action} request with signature`, {
|
|
430
437
|
request,
|
|
431
438
|
round,
|
|
@@ -476,13 +483,19 @@ export class SequencerPublisher {
|
|
|
476
483
|
* @param voteType - The type of vote to cast.
|
|
477
484
|
* @returns True if the vote was successfully enqueued, false otherwise.
|
|
478
485
|
*/
|
|
479
|
-
public async enqueueCastVote(
|
|
486
|
+
public async enqueueCastVote(
|
|
487
|
+
slotNumber: bigint,
|
|
488
|
+
timestamp: bigint,
|
|
489
|
+
voteType: VoteType,
|
|
490
|
+
signerAddress: EthAddress,
|
|
491
|
+
signer: (msg: `0x${string}`) => Promise<`0x${string}`>,
|
|
492
|
+
): Promise<boolean> {
|
|
480
493
|
const voteConfig = await this.getVoteConfig(slotNumber, voteType);
|
|
481
494
|
if (!voteConfig) {
|
|
482
495
|
return false;
|
|
483
496
|
}
|
|
484
497
|
const { payload, base } = voteConfig;
|
|
485
|
-
return this.enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base);
|
|
498
|
+
return this.enqueueCastVoteHelper(slotNumber, timestamp, voteType, payload, base, signerAddress, signer);
|
|
486
499
|
}
|
|
487
500
|
|
|
488
501
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { L2Block } from '@aztec/aztec.js';
|
|
2
2
|
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
3
3
|
import { FormattedViemError, NoCommitteeError, type ViemPublicClient } from '@aztec/ethereum';
|
|
4
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
4
5
|
import { omit } from '@aztec/foundation/collection';
|
|
5
6
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
7
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -355,6 +356,7 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
355
356
|
// Double check we are good for proposing at the next block before we start operations.
|
|
356
357
|
// We should never fail this check assuming the logic above is good.
|
|
357
358
|
const proposerAddress = proposerInNextSlot ?? EthAddress.ZERO;
|
|
359
|
+
|
|
358
360
|
const canProposeCheck = await this.publisher.canProposeAtNextEthBlock(chainTipArchive.toBuffer(), proposerAddress);
|
|
359
361
|
if (canProposeCheck === undefined) {
|
|
360
362
|
this.log.warn(
|
|
@@ -395,12 +397,16 @@ export class Sequencer extends (EventEmitter as new () => TypedEventEmitter<Sequ
|
|
|
395
397
|
slot,
|
|
396
398
|
newGlobalVariables.timestamp,
|
|
397
399
|
VoteType.GOVERNANCE,
|
|
400
|
+
proposerAddress,
|
|
401
|
+
msg => this.validatorClient!.signWithAddress(proposerAddress, Buffer32.fromString(msg)).then(s => s.toString()),
|
|
398
402
|
);
|
|
399
403
|
|
|
400
404
|
const enqueueSlashingVotePromise = this.publisher.enqueueCastVote(
|
|
401
405
|
slot,
|
|
402
406
|
newGlobalVariables.timestamp,
|
|
403
407
|
VoteType.SLASHING,
|
|
408
|
+
proposerAddress,
|
|
409
|
+
msg => this.validatorClient!.signWithAddress(proposerAddress, Buffer32.fromString(msg)).then(s => s.toString()),
|
|
404
410
|
);
|
|
405
411
|
|
|
406
412
|
this.setState(SequencerState.INITIALIZING_PROPOSAL, slot);
|