@aztec/validator-client 0.0.1-commit.b1c78909e → 0.0.1-commit.b2a5d0dd1
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/README.md +9 -12
- package/dest/checkpoint_builder.d.ts +10 -7
- package/dest/checkpoint_builder.d.ts.map +1 -1
- package/dest/checkpoint_builder.js +64 -41
- package/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +4 -9
- package/dest/duties/validation_service.d.ts +7 -9
- package/dest/duties/validation_service.d.ts.map +1 -1
- package/dest/duties/validation_service.js +14 -26
- package/dest/factory.d.ts +7 -4
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +5 -5
- package/dest/index.d.ts +2 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/metrics.d.ts +6 -2
- package/dest/metrics.d.ts.map +1 -1
- package/dest/metrics.js +12 -0
- package/dest/proposal_handler.d.ts +108 -0
- package/dest/proposal_handler.d.ts.map +1 -0
- package/dest/{block_proposal_handler.js → proposal_handler.js} +393 -25
- package/dest/validator.d.ts +15 -20
- package/dest/validator.d.ts.map +1 -1
- package/dest/validator.js +59 -227
- package/package.json +19 -19
- package/src/checkpoint_builder.ts +79 -52
- package/src/config.ts +4 -9
- package/src/duties/validation_service.ts +17 -30
- package/src/factory.ts +10 -4
- package/src/index.ts +1 -1
- package/src/metrics.ts +19 -1
- package/src/{block_proposal_handler.ts → proposal_handler.ts} +441 -23
- package/src/validator.ts +85 -249
- package/dest/block_proposal_handler.d.ts +0 -64
- package/dest/block_proposal_handler.d.ts.map +0 -1
|
@@ -63,7 +63,9 @@ function _ts_dispose_resources(env) {
|
|
|
63
63
|
return next();
|
|
64
64
|
})(env);
|
|
65
65
|
}
|
|
66
|
+
import { encodeCheckpointBlobDataFromBlocks, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
66
67
|
import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
|
|
68
|
+
import { validateFeeAssetPriceModifier } from '@aztec/ethereum/contracts';
|
|
67
69
|
import { BlockNumber, CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
68
70
|
import { pick } from '@aztec/foundation/collection';
|
|
69
71
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
@@ -71,13 +73,14 @@ import { TimeoutError } from '@aztec/foundation/error';
|
|
|
71
73
|
import { createLogger } from '@aztec/foundation/log';
|
|
72
74
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
73
75
|
import { DateProvider, Timer } from '@aztec/foundation/timer';
|
|
76
|
+
import { validateCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
74
77
|
import { getEpochAtSlot, getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
75
78
|
import { Gas } from '@aztec/stdlib/gas';
|
|
76
|
-
import { computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging';
|
|
79
|
+
import { accumulateCheckpointOutHashes, computeInHashFromL1ToL2Messages } from '@aztec/stdlib/messaging';
|
|
77
80
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
78
81
|
import { ReExFailedTxsError, ReExInitialStateMismatchError, ReExStateMismatchError, ReExTimeoutError, TransactionsNotAvailableError } from '@aztec/stdlib/validators';
|
|
79
82
|
import { getTelemetryClient } from '@aztec/telemetry-client';
|
|
80
|
-
export class
|
|
83
|
+
/** Handles block and checkpoint proposals for both validator and non-validator nodes. */ export class ProposalHandler {
|
|
81
84
|
checkpointsBuilder;
|
|
82
85
|
worldState;
|
|
83
86
|
blockSource;
|
|
@@ -86,11 +89,15 @@ export class BlockProposalHandler {
|
|
|
86
89
|
blockProposalValidator;
|
|
87
90
|
epochCache;
|
|
88
91
|
config;
|
|
92
|
+
blobClient;
|
|
89
93
|
metrics;
|
|
90
94
|
dateProvider;
|
|
91
95
|
log;
|
|
92
96
|
tracer;
|
|
93
|
-
|
|
97
|
+
/** Cached last checkpoint validation result to avoid double-validation on validator nodes. */ lastCheckpointValidationResult;
|
|
98
|
+
/** Archiver reference for setting proposed checkpoints (pipelining). Set via register(). */ archiver;
|
|
99
|
+
/** Returns current validator addresses for own-proposal detection. Set via register(). */ getOwnValidatorAddresses;
|
|
100
|
+
constructor(checkpointsBuilder, worldState, blockSource, l1ToL2MessageSource, txProvider, blockProposalValidator, epochCache, config, blobClient, metrics, dateProvider = new DateProvider(), telemetry = getTelemetryClient(), log = createLogger('validator:proposal-handler')){
|
|
94
101
|
this.checkpointsBuilder = checkpointsBuilder;
|
|
95
102
|
this.worldState = worldState;
|
|
96
103
|
this.blockSource = blockSource;
|
|
@@ -99,18 +106,27 @@ export class BlockProposalHandler {
|
|
|
99
106
|
this.blockProposalValidator = blockProposalValidator;
|
|
100
107
|
this.epochCache = epochCache;
|
|
101
108
|
this.config = config;
|
|
109
|
+
this.blobClient = blobClient;
|
|
102
110
|
this.metrics = metrics;
|
|
103
111
|
this.dateProvider = dateProvider;
|
|
104
112
|
this.log = log;
|
|
105
113
|
if (config.fishermanMode) {
|
|
106
114
|
this.log = this.log.createChild('[FISHERMAN]');
|
|
107
115
|
}
|
|
108
|
-
this.tracer = telemetry.getTracer('
|
|
116
|
+
this.tracer = telemetry.getTracer('ProposalHandler');
|
|
109
117
|
}
|
|
110
|
-
|
|
118
|
+
/**
|
|
119
|
+
* Registers handlers for block and checkpoint proposals on the p2p client.
|
|
120
|
+
* Block proposals are registered for non-validator nodes (validators register their own enhanced handler).
|
|
121
|
+
* The all-nodes checkpoint proposal handler is always registered for validation, caching, and pipelining.
|
|
122
|
+
* @param archiver - Archiver reference for setting proposed checkpoints (pipelining)
|
|
123
|
+
* @param getOwnValidatorAddresses - Returns current validator addresses for own-proposal detection
|
|
124
|
+
*/ register(p2pClient, shouldReexecute, archiver, getOwnValidatorAddresses) {
|
|
125
|
+
this.archiver = archiver;
|
|
126
|
+
this.getOwnValidatorAddresses = getOwnValidatorAddresses;
|
|
111
127
|
// Non-validator handler that processes or re-executes for monitoring but does not attest.
|
|
112
128
|
// Returns boolean indicating whether the proposal was valid.
|
|
113
|
-
const
|
|
129
|
+
const blockHandler = async (proposal, proposalSender)=>{
|
|
114
130
|
try {
|
|
115
131
|
const { slotNumber, blockNumber } = proposal;
|
|
116
132
|
const result = await this.handleBlockProposal(proposal, proposalSender, shouldReexecute);
|
|
@@ -137,7 +153,44 @@ export class BlockProposalHandler {
|
|
|
137
153
|
return false;
|
|
138
154
|
}
|
|
139
155
|
};
|
|
140
|
-
p2pClient.registerBlockProposalHandler(
|
|
156
|
+
p2pClient.registerBlockProposalHandler(blockHandler);
|
|
157
|
+
// All-nodes checkpoint proposal handler: validates, caches, and sets proposed checkpoint for pipelining.
|
|
158
|
+
// Runs for all nodes (validators and non-validators). Validators get the cached result in the
|
|
159
|
+
// validator-specific callback (attestToCheckpointProposal) which runs after this one.
|
|
160
|
+
const checkpointHandler = async (proposal, _sender)=>{
|
|
161
|
+
try {
|
|
162
|
+
const pipeliningTimer = new Timer();
|
|
163
|
+
const proposalInfo = {
|
|
164
|
+
slot: proposal.slotNumber,
|
|
165
|
+
archive: proposal.archive.toString(),
|
|
166
|
+
proposer: proposal.getSender()?.toString()
|
|
167
|
+
};
|
|
168
|
+
// For own proposals, skip validation — the proposer already built and validated the checkpoint
|
|
169
|
+
const proposer = proposal.getSender();
|
|
170
|
+
const ownAddresses = this.getOwnValidatorAddresses?.();
|
|
171
|
+
const isOwnProposal = proposer && ownAddresses?.some((addr)=>addr === proposer.toString());
|
|
172
|
+
if (isOwnProposal) {
|
|
173
|
+
this.log.debug(`Skipping validation for own checkpoint proposal at slot ${proposal.slotNumber}`);
|
|
174
|
+
if (this.archiver && this.epochCache.isProposerPipeliningEnabled()) {
|
|
175
|
+
await this.setProposedCheckpointFromBlocks(proposal);
|
|
176
|
+
}
|
|
177
|
+
return undefined;
|
|
178
|
+
}
|
|
179
|
+
const result = await this.handleCheckpointProposal(proposal, proposalInfo);
|
|
180
|
+
if (result.isValid && this.archiver && this.epochCache.isProposerPipeliningEnabled()) {
|
|
181
|
+
const set = await this.setProposedCheckpointFromValidation(proposal);
|
|
182
|
+
if (set) {
|
|
183
|
+
this.metrics?.recordCheckpointProposalToPipelinedStateDuration(pipeliningTimer.ms());
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
} catch (err) {
|
|
187
|
+
this.log.warn(`Error handling checkpoint proposal for slot ${proposal.slotNumber}`, {
|
|
188
|
+
err
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
return undefined;
|
|
192
|
+
};
|
|
193
|
+
p2pClient.registerAllNodesCheckpointProposalHandler(checkpointHandler);
|
|
141
194
|
return this;
|
|
142
195
|
}
|
|
143
196
|
async handleBlockProposal(proposal, proposalSender, shouldReexecute) {
|
|
@@ -173,17 +226,21 @@ export class BlockProposalHandler {
|
|
|
173
226
|
};
|
|
174
227
|
}
|
|
175
228
|
// Ensure the block source is synced before checking for existing blocks,
|
|
176
|
-
// since a
|
|
229
|
+
// since a proposed checkpoint prune may remove blocks we'd otherwise find.
|
|
177
230
|
// This affects mostly the block_number_already_exists check, since a pending
|
|
178
231
|
// checkpoint prune could remove a block that would conflict with this proposal.
|
|
179
|
-
//
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
232
|
+
// When pipelining is enabled, the proposer builds ahead of L1 submission, so the
|
|
233
|
+
// block source won't have synced to the proposed slot yet. Skip the sync wait to
|
|
234
|
+
// avoid eating into the attestation window.
|
|
235
|
+
if (!this.epochCache.isProposerPipeliningEnabled()) {
|
|
236
|
+
const blockSourceSync = await this.waitForBlockSourceSync(slotNumber);
|
|
237
|
+
if (!blockSourceSync) {
|
|
238
|
+
this.log.warn(`Block source is not synced, skipping processing`, proposalInfo);
|
|
239
|
+
return {
|
|
240
|
+
isValid: false,
|
|
241
|
+
reason: 'block_source_not_synced'
|
|
242
|
+
};
|
|
243
|
+
}
|
|
187
244
|
}
|
|
188
245
|
// Check that the parent proposal is a block we know, otherwise reexecution would fail.
|
|
189
246
|
// If we don't find it immediately, we keep retrying for a while; it may be we still
|
|
@@ -294,7 +351,7 @@ export class BlockProposalHandler {
|
|
|
294
351
|
}
|
|
295
352
|
// If we succeeded, push this block into the archiver (unless disabled)
|
|
296
353
|
if (reexecutionResult?.block && this.config.skipPushProposedBlocksToArchiver === false) {
|
|
297
|
-
await this.blockSource.addBlock(reexecutionResult
|
|
354
|
+
await this.blockSource.addBlock(reexecutionResult.block);
|
|
298
355
|
}
|
|
299
356
|
this.log.info(`Successfully re-executed block ${blockNumber} proposal at index ${proposal.indexWithinCheckpoint} on slot ${slotNumber}`, {
|
|
300
357
|
...proposalInfo,
|
|
@@ -308,13 +365,12 @@ export class BlockProposalHandler {
|
|
|
308
365
|
}
|
|
309
366
|
async getParentBlock(proposal) {
|
|
310
367
|
const parentArchive = proposal.blockHeader.lastArchive.root;
|
|
311
|
-
const slot = proposal.slotNumber;
|
|
312
368
|
const config = this.checkpointsBuilder.getConfig();
|
|
313
369
|
const { genesisArchiveRoot } = await this.blockSource.getGenesisValues();
|
|
314
370
|
if (parentArchive.equals(genesisArchiveRoot)) {
|
|
315
371
|
return 'genesis';
|
|
316
372
|
}
|
|
317
|
-
const deadline = this.getReexecutionDeadline(
|
|
373
|
+
const deadline = this.getReexecutionDeadline(proposal.slotNumber, config);
|
|
318
374
|
const currentTime = this.dateProvider.now();
|
|
319
375
|
const timeoutDurationMs = deadline.getTime() - currentTime;
|
|
320
376
|
try {
|
|
@@ -460,8 +516,11 @@ export class BlockProposalHandler {
|
|
|
460
516
|
}
|
|
461
517
|
return undefined;
|
|
462
518
|
}
|
|
463
|
-
getReexecutionDeadline(
|
|
464
|
-
|
|
519
|
+
getReexecutionDeadline(slotNumber, config) {
|
|
520
|
+
// Under proposer pipelining, the proposal slot may be ahead of wall clock time.
|
|
521
|
+
// Reexecution budgets should still be bounded by the current slot we are in now.
|
|
522
|
+
const wallclockSlot = slotNumber - this.epochCache.pipeliningOffset();
|
|
523
|
+
const nextSlotTimestampSeconds = Number(getTimestampForSlot(SlotNumber(wallclockSlot + 1), config));
|
|
465
524
|
return new Date(nextSlotTimestampSeconds * 1000);
|
|
466
525
|
}
|
|
467
526
|
/** Waits for the block source to sync L1 data up to at least the slot before the given one. */ async waitForBlockSourceSync(slot) {
|
|
@@ -471,16 +530,17 @@ export class BlockProposalHandler {
|
|
|
471
530
|
return true;
|
|
472
531
|
}
|
|
473
532
|
// Make a quick check before triggering an archiver sync
|
|
533
|
+
// If we are pipelining and have a pending checkpoint number stored, we will allow the block proposal to be for a slot further
|
|
474
534
|
const syncedSlot = await this.blockSource.getSyncedL2SlotNumber();
|
|
475
|
-
if (syncedSlot !== undefined && syncedSlot + 1 >= slot) {
|
|
535
|
+
if (syncedSlot !== undefined && syncedSlot + 1 + this.epochCache.pipeliningOffset() >= slot) {
|
|
476
536
|
return true;
|
|
477
537
|
}
|
|
478
538
|
try {
|
|
479
539
|
// Trigger an immediate sync of the block source, and wait until it reports being synced to the required slot
|
|
480
540
|
return await retryUntil(async ()=>{
|
|
481
541
|
await this.blockSource.syncImmediate();
|
|
482
|
-
const
|
|
483
|
-
return
|
|
542
|
+
const updatedSyncedSlot = await this.blockSource.getSyncedL2SlotNumber();
|
|
543
|
+
return updatedSyncedSlot !== undefined && updatedSyncedSlot + 1 >= slot;
|
|
484
544
|
}, 'wait for block source sync', timeoutMs / 1000, 0.5);
|
|
485
545
|
} catch (err) {
|
|
486
546
|
if (err instanceof TimeoutError) {
|
|
@@ -492,7 +552,9 @@ export class BlockProposalHandler {
|
|
|
492
552
|
}
|
|
493
553
|
}
|
|
494
554
|
getReexecuteFailureReason(err) {
|
|
495
|
-
if (err instanceof
|
|
555
|
+
if (err instanceof TransactionsNotAvailableError) {
|
|
556
|
+
return 'txs_not_available';
|
|
557
|
+
} else if (err instanceof ReExInitialStateMismatchError) {
|
|
496
558
|
return 'initial_state_mismatch';
|
|
497
559
|
} else if (err instanceof ReExStateMismatchError) {
|
|
498
560
|
return 'state_mismatch';
|
|
@@ -550,6 +612,8 @@ export class BlockProposalHandler {
|
|
|
550
612
|
const deadline = this.getReexecutionDeadline(slot, config);
|
|
551
613
|
const maxBlockGas = this.config.validateMaxL2BlockGas !== undefined || this.config.validateMaxDABlockGas !== undefined ? new Gas(this.config.validateMaxDABlockGas ?? Infinity, this.config.validateMaxL2BlockGas ?? Infinity) : undefined;
|
|
552
614
|
const result = await checkpointBuilder.buildBlock(txs, blockNumber, blockHeader.globalVariables.timestamp, {
|
|
615
|
+
isBuildingProposal: false,
|
|
616
|
+
minValidTxs: 0,
|
|
553
617
|
deadline,
|
|
554
618
|
expectedEndState: blockHeader.state,
|
|
555
619
|
maxTransactions: this.config.validateMaxTxsPerBlock,
|
|
@@ -603,4 +667,308 @@ export class BlockProposalHandler {
|
|
|
603
667
|
if (result) await result;
|
|
604
668
|
}
|
|
605
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* Validates a checkpoint proposal, caches the result, and uploads blobs if configured.
|
|
672
|
+
* Returns a cached result if the same proposal (archive + slot) was already validated.
|
|
673
|
+
* Used by both the all-nodes callback (via register) and the validator client (via delegation).
|
|
674
|
+
*/ async handleCheckpointProposal(proposal, proposalInfo) {
|
|
675
|
+
const slot = proposal.slotNumber;
|
|
676
|
+
// Check cache: same archive+slot means we already validated this proposal
|
|
677
|
+
if (this.lastCheckpointValidationResult && this.lastCheckpointValidationResult.archive.equals(proposal.archive) && this.lastCheckpointValidationResult.slotNumber === slot) {
|
|
678
|
+
this.log.debug(`Returning cached validation result for checkpoint proposal at slot ${slot}`, proposalInfo);
|
|
679
|
+
return this.lastCheckpointValidationResult.result;
|
|
680
|
+
}
|
|
681
|
+
const proposer = proposal.getSender();
|
|
682
|
+
if (!proposer) {
|
|
683
|
+
this.log.warn(`Received checkpoint proposal with invalid signature for slot ${proposal.slotNumber}`);
|
|
684
|
+
const result = {
|
|
685
|
+
isValid: false,
|
|
686
|
+
reason: 'invalid_signature'
|
|
687
|
+
};
|
|
688
|
+
this.lastCheckpointValidationResult = {
|
|
689
|
+
archive: proposal.archive,
|
|
690
|
+
slotNumber: slot,
|
|
691
|
+
result
|
|
692
|
+
};
|
|
693
|
+
return result;
|
|
694
|
+
}
|
|
695
|
+
if (!validateFeeAssetPriceModifier(proposal.feeAssetPriceModifier)) {
|
|
696
|
+
this.log.warn(`Received checkpoint proposal with invalid feeAssetPriceModifier ${proposal.feeAssetPriceModifier} for slot ${proposal.slotNumber}`);
|
|
697
|
+
const result = {
|
|
698
|
+
isValid: false,
|
|
699
|
+
reason: 'invalid_fee_asset_price_modifier'
|
|
700
|
+
};
|
|
701
|
+
this.lastCheckpointValidationResult = {
|
|
702
|
+
archive: proposal.archive,
|
|
703
|
+
slotNumber: slot,
|
|
704
|
+
result
|
|
705
|
+
};
|
|
706
|
+
return result;
|
|
707
|
+
}
|
|
708
|
+
const result = await this.validateCheckpointProposal(proposal, proposalInfo);
|
|
709
|
+
this.lastCheckpointValidationResult = {
|
|
710
|
+
archive: proposal.archive,
|
|
711
|
+
slotNumber: slot,
|
|
712
|
+
result
|
|
713
|
+
};
|
|
714
|
+
// Upload blobs to filestore if validation passed (fire and forget)
|
|
715
|
+
if (result.isValid) {
|
|
716
|
+
this.tryUploadBlobsForCheckpoint(proposal, proposalInfo);
|
|
717
|
+
}
|
|
718
|
+
return result;
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Validates a checkpoint proposal by building the full checkpoint and comparing it with the proposal.
|
|
722
|
+
* @returns Validation result with isValid flag and reason if invalid.
|
|
723
|
+
*/ async validateCheckpointProposal(proposal, proposalInfo) {
|
|
724
|
+
const env = {
|
|
725
|
+
stack: [],
|
|
726
|
+
error: void 0,
|
|
727
|
+
hasError: false
|
|
728
|
+
};
|
|
729
|
+
try {
|
|
730
|
+
const slot = proposal.slotNumber;
|
|
731
|
+
// Timeout block syncing at the start of the next slot
|
|
732
|
+
const config = this.checkpointsBuilder.getConfig();
|
|
733
|
+
const nextSlotTimestampSeconds = Number(getTimestampForSlot(SlotNumber(slot + 1), config));
|
|
734
|
+
const timeoutSeconds = Math.max(1, nextSlotTimestampSeconds - Math.floor(this.dateProvider.now() / 1000));
|
|
735
|
+
// Wait for last block to sync by archive
|
|
736
|
+
let lastBlockHeader;
|
|
737
|
+
try {
|
|
738
|
+
lastBlockHeader = await retryUntil(async ()=>{
|
|
739
|
+
await this.blockSource.syncImmediate();
|
|
740
|
+
return this.blockSource.getBlockHeaderByArchive(proposal.archive);
|
|
741
|
+
}, `waiting for block with archive ${proposal.archive.toString()} for slot ${slot}`, timeoutSeconds, 0.5);
|
|
742
|
+
} catch (err) {
|
|
743
|
+
if (err instanceof TimeoutError) {
|
|
744
|
+
this.log.warn(`Timed out waiting for block with archive matching checkpoint proposal`, proposalInfo);
|
|
745
|
+
return {
|
|
746
|
+
isValid: false,
|
|
747
|
+
reason: 'last_block_not_found'
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
this.log.error(`Error fetching last block for checkpoint proposal`, err, proposalInfo);
|
|
751
|
+
return {
|
|
752
|
+
isValid: false,
|
|
753
|
+
reason: 'block_fetch_error'
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
if (!lastBlockHeader) {
|
|
757
|
+
this.log.warn(`Last block not found for checkpoint proposal`, proposalInfo);
|
|
758
|
+
return {
|
|
759
|
+
isValid: false,
|
|
760
|
+
reason: 'last_block_not_found'
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
// Get all full blocks for the slot and checkpoint
|
|
764
|
+
const blocks = await this.blockSource.getBlocksForSlot(slot);
|
|
765
|
+
if (blocks.length === 0) {
|
|
766
|
+
this.log.warn(`No blocks found for slot ${slot}`, proposalInfo);
|
|
767
|
+
return {
|
|
768
|
+
isValid: false,
|
|
769
|
+
reason: 'no_blocks_for_slot'
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
// Ensure the last block for this slot matches the archive in the checkpoint proposal
|
|
773
|
+
if (!blocks.at(-1)?.archive.root.equals(proposal.archive)) {
|
|
774
|
+
this.log.warn(`Last block archive mismatch for checkpoint proposal`, proposalInfo);
|
|
775
|
+
return {
|
|
776
|
+
isValid: false,
|
|
777
|
+
reason: 'last_block_archive_mismatch'
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
this.log.debug(`Found ${blocks.length} blocks for slot ${slot}`, {
|
|
781
|
+
...proposalInfo,
|
|
782
|
+
blockNumbers: blocks.map((b)=>b.number)
|
|
783
|
+
});
|
|
784
|
+
// Get checkpoint constants from first block
|
|
785
|
+
const firstBlock = blocks[0];
|
|
786
|
+
const constants = this.extractCheckpointConstants(firstBlock);
|
|
787
|
+
const checkpointNumber = firstBlock.checkpointNumber;
|
|
788
|
+
// Get L1-to-L2 messages for this checkpoint
|
|
789
|
+
const l1ToL2Messages = await this.l1ToL2MessageSource.getL1ToL2Messages(checkpointNumber);
|
|
790
|
+
// Collect the out hashes of all the checkpoints before this one in the same epoch
|
|
791
|
+
const epoch = getEpochAtSlot(slot, this.epochCache.getL1Constants());
|
|
792
|
+
const previousCheckpointOutHashes = (await this.blockSource.getCheckpointsDataForEpoch(epoch)).filter((c)=>c.checkpointNumber < checkpointNumber).map((c)=>c.checkpointOutHash);
|
|
793
|
+
// Fork world state at the block before the first block
|
|
794
|
+
const parentBlockNumber = BlockNumber(firstBlock.number - 1);
|
|
795
|
+
const fork = _ts_add_disposable_resource(env, await this.checkpointsBuilder.getFork(parentBlockNumber), true);
|
|
796
|
+
// Create checkpoint builder with all existing blocks
|
|
797
|
+
const checkpointBuilder = await this.checkpointsBuilder.openCheckpoint(checkpointNumber, constants, proposal.feeAssetPriceModifier, l1ToL2Messages, previousCheckpointOutHashes, fork, blocks, this.log.getBindings());
|
|
798
|
+
// Complete the checkpoint to get computed values
|
|
799
|
+
const computedCheckpoint = await checkpointBuilder.completeCheckpoint();
|
|
800
|
+
// Compare checkpoint header with proposal
|
|
801
|
+
if (!computedCheckpoint.header.equals(proposal.checkpointHeader)) {
|
|
802
|
+
this.log.warn(`Checkpoint header mismatch`, {
|
|
803
|
+
...proposalInfo,
|
|
804
|
+
computed: computedCheckpoint.header.toInspect(),
|
|
805
|
+
proposal: proposal.checkpointHeader.toInspect()
|
|
806
|
+
});
|
|
807
|
+
return {
|
|
808
|
+
isValid: false,
|
|
809
|
+
reason: 'checkpoint_header_mismatch'
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
// Compare archive root with proposal
|
|
813
|
+
if (!computedCheckpoint.archive.root.equals(proposal.archive)) {
|
|
814
|
+
this.log.warn(`Archive root mismatch`, {
|
|
815
|
+
...proposalInfo,
|
|
816
|
+
computed: computedCheckpoint.archive.root.toString(),
|
|
817
|
+
proposal: proposal.archive.toString()
|
|
818
|
+
});
|
|
819
|
+
return {
|
|
820
|
+
isValid: false,
|
|
821
|
+
reason: 'archive_mismatch'
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
// Check that the accumulated epoch out hash matches the value in the proposal.
|
|
825
|
+
// The epoch out hash is the accumulated hash of all checkpoint out hashes in the epoch.
|
|
826
|
+
const checkpointOutHash = computedCheckpoint.getCheckpointOutHash();
|
|
827
|
+
const computedEpochOutHash = accumulateCheckpointOutHashes([
|
|
828
|
+
...previousCheckpointOutHashes,
|
|
829
|
+
checkpointOutHash
|
|
830
|
+
]);
|
|
831
|
+
const proposalEpochOutHash = proposal.checkpointHeader.epochOutHash;
|
|
832
|
+
if (!computedEpochOutHash.equals(proposalEpochOutHash)) {
|
|
833
|
+
this.log.warn(`Epoch out hash mismatch`, {
|
|
834
|
+
proposalEpochOutHash: proposalEpochOutHash.toString(),
|
|
835
|
+
computedEpochOutHash: computedEpochOutHash.toString(),
|
|
836
|
+
checkpointOutHash: checkpointOutHash.toString(),
|
|
837
|
+
previousCheckpointOutHashes: previousCheckpointOutHashes.map((h)=>h.toString()),
|
|
838
|
+
...proposalInfo
|
|
839
|
+
});
|
|
840
|
+
return {
|
|
841
|
+
isValid: false,
|
|
842
|
+
reason: 'out_hash_mismatch'
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
// Final round of validations on the checkpoint, just in case.
|
|
846
|
+
try {
|
|
847
|
+
validateCheckpoint(computedCheckpoint, {
|
|
848
|
+
rollupManaLimit: this.checkpointsBuilder.getConfig().rollupManaLimit,
|
|
849
|
+
maxDABlockGas: this.config.validateMaxDABlockGas,
|
|
850
|
+
maxL2BlockGas: this.config.validateMaxL2BlockGas,
|
|
851
|
+
maxTxsPerBlock: this.config.validateMaxTxsPerBlock,
|
|
852
|
+
maxTxsPerCheckpoint: this.config.validateMaxTxsPerCheckpoint
|
|
853
|
+
});
|
|
854
|
+
} catch (err) {
|
|
855
|
+
this.log.warn(`Checkpoint validation failed: ${err}`, proposalInfo);
|
|
856
|
+
return {
|
|
857
|
+
isValid: false,
|
|
858
|
+
reason: 'checkpoint_validation_failed'
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
this.log.verbose(`Checkpoint proposal validation successful for slot ${slot}`, proposalInfo);
|
|
862
|
+
return {
|
|
863
|
+
isValid: true,
|
|
864
|
+
checkpointNumber
|
|
865
|
+
};
|
|
866
|
+
} catch (e) {
|
|
867
|
+
env.error = e;
|
|
868
|
+
env.hasError = true;
|
|
869
|
+
} finally{
|
|
870
|
+
const result = _ts_dispose_resources(env);
|
|
871
|
+
if (result) await result;
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
/** Extracts checkpoint global variables from a block. */ extractCheckpointConstants(block) {
|
|
875
|
+
const gv = block.header.globalVariables;
|
|
876
|
+
return {
|
|
877
|
+
chainId: gv.chainId,
|
|
878
|
+
version: gv.version,
|
|
879
|
+
slotNumber: gv.slotNumber,
|
|
880
|
+
timestamp: gv.timestamp,
|
|
881
|
+
coinbase: gv.coinbase,
|
|
882
|
+
feeRecipient: gv.feeRecipient,
|
|
883
|
+
gasFees: gv.gasFees
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
/** Triggers blob upload for a checkpoint if the blob client can upload (fire and forget). */ tryUploadBlobsForCheckpoint(proposal, proposalInfo) {
|
|
887
|
+
if (this.blobClient.canUpload()) {
|
|
888
|
+
void this.uploadBlobsForCheckpoint(proposal, proposalInfo);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
/** Uploads blobs for a checkpoint to the filestore. */ async uploadBlobsForCheckpoint(proposal, proposalInfo) {
|
|
892
|
+
try {
|
|
893
|
+
const lastBlockHeader = await this.blockSource.getBlockHeaderByArchive(proposal.archive);
|
|
894
|
+
if (!lastBlockHeader) {
|
|
895
|
+
this.log.warn(`Failed to get last block header for blob upload`, proposalInfo);
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
const blocks = await this.blockSource.getBlocksForSlot(proposal.slotNumber);
|
|
899
|
+
if (blocks.length === 0) {
|
|
900
|
+
this.log.warn(`No blocks found for blob upload`, proposalInfo);
|
|
901
|
+
return;
|
|
902
|
+
}
|
|
903
|
+
const blockBlobData = blocks.map((b)=>b.toBlockBlobData());
|
|
904
|
+
const blobFields = encodeCheckpointBlobDataFromBlocks(blockBlobData);
|
|
905
|
+
const blobs = await getBlobsPerL1Block(blobFields);
|
|
906
|
+
await this.blobClient.sendBlobsToFilestore(blobs);
|
|
907
|
+
this.log.debug(`Uploaded ${blobs.length} blobs to filestore for checkpoint at slot ${proposal.slotNumber}`, {
|
|
908
|
+
...proposalInfo,
|
|
909
|
+
numBlobs: blobs.length
|
|
910
|
+
});
|
|
911
|
+
} catch (err) {
|
|
912
|
+
this.log.warn(`Failed to upload blobs for checkpoint: ${err}`, proposalInfo);
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* Derives proposed checkpoint data from validated blocks and sets it on the archiver.
|
|
917
|
+
* Used after successful validation of a foreign proposal.
|
|
918
|
+
* Does not retry since we already waited for the block during validation.
|
|
919
|
+
*/ async setProposedCheckpointFromValidation(proposal) {
|
|
920
|
+
if (!this.archiver) {
|
|
921
|
+
return false;
|
|
922
|
+
}
|
|
923
|
+
const blockData = await this.blockSource.getBlockDataByArchive(proposal.archive);
|
|
924
|
+
if (!blockData) {
|
|
925
|
+
this.log.debug(`Block data not found for checkpoint proposal archive, cannot set proposed checkpoint`, {
|
|
926
|
+
archive: proposal.archive.toString()
|
|
927
|
+
});
|
|
928
|
+
return false;
|
|
929
|
+
}
|
|
930
|
+
await this.archiver.setProposedCheckpoint({
|
|
931
|
+
header: proposal.checkpointHeader,
|
|
932
|
+
checkpointNumber: blockData.checkpointNumber,
|
|
933
|
+
startBlock: BlockNumber(blockData.header.getBlockNumber() - blockData.indexWithinCheckpoint),
|
|
934
|
+
blockCount: blockData.indexWithinCheckpoint + 1,
|
|
935
|
+
totalManaUsed: proposal.checkpointHeader.totalManaUsed.toBigInt(),
|
|
936
|
+
feeAssetPriceModifier: proposal.feeAssetPriceModifier
|
|
937
|
+
});
|
|
938
|
+
return true;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* Sets proposed checkpoint from blocks for own proposals (skips full validation).
|
|
942
|
+
* Retries fetching block data since the checkpoint proposal often arrives before the last block
|
|
943
|
+
* finishes re-execution.
|
|
944
|
+
*/ async setProposedCheckpointFromBlocks(proposal) {
|
|
945
|
+
if (!this.archiver) {
|
|
946
|
+
return false;
|
|
947
|
+
}
|
|
948
|
+
let blockData = await this.blockSource.getBlockDataByArchive(proposal.archive);
|
|
949
|
+
if (!blockData) {
|
|
950
|
+
// The checkpoint proposal often arrives before the last block finishes re-execution.
|
|
951
|
+
// Retry until we find the data or give up at the end of the slot.
|
|
952
|
+
const nextSlot = this.epochCache.getSlotNow() + 1;
|
|
953
|
+
const timeOfNextSlot = getTimestampForSlot(SlotNumber(nextSlot), await this.archiver.getL1Constants());
|
|
954
|
+
const timeoutSeconds = Math.max(1, Number(timeOfNextSlot) - Math.floor(this.dateProvider.now() / 1000));
|
|
955
|
+
blockData = await retryUntil(()=>this.blockSource.getBlockDataByArchive(proposal.archive), 'block data for own checkpoint proposal', timeoutSeconds, 0.25).catch(()=>undefined);
|
|
956
|
+
}
|
|
957
|
+
if (blockData) {
|
|
958
|
+
await this.archiver.setProposedCheckpoint({
|
|
959
|
+
header: proposal.checkpointHeader,
|
|
960
|
+
checkpointNumber: blockData.checkpointNumber,
|
|
961
|
+
startBlock: BlockNumber(blockData.header.getBlockNumber() - blockData.indexWithinCheckpoint),
|
|
962
|
+
blockCount: blockData.indexWithinCheckpoint + 1,
|
|
963
|
+
totalManaUsed: proposal.checkpointHeader.totalManaUsed.toBigInt(),
|
|
964
|
+
feeAssetPriceModifier: proposal.feeAssetPriceModifier
|
|
965
|
+
});
|
|
966
|
+
return true;
|
|
967
|
+
} else {
|
|
968
|
+
this.log.debug(`Block data not found for own checkpoint proposal archive, cannot set proposed checkpoint`, {
|
|
969
|
+
archive: proposal.archive.toString()
|
|
970
|
+
});
|
|
971
|
+
return false;
|
|
972
|
+
}
|
|
973
|
+
}
|
|
606
974
|
}
|
package/dest/validator.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BlobClientInterface } from '@aztec/blob-client/client';
|
|
2
2
|
import type { EpochCache } from '@aztec/epoch-cache';
|
|
3
|
-
import {
|
|
3
|
+
import { CheckpointNumber, IndexWithinCheckpoint, SlotNumber } from '@aztec/foundation/branded-types';
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
6
|
import type { Signature } from '@aztec/foundation/eth-signature';
|
|
@@ -11,18 +11,18 @@ import type { P2P, PeerId } from '@aztec/p2p';
|
|
|
11
11
|
import { type Watcher, type WatcherEmitter } from '@aztec/slasher';
|
|
12
12
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
13
13
|
import type { CommitteeAttestationsAndSigners, L2BlockSink, L2BlockSource } from '@aztec/stdlib/block';
|
|
14
|
-
import type {
|
|
15
|
-
import {
|
|
14
|
+
import type { ITxProvider, Validator, ValidatorClientFullConfig, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
15
|
+
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
16
16
|
import { type BlockProposal, type BlockProposalOptions, type CheckpointAttestation, CheckpointProposal, type CheckpointProposalCore, type CheckpointProposalOptions } from '@aztec/stdlib/p2p';
|
|
17
17
|
import type { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
18
18
|
import type { BlockHeader, Tx } from '@aztec/stdlib/tx';
|
|
19
19
|
import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
|
|
20
|
-
import { type SigningContext } from '@aztec/validator-ha-signer/types';
|
|
20
|
+
import { type SigningContext, type SlashingProtectionDatabase } from '@aztec/validator-ha-signer/types';
|
|
21
21
|
import type { ValidatorHASigner } from '@aztec/validator-ha-signer/validator-ha-signer';
|
|
22
22
|
import type { TypedDataDefinition } from 'viem';
|
|
23
|
-
import { BlockProposalHandler } from './block_proposal_handler.js';
|
|
24
23
|
import type { FullNodeCheckpointsBuilder } from './checkpoint_builder.js';
|
|
25
24
|
import type { ExtendedValidatorKeyStore } from './key_store/interface.js';
|
|
25
|
+
import { ProposalHandler } from './proposal_handler.js';
|
|
26
26
|
declare const ValidatorClient_base: new () => WatcherEmitter;
|
|
27
27
|
/**
|
|
28
28
|
* Validator Client
|
|
@@ -31,7 +31,7 @@ export declare class ValidatorClient extends ValidatorClient_base implements Val
|
|
|
31
31
|
private keyStore;
|
|
32
32
|
private epochCache;
|
|
33
33
|
private p2pClient;
|
|
34
|
-
private
|
|
34
|
+
private proposalHandler;
|
|
35
35
|
private blockSource;
|
|
36
36
|
private checkpointsBuilder;
|
|
37
37
|
private worldState;
|
|
@@ -56,12 +56,12 @@ export declare class ValidatorClient extends ValidatorClient_base implements Val
|
|
|
56
56
|
private proposersOfInvalidBlocks;
|
|
57
57
|
/** Tracks the last checkpoint proposal we attested to, to prevent equivocation. */
|
|
58
58
|
private lastAttestedProposal?;
|
|
59
|
-
protected constructor(keyStore: ExtendedValidatorKeyStore, epochCache: EpochCache, p2pClient: P2P,
|
|
59
|
+
protected constructor(keyStore: ExtendedValidatorKeyStore, epochCache: EpochCache, p2pClient: P2P, proposalHandler: ProposalHandler, blockSource: L2BlockSource, checkpointsBuilder: FullNodeCheckpointsBuilder, worldState: WorldStateSynchronizer, l1ToL2MessageSource: L1ToL2MessageSource, config: ValidatorClientFullConfig, blobClient: BlobClientInterface, slashingProtectionSigner: ValidatorHASigner, dateProvider?: DateProvider, telemetry?: TelemetryClient, log?: Logger);
|
|
60
60
|
static validateKeyStoreConfiguration(keyStoreManager: KeystoreManager, logger?: Logger): void;
|
|
61
61
|
private handleEpochCommitteeUpdate;
|
|
62
|
-
static new(config: ValidatorClientFullConfig, checkpointsBuilder: FullNodeCheckpointsBuilder, worldState: WorldStateSynchronizer, epochCache: EpochCache, p2pClient: P2P, blockSource: L2BlockSource & L2BlockSink, l1ToL2MessageSource: L1ToL2MessageSource, txProvider: ITxProvider, keyStoreManager: KeystoreManager, blobClient: BlobClientInterface, dateProvider?: DateProvider, telemetry?: TelemetryClient): Promise<ValidatorClient>;
|
|
62
|
+
static new(config: ValidatorClientFullConfig, checkpointsBuilder: FullNodeCheckpointsBuilder, worldState: WorldStateSynchronizer, epochCache: EpochCache, p2pClient: P2P, blockSource: L2BlockSource & L2BlockSink, l1ToL2MessageSource: L1ToL2MessageSource, txProvider: ITxProvider, keyStoreManager: KeystoreManager, blobClient: BlobClientInterface, dateProvider?: DateProvider, telemetry?: TelemetryClient, slashingProtectionDb?: SlashingProtectionDatabase): Promise<ValidatorClient>;
|
|
63
63
|
getValidatorAddresses(): EthAddress[];
|
|
64
|
-
|
|
64
|
+
getProposalHandler(): ProposalHandler;
|
|
65
65
|
signWithAddress(addr: EthAddress, msg: TypedDataDefinition, context: SigningContext): Promise<Signature>;
|
|
66
66
|
getCoinbaseForAttestor(attestor: EthAddress): EthAddress;
|
|
67
67
|
getFeeRecipientForAttestor(attestor: EthAddress): AztecAddress;
|
|
@@ -91,11 +91,6 @@ export declare class ValidatorClient extends ValidatorClient_base implements Val
|
|
|
91
91
|
*/
|
|
92
92
|
private shouldAttestToSlot;
|
|
93
93
|
private createCheckpointAttestationsFromProposal;
|
|
94
|
-
private validateCheckpointProposal;
|
|
95
|
-
/**
|
|
96
|
-
* Extract checkpoint global variables from a block.
|
|
97
|
-
*/
|
|
98
|
-
private extractCheckpointConstants;
|
|
99
94
|
/**
|
|
100
95
|
* Uploads blobs for a checkpoint to the filestore (fire and forget).
|
|
101
96
|
*/
|
|
@@ -111,13 +106,13 @@ export declare class ValidatorClient extends ValidatorClient_base implements Val
|
|
|
111
106
|
* Emits a slash event when an attester signs attestations for different proposals at the same slot.
|
|
112
107
|
*/
|
|
113
108
|
private handleDuplicateAttestation;
|
|
114
|
-
createBlockProposal(blockHeader: BlockHeader, indexWithinCheckpoint: IndexWithinCheckpoint, inHash: Fr, archive: Fr, txs: Tx[], proposerAddress: EthAddress | undefined, options?: BlockProposalOptions): Promise<BlockProposal>;
|
|
115
|
-
createCheckpointProposal(checkpointHeader: CheckpointHeader, archive: Fr, feeAssetPriceModifier: bigint,
|
|
109
|
+
createBlockProposal(blockHeader: BlockHeader, checkpointNumber: CheckpointNumber, indexWithinCheckpoint: IndexWithinCheckpoint, inHash: Fr, archive: Fr, txs: Tx[], proposerAddress: EthAddress | undefined, options?: BlockProposalOptions): Promise<BlockProposal>;
|
|
110
|
+
createCheckpointProposal(checkpointHeader: CheckpointHeader, archive: Fr, checkpointNumber: CheckpointNumber, feeAssetPriceModifier: bigint, lastBlockProposal: BlockProposal | undefined, proposerAddress: EthAddress | undefined, options?: CheckpointProposalOptions): Promise<CheckpointProposal>;
|
|
116
111
|
broadcastBlockProposal(proposal: BlockProposal): Promise<void>;
|
|
117
|
-
signAttestationsAndSigners(attestationsAndSigners: CommitteeAttestationsAndSigners, proposer: EthAddress, slot: SlotNumber,
|
|
118
|
-
collectOwnAttestations(proposal: CheckpointProposal): Promise<CheckpointAttestation[]>;
|
|
119
|
-
collectAttestations(proposal: CheckpointProposal, required: number, deadline: Date): Promise<CheckpointAttestation[]>;
|
|
112
|
+
signAttestationsAndSigners(attestationsAndSigners: CommitteeAttestationsAndSigners, proposer: EthAddress, slot: SlotNumber, checkpointNumber: CheckpointNumber): Promise<Signature>;
|
|
113
|
+
collectOwnAttestations(proposal: CheckpointProposal, checkpointNumber: CheckpointNumber): Promise<CheckpointAttestation[]>;
|
|
114
|
+
collectAttestations(proposal: CheckpointProposal, required: number, deadline: Date, checkpointNumber: CheckpointNumber): Promise<CheckpointAttestation[]>;
|
|
120
115
|
private handleAuthRequest;
|
|
121
116
|
}
|
|
122
117
|
export {};
|
|
123
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
118
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFsaWRhdG9yLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvdmFsaWRhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFckUsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDckQsT0FBTyxFQUFFLGdCQUFnQixFQUFlLHFCQUFxQixFQUFFLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ25ILE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEVBQUUsS0FBSyxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0sdUJBQXVCLEN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