@aztec/sequencer-client 0.0.1-commit.9ee6fcc6 → 0.0.1-commit.9ef841308
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 +9 -6
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +42 -48
- package/dest/sequencer/checkpoint_proposal_job.js +1 -1
- 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/package.json +27 -27
- package/src/publisher/sequencer-publisher.ts +32 -55
- package/src/sequencer/checkpoint_proposal_job.ts +1 -1
- package/src/sequencer/checkpoint_voter.ts +1 -12
|
@@ -182,18 +182,17 @@ export declare class SequencerPublisher {
|
|
|
182
182
|
/** Simulates `propose` to make sure that the checkpoint is valid for submission */
|
|
183
183
|
validateCheckpointForSubmission(checkpoint: Checkpoint, attestationsAndSigners: CommitteeAttestationsAndSigners, attestationsAndSignersSignature: Signature, options: {
|
|
184
184
|
forcePendingCheckpointNumber?: CheckpointNumber;
|
|
185
|
-
}): Promise<
|
|
185
|
+
}): Promise<void>;
|
|
186
186
|
private enqueueCastSignalHelper;
|
|
187
187
|
private isPayloadEmpty;
|
|
188
188
|
/**
|
|
189
189
|
* Enqueues a governance castSignal transaction to cast a signal for a given slot number.
|
|
190
190
|
* @param slotNumber - The slot number to cast a signal for.
|
|
191
|
-
* @param timestamp - The timestamp of the slot to cast a signal for.
|
|
192
191
|
* @returns True if the signal was successfully enqueued, false otherwise.
|
|
193
192
|
*/
|
|
194
|
-
enqueueGovernanceCastSignal(governancePayload: EthAddress, slotNumber: SlotNumber,
|
|
193
|
+
enqueueGovernanceCastSignal(governancePayload: EthAddress, slotNumber: SlotNumber, signerAddress: EthAddress, signer: (msg: TypedDataDefinition) => Promise<`0x${string}`>): Promise<boolean>;
|
|
195
194
|
/** Enqueues all slashing actions as returned by the slasher client. */
|
|
196
|
-
enqueueSlashingActions(actions: ProposerSlashAction[], slotNumber: SlotNumber,
|
|
195
|
+
enqueueSlashingActions(actions: ProposerSlashAction[], slotNumber: SlotNumber, signerAddress: EthAddress, signer: (msg: TypedDataDefinition) => Promise<`0x${string}`>): Promise<boolean>;
|
|
197
196
|
/** Simulates and enqueues a proposal for a checkpoint on L1 */
|
|
198
197
|
enqueueProposeCheckpoint(checkpoint: Checkpoint, attestationsAndSigners: CommitteeAttestationsAndSigners, attestationsAndSignersSignature: Signature, opts?: {
|
|
199
198
|
txTimeoutAt?: Date;
|
|
@@ -215,7 +214,11 @@ export declare class SequencerPublisher {
|
|
|
215
214
|
private prepareProposeTx;
|
|
216
215
|
private simulateProposeTx;
|
|
217
216
|
private addProposeTx;
|
|
218
|
-
|
|
217
|
+
/** Returns the timestamp of the last L1 slot within a given L2 slot. Used as the simulation timestamp
|
|
218
|
+
* for eth_simulateV1 calls, since it's guaranteed to be greater than any L1 block produced during the slot. */
|
|
219
|
+
private getSimulationTimestamp;
|
|
220
|
+
/** Returns the timestamp of the next L1 slot boundary after now. */
|
|
221
|
+
private getNextL1SlotTimestamp;
|
|
219
222
|
}
|
|
220
223
|
export {};
|
|
221
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
224
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VxdWVuY2VyLXB1Ymxpc2hlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3B1Ymxpc2hlci9zZXF1ZW5jZXItcHVibGlzaGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFFckUsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDckQsT0FBT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EAAE,CAAC,GAC3D,OAAO,CAAC,OAAO,CAAC,CASlB;IAED,uEAAuE;IAC1D,sBAAsB,CACjC,OAAO,EAAE,mBAAmB,EAAE,EAC9B,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,UAAU,EACzB,MAAM,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,GAC3D,OAAO,CAAC,OAAO,CAAC,CA6GlB;IAED,+DAA+D;IAClD,wBAAwB,CACnC,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,+BAA+B,EACvD,+BAA+B,EAAE,SAAS,EAC1C,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAC;QAAC,4BAA4B,CAAC,EAAE,gBAAgB,CAAA;KAAO,GACjF,OAAO,CAAC,IAAI,CAAC,CAsCf;IAEM,2BAA2B,CAChC,OAAO,EAAE,2BAA2B,GAAG,SAAS,EAChD,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAA;KAAO,QA+BlC;YAEa,yBAAyB;IA0EvC;;;;;OAKG;IACI,SAAS,SAGf;IAED,wDAAwD;IACjD,OAAO,SAGb;YAEa,gBAAgB;YAoFhB,iBAAiB;YAoGjB,YAAY;IAqF1B;mHAC+G;IAC/G,OAAO,CAAC,sBAAsB;IAK9B,oEAAoE;IACpE,OAAO,CAAC,sBAAsB;CAI/B"}
|
|
@@ -391,7 +391,7 @@ import { Timer } from '@aztec/foundation/timer';
|
|
|
391
391
|
import { EmpireBaseAbi, ErrorsAbi, RollupAbi } from '@aztec/l1-artifacts';
|
|
392
392
|
import { encodeSlashConsensusVotes } from '@aztec/slasher';
|
|
393
393
|
import { CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
|
|
394
|
-
import { getNextL1SlotTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
394
|
+
import { getLastL1SlotTimestampForL2Slot, getNextL1SlotTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
395
395
|
import { getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
396
396
|
import { encodeFunctionData, keccak256, multicall3Abi, toHex } from 'viem';
|
|
397
397
|
import { createL1TxFailedStore } from './l1_tx_failed_store/index.js';
|
|
@@ -834,7 +834,7 @@ export class SequencerPublisher {
|
|
|
834
834
|
* @notice Will call `canProposeAt` to make sure that it is possible to propose
|
|
835
835
|
* @param tipArchive - The archive to check
|
|
836
836
|
* @returns The slot and block number if it is possible to propose, undefined otherwise
|
|
837
|
-
*/
|
|
837
|
+
*/ canProposeAt(tipArchive, msgSender, opts = {}) {
|
|
838
838
|
// TODO: #14291 - should loop through multiple keys to check if any of them can propose
|
|
839
839
|
const ignoredErrors = [
|
|
840
840
|
'SlotAlreadyInChain',
|
|
@@ -843,7 +843,7 @@ export class SequencerPublisher {
|
|
|
843
843
|
];
|
|
844
844
|
const pipelined = opts.pipelined ?? this.epochCache.isProposerPipeliningEnabled();
|
|
845
845
|
const slotOffset = pipelined ? this.aztecSlotDuration : 0n;
|
|
846
|
-
const nextL1SlotTs =
|
|
846
|
+
const nextL1SlotTs = this.getNextL1SlotTimestamp() + slotOffset;
|
|
847
847
|
return this.rollupContract.canProposeAt(tipArchive.toBuffer(), msgSender.toString(), nextL1SlotTs, {
|
|
848
848
|
forcePendingCheckpointNumber: opts.forcePendingCheckpointNumber
|
|
849
849
|
}).catch((err)=>{
|
|
@@ -876,7 +876,7 @@ export class SequencerPublisher {
|
|
|
876
876
|
header.blobsHash.toString(),
|
|
877
877
|
flags
|
|
878
878
|
];
|
|
879
|
-
const ts =
|
|
879
|
+
const ts = this.getSimulationTimestamp(header.slotNumber);
|
|
880
880
|
const stateOverrides = await this.rollupContract.makePendingCheckpointNumberOverride(opts?.forcePendingCheckpointNumber);
|
|
881
881
|
let balance = 0n;
|
|
882
882
|
if (this.config.fishermanMode) {
|
|
@@ -899,7 +899,7 @@ export class SequencerPublisher {
|
|
|
899
899
|
}),
|
|
900
900
|
from: MULTI_CALL_3_ADDRESS
|
|
901
901
|
}, {
|
|
902
|
-
time: ts
|
|
902
|
+
time: ts
|
|
903
903
|
}, stateOverrides);
|
|
904
904
|
this.log.debug(`Simulated validateHeader`);
|
|
905
905
|
}
|
|
@@ -1019,9 +1019,6 @@ export class SequencerPublisher {
|
|
|
1019
1019
|
}
|
|
1020
1020
|
}
|
|
1021
1021
|
/** Simulates `propose` to make sure that the checkpoint is valid for submission */ async validateCheckpointForSubmission(checkpoint, attestationsAndSigners, attestationsAndSignersSignature, options) {
|
|
1022
|
-
// Anchor the simulation timestamp to the checkpoint's own slot start time
|
|
1023
|
-
// rather than the current L1 block timestamp, which may overshoot into the next slot if the build ran late.
|
|
1024
|
-
const ts = checkpoint.header.timestamp;
|
|
1025
1022
|
const blobFields = checkpoint.toBlobFields();
|
|
1026
1023
|
const blobs = await getBlobsPerL1Block(blobFields);
|
|
1027
1024
|
const blobInput = getPrefixedEthBlobCommitments(blobs);
|
|
@@ -1038,10 +1035,9 @@ export class SequencerPublisher {
|
|
|
1038
1035
|
attestationsAndSignersSignature.toViemSignature(),
|
|
1039
1036
|
blobInput
|
|
1040
1037
|
];
|
|
1041
|
-
await this.simulateProposeTx(args,
|
|
1042
|
-
return ts;
|
|
1038
|
+
await this.simulateProposeTx(args, options);
|
|
1043
1039
|
}
|
|
1044
|
-
async enqueueCastSignalHelper(slotNumber,
|
|
1040
|
+
async enqueueCastSignalHelper(slotNumber, signalType, payload, base, signerAddress, signer) {
|
|
1045
1041
|
if (this.lastActions[signalType] && this.lastActions[signalType] === slotNumber) {
|
|
1046
1042
|
this.log.debug(`Skipping duplicate vote cast signal ${signalType} for slot ${slotNumber}`);
|
|
1047
1043
|
return false;
|
|
@@ -1098,6 +1094,7 @@ export class SequencerPublisher {
|
|
|
1098
1094
|
lastValidL2Slot: slotNumber
|
|
1099
1095
|
});
|
|
1100
1096
|
const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
|
|
1097
|
+
const timestamp = this.getSimulationTimestamp(slotNumber);
|
|
1101
1098
|
try {
|
|
1102
1099
|
await this.l1TxUtils.simulate(request, {
|
|
1103
1100
|
time: timestamp
|
|
@@ -1110,7 +1107,10 @@ export class SequencerPublisher {
|
|
|
1110
1107
|
});
|
|
1111
1108
|
} catch (err) {
|
|
1112
1109
|
const viemError = formatViemError(err);
|
|
1113
|
-
this.log.error(`Failed simulation for ${action} at slot ${slotNumber} (enqueuing the action anyway)`, viemError
|
|
1110
|
+
this.log.error(`Failed simulation for ${action} at slot ${slotNumber} (enqueuing the action anyway)`, viemError, {
|
|
1111
|
+
simulationTimestamp: timestamp,
|
|
1112
|
+
l1BlockNumber
|
|
1113
|
+
});
|
|
1114
1114
|
this.backupFailedTx({
|
|
1115
1115
|
id: keccak256(request.data),
|
|
1116
1116
|
failureType: 'simulation',
|
|
@@ -1175,12 +1175,11 @@ export class SequencerPublisher {
|
|
|
1175
1175
|
/**
|
|
1176
1176
|
* Enqueues a governance castSignal transaction to cast a signal for a given slot number.
|
|
1177
1177
|
* @param slotNumber - The slot number to cast a signal for.
|
|
1178
|
-
* @param timestamp - The timestamp of the slot to cast a signal for.
|
|
1179
1178
|
* @returns True if the signal was successfully enqueued, false otherwise.
|
|
1180
|
-
*/ enqueueGovernanceCastSignal(governancePayload, slotNumber,
|
|
1181
|
-
return this.enqueueCastSignalHelper(slotNumber,
|
|
1179
|
+
*/ enqueueGovernanceCastSignal(governancePayload, slotNumber, signerAddress, signer) {
|
|
1180
|
+
return this.enqueueCastSignalHelper(slotNumber, 'governance-signal', governancePayload, this.govProposerContract, signerAddress, signer);
|
|
1182
1181
|
}
|
|
1183
|
-
/** Enqueues all slashing actions as returned by the slasher client. */ async enqueueSlashingActions(actions, slotNumber,
|
|
1182
|
+
/** Enqueues all slashing actions as returned by the slasher client. */ async enqueueSlashingActions(actions, slotNumber, signerAddress, signer) {
|
|
1184
1183
|
if (actions.length === 0) {
|
|
1185
1184
|
this.log.debug(`No slashing actions to enqueue for slot ${slotNumber}`);
|
|
1186
1185
|
return false;
|
|
@@ -1196,7 +1195,7 @@ export class SequencerPublisher {
|
|
|
1196
1195
|
this.log.debug(`Enqueuing slashing vote for payload ${action.payload} at slot ${slotNumber}`, {
|
|
1197
1196
|
signerAddress
|
|
1198
1197
|
});
|
|
1199
|
-
await this.enqueueCastSignalHelper(slotNumber,
|
|
1198
|
+
await this.enqueueCastSignalHelper(slotNumber, 'empire-slashing-signal', action.payload, this.slashingProposerContract, signerAddress, signer);
|
|
1200
1199
|
break;
|
|
1201
1200
|
}
|
|
1202
1201
|
case 'create-empire-payload':
|
|
@@ -1206,7 +1205,7 @@ export class SequencerPublisher {
|
|
|
1206
1205
|
signerAddress
|
|
1207
1206
|
});
|
|
1208
1207
|
const request = this.slashFactoryContract.buildCreatePayloadRequest(action.data);
|
|
1209
|
-
await this.simulateAndEnqueueRequest('create-empire-payload', request, (receipt)=>!!this.slashFactoryContract.tryExtractSlashPayloadCreatedEvent(receipt.logs), slotNumber
|
|
1208
|
+
await this.simulateAndEnqueueRequest('create-empire-payload', request, (receipt)=>!!this.slashFactoryContract.tryExtractSlashPayloadCreatedEvent(receipt.logs), slotNumber);
|
|
1210
1209
|
break;
|
|
1211
1210
|
}
|
|
1212
1211
|
case 'execute-empire-payload':
|
|
@@ -1221,7 +1220,7 @@ export class SequencerPublisher {
|
|
|
1221
1220
|
}
|
|
1222
1221
|
const empireSlashingProposer = this.slashingProposerContract;
|
|
1223
1222
|
const request = empireSlashingProposer.buildExecuteRoundRequest(action.round);
|
|
1224
|
-
await this.simulateAndEnqueueRequest('execute-empire-payload', request, (receipt)=>!!empireSlashingProposer.tryExtractPayloadSubmittedEvent(receipt.logs), slotNumber
|
|
1223
|
+
await this.simulateAndEnqueueRequest('execute-empire-payload', request, (receipt)=>!!empireSlashingProposer.tryExtractPayloadSubmittedEvent(receipt.logs), slotNumber);
|
|
1225
1224
|
break;
|
|
1226
1225
|
}
|
|
1227
1226
|
case 'vote-offenses':
|
|
@@ -1239,7 +1238,7 @@ export class SequencerPublisher {
|
|
|
1239
1238
|
const tallySlashingProposer = this.slashingProposerContract;
|
|
1240
1239
|
const votes = bufferToHex(encodeSlashConsensusVotes(action.votes));
|
|
1241
1240
|
const request = await tallySlashingProposer.buildVoteRequestFromSigner(votes, slotNumber, signer);
|
|
1242
|
-
await this.simulateAndEnqueueRequest('vote-offenses', request, (receipt)=>!!tallySlashingProposer.tryExtractVoteCastEvent(receipt.logs), slotNumber
|
|
1241
|
+
await this.simulateAndEnqueueRequest('vote-offenses', request, (receipt)=>!!tallySlashingProposer.tryExtractVoteCastEvent(receipt.logs), slotNumber);
|
|
1243
1242
|
break;
|
|
1244
1243
|
}
|
|
1245
1244
|
case 'execute-slash':
|
|
@@ -1255,7 +1254,7 @@ export class SequencerPublisher {
|
|
|
1255
1254
|
}
|
|
1256
1255
|
const tallySlashingProposer = this.slashingProposerContract;
|
|
1257
1256
|
const request = tallySlashingProposer.buildExecuteRoundRequest(action.round, action.committees);
|
|
1258
|
-
await this.simulateAndEnqueueRequest('execute-slash', request, (receipt)=>!!tallySlashingProposer.tryExtractRoundExecutedEvent(receipt.logs), slotNumber
|
|
1257
|
+
await this.simulateAndEnqueueRequest('execute-slash', request, (receipt)=>!!tallySlashingProposer.tryExtractRoundExecutedEvent(receipt.logs), slotNumber);
|
|
1259
1258
|
break;
|
|
1260
1259
|
}
|
|
1261
1260
|
default:
|
|
@@ -1279,14 +1278,13 @@ export class SequencerPublisher {
|
|
|
1279
1278
|
attestationsAndSignersSignature,
|
|
1280
1279
|
feeAssetPriceModifier: checkpoint.feeAssetPriceModifier
|
|
1281
1280
|
};
|
|
1282
|
-
let ts;
|
|
1283
1281
|
try {
|
|
1284
1282
|
// @note This will make sure that we are passing the checks for our header ASSUMING that the data is also made available
|
|
1285
1283
|
// This means that we can avoid the simulation issues in later checks.
|
|
1286
1284
|
// By simulation issue, I mean the fact that the block.timestamp is equal to the last block, not the next, which
|
|
1287
1285
|
// make time consistency checks break.
|
|
1288
1286
|
// TODO(palla): Check whether we're validating twice, once here and once within addProposeTx, since we call simulateProposeTx in both places.
|
|
1289
|
-
|
|
1287
|
+
await this.validateCheckpointForSubmission(checkpoint, attestationsAndSigners, attestationsAndSignersSignature, opts);
|
|
1290
1288
|
} catch (err) {
|
|
1291
1289
|
this.log.error(`Checkpoint validation failed. ${err instanceof Error ? err.message : 'No error message'}`, err, {
|
|
1292
1290
|
...checkpoint.getStats(),
|
|
@@ -1299,7 +1297,7 @@ export class SequencerPublisher {
|
|
|
1299
1297
|
...checkpoint.toCheckpointInfo(),
|
|
1300
1298
|
...opts
|
|
1301
1299
|
});
|
|
1302
|
-
await this.addProposeTx(checkpoint, proposeTxArgs, opts
|
|
1300
|
+
await this.addProposeTx(checkpoint, proposeTxArgs, opts);
|
|
1303
1301
|
}
|
|
1304
1302
|
enqueueInvalidateCheckpoint(request, opts = {}) {
|
|
1305
1303
|
if (!request) {
|
|
@@ -1340,7 +1338,8 @@ export class SequencerPublisher {
|
|
|
1340
1338
|
}
|
|
1341
1339
|
});
|
|
1342
1340
|
}
|
|
1343
|
-
async simulateAndEnqueueRequest(action, request, checkSuccess, slotNumber
|
|
1341
|
+
async simulateAndEnqueueRequest(action, request, checkSuccess, slotNumber) {
|
|
1342
|
+
const timestamp = this.getSimulationTimestamp(slotNumber);
|
|
1344
1343
|
const logData = {
|
|
1345
1344
|
slotNumber,
|
|
1346
1345
|
timestamp,
|
|
@@ -1362,7 +1361,7 @@ export class SequencerPublisher {
|
|
|
1362
1361
|
try {
|
|
1363
1362
|
({ gasUsed } = await this.l1TxUtils.simulate(request, {
|
|
1364
1363
|
time: timestamp
|
|
1365
|
-
}, [], simulateAbi));
|
|
1364
|
+
}, [], simulateAbi));
|
|
1366
1365
|
this.log.verbose(`Simulation for ${action} succeeded`, {
|
|
1367
1366
|
...logData,
|
|
1368
1367
|
request,
|
|
@@ -1443,7 +1442,7 @@ export class SequencerPublisher {
|
|
|
1443
1442
|
this.interrupted = false;
|
|
1444
1443
|
this.l1TxUtils.restart();
|
|
1445
1444
|
}
|
|
1446
|
-
async prepareProposeTx(encodedData,
|
|
1445
|
+
async prepareProposeTx(encodedData, options) {
|
|
1447
1446
|
const kzg = Blob.getViemKzgInstance();
|
|
1448
1447
|
const blobInput = getPrefixedEthBlobCommitments(encodedData.blobs);
|
|
1449
1448
|
this.log.debug('Validating blob input', {
|
|
@@ -1520,7 +1519,7 @@ export class SequencerPublisher {
|
|
|
1520
1519
|
encodedData.attestationsAndSignersSignature.toViemSignature(),
|
|
1521
1520
|
blobInput
|
|
1522
1521
|
];
|
|
1523
|
-
const { rollupData, simulationResult } = await this.simulateProposeTx(args,
|
|
1522
|
+
const { rollupData, simulationResult } = await this.simulateProposeTx(args, options);
|
|
1524
1523
|
return {
|
|
1525
1524
|
args,
|
|
1526
1525
|
blobEvaluationGas,
|
|
@@ -1531,9 +1530,8 @@ export class SequencerPublisher {
|
|
|
1531
1530
|
/**
|
|
1532
1531
|
* Simulates the propose tx with eth_simulateV1
|
|
1533
1532
|
* @param args - The propose tx args
|
|
1534
|
-
* @param timestamp - The timestamp to simulate proposal at
|
|
1535
1533
|
* @returns The simulation result
|
|
1536
|
-
*/ async simulateProposeTx(args,
|
|
1534
|
+
*/ async simulateProposeTx(args, options) {
|
|
1537
1535
|
const rollupData = encodeFunctionData({
|
|
1538
1536
|
abi: RollupAbi,
|
|
1539
1537
|
functionName: 'propose',
|
|
@@ -1562,6 +1560,7 @@ export class SequencerPublisher {
|
|
|
1562
1560
|
});
|
|
1563
1561
|
}
|
|
1564
1562
|
const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
|
|
1563
|
+
const simTs = this.getSimulationTimestamp(SlotNumber.fromBigInt(args[0].header.slotNumber));
|
|
1565
1564
|
const simulationResult = await this.l1TxUtils.simulate({
|
|
1566
1565
|
to: this.rollupContract.address,
|
|
1567
1566
|
data: rollupData,
|
|
@@ -1570,8 +1569,7 @@ export class SequencerPublisher {
|
|
|
1570
1569
|
from: this.proposerAddressForSimulation.toString()
|
|
1571
1570
|
}
|
|
1572
1571
|
}, {
|
|
1573
|
-
|
|
1574
|
-
time: timestamp + 1n,
|
|
1572
|
+
time: simTs,
|
|
1575
1573
|
// @note reth should have a 30m gas limit per block but throws errors that this tx is beyond limit so we increase here
|
|
1576
1574
|
gasLimit: MAX_L1_TX_LIMIT * 2n
|
|
1577
1575
|
}, stateOverrides, RollupAbi, {
|
|
@@ -1588,7 +1586,9 @@ export class SequencerPublisher {
|
|
|
1588
1586
|
logs: []
|
|
1589
1587
|
};
|
|
1590
1588
|
}
|
|
1591
|
-
this.log.error(`Failed to simulate propose tx`, viemError
|
|
1589
|
+
this.log.error(`Failed to simulate propose tx`, viemError, {
|
|
1590
|
+
simulationTimestamp: simTs
|
|
1591
|
+
});
|
|
1592
1592
|
this.backupFailedTx({
|
|
1593
1593
|
id: keccak256(rollupData),
|
|
1594
1594
|
failureType: 'simulation',
|
|
@@ -1616,11 +1616,11 @@ export class SequencerPublisher {
|
|
|
1616
1616
|
simulationResult
|
|
1617
1617
|
};
|
|
1618
1618
|
}
|
|
1619
|
-
async addProposeTx(checkpoint, encodedData, opts = {}
|
|
1619
|
+
async addProposeTx(checkpoint, encodedData, opts = {}) {
|
|
1620
1620
|
const slot = checkpoint.header.slotNumber;
|
|
1621
1621
|
const timer = new Timer();
|
|
1622
1622
|
const kzg = Blob.getViemKzgInstance();
|
|
1623
|
-
const { rollupData, simulationResult, blobEvaluationGas } = await this.prepareProposeTx(encodedData,
|
|
1623
|
+
const { rollupData, simulationResult, blobEvaluationGas } = await this.prepareProposeTx(encodedData, opts);
|
|
1624
1624
|
const startBlock = await this.l1TxUtils.getBlockNumber();
|
|
1625
1625
|
const gasLimit = this.l1TxUtils.bumpGasLimit(BigInt(Math.ceil(Number(simulationResult.gasUsed) * 64 / 63)) + blobEvaluationGas + SequencerPublisher.MULTICALL_OVERHEAD_GAS_GUESS);
|
|
1626
1626
|
// Send the blobs to the blob client preemptively. This helps in tests where the sequencer mistakingly thinks that the propose
|
|
@@ -1685,19 +1685,13 @@ export class SequencerPublisher {
|
|
|
1685
1685
|
}
|
|
1686
1686
|
});
|
|
1687
1687
|
}
|
|
1688
|
-
/**
|
|
1689
|
-
*
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
* still in the previous L2 slot.
|
|
1695
|
-
* TODO(palla): Properly fix by keeping dateProvider synced with anvil's chain time on every block.
|
|
1696
|
-
*/ async getNextL1SlotTimestampWithL1Floor() {
|
|
1688
|
+
/** Returns the timestamp of the last L1 slot within a given L2 slot. Used as the simulation timestamp
|
|
1689
|
+
* for eth_simulateV1 calls, since it's guaranteed to be greater than any L1 block produced during the slot. */ getSimulationTimestamp(slot) {
|
|
1690
|
+
const l1Constants = this.epochCache.getL1Constants();
|
|
1691
|
+
return getLastL1SlotTimestampForL2Slot(slot, l1Constants);
|
|
1692
|
+
}
|
|
1693
|
+
/** Returns the timestamp of the next L1 slot boundary after now. */ getNextL1SlotTimestamp() {
|
|
1697
1694
|
const l1Constants = this.epochCache.getL1Constants();
|
|
1698
|
-
|
|
1699
|
-
const latestBlock = await this.l1TxUtils.client.getBlock();
|
|
1700
|
-
const fromL1Block = latestBlock.timestamp + BigInt(l1Constants.ethereumSlotDuration);
|
|
1701
|
-
return fromWallClock > fromL1Block ? fromWallClock : fromL1Block;
|
|
1695
|
+
return getNextL1SlotTimestamp(this.dateProvider.nowInSeconds(), l1Constants);
|
|
1702
1696
|
}
|
|
1703
1697
|
}
|
|
@@ -1216,7 +1216,7 @@ _dec = trackSpan('CheckpointProposalJob.execute'), _dec1 = trackSpan('Checkpoint
|
|
|
1216
1216
|
* Gossip doesn't echo messages back to the sender, so the proposer's archiver/world-state
|
|
1217
1217
|
* would never receive its own block without this explicit sync.
|
|
1218
1218
|
*/ async syncProposedBlockToArchiver(block) {
|
|
1219
|
-
if (this.config.skipPushProposedBlocksToArchiver
|
|
1219
|
+
if (this.config.skipPushProposedBlocksToArchiver) {
|
|
1220
1220
|
this.log.warn(`Skipping push of proposed block ${block.number} to archiver`, {
|
|
1221
1221
|
blockNumber: block.number,
|
|
1222
1222
|
slot: block.header.globalVariables.slotNumber
|
|
@@ -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,
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2twb2ludF92b3Rlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NlcXVlbmNlci9jaGVja3BvaW50X3ZvdGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2xFLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDN0QsT0FBTyxLQUFLLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztB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Ds7O09BR0c7SUFDSCxZQUFZLElBQUksQ0FBQyxPQUFPLENBQUMsT0FBTyxHQUFHLFNBQVMsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxPQUFPLEdBQUcsU0FBUyxDQUFDLENBQUMsQ0FVM0U7WUFFYSxxQkFBcUI7WUErQnJCLG1CQUFtQjtDQTJCbEMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkpoint_voter.d.ts","sourceRoot":"","sources":["../../src/sequencer/checkpoint_voter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"checkpoint_voter.d.ts","sourceRoot":"","sources":["../../src/sequencer/checkpoint_voter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D;;GAEG;AACH,qBAAa,eAAe;IAKxB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAZtB,OAAO,CAAC,gBAAgB,CAAuD;IAC/E,OAAO,CAAC,cAAc,CAAuD;IAE7E,YACmB,IAAI,EAAE,UAAU,EAChB,SAAS,EAAE,kBAAkB,EAC7B,eAAe,EAAE,UAAU,EAC3B,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,sBAAsB,GAAG,SAAS,EACjD,WAAW,EAAE,wBAAwB,EACrC,MAAM,EAAE,uBAAuB,EAC/B,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`, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/sequencer-client",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.9ef841308",
|
|
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": "0.0.1-commit.
|
|
30
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
31
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
32
|
-
"@aztec/blob-lib": "0.0.1-commit.
|
|
33
|
-
"@aztec/constants": "0.0.1-commit.
|
|
34
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
35
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
36
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
37
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
38
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
39
|
-
"@aztec/noir-acvm_js": "0.0.1-commit.
|
|
40
|
-
"@aztec/noir-contracts.js": "0.0.1-commit.
|
|
41
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
42
|
-
"@aztec/noir-types": "0.0.1-commit.
|
|
43
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
44
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
45
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
46
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
47
|
-
"@aztec/slasher": "0.0.1-commit.
|
|
48
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
49
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
50
|
-
"@aztec/validator-client": "0.0.1-commit.
|
|
51
|
-
"@aztec/validator-ha-signer": "0.0.1-commit.
|
|
52
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
29
|
+
"@aztec/aztec.js": "0.0.1-commit.9ef841308",
|
|
30
|
+
"@aztec/bb-prover": "0.0.1-commit.9ef841308",
|
|
31
|
+
"@aztec/blob-client": "0.0.1-commit.9ef841308",
|
|
32
|
+
"@aztec/blob-lib": "0.0.1-commit.9ef841308",
|
|
33
|
+
"@aztec/constants": "0.0.1-commit.9ef841308",
|
|
34
|
+
"@aztec/epoch-cache": "0.0.1-commit.9ef841308",
|
|
35
|
+
"@aztec/ethereum": "0.0.1-commit.9ef841308",
|
|
36
|
+
"@aztec/foundation": "0.0.1-commit.9ef841308",
|
|
37
|
+
"@aztec/l1-artifacts": "0.0.1-commit.9ef841308",
|
|
38
|
+
"@aztec/node-keystore": "0.0.1-commit.9ef841308",
|
|
39
|
+
"@aztec/noir-acvm_js": "0.0.1-commit.9ef841308",
|
|
40
|
+
"@aztec/noir-contracts.js": "0.0.1-commit.9ef841308",
|
|
41
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.9ef841308",
|
|
42
|
+
"@aztec/noir-types": "0.0.1-commit.9ef841308",
|
|
43
|
+
"@aztec/p2p": "0.0.1-commit.9ef841308",
|
|
44
|
+
"@aztec/protocol-contracts": "0.0.1-commit.9ef841308",
|
|
45
|
+
"@aztec/prover-client": "0.0.1-commit.9ef841308",
|
|
46
|
+
"@aztec/simulator": "0.0.1-commit.9ef841308",
|
|
47
|
+
"@aztec/slasher": "0.0.1-commit.9ef841308",
|
|
48
|
+
"@aztec/stdlib": "0.0.1-commit.9ef841308",
|
|
49
|
+
"@aztec/telemetry-client": "0.0.1-commit.9ef841308",
|
|
50
|
+
"@aztec/validator-client": "0.0.1-commit.9ef841308",
|
|
51
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.9ef841308",
|
|
52
|
+
"@aztec/world-state": "0.0.1-commit.9ef841308",
|
|
53
53
|
"lodash.chunk": "^4.2.0",
|
|
54
54
|
"tslib": "^2.4.0",
|
|
55
55
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
59
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
58
|
+
"@aztec/archiver": "0.0.1-commit.9ef841308",
|
|
59
|
+
"@aztec/kv-store": "0.0.1-commit.9ef841308",
|
|
60
60
|
"@electric-sql/pglite": "^0.3.14",
|
|
61
61
|
"@jest/globals": "^30.0.0",
|
|
62
62
|
"@types/jest": "^30.0.0",
|
|
@@ -42,7 +42,7 @@ import { EmpireBaseAbi, ErrorsAbi, RollupAbi } from '@aztec/l1-artifacts';
|
|
|
42
42
|
import { type ProposerSlashAction, encodeSlashConsensusVotes } from '@aztec/slasher';
|
|
43
43
|
import { CommitteeAttestationsAndSigners, type ValidateCheckpointResult } from '@aztec/stdlib/block';
|
|
44
44
|
import type { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
45
|
-
import { getNextL1SlotTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
45
|
+
import { getLastL1SlotTimestampForL2Slot, getNextL1SlotTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
46
46
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
47
47
|
import type { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
48
48
|
import type { L1PublishCheckpointStats } from '@aztec/stdlib/stats';
|
|
@@ -605,7 +605,7 @@ export class SequencerPublisher {
|
|
|
605
605
|
* @param tipArchive - The archive to check
|
|
606
606
|
* @returns The slot and block number if it is possible to propose, undefined otherwise
|
|
607
607
|
*/
|
|
608
|
-
public
|
|
608
|
+
public canProposeAt(
|
|
609
609
|
tipArchive: Fr,
|
|
610
610
|
msgSender: EthAddress,
|
|
611
611
|
opts: { forcePendingCheckpointNumber?: CheckpointNumber; pipelined?: boolean } = {},
|
|
@@ -615,7 +615,7 @@ export class SequencerPublisher {
|
|
|
615
615
|
|
|
616
616
|
const pipelined = opts.pipelined ?? this.epochCache.isProposerPipeliningEnabled();
|
|
617
617
|
const slotOffset = pipelined ? this.aztecSlotDuration : 0n;
|
|
618
|
-
const nextL1SlotTs =
|
|
618
|
+
const nextL1SlotTs = this.getNextL1SlotTimestamp() + slotOffset;
|
|
619
619
|
|
|
620
620
|
return this.rollupContract
|
|
621
621
|
.canProposeAt(tipArchive.toBuffer(), msgSender.toString(), nextL1SlotTs, {
|
|
@@ -656,7 +656,7 @@ export class SequencerPublisher {
|
|
|
656
656
|
flags,
|
|
657
657
|
] as const;
|
|
658
658
|
|
|
659
|
-
const ts =
|
|
659
|
+
const ts = this.getSimulationTimestamp(header.slotNumber);
|
|
660
660
|
const stateOverrides = await this.rollupContract.makePendingCheckpointNumberOverride(
|
|
661
661
|
opts?.forcePendingCheckpointNumber,
|
|
662
662
|
);
|
|
@@ -679,7 +679,7 @@ export class SequencerPublisher {
|
|
|
679
679
|
data: encodeFunctionData({ abi: RollupAbi, functionName: 'validateHeaderWithAttestations', args }),
|
|
680
680
|
from: MULTI_CALL_3_ADDRESS,
|
|
681
681
|
},
|
|
682
|
-
{ time: ts
|
|
682
|
+
{ time: ts },
|
|
683
683
|
stateOverrides,
|
|
684
684
|
);
|
|
685
685
|
this.log.debug(`Simulated validateHeader`);
|
|
@@ -820,10 +820,7 @@ export class SequencerPublisher {
|
|
|
820
820
|
attestationsAndSigners: CommitteeAttestationsAndSigners,
|
|
821
821
|
attestationsAndSignersSignature: Signature,
|
|
822
822
|
options: { forcePendingCheckpointNumber?: CheckpointNumber },
|
|
823
|
-
): Promise<
|
|
824
|
-
// Anchor the simulation timestamp to the checkpoint's own slot start time
|
|
825
|
-
// rather than the current L1 block timestamp, which may overshoot into the next slot if the build ran late.
|
|
826
|
-
const ts = checkpoint.header.timestamp;
|
|
823
|
+
): Promise<void> {
|
|
827
824
|
const blobFields = checkpoint.toBlobFields();
|
|
828
825
|
const blobs = await getBlobsPerL1Block(blobFields);
|
|
829
826
|
const blobInput = getPrefixedEthBlobCommitments(blobs);
|
|
@@ -842,13 +839,11 @@ export class SequencerPublisher {
|
|
|
842
839
|
blobInput,
|
|
843
840
|
] as const;
|
|
844
841
|
|
|
845
|
-
await this.simulateProposeTx(args,
|
|
846
|
-
return ts;
|
|
842
|
+
await this.simulateProposeTx(args, options);
|
|
847
843
|
}
|
|
848
844
|
|
|
849
845
|
private async enqueueCastSignalHelper(
|
|
850
846
|
slotNumber: SlotNumber,
|
|
851
|
-
timestamp: bigint,
|
|
852
847
|
signalType: GovernanceSignalAction,
|
|
853
848
|
payload: EthAddress,
|
|
854
849
|
base: IEmpireBase,
|
|
@@ -927,13 +922,17 @@ export class SequencerPublisher {
|
|
|
927
922
|
});
|
|
928
923
|
|
|
929
924
|
const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
|
|
925
|
+
const timestamp = this.getSimulationTimestamp(slotNumber);
|
|
930
926
|
|
|
931
927
|
try {
|
|
932
928
|
await this.l1TxUtils.simulate(request, { time: timestamp }, [], mergeAbis([request.abi ?? [], ErrorsAbi]));
|
|
933
929
|
this.log.debug(`Simulation for ${action} at slot ${slotNumber} succeeded`, { request });
|
|
934
930
|
} catch (err) {
|
|
935
931
|
const viemError = formatViemError(err);
|
|
936
|
-
this.log.error(`Failed simulation for ${action} at slot ${slotNumber} (enqueuing the action anyway)`, viemError
|
|
932
|
+
this.log.error(`Failed simulation for ${action} at slot ${slotNumber} (enqueuing the action anyway)`, viemError, {
|
|
933
|
+
simulationTimestamp: timestamp,
|
|
934
|
+
l1BlockNumber,
|
|
935
|
+
});
|
|
937
936
|
this.backupFailedTx({
|
|
938
937
|
id: keccak256(request.data!),
|
|
939
938
|
failureType: 'simulation',
|
|
@@ -996,19 +995,16 @@ export class SequencerPublisher {
|
|
|
996
995
|
/**
|
|
997
996
|
* Enqueues a governance castSignal transaction to cast a signal for a given slot number.
|
|
998
997
|
* @param slotNumber - The slot number to cast a signal for.
|
|
999
|
-
* @param timestamp - The timestamp of the slot to cast a signal for.
|
|
1000
998
|
* @returns True if the signal was successfully enqueued, false otherwise.
|
|
1001
999
|
*/
|
|
1002
1000
|
public enqueueGovernanceCastSignal(
|
|
1003
1001
|
governancePayload: EthAddress,
|
|
1004
1002
|
slotNumber: SlotNumber,
|
|
1005
|
-
timestamp: bigint,
|
|
1006
1003
|
signerAddress: EthAddress,
|
|
1007
1004
|
signer: (msg: TypedDataDefinition) => Promise<`0x${string}`>,
|
|
1008
1005
|
): Promise<boolean> {
|
|
1009
1006
|
return this.enqueueCastSignalHelper(
|
|
1010
1007
|
slotNumber,
|
|
1011
|
-
timestamp,
|
|
1012
1008
|
'governance-signal',
|
|
1013
1009
|
governancePayload,
|
|
1014
1010
|
this.govProposerContract,
|
|
@@ -1021,7 +1017,6 @@ export class SequencerPublisher {
|
|
|
1021
1017
|
public async enqueueSlashingActions(
|
|
1022
1018
|
actions: ProposerSlashAction[],
|
|
1023
1019
|
slotNumber: SlotNumber,
|
|
1024
|
-
timestamp: bigint,
|
|
1025
1020
|
signerAddress: EthAddress,
|
|
1026
1021
|
signer: (msg: TypedDataDefinition) => Promise<`0x${string}`>,
|
|
1027
1022
|
): Promise<boolean> {
|
|
@@ -1042,7 +1037,6 @@ export class SequencerPublisher {
|
|
|
1042
1037
|
});
|
|
1043
1038
|
await this.enqueueCastSignalHelper(
|
|
1044
1039
|
slotNumber,
|
|
1045
|
-
timestamp,
|
|
1046
1040
|
'empire-slashing-signal',
|
|
1047
1041
|
action.payload,
|
|
1048
1042
|
this.slashingProposerContract,
|
|
@@ -1061,7 +1055,6 @@ export class SequencerPublisher {
|
|
|
1061
1055
|
(receipt: TransactionReceipt) =>
|
|
1062
1056
|
!!this.slashFactoryContract.tryExtractSlashPayloadCreatedEvent(receipt.logs),
|
|
1063
1057
|
slotNumber,
|
|
1064
|
-
timestamp,
|
|
1065
1058
|
);
|
|
1066
1059
|
break;
|
|
1067
1060
|
}
|
|
@@ -1079,7 +1072,6 @@ export class SequencerPublisher {
|
|
|
1079
1072
|
request,
|
|
1080
1073
|
(receipt: TransactionReceipt) => !!empireSlashingProposer.tryExtractPayloadSubmittedEvent(receipt.logs),
|
|
1081
1074
|
slotNumber,
|
|
1082
|
-
timestamp,
|
|
1083
1075
|
);
|
|
1084
1076
|
break;
|
|
1085
1077
|
}
|
|
@@ -1103,7 +1095,6 @@ export class SequencerPublisher {
|
|
|
1103
1095
|
request,
|
|
1104
1096
|
(receipt: TransactionReceipt) => !!tallySlashingProposer.tryExtractVoteCastEvent(receipt.logs),
|
|
1105
1097
|
slotNumber,
|
|
1106
|
-
timestamp,
|
|
1107
1098
|
);
|
|
1108
1099
|
break;
|
|
1109
1100
|
}
|
|
@@ -1125,7 +1116,6 @@ export class SequencerPublisher {
|
|
|
1125
1116
|
request,
|
|
1126
1117
|
(receipt: TransactionReceipt) => !!tallySlashingProposer.tryExtractRoundExecutedEvent(receipt.logs),
|
|
1127
1118
|
slotNumber,
|
|
1128
|
-
timestamp,
|
|
1129
1119
|
);
|
|
1130
1120
|
break;
|
|
1131
1121
|
}
|
|
@@ -1161,15 +1151,13 @@ export class SequencerPublisher {
|
|
|
1161
1151
|
feeAssetPriceModifier: checkpoint.feeAssetPriceModifier,
|
|
1162
1152
|
};
|
|
1163
1153
|
|
|
1164
|
-
let ts: bigint;
|
|
1165
|
-
|
|
1166
1154
|
try {
|
|
1167
1155
|
// @note This will make sure that we are passing the checks for our header ASSUMING that the data is also made available
|
|
1168
1156
|
// This means that we can avoid the simulation issues in later checks.
|
|
1169
1157
|
// By simulation issue, I mean the fact that the block.timestamp is equal to the last block, not the next, which
|
|
1170
1158
|
// make time consistency checks break.
|
|
1171
1159
|
// TODO(palla): Check whether we're validating twice, once here and once within addProposeTx, since we call simulateProposeTx in both places.
|
|
1172
|
-
|
|
1160
|
+
await this.validateCheckpointForSubmission(
|
|
1173
1161
|
checkpoint,
|
|
1174
1162
|
attestationsAndSigners,
|
|
1175
1163
|
attestationsAndSignersSignature,
|
|
@@ -1185,7 +1173,7 @@ export class SequencerPublisher {
|
|
|
1185
1173
|
}
|
|
1186
1174
|
|
|
1187
1175
|
this.log.verbose(`Enqueuing checkpoint propose transaction`, { ...checkpoint.toCheckpointInfo(), ...opts });
|
|
1188
|
-
await this.addProposeTx(checkpoint, proposeTxArgs, opts
|
|
1176
|
+
await this.addProposeTx(checkpoint, proposeTxArgs, opts);
|
|
1189
1177
|
}
|
|
1190
1178
|
|
|
1191
1179
|
public enqueueInvalidateCheckpoint(
|
|
@@ -1228,8 +1216,8 @@ export class SequencerPublisher {
|
|
|
1228
1216
|
request: L1TxRequest,
|
|
1229
1217
|
checkSuccess: (receipt: TransactionReceipt) => boolean | undefined,
|
|
1230
1218
|
slotNumber: SlotNumber,
|
|
1231
|
-
timestamp: bigint,
|
|
1232
1219
|
) {
|
|
1220
|
+
const timestamp = this.getSimulationTimestamp(slotNumber);
|
|
1233
1221
|
const logData = { slotNumber, timestamp, gasLimit: undefined as bigint | undefined };
|
|
1234
1222
|
if (this.lastActions[action] && this.lastActions[action] === slotNumber) {
|
|
1235
1223
|
this.log.debug(`Skipping duplicate action ${action} for slot ${slotNumber}`);
|
|
@@ -1245,8 +1233,9 @@ export class SequencerPublisher {
|
|
|
1245
1233
|
|
|
1246
1234
|
let gasUsed: bigint;
|
|
1247
1235
|
const simulateAbi = mergeAbis([request.abi ?? [], ErrorsAbi]);
|
|
1236
|
+
|
|
1248
1237
|
try {
|
|
1249
|
-
({ gasUsed } = await this.l1TxUtils.simulate(request, { time: timestamp }, [], simulateAbi));
|
|
1238
|
+
({ gasUsed } = await this.l1TxUtils.simulate(request, { time: timestamp }, [], simulateAbi));
|
|
1250
1239
|
this.log.verbose(`Simulation for ${action} succeeded`, { ...logData, request, gasUsed });
|
|
1251
1240
|
} catch (err) {
|
|
1252
1241
|
const viemError = formatViemError(err, simulateAbi);
|
|
@@ -1315,7 +1304,6 @@ export class SequencerPublisher {
|
|
|
1315
1304
|
|
|
1316
1305
|
private async prepareProposeTx(
|
|
1317
1306
|
encodedData: L1ProcessArgs,
|
|
1318
|
-
timestamp: bigint,
|
|
1319
1307
|
options: { forcePendingCheckpointNumber?: CheckpointNumber },
|
|
1320
1308
|
) {
|
|
1321
1309
|
const kzg = Blob.getViemKzgInstance();
|
|
@@ -1388,7 +1376,7 @@ export class SequencerPublisher {
|
|
|
1388
1376
|
blobInput,
|
|
1389
1377
|
] as const;
|
|
1390
1378
|
|
|
1391
|
-
const { rollupData, simulationResult } = await this.simulateProposeTx(args,
|
|
1379
|
+
const { rollupData, simulationResult } = await this.simulateProposeTx(args, options);
|
|
1392
1380
|
|
|
1393
1381
|
return { args, blobEvaluationGas, rollupData, simulationResult };
|
|
1394
1382
|
}
|
|
@@ -1396,7 +1384,6 @@ export class SequencerPublisher {
|
|
|
1396
1384
|
/**
|
|
1397
1385
|
* Simulates the propose tx with eth_simulateV1
|
|
1398
1386
|
* @param args - The propose tx args
|
|
1399
|
-
* @param timestamp - The timestamp to simulate proposal at
|
|
1400
1387
|
* @returns The simulation result
|
|
1401
1388
|
*/
|
|
1402
1389
|
private async simulateProposeTx(
|
|
@@ -1413,7 +1400,6 @@ export class SequencerPublisher {
|
|
|
1413
1400
|
ViemSignature,
|
|
1414
1401
|
`0x${string}`,
|
|
1415
1402
|
],
|
|
1416
|
-
timestamp: bigint,
|
|
1417
1403
|
options: { forcePendingCheckpointNumber?: CheckpointNumber },
|
|
1418
1404
|
) {
|
|
1419
1405
|
const rollupData = encodeFunctionData({
|
|
@@ -1448,6 +1434,7 @@ export class SequencerPublisher {
|
|
|
1448
1434
|
}
|
|
1449
1435
|
|
|
1450
1436
|
const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
|
|
1437
|
+
const simTs = this.getSimulationTimestamp(SlotNumber.fromBigInt(args[0].header.slotNumber));
|
|
1451
1438
|
|
|
1452
1439
|
const simulationResult = await this.l1TxUtils
|
|
1453
1440
|
.simulate(
|
|
@@ -1458,8 +1445,7 @@ export class SequencerPublisher {
|
|
|
1458
1445
|
...(this.proposerAddressForSimulation && { from: this.proposerAddressForSimulation.toString() }),
|
|
1459
1446
|
},
|
|
1460
1447
|
{
|
|
1461
|
-
|
|
1462
|
-
time: timestamp + 1n,
|
|
1448
|
+
time: simTs,
|
|
1463
1449
|
// @note reth should have a 30m gas limit per block but throws errors that this tx is beyond limit so we increase here
|
|
1464
1450
|
gasLimit: MAX_L1_TX_LIMIT * 2n,
|
|
1465
1451
|
},
|
|
@@ -1481,7 +1467,7 @@ export class SequencerPublisher {
|
|
|
1481
1467
|
logs: [],
|
|
1482
1468
|
};
|
|
1483
1469
|
}
|
|
1484
|
-
this.log.error(`Failed to simulate propose tx`, viemError);
|
|
1470
|
+
this.log.error(`Failed to simulate propose tx`, viemError, { simulationTimestamp: simTs });
|
|
1485
1471
|
this.backupFailedTx({
|
|
1486
1472
|
id: keccak256(rollupData),
|
|
1487
1473
|
failureType: 'simulation',
|
|
@@ -1504,16 +1490,11 @@ export class SequencerPublisher {
|
|
|
1504
1490
|
checkpoint: Checkpoint,
|
|
1505
1491
|
encodedData: L1ProcessArgs,
|
|
1506
1492
|
opts: { txTimeoutAt?: Date; forcePendingCheckpointNumber?: CheckpointNumber } = {},
|
|
1507
|
-
timestamp: bigint,
|
|
1508
1493
|
): Promise<void> {
|
|
1509
1494
|
const slot = checkpoint.header.slotNumber;
|
|
1510
1495
|
const timer = new Timer();
|
|
1511
1496
|
const kzg = Blob.getViemKzgInstance();
|
|
1512
|
-
const { rollupData, simulationResult, blobEvaluationGas } = await this.prepareProposeTx(
|
|
1513
|
-
encodedData,
|
|
1514
|
-
timestamp,
|
|
1515
|
-
opts,
|
|
1516
|
-
);
|
|
1497
|
+
const { rollupData, simulationResult, blobEvaluationGas } = await this.prepareProposeTx(encodedData, opts);
|
|
1517
1498
|
const startBlock = await this.l1TxUtils.getBlockNumber();
|
|
1518
1499
|
const gasLimit = this.l1TxUtils.bumpGasLimit(
|
|
1519
1500
|
BigInt(Math.ceil((Number(simulationResult.gasUsed) * 64) / 63)) +
|
|
@@ -1590,20 +1571,16 @@ export class SequencerPublisher {
|
|
|
1590
1571
|
});
|
|
1591
1572
|
}
|
|
1592
1573
|
|
|
1593
|
-
/**
|
|
1594
|
-
*
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
private async getNextL1SlotTimestampWithL1Floor(): Promise<bigint> {
|
|
1574
|
+
/** Returns the timestamp of the last L1 slot within a given L2 slot. Used as the simulation timestamp
|
|
1575
|
+
* for eth_simulateV1 calls, since it's guaranteed to be greater than any L1 block produced during the slot. */
|
|
1576
|
+
private getSimulationTimestamp(slot: SlotNumber): bigint {
|
|
1577
|
+
const l1Constants = this.epochCache.getL1Constants();
|
|
1578
|
+
return getLastL1SlotTimestampForL2Slot(slot, l1Constants);
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
/** Returns the timestamp of the next L1 slot boundary after now. */
|
|
1582
|
+
private getNextL1SlotTimestamp(): bigint {
|
|
1603
1583
|
const l1Constants = this.epochCache.getL1Constants();
|
|
1604
|
-
|
|
1605
|
-
const latestBlock = await this.l1TxUtils.client.getBlock();
|
|
1606
|
-
const fromL1Block = latestBlock.timestamp + BigInt(l1Constants.ethereumSlotDuration);
|
|
1607
|
-
return fromWallClock > fromL1Block ? fromWallClock : fromL1Block;
|
|
1584
|
+
return getNextL1SlotTimestamp(this.dateProvider.nowInSeconds(), l1Constants);
|
|
1608
1585
|
}
|
|
1609
1586
|
}
|
|
@@ -960,7 +960,7 @@ export class CheckpointProposalJob implements Traceable {
|
|
|
960
960
|
* would never receive its own block without this explicit sync.
|
|
961
961
|
*/
|
|
962
962
|
private async syncProposedBlockToArchiver(block: L2Block): Promise<void> {
|
|
963
|
-
if (this.config.skipPushProposedBlocksToArchiver
|
|
963
|
+
if (this.config.skipPushProposedBlocksToArchiver) {
|
|
964
964
|
this.log.warn(`Skipping push of proposed block ${block.number} to archiver`, {
|
|
965
965
|
blockNumber: block.number,
|
|
966
966
|
slot: block.header.globalVariables.slotNumber,
|
|
@@ -2,7 +2,6 @@ import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import type { Logger } from '@aztec/foundation/log';
|
|
4
4
|
import type { SlasherClientInterface } from '@aztec/slasher';
|
|
5
|
-
import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
|
|
6
5
|
import type { ResolvedSequencerConfig } from '@aztec/stdlib/interfaces/server';
|
|
7
6
|
import type { ValidatorClient } from '@aztec/validator-client';
|
|
8
7
|
import { DutyAlreadySignedError } from '@aztec/validator-ha-signer/errors';
|
|
@@ -18,7 +17,6 @@ import type { SequencerRollupConstants } from './types.js';
|
|
|
18
17
|
* Handles governance and slashing voting for a given slot.
|
|
19
18
|
*/
|
|
20
19
|
export class CheckpointVoter {
|
|
21
|
-
private slotTimestamp: bigint;
|
|
22
20
|
private governanceSigner: (msg: TypedDataDefinition) => Promise<`0x${string}`>;
|
|
23
21
|
private slashingSigner: (msg: TypedDataDefinition) => Promise<`0x${string}`>;
|
|
24
22
|
|
|
@@ -33,8 +31,6 @@ export class CheckpointVoter {
|
|
|
33
31
|
private readonly metrics: SequencerMetrics,
|
|
34
32
|
private readonly log: Logger,
|
|
35
33
|
) {
|
|
36
|
-
this.slotTimestamp = getTimestampForSlot(this.slot, this.l1Constants);
|
|
37
|
-
|
|
38
34
|
// Create separate signers with appropriate duty contexts for governance and slashing votes
|
|
39
35
|
// These use HA protection to ensure only one node signs per slot/duty
|
|
40
36
|
const governanceContext: SigningContext = { slot: this.slot, dutyType: DutyType.GOVERNANCE_VOTE };
|
|
@@ -77,7 +73,6 @@ export class CheckpointVoter {
|
|
|
77
73
|
return await this.publisher.enqueueGovernanceCastSignal(
|
|
78
74
|
governanceProposerPayload,
|
|
79
75
|
this.slot,
|
|
80
|
-
this.slotTimestamp,
|
|
81
76
|
this.attestorAddress,
|
|
82
77
|
this.governanceSigner,
|
|
83
78
|
);
|
|
@@ -108,13 +103,7 @@ export class CheckpointVoter {
|
|
|
108
103
|
|
|
109
104
|
this.metrics.recordSlashingAttempt(actions.length);
|
|
110
105
|
|
|
111
|
-
return await this.publisher.enqueueSlashingActions(
|
|
112
|
-
actions,
|
|
113
|
-
this.slot,
|
|
114
|
-
this.slotTimestamp,
|
|
115
|
-
this.attestorAddress,
|
|
116
|
-
this.slashingSigner,
|
|
117
|
-
);
|
|
106
|
+
return await this.publisher.enqueueSlashingActions(actions, this.slot, this.attestorAddress, this.slashingSigner);
|
|
118
107
|
} catch (err) {
|
|
119
108
|
if (err instanceof DutyAlreadySignedError) {
|
|
120
109
|
this.log.info(`Slashing vote already signed by another node`, {
|