@aztec/sequencer-client 0.0.1-commit.88e6f9396 → 0.0.1-commit.8c0b8ff
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.d.ts +5 -1
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +6 -12
- package/dest/config.d.ts +3 -3
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +1 -2
- package/dest/global_variable_builder/global_builder.d.ts +13 -7
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +22 -22
- package/dest/global_variable_builder/index.d.ts +2 -2
- package/dest/global_variable_builder/index.d.ts.map +1 -1
- package/dest/publisher/config.d.ts +1 -5
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +1 -6
- package/dest/publisher/index.d.ts +1 -2
- package/dest/publisher/index.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-factory.d.ts +1 -1
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-factory.js +0 -14
- package/dest/publisher/sequencer-publisher.d.ts +11 -16
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +53 -289
- package/dest/sequencer/checkpoint_proposal_job.d.ts +4 -10
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +75 -117
- package/dest/sequencer/checkpoint_voter.d.ts +1 -2
- package/dest/sequencer/checkpoint_voter.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_voter.js +2 -5
- package/dest/sequencer/events.d.ts +1 -2
- package/dest/sequencer/events.d.ts.map +1 -1
- package/dest/sequencer/metrics.d.ts +1 -5
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +0 -11
- package/dest/sequencer/sequencer.d.ts +5 -4
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +50 -59
- package/dest/test/mock_checkpoint_builder.d.ts +1 -1
- package/dest/test/mock_checkpoint_builder.d.ts.map +1 -1
- package/dest/test/mock_checkpoint_builder.js +2 -0
- package/package.json +28 -27
- package/src/client/sequencer-client.ts +9 -11
- package/src/config.ts +0 -4
- package/src/global_variable_builder/global_builder.ts +22 -24
- package/src/global_variable_builder/index.ts +1 -1
- package/src/publisher/config.ts +0 -9
- package/src/publisher/index.ts +0 -3
- package/src/publisher/sequencer-publisher-factory.ts +0 -15
- package/src/publisher/sequencer-publisher.ts +51 -274
- package/src/sequencer/checkpoint_proposal_job.ts +66 -139
- package/src/sequencer/checkpoint_voter.ts +1 -12
- package/src/sequencer/events.ts +1 -1
- package/src/sequencer/metrics.ts +0 -14
- package/src/sequencer/sequencer.ts +58 -84
- package/src/test/mock_checkpoint_builder.ts +2 -0
- package/dest/publisher/l1_tx_failed_store/factory.d.ts +0 -11
- package/dest/publisher/l1_tx_failed_store/factory.d.ts.map +0 -1
- package/dest/publisher/l1_tx_failed_store/factory.js +0 -22
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts +0 -59
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts.map +0 -1
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.js +0 -1
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts +0 -15
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts.map +0 -1
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.js +0 -34
- package/dest/publisher/l1_tx_failed_store/index.d.ts +0 -4
- package/dest/publisher/l1_tx_failed_store/index.d.ts.map +0 -1
- package/dest/publisher/l1_tx_failed_store/index.js +0 -2
- package/src/publisher/l1_tx_failed_store/factory.ts +0 -32
- package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +0 -55
- package/src/publisher/l1_tx_failed_store/file_store_failed_tx_store.ts +0 -46
- package/src/publisher/l1_tx_failed_store/index.ts +0 -3
|
@@ -27,10 +27,8 @@ import { SequencerState } from './utils.js';
|
|
|
27
27
|
* the Sequencer once the check for being the proposer for the slot has succeeded.
|
|
28
28
|
*/
|
|
29
29
|
export declare class CheckpointProposalJob implements Traceable {
|
|
30
|
-
private readonly
|
|
31
|
-
private readonly
|
|
32
|
-
private readonly epochNow;
|
|
33
|
-
private readonly targetEpoch;
|
|
30
|
+
private readonly epoch;
|
|
31
|
+
private readonly slot;
|
|
34
32
|
private readonly checkpointNumber;
|
|
35
33
|
private readonly syncedToBlockNumber;
|
|
36
34
|
private readonly proposer;
|
|
@@ -56,11 +54,7 @@ export declare class CheckpointProposalJob implements Traceable {
|
|
|
56
54
|
private readonly setStateFn;
|
|
57
55
|
readonly tracer: Tracer;
|
|
58
56
|
protected readonly log: Logger;
|
|
59
|
-
constructor(
|
|
60
|
-
/** The wall-clock slot during which the proposer builds. */
|
|
61
|
-
private get slot();
|
|
62
|
-
/** The wall-clock epoch. */
|
|
63
|
-
private get epoch();
|
|
57
|
+
constructor(epoch: EpochNumber, slot: SlotNumber, checkpointNumber: CheckpointNumber, syncedToBlockNumber: BlockNumber, proposer: EthAddress | undefined, publisher: SequencerPublisher, attestorAddress: EthAddress, invalidateCheckpoint: InvalidateCheckpointRequest | undefined, validatorClient: ValidatorClient, globalsBuilder: GlobalVariableBuilder, p2pClient: P2P, worldState: WorldStateSynchronizer, l1ToL2MessageSource: L1ToL2MessageSource, l2BlockSource: L2BlockSource, checkpointsBuilder: FullNodeCheckpointsBuilder, blockSink: L2BlockSink, l1Constants: SequencerRollupConstants, config: ResolvedSequencerConfig, timetable: SequencerTimetable, slasherClient: SlasherClientInterface | undefined, epochCache: EpochCache, dateProvider: DateProvider, metrics: SequencerMetrics, eventEmitter: TypedEventEmitter<SequencerEvents>, setStateFn: (state: SequencerState, slot?: SlotNumber) => void, tracer: Tracer, bindings?: LoggerBindings);
|
|
64
58
|
/**
|
|
65
59
|
* Executes the checkpoint proposal job.
|
|
66
60
|
* Returns the published checkpoint if successful, undefined otherwise.
|
|
@@ -105,4 +99,4 @@ export declare class CheckpointProposalJob implements Traceable {
|
|
|
105
99
|
private getSecondsIntoSlot;
|
|
106
100
|
getPublisher(): SequencerPublisher;
|
|
107
101
|
}
|
|
108
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
102
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2twb2ludF9wcm9wb3NhbF9qb2IuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXF1ZW5jZXIvY2hlY2twb2ludF9wcm9wb3NhbF9qb2IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDckQsT0FBTyxFQUNMLFdBQVcsRUFDWCxnQkFBZ0IsRUFDaEIsV0FBVyxFQUNYLHFCQUFxQixFQUNyQixVQUFVLEVBQ1gsTUFBTSxpQ0FBaUMsQ0FBQztBQVF6QyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFHM0QsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFFLEtBQUssY0FBYyxFQUFnQixNQUFNLHVCQUF1QixDQUFDO0FBRXZGLE9BQU8sRUFBRSxLQUFLLFlBQVksRUFBUyxNQUFNLHlCQUF5QixDQUFDO0FBQ25FLE9BQU8sRUFBRSxLQUFLLGlCQUFpQixFQUEwQixNQUFNLHlCQUF5QixDQUFDO0FBQ3pGLE9BQU8sS0FBSyxFQUFFLEdBQUcsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUN0QyxPQUFPLEtBQUssRUFBRSxzQkFBc0IsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzdELE9BQU8sRUFHTCxPQUFPLEVBQ1AsS0FBSyxXQUFXLEVBQ2hC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;IACH,OAAO,CAAC,oBAAoB;IAmB5B,0DAA0D;IAC1D,UACgB,mBAAmB,CAAC,qBAAqB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIhF;IAED,kFAAkF;IAClF,UAAgB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEzD;IAED,OAAO,CAAC,0BAA0B;IAIlC,OAAO,CAAC,kBAAkB;IAKnB,YAAY,uBAElB;CACF"}
|
|
@@ -446,7 +446,7 @@ import { Timer } from '@aztec/foundation/timer';
|
|
|
446
446
|
import { isErrorClass, unfreeze } from '@aztec/foundation/types';
|
|
447
447
|
import { CommitteeAttestationsAndSigners, MaliciousCommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
|
|
448
448
|
import { validateCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
449
|
-
import { getSlotStartBuildTimestamp
|
|
449
|
+
import { getSlotStartBuildTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
450
450
|
import { Gas } from '@aztec/stdlib/gas';
|
|
451
451
|
import { InsufficientValidTxsError } from '@aztec/stdlib/interfaces/server';
|
|
452
452
|
import { computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging';
|
|
@@ -462,7 +462,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
462
462
|
return {
|
|
463
463
|
// nullish operator needed for tests
|
|
464
464
|
[Attributes.COINBASE]: this.validatorClient.getCoinbaseForAttestor(this.attestorAddress)?.toString(),
|
|
465
|
-
[Attributes.SLOT_NUMBER]: this.
|
|
465
|
+
[Attributes.SLOT_NUMBER]: this.slot
|
|
466
466
|
};
|
|
467
467
|
}), _dec2 = trackSpan('CheckpointProposalJob.buildBlocksForCheckpoint'), _dec3 = trackSpan('CheckpointProposalJob.waitUntilNextSubslot'), _dec4 = trackSpan('CheckpointProposalJob.buildSingleBlock'), _dec5 = trackSpan('CheckpointProposalJob.waitForMinTxs'), _dec6 = trackSpan('CheckpointProposalJob.waitForAttestations'), _dec7 = trackSpan('CheckpointProposalJob.waitUntilTimeInSlot');
|
|
468
468
|
/**
|
|
@@ -471,10 +471,8 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
471
471
|
* as well as enqueueing votes for slashing and governance proposals. This class is created from
|
|
472
472
|
* the Sequencer once the check for being the proposer for the slot has succeeded.
|
|
473
473
|
*/ export class CheckpointProposalJob {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
epochNow;
|
|
477
|
-
targetEpoch;
|
|
474
|
+
epoch;
|
|
475
|
+
slot;
|
|
478
476
|
checkpointNumber;
|
|
479
477
|
syncedToBlockNumber;
|
|
480
478
|
proposer;
|
|
@@ -544,12 +542,10 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
544
542
|
], []));
|
|
545
543
|
}
|
|
546
544
|
log;
|
|
547
|
-
constructor(
|
|
545
|
+
constructor(epoch, slot, checkpointNumber, syncedToBlockNumber, // TODO(palla/mbps): Can we remove the proposer in favor of attestorAddress? Need to check fisherman-node flows.
|
|
548
546
|
proposer, publisher, attestorAddress, invalidateCheckpoint, validatorClient, globalsBuilder, p2pClient, worldState, l1ToL2MessageSource, l2BlockSource, checkpointsBuilder, blockSink, l1Constants, config, timetable, slasherClient, epochCache, dateProvider, metrics, eventEmitter, setStateFn, tracer, bindings){
|
|
549
|
-
this.
|
|
550
|
-
this.
|
|
551
|
-
this.epochNow = epochNow;
|
|
552
|
-
this.targetEpoch = targetEpoch;
|
|
547
|
+
this.epoch = epoch;
|
|
548
|
+
this.slot = slot;
|
|
553
549
|
this.checkpointNumber = checkpointNumber;
|
|
554
550
|
this.syncedToBlockNumber = syncedToBlockNumber;
|
|
555
551
|
this.proposer = proposer;
|
|
@@ -577,15 +573,9 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
577
573
|
_initProto(this);
|
|
578
574
|
this.log = createLogger('sequencer:checkpoint-proposal', {
|
|
579
575
|
...bindings,
|
|
580
|
-
instanceId: `slot-${
|
|
576
|
+
instanceId: `slot-${slot}`
|
|
581
577
|
});
|
|
582
578
|
}
|
|
583
|
-
/** The wall-clock slot during which the proposer builds. */ get slot() {
|
|
584
|
-
return this.slotNow;
|
|
585
|
-
}
|
|
586
|
-
/** The wall-clock epoch. */ get epoch() {
|
|
587
|
-
return this.epochNow;
|
|
588
|
-
}
|
|
589
579
|
/**
|
|
590
580
|
* Executes the checkpoint proposal job.
|
|
591
581
|
* Returns the published checkpoint if successful, undefined otherwise.
|
|
@@ -593,7 +583,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
593
583
|
// Enqueue governance and slashing votes (returns promises that will be awaited later)
|
|
594
584
|
// In fisherman mode, we simulate slashing but don't actually publish to L1
|
|
595
585
|
// These are constant for the whole slot, so we only enqueue them once
|
|
596
|
-
const votesPromises = new CheckpointVoter(this.
|
|
586
|
+
const votesPromises = new CheckpointVoter(this.slot, this.publisher, this.attestorAddress, this.validatorClient, this.slasherClient, this.l1Constants, this.config, this.metrics, this.log).enqueueVotes();
|
|
597
587
|
// Build and propose the checkpoint. This will enqueue the request on the publisher if a checkpoint is built.
|
|
598
588
|
const checkpoint = await this.proposeCheckpoint();
|
|
599
589
|
// Wait until the voting promises have resolved, so all requests are enqueued (not sent)
|
|
@@ -606,24 +596,6 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
606
596
|
await this.handleCheckpointEndAsFisherman(checkpoint);
|
|
607
597
|
return;
|
|
608
598
|
}
|
|
609
|
-
// If pipelining, wait until the submission slot so L1 recognizes the pipelined proposer
|
|
610
|
-
if (this.epochCache.isProposerPipeliningEnabled()) {
|
|
611
|
-
const submissionSlotTimestamp = getTimestampForSlot(this.targetSlot, this.l1Constants) - BigInt(this.l1Constants.ethereumSlotDuration);
|
|
612
|
-
this.log.info(`Waiting until submission slot ${this.targetSlot} for L1 submission`, {
|
|
613
|
-
slot: this.slot,
|
|
614
|
-
submissionSlot: this.targetSlot,
|
|
615
|
-
submissionSlotTimestamp
|
|
616
|
-
});
|
|
617
|
-
await sleepUntil(new Date(Number(submissionSlotTimestamp) * 1000), this.dateProvider.nowAsDate());
|
|
618
|
-
// After waking, verify the parent checkpoint wasn't pruned during the sleep.
|
|
619
|
-
// We check L1's pending tip directly instead of canProposeAt, which also validates the proposer
|
|
620
|
-
// identity and would fail because the timestamp resolves to a different slot's proposer.
|
|
621
|
-
const l1Tips = await this.publisher.rollupContract.getTips();
|
|
622
|
-
if (l1Tips.pending < this.checkpointNumber - 1) {
|
|
623
|
-
this.log.warn(`Parent checkpoint was pruned during pipelining sleep (L1 pending=${l1Tips.pending}, expected>=${this.checkpointNumber - 1}), skipping L1 submission for checkpoint ${this.checkpointNumber}`);
|
|
624
|
-
return undefined;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
599
|
// Then send everything to L1
|
|
628
600
|
const l1Response = await this.publisher.sendRequests();
|
|
629
601
|
const proposedAction = l1Response?.successfulActions.find((a)=>a === 'propose');
|
|
@@ -655,26 +627,19 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
655
627
|
const coinbase = this.validatorClient.getCoinbaseForAttestor(this.attestorAddress);
|
|
656
628
|
const feeRecipient = this.validatorClient.getFeeRecipientForAttestor(this.attestorAddress);
|
|
657
629
|
// Start the checkpoint
|
|
658
|
-
this.setStateFn(SequencerState.INITIALIZING_CHECKPOINT, this.
|
|
659
|
-
this.
|
|
660
|
-
buildSlot: this.slot,
|
|
661
|
-
submissionSlot: this.targetSlot,
|
|
662
|
-
pipelining: this.epochCache.isProposerPipeliningEnabled(),
|
|
663
|
-
proposer: this.proposer?.toString(),
|
|
664
|
-
coinbase: coinbase.toString()
|
|
665
|
-
});
|
|
666
|
-
this.metrics.incOpenSlot(this.targetSlot, this.proposer?.toString() ?? 'unknown');
|
|
630
|
+
this.setStateFn(SequencerState.INITIALIZING_CHECKPOINT, this.slot);
|
|
631
|
+
this.metrics.incOpenSlot(this.slot, this.proposer?.toString() ?? 'unknown');
|
|
667
632
|
// Enqueues checkpoint invalidation (constant for the whole slot)
|
|
668
633
|
if (this.invalidateCheckpoint && !this.config.skipInvalidateBlockAsProposer) {
|
|
669
634
|
this.publisher.enqueueInvalidateCheckpoint(this.invalidateCheckpoint);
|
|
670
635
|
}
|
|
671
636
|
// Create checkpoint builder for the slot
|
|
672
|
-
const checkpointGlobalVariables = await this.globalsBuilder.buildCheckpointGlobalVariables(coinbase, feeRecipient, this.
|
|
637
|
+
const checkpointGlobalVariables = await this.globalsBuilder.buildCheckpointGlobalVariables(coinbase, feeRecipient, this.slot);
|
|
673
638
|
// Collect L1 to L2 messages for the checkpoint and compute their hash
|
|
674
639
|
const l1ToL2Messages = await this.l1ToL2MessageSource.getL1ToL2Messages(this.checkpointNumber);
|
|
675
640
|
const inHash = computeInHashFromL1ToL2Messages(l1ToL2Messages);
|
|
676
641
|
// Collect the out hashes of all the checkpoints before this one in the same epoch
|
|
677
|
-
const previousCheckpointOutHashes = (await this.l2BlockSource.getCheckpointsDataForEpoch(this.
|
|
642
|
+
const previousCheckpointOutHashes = (await this.l2BlockSource.getCheckpointsDataForEpoch(this.epoch)).filter((c)=>c.checkpointNumber < this.checkpointNumber).map((c)=>c.checkpointOutHash);
|
|
678
643
|
// Get the fee asset price modifier from the oracle
|
|
679
644
|
const feeAssetPriceModifier = await this.publisher.getFeeAssetPriceModifier();
|
|
680
645
|
const fork = _ts_add_disposable_resource(env, await this.worldState.fork(this.syncedToBlockNumber, {
|
|
@@ -709,18 +674,18 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
709
674
|
throw err;
|
|
710
675
|
}
|
|
711
676
|
if (blocksInCheckpoint.length === 0) {
|
|
712
|
-
this.log.warn(`No blocks were built for slot ${this.
|
|
713
|
-
slot: this.
|
|
677
|
+
this.log.warn(`No blocks were built for slot ${this.slot}`, {
|
|
678
|
+
slot: this.slot
|
|
714
679
|
});
|
|
715
680
|
this.eventEmitter.emit('checkpoint-empty', {
|
|
716
|
-
slot: this.
|
|
681
|
+
slot: this.slot
|
|
717
682
|
});
|
|
718
683
|
return undefined;
|
|
719
684
|
}
|
|
720
685
|
const minBlocksForCheckpoint = this.config.minBlocksForCheckpoint;
|
|
721
686
|
if (minBlocksForCheckpoint !== undefined && blocksInCheckpoint.length < minBlocksForCheckpoint) {
|
|
722
687
|
this.log.warn(`Checkpoint has fewer blocks than minimum (${blocksInCheckpoint.length} < ${minBlocksForCheckpoint}), skipping proposal`, {
|
|
723
|
-
slot: this.
|
|
688
|
+
slot: this.slot,
|
|
724
689
|
blocksBuilt: blocksInCheckpoint.length,
|
|
725
690
|
minBlocksForCheckpoint
|
|
726
691
|
});
|
|
@@ -728,7 +693,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
728
693
|
}
|
|
729
694
|
// Assemble and broadcast the checkpoint proposal, including the last block that was not
|
|
730
695
|
// broadcasted yet, and wait to collect the committee attestations.
|
|
731
|
-
this.setStateFn(SequencerState.ASSEMBLING_CHECKPOINT, this.
|
|
696
|
+
this.setStateFn(SequencerState.ASSEMBLING_CHECKPOINT, this.slot);
|
|
732
697
|
const checkpoint = await checkpointBuilder.completeCheckpoint();
|
|
733
698
|
// Final validation: per-block limits are only checked if the operator set them explicitly.
|
|
734
699
|
// Otherwise, checkpoint-level budgets were already enforced by the redistribution logic.
|
|
@@ -750,8 +715,8 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
750
715
|
this.metrics.recordCheckpointBuild(checkpointBuildTimer.ms(), blocksInCheckpoint.length, checkpoint.getStats().txCount, Number(checkpoint.header.totalManaUsed.toBigInt()));
|
|
751
716
|
// Do not collect attestations nor publish to L1 in fisherman mode
|
|
752
717
|
if (this.config.fishermanMode) {
|
|
753
|
-
this.log.info(`Built checkpoint for slot ${this.
|
|
754
|
-
slot: this.
|
|
718
|
+
this.log.info(`Built checkpoint for slot ${this.slot} with ${blocksInCheckpoint.length} blocks. ` + `Skipping proposal in fisherman mode.`, {
|
|
719
|
+
slot: this.slot,
|
|
755
720
|
checkpoint: checkpoint.header.toInspect(),
|
|
756
721
|
blocksBuilt: blocksInCheckpoint.length
|
|
757
722
|
});
|
|
@@ -768,7 +733,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
768
733
|
const proposal = await this.validatorClient.createCheckpointProposal(checkpoint.header, checkpoint.archive.root, feeAssetPriceModifier, lastBlock, this.proposer, checkpointProposalOptions);
|
|
769
734
|
const blockProposedAt = this.dateProvider.now();
|
|
770
735
|
await this.p2pClient.broadcastCheckpointProposal(proposal);
|
|
771
|
-
this.setStateFn(SequencerState.COLLECTING_ATTESTATIONS, this.
|
|
736
|
+
this.setStateFn(SequencerState.COLLECTING_ATTESTATIONS, this.slot);
|
|
772
737
|
const attestations = await this.waitForAttestations(proposal);
|
|
773
738
|
const blockAttestedAt = this.dateProvider.now();
|
|
774
739
|
this.metrics.recordCheckpointAttestationDelay(blockAttestedAt - blockProposedAt);
|
|
@@ -776,7 +741,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
776
741
|
const signer = this.proposer ?? this.publisher.getSenderAddress();
|
|
777
742
|
let attestationsSignature;
|
|
778
743
|
try {
|
|
779
|
-
attestationsSignature = await this.validatorClient.signAttestationsAndSigners(attestations, signer, this.
|
|
744
|
+
attestationsSignature = await this.validatorClient.signAttestationsAndSigners(attestations, signer, this.slot, this.checkpointNumber);
|
|
780
745
|
} catch (err) {
|
|
781
746
|
// We shouldn't really get here since we yield to another HA node
|
|
782
747
|
// as soon as we see these errors when creating block or checkpoint proposals.
|
|
@@ -786,10 +751,10 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
786
751
|
throw err;
|
|
787
752
|
}
|
|
788
753
|
// Enqueue publishing the checkpoint to L1
|
|
789
|
-
this.setStateFn(SequencerState.PUBLISHING_CHECKPOINT, this.
|
|
754
|
+
this.setStateFn(SequencerState.PUBLISHING_CHECKPOINT, this.slot);
|
|
790
755
|
const aztecSlotDuration = this.l1Constants.slotDuration;
|
|
791
|
-
const
|
|
792
|
-
const txTimeoutAt = new Date((
|
|
756
|
+
const slotStartBuildTimestamp = this.getSlotStartBuildTimestamp();
|
|
757
|
+
const txTimeoutAt = new Date((slotStartBuildTimestamp + aztecSlotDuration) * 1000);
|
|
793
758
|
// If we have been configured to potentially skip publishing checkpoint then roll the dice here
|
|
794
759
|
if (this.config.skipPublishingCheckpointsPercent !== undefined && this.config.skipPublishingCheckpointsPercent > 0) {
|
|
795
760
|
const result = Math.max(0, randomInt(100));
|
|
@@ -825,6 +790,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
825
790
|
const blocksInCheckpoint = [];
|
|
826
791
|
const txHashesAlreadyIncluded = new Set();
|
|
827
792
|
const initialBlockNumber = BlockNumber(this.syncedToBlockNumber + 1);
|
|
793
|
+
const slot = this.slot;
|
|
828
794
|
// Last block in the checkpoint will usually be flagged as pending broadcast, so we send it along with the checkpoint proposal
|
|
829
795
|
let blockPendingBroadcast = undefined;
|
|
830
796
|
while(true){
|
|
@@ -835,7 +801,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
835
801
|
const timingInfo = this.timetable.canStartNextBlock(secondsIntoSlot);
|
|
836
802
|
if (!timingInfo.canStart) {
|
|
837
803
|
this.log.debug(`Not enough time left in slot to start another block`, {
|
|
838
|
-
slot
|
|
804
|
+
slot,
|
|
839
805
|
blocksBuilt,
|
|
840
806
|
secondsIntoSlot
|
|
841
807
|
});
|
|
@@ -864,8 +830,8 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
864
830
|
} else if ('error' in buildResult) {
|
|
865
831
|
// If there was an error building the block, just exit the loop and give up the rest of the slot
|
|
866
832
|
if (!(buildResult.error instanceof SequencerInterruptedError)) {
|
|
867
|
-
this.log.warn(`Halting block building for slot ${
|
|
868
|
-
slot
|
|
833
|
+
this.log.warn(`Halting block building for slot ${slot}`, {
|
|
834
|
+
slot,
|
|
869
835
|
blocksBuilt,
|
|
870
836
|
error: buildResult.error
|
|
871
837
|
});
|
|
@@ -875,12 +841,12 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
875
841
|
const { block, usedTxs } = buildResult;
|
|
876
842
|
blocksInCheckpoint.push(block);
|
|
877
843
|
usedTxs.forEach((tx)=>txHashesAlreadyIncluded.add(tx.txHash.toString()));
|
|
878
|
-
// If this is the last block,
|
|
879
|
-
// so we can build the checkpoint and start collecting attestations.
|
|
844
|
+
// If this is the last block, send the proposed block to the archiver,
|
|
845
|
+
// and exit the loop now so we can build the checkpoint and start collecting attestations.
|
|
880
846
|
if (timingInfo.isLastBlock) {
|
|
881
847
|
await this.syncProposedBlockToArchiver(block);
|
|
882
|
-
this.log.verbose(`Completed final block ${blockNumber} for slot ${
|
|
883
|
-
slot
|
|
848
|
+
this.log.verbose(`Completed final block ${blockNumber} for slot ${slot}`, {
|
|
849
|
+
slot,
|
|
884
850
|
blockNumber,
|
|
885
851
|
blocksBuilt
|
|
886
852
|
});
|
|
@@ -904,8 +870,8 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
904
870
|
// Wait until the next block's start time
|
|
905
871
|
await this.waitUntilNextSubslot(timingInfo.deadline);
|
|
906
872
|
}
|
|
907
|
-
this.log.verbose(`Block building loop completed for slot ${this.
|
|
908
|
-
slot: this.
|
|
873
|
+
this.log.verbose(`Block building loop completed for slot ${this.slot}`, {
|
|
874
|
+
slot: this.slot,
|
|
909
875
|
blocksBuilt: blocksInCheckpoint.length
|
|
910
876
|
});
|
|
911
877
|
return {
|
|
@@ -921,15 +887,15 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
921
887
|
return this.validatorClient.createBlockProposal(block.header, block.indexWithinCheckpoint, inHash, block.archive.root, usedTxs, this.proposer, blockProposalOptions);
|
|
922
888
|
}
|
|
923
889
|
/** Sleeps until it is time to produce the next block in the slot */ async waitUntilNextSubslot(nextSubslotStart) {
|
|
924
|
-
this.setStateFn(SequencerState.WAITING_UNTIL_NEXT_BLOCK, this.
|
|
890
|
+
this.setStateFn(SequencerState.WAITING_UNTIL_NEXT_BLOCK, this.slot);
|
|
925
891
|
this.log.verbose(`Waiting until time for the next block at ${nextSubslotStart}s into slot`, {
|
|
926
|
-
slot: this.
|
|
892
|
+
slot: this.slot
|
|
927
893
|
});
|
|
928
894
|
await this.waitUntilTimeInSlot(nextSubslotStart);
|
|
929
895
|
}
|
|
930
896
|
/** Builds a single block. Called from the main block building loop. */ async buildSingleBlock(checkpointBuilder, opts) {
|
|
931
897
|
const { blockTimestamp, forceCreate, blockNumber, indexWithinCheckpoint, buildDeadline, txHashesAlreadyIncluded } = opts;
|
|
932
|
-
this.log.verbose(`Preparing block ${blockNumber} index ${indexWithinCheckpoint} at checkpoint ${this.checkpointNumber} for slot ${this.
|
|
898
|
+
this.log.verbose(`Preparing block ${blockNumber} index ${indexWithinCheckpoint} at checkpoint ${this.checkpointNumber} for slot ${this.slot}`, {
|
|
933
899
|
...checkpointBuilder.getConstantData(),
|
|
934
900
|
...opts
|
|
935
901
|
});
|
|
@@ -937,15 +903,15 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
937
903
|
// Wait until we have enough txs to build the block
|
|
938
904
|
const { availableTxs, canStartBuilding, minTxs } = await this.waitForMinTxs(opts);
|
|
939
905
|
if (!canStartBuilding) {
|
|
940
|
-
this.log.warn(`Not enough txs to build block ${blockNumber} at index ${indexWithinCheckpoint} in slot ${this.
|
|
906
|
+
this.log.warn(`Not enough txs to build block ${blockNumber} at index ${indexWithinCheckpoint} in slot ${this.slot} (got ${availableTxs} txs but needs ${minTxs})`, {
|
|
941
907
|
blockNumber,
|
|
942
|
-
slot: this.
|
|
908
|
+
slot: this.slot,
|
|
943
909
|
indexWithinCheckpoint
|
|
944
910
|
});
|
|
945
911
|
this.eventEmitter.emit('block-tx-count-check-failed', {
|
|
946
912
|
minTxs,
|
|
947
913
|
availableTxs,
|
|
948
|
-
slot: this.
|
|
914
|
+
slot: this.slot
|
|
949
915
|
});
|
|
950
916
|
this.metrics.recordBlockProposalFailed('insufficient_txs');
|
|
951
917
|
return undefined;
|
|
@@ -953,12 +919,12 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
953
919
|
// Create iterator to pending txs. We filter out txs already included in previous blocks in the checkpoint
|
|
954
920
|
// just in case p2p failed to sync the provisional block and didn't get to remove those txs from the mempool yet.
|
|
955
921
|
const pendingTxs = filter(this.p2pClient.iterateEligiblePendingTxs(), (tx)=>!txHashesAlreadyIncluded.has(tx.txHash.toString()));
|
|
956
|
-
this.log.debug(`Building block ${blockNumber} at index ${indexWithinCheckpoint} for slot ${this.
|
|
957
|
-
slot: this.
|
|
922
|
+
this.log.debug(`Building block ${blockNumber} at index ${indexWithinCheckpoint} for slot ${this.slot} with ${availableTxs} available txs`, {
|
|
923
|
+
slot: this.slot,
|
|
958
924
|
blockNumber,
|
|
959
925
|
indexWithinCheckpoint
|
|
960
926
|
});
|
|
961
|
-
this.setStateFn(SequencerState.CREATING_BLOCK, this.
|
|
927
|
+
this.setStateFn(SequencerState.CREATING_BLOCK, this.slot);
|
|
962
928
|
// Per-block limits are operator overrides (from SEQ_MAX_L2_BLOCK_GAS etc.) further capped
|
|
963
929
|
// by remaining checkpoint-level budgets inside CheckpointBuilder before each block is built.
|
|
964
930
|
// minValidTxs is passed into the builder so it can reject the block *before* updating state.
|
|
@@ -979,8 +945,8 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
979
945
|
// If any txs failed during execution, drop them from the mempool so we don't pick them up again
|
|
980
946
|
await this.dropFailedTxsFromP2P(buildResult.failedTxs);
|
|
981
947
|
if (buildResult.status === 'insufficient-valid-txs') {
|
|
982
|
-
this.log.warn(`Block ${blockNumber} at index ${indexWithinCheckpoint} on slot ${this.
|
|
983
|
-
slot: this.
|
|
948
|
+
this.log.warn(`Block ${blockNumber} at index ${indexWithinCheckpoint} on slot ${this.slot} has too few valid txs to be proposed`, {
|
|
949
|
+
slot: this.slot,
|
|
984
950
|
blockNumber,
|
|
985
951
|
numTxs: buildResult.processedCount,
|
|
986
952
|
indexWithinCheckpoint,
|
|
@@ -988,7 +954,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
988
954
|
});
|
|
989
955
|
this.eventEmitter.emit('block-build-failed', {
|
|
990
956
|
reason: `Insufficient valid txs`,
|
|
991
|
-
slot: this.
|
|
957
|
+
slot: this.slot
|
|
992
958
|
});
|
|
993
959
|
this.metrics.recordBlockProposalFailed('insufficient_valid_txs');
|
|
994
960
|
return undefined;
|
|
@@ -1004,7 +970,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1004
970
|
const blockHash = await block.hash();
|
|
1005
971
|
const txHashes = block.body.txEffects.map((tx)=>tx.txHash);
|
|
1006
972
|
const manaPerSec = block.header.totalManaUsed.toNumberUnsafe() / (blockBuildDuration / 1000);
|
|
1007
|
-
this.log.info(`Built block ${block.number} at checkpoint ${this.checkpointNumber} for slot ${this.
|
|
973
|
+
this.log.info(`Built block ${block.number} at checkpoint ${this.checkpointNumber} for slot ${this.slot} with ${numTxs} txs`, {
|
|
1008
974
|
blockHash,
|
|
1009
975
|
txHashes,
|
|
1010
976
|
manaPerSec,
|
|
@@ -1012,8 +978,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1012
978
|
});
|
|
1013
979
|
this.eventEmitter.emit('block-proposed', {
|
|
1014
980
|
blockNumber: block.number,
|
|
1015
|
-
slot: this.
|
|
1016
|
-
buildSlot: this.slotNow
|
|
981
|
+
slot: this.slot
|
|
1017
982
|
});
|
|
1018
983
|
this.metrics.recordBuiltBlock(blockBuildDuration, block.header.totalManaUsed.toNumberUnsafe());
|
|
1019
984
|
return {
|
|
@@ -1023,11 +988,11 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1023
988
|
} catch (err) {
|
|
1024
989
|
this.eventEmitter.emit('block-build-failed', {
|
|
1025
990
|
reason: err.message,
|
|
1026
|
-
slot: this.
|
|
991
|
+
slot: this.slot
|
|
1027
992
|
});
|
|
1028
993
|
this.log.error(`Error building block`, err, {
|
|
1029
994
|
blockNumber,
|
|
1030
|
-
slot: this.
|
|
995
|
+
slot: this.slot
|
|
1031
996
|
});
|
|
1032
997
|
this.metrics.recordBlockProposalFailed(err.name || 'unknown_error');
|
|
1033
998
|
this.metrics.recordFailedBlock();
|
|
@@ -1075,10 +1040,10 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1075
1040
|
};
|
|
1076
1041
|
}
|
|
1077
1042
|
// Wait a bit before checking again
|
|
1078
|
-
this.setStateFn(SequencerState.WAITING_FOR_TXS, this.
|
|
1079
|
-
this.log.verbose(`Waiting for enough txs to build block ${blockNumber} at index ${indexWithinCheckpoint} in slot ${this.
|
|
1043
|
+
this.setStateFn(SequencerState.WAITING_FOR_TXS, this.slot);
|
|
1044
|
+
this.log.verbose(`Waiting for enough txs to build block ${blockNumber} at index ${indexWithinCheckpoint} in slot ${this.slot} (have ${availableTxs} but need ${minTxs})`, {
|
|
1080
1045
|
blockNumber,
|
|
1081
|
-
slot: this.
|
|
1046
|
+
slot: this.slot,
|
|
1082
1047
|
indexWithinCheckpoint
|
|
1083
1048
|
});
|
|
1084
1049
|
await this.waitForTxsPollingInterval();
|
|
@@ -1178,25 +1143,14 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1178
1143
|
const shuffled = [
|
|
1179
1144
|
...attestations
|
|
1180
1145
|
];
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
}
|
|
1190
|
-
if (swappable.length >= 2) {
|
|
1191
|
-
const [i, j] = [
|
|
1192
|
-
swappable[0],
|
|
1193
|
-
swappable[1]
|
|
1194
|
-
];
|
|
1195
|
-
[shuffled[i], shuffled[j]] = [
|
|
1196
|
-
shuffled[j],
|
|
1197
|
-
shuffled[i]
|
|
1198
|
-
];
|
|
1199
|
-
}
|
|
1146
|
+
const [i, j] = [
|
|
1147
|
+
(proposerIndex + 1) % shuffled.length,
|
|
1148
|
+
(proposerIndex + 2) % shuffled.length
|
|
1149
|
+
];
|
|
1150
|
+
const valueI = shuffled[i];
|
|
1151
|
+
const valueJ = shuffled[j];
|
|
1152
|
+
shuffled[i] = valueJ;
|
|
1153
|
+
shuffled[j] = valueI;
|
|
1200
1154
|
const signers = new CommitteeAttestationsAndSigners(attestations).getSigners();
|
|
1201
1155
|
return new MaliciousCommitteeAttestationsAndSigners(shuffled, signers);
|
|
1202
1156
|
}
|
|
@@ -1215,8 +1169,12 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1215
1169
|
* Adds the proposed block to the archiver so it's available via P2P.
|
|
1216
1170
|
* Gossip doesn't echo messages back to the sender, so the proposer's archiver/world-state
|
|
1217
1171
|
* would never receive its own block without this explicit sync.
|
|
1172
|
+
*
|
|
1173
|
+
* In fisherman mode we skip this push: the fisherman builds blocks locally for validation
|
|
1174
|
+
* and fee analysis only, and pushing them to the archiver causes spurious reorg cascades
|
|
1175
|
+
* whenever the real proposer's block arrives from L1.
|
|
1218
1176
|
*/ async syncProposedBlockToArchiver(block) {
|
|
1219
|
-
if (this.config.skipPushProposedBlocksToArchiver !== false) {
|
|
1177
|
+
if (this.config.skipPushProposedBlocksToArchiver !== false || this.config.fishermanMode) {
|
|
1220
1178
|
this.log.warn(`Skipping push of proposed block ${block.number} to archiver`, {
|
|
1221
1179
|
blockNumber: block.number,
|
|
1222
1180
|
slot: block.header.globalVariables.slotNumber
|
|
@@ -1232,16 +1190,16 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1232
1190
|
/** Runs fee analysis and logs checkpoint outcome as fisherman */ async handleCheckpointEndAsFisherman(checkpoint) {
|
|
1233
1191
|
// Perform L1 fee analysis before clearing requests
|
|
1234
1192
|
// The callback is invoked asynchronously after the next block is mined
|
|
1235
|
-
const feeAnalysis = await this.publisher.analyzeL1Fees(this.
|
|
1193
|
+
const feeAnalysis = await this.publisher.analyzeL1Fees(this.slot, (analysis)=>this.metrics.recordFishermanFeeAnalysis(analysis));
|
|
1236
1194
|
if (checkpoint) {
|
|
1237
|
-
this.log.info(`Validation checkpoint building SUCCEEDED for slot ${this.
|
|
1195
|
+
this.log.info(`Validation checkpoint building SUCCEEDED for slot ${this.slot}`, {
|
|
1238
1196
|
...checkpoint.toCheckpointInfo(),
|
|
1239
1197
|
...checkpoint.getStats(),
|
|
1240
1198
|
feeAnalysisId: feeAnalysis?.id
|
|
1241
1199
|
});
|
|
1242
1200
|
} else {
|
|
1243
|
-
this.log.warn(`Validation block building FAILED for slot ${this.
|
|
1244
|
-
slot: this.
|
|
1201
|
+
this.log.warn(`Validation block building FAILED for slot ${this.slot}`, {
|
|
1202
|
+
slot: this.slot,
|
|
1245
1203
|
feeAnalysisId: feeAnalysis?.id
|
|
1246
1204
|
});
|
|
1247
1205
|
this.metrics.recordCheckpointProposalFailed('block_build_failed');
|
|
@@ -1252,15 +1210,15 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1252
1210
|
* Helper to handle HA double-signing errors. Returns true if the error was handled (caller should yield).
|
|
1253
1211
|
*/ handleHASigningError(err, errorContext) {
|
|
1254
1212
|
if (err instanceof DutyAlreadySignedError) {
|
|
1255
|
-
this.log.info(`${errorContext} for slot ${this.
|
|
1256
|
-
slot: this.
|
|
1213
|
+
this.log.info(`${errorContext} for slot ${this.slot} already signed by another HA node, yielding`, {
|
|
1214
|
+
slot: this.slot,
|
|
1257
1215
|
signedByNode: err.signedByNode
|
|
1258
1216
|
});
|
|
1259
1217
|
return true;
|
|
1260
1218
|
}
|
|
1261
1219
|
if (err instanceof SlashingProtectionError) {
|
|
1262
|
-
this.log.info(`${errorContext} for slot ${this.
|
|
1263
|
-
slot: this.
|
|
1220
|
+
this.log.info(`${errorContext} for slot ${this.slot} blocked by slashing protection, yielding`, {
|
|
1221
|
+
slot: this.slot,
|
|
1264
1222
|
existingMessageHash: err.existingMessageHash,
|
|
1265
1223
|
attemptedMessageHash: err.attemptedMessageHash
|
|
1266
1224
|
});
|
|
@@ -20,7 +20,6 @@ export declare class CheckpointVoter {
|
|
|
20
20
|
private readonly config;
|
|
21
21
|
private readonly metrics;
|
|
22
22
|
private readonly log;
|
|
23
|
-
private slotTimestamp;
|
|
24
23
|
private governanceSigner;
|
|
25
24
|
private slashingSigner;
|
|
26
25
|
constructor(slot: SlotNumber, publisher: SequencerPublisher, attestorAddress: EthAddress, validatorClient: ValidatorClient, slasherClient: SlasherClientInterface | undefined, l1Constants: SequencerRollupConstants, config: ResolvedSequencerConfig, metrics: SequencerMetrics, log: Logger);
|
|
@@ -32,4 +31,4 @@ export declare class CheckpointVoter {
|
|
|
32
31
|
private enqueueGovernanceVote;
|
|
33
32
|
private enqueueSlashingVote;
|
|
34
33
|
}
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
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,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,MAAM,EAW7B;IAED;;;OAGG;IACH,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,EAAE,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAU3E;YAEa,qBAAqB;YA+BrB,mBAAmB;CA2BlC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
2
1
|
import { DutyAlreadySignedError } from '@aztec/validator-ha-signer/errors';
|
|
3
2
|
import { DutyType } from '@aztec/validator-ha-signer/types';
|
|
4
3
|
/**
|
|
@@ -13,7 +12,6 @@ import { DutyType } from '@aztec/validator-ha-signer/types';
|
|
|
13
12
|
config;
|
|
14
13
|
metrics;
|
|
15
14
|
log;
|
|
16
|
-
slotTimestamp;
|
|
17
15
|
governanceSigner;
|
|
18
16
|
slashingSigner;
|
|
19
17
|
constructor(slot, publisher, attestorAddress, validatorClient, slasherClient, l1Constants, config, metrics, log){
|
|
@@ -26,7 +24,6 @@ import { DutyType } from '@aztec/validator-ha-signer/types';
|
|
|
26
24
|
this.config = config;
|
|
27
25
|
this.metrics = metrics;
|
|
28
26
|
this.log = log;
|
|
29
|
-
this.slotTimestamp = getTimestampForSlot(this.slot, this.l1Constants);
|
|
30
27
|
// Create separate signers with appropriate duty contexts for governance and slashing votes
|
|
31
28
|
// These use HA protection to ensure only one node signs per slot/duty
|
|
32
29
|
const governanceContext = {
|
|
@@ -69,7 +66,7 @@ import { DutyType } from '@aztec/validator-ha-signer/types';
|
|
|
69
66
|
governanceProposerPayload: governanceProposerPayload.toString()
|
|
70
67
|
});
|
|
71
68
|
try {
|
|
72
|
-
return await this.publisher.enqueueGovernanceCastSignal(governanceProposerPayload, this.slot, this.
|
|
69
|
+
return await this.publisher.enqueueGovernanceCastSignal(governanceProposerPayload, this.slot, this.attestorAddress, this.governanceSigner);
|
|
73
70
|
} catch (err) {
|
|
74
71
|
if (err instanceof DutyAlreadySignedError) {
|
|
75
72
|
this.log.info(`Governance vote already signed by another node`, {
|
|
@@ -93,7 +90,7 @@ import { DutyType } from '@aztec/validator-ha-signer/types';
|
|
|
93
90
|
actionCount: actions.length
|
|
94
91
|
});
|
|
95
92
|
this.metrics.recordSlashingAttempt(actions.length);
|
|
96
|
-
return await this.publisher.enqueueSlashingActions(actions, this.slot, this.
|
|
93
|
+
return await this.publisher.enqueueSlashingActions(actions, this.slot, this.attestorAddress, this.slashingSigner);
|
|
97
94
|
} catch (err) {
|
|
98
95
|
if (err instanceof DutyAlreadySignedError) {
|
|
99
96
|
this.log.info(`Slashing vote already signed by another node`, {
|