@aztec/ethereum 0.0.1-commit.b655e406 → 0.0.1-commit.c7c42ec
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/account.d.ts +1 -1
- package/dest/chain.d.ts +1 -1
- package/dest/client.d.ts +1 -1
- package/dest/client.js +6 -2
- package/dest/config.d.ts +11 -44
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +20 -332
- package/dest/constants.d.ts +1 -1
- package/dest/contracts/empire_base.d.ts +7 -5
- package/dest/contracts/empire_base.d.ts.map +1 -1
- package/dest/contracts/empire_base.js +1 -1
- package/dest/contracts/empire_slashing_proposer.d.ts +6 -4
- package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -1
- package/dest/contracts/empire_slashing_proposer.js +17 -2
- package/dest/contracts/errors.d.ts +1 -1
- package/dest/contracts/errors.d.ts.map +1 -1
- package/dest/contracts/fee_asset_handler.d.ts +1 -1
- package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
- package/dest/contracts/fee_juice.d.ts +1 -1
- package/dest/contracts/fee_juice.d.ts.map +1 -1
- package/dest/contracts/governance.d.ts +16 -16
- package/dest/contracts/governance.d.ts.map +1 -1
- package/dest/contracts/governance_proposer.d.ts +6 -4
- package/dest/contracts/governance_proposer.d.ts.map +1 -1
- package/dest/contracts/governance_proposer.js +17 -2
- package/dest/contracts/gse.d.ts +1 -1
- package/dest/contracts/gse.d.ts.map +1 -1
- package/dest/contracts/inbox.d.ts +7 -3
- package/dest/contracts/inbox.d.ts.map +1 -1
- package/dest/contracts/inbox.js +4 -0
- package/dest/contracts/index.d.ts +1 -1
- package/dest/contracts/multicall.d.ts +2 -2
- package/dest/contracts/multicall.d.ts.map +1 -1
- package/dest/contracts/registry.d.ts +1 -1
- package/dest/contracts/registry.d.ts.map +1 -1
- package/dest/contracts/rollup.d.ts +71 -64
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +90 -67
- package/dest/contracts/slasher_contract.d.ts +1 -1
- package/dest/contracts/slasher_contract.d.ts.map +1 -1
- package/dest/contracts/tally_slashing_proposer.d.ts +9 -7
- package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -1
- package/dest/contracts/tally_slashing_proposer.js +4 -4
- package/dest/contracts/utils.d.ts +1 -1
- package/dest/deploy_aztec_l1_contracts.d.ts +247 -0
- package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -0
- package/dest/deploy_aztec_l1_contracts.js +336 -0
- package/dest/deploy_l1_contract.d.ts +68 -0
- package/dest/deploy_l1_contract.d.ts.map +1 -0
- package/dest/deploy_l1_contract.js +312 -0
- package/dest/eth-signer/eth-signer.d.ts +1 -1
- package/dest/eth-signer/index.d.ts +1 -1
- package/dest/forwarder_proxy.d.ts +32 -0
- package/dest/forwarder_proxy.d.ts.map +1 -0
- package/dest/forwarder_proxy.js +93 -0
- package/dest/l1_artifacts.d.ts +2078 -880
- package/dest/l1_artifacts.d.ts.map +1 -1
- package/dest/l1_contract_addresses.d.ts +3 -3
- package/dest/l1_contract_addresses.d.ts.map +1 -1
- package/dest/l1_contract_addresses.js +3 -3
- package/dest/l1_reader.d.ts +3 -1
- package/dest/l1_reader.d.ts.map +1 -1
- package/dest/l1_reader.js +6 -0
- package/dest/l1_tx_utils/config.d.ts +5 -5
- package/dest/l1_tx_utils/config.d.ts.map +1 -1
- package/dest/l1_tx_utils/config.js +30 -7
- package/dest/l1_tx_utils/constants.d.ts +7 -1
- package/dest/l1_tx_utils/constants.d.ts.map +1 -1
- package/dest/l1_tx_utils/constants.js +25 -0
- package/dest/l1_tx_utils/factory.d.ts +1 -1
- package/dest/l1_tx_utils/fee-strategies/index.d.ts +9 -0
- package/dest/l1_tx_utils/fee-strategies/index.d.ts.map +1 -0
- package/dest/l1_tx_utils/fee-strategies/index.js +11 -0
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts +18 -0
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts.map +1 -0
- package/dest/l1_tx_utils/fee-strategies/p75_competitive.js +111 -0
- package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts +32 -0
- package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts.map +1 -0
- package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.js +173 -0
- package/dest/l1_tx_utils/fee-strategies/types.d.ts +64 -0
- package/dest/l1_tx_utils/fee-strategies/types.d.ts.map +1 -0
- package/dest/l1_tx_utils/fee-strategies/types.js +24 -0
- package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts +41 -0
- package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/forwarder_l1_tx_utils.js +48 -0
- package/dest/l1_tx_utils/index-blobs.d.ts +3 -0
- package/dest/l1_tx_utils/index-blobs.d.ts.map +1 -0
- package/dest/l1_tx_utils/index-blobs.js +2 -0
- package/dest/l1_tx_utils/index.d.ts +3 -1
- package/dest/l1_tx_utils/index.d.ts.map +1 -1
- package/dest/l1_tx_utils/index.js +2 -0
- package/dest/l1_tx_utils/interfaces.d.ts +2 -2
- package/dest/l1_tx_utils/interfaces.d.ts.map +1 -1
- package/dest/l1_tx_utils/l1_fee_analyzer.d.ts +233 -0
- package/dest/l1_tx_utils/l1_fee_analyzer.d.ts.map +1 -0
- package/dest/l1_tx_utils/l1_fee_analyzer.js +506 -0
- package/dest/l1_tx_utils/l1_tx_utils.d.ts +1 -2
- package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/l1_tx_utils.js +17 -4
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +1 -1
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +1 -1
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +19 -26
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -1
- package/dest/l1_tx_utils/readonly_l1_tx_utils.js +70 -141
- package/dest/l1_tx_utils/signer.d.ts +1 -1
- package/dest/l1_tx_utils/types.d.ts +1 -1
- package/dest/l1_tx_utils/types.d.ts.map +1 -1
- package/dest/l1_tx_utils/utils.d.ts +1 -1
- package/dest/l1_types.d.ts +1 -1
- package/dest/publisher_manager.d.ts +1 -1
- package/dest/publisher_manager.d.ts.map +1 -1
- package/dest/queries.d.ts +1 -1
- package/dest/queries.d.ts.map +1 -1
- package/dest/queries.js +10 -3
- package/dest/test/chain_monitor.d.ts +27 -24
- package/dest/test/chain_monitor.d.ts.map +1 -1
- package/dest/test/chain_monitor.js +32 -34
- package/dest/test/delayed_tx_utils.d.ts +1 -1
- package/dest/test/delayed_tx_utils.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes.d.ts +8 -12
- package/dest/test/eth_cheat_codes.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes.js +11 -3
- package/dest/test/eth_cheat_codes_with_state.d.ts +1 -1
- package/dest/test/eth_cheat_codes_with_state.d.ts.map +1 -1
- package/dest/test/index.d.ts +1 -1
- package/dest/test/rollup_cheat_codes.d.ts +14 -13
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +46 -39
- package/dest/test/start_anvil.d.ts +4 -1
- package/dest/test/start_anvil.d.ts.map +1 -1
- package/dest/test/start_anvil.js +2 -1
- package/dest/test/tx_delayer.d.ts +1 -1
- package/dest/test/tx_delayer.d.ts.map +1 -1
- package/dest/test/tx_delayer.js +4 -3
- package/dest/test/upgrade_utils.d.ts +1 -1
- package/dest/types.d.ts +57 -2
- package/dest/types.d.ts.map +1 -1
- package/dest/utils.d.ts +15 -3
- package/dest/utils.d.ts.map +1 -1
- package/dest/utils.js +18 -0
- package/dest/zkPassportVerifierAddress.d.ts +1 -1
- package/package.json +33 -14
- package/src/client.ts +2 -2
- package/src/config.ts +24 -412
- package/src/contracts/empire_base.ts +6 -5
- package/src/contracts/empire_slashing_proposer.ts +16 -5
- package/src/contracts/governance_proposer.ts +16 -5
- package/src/contracts/inbox.ts +7 -2
- package/src/contracts/rollup.ts +99 -82
- package/src/contracts/tally_slashing_proposer.ts +11 -8
- package/src/deploy_aztec_l1_contracts.ts +557 -0
- package/src/deploy_l1_contract.ts +362 -0
- package/src/forwarder_proxy.ts +108 -0
- package/src/l1_contract_addresses.ts +22 -20
- package/src/l1_reader.ts +8 -0
- package/src/l1_tx_utils/config.ts +32 -11
- package/src/l1_tx_utils/constants.ts +11 -0
- package/src/l1_tx_utils/fee-strategies/index.ts +22 -0
- package/src/l1_tx_utils/fee-strategies/p75_competitive.ts +159 -0
- package/src/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.ts +241 -0
- package/src/l1_tx_utils/fee-strategies/types.ts +88 -0
- package/src/l1_tx_utils/forwarder_l1_tx_utils.ts +119 -0
- package/src/l1_tx_utils/index-blobs.ts +2 -0
- package/src/l1_tx_utils/index.ts +2 -0
- package/src/l1_tx_utils/interfaces.ts +1 -1
- package/src/l1_tx_utils/l1_fee_analyzer.ts +804 -0
- package/src/l1_tx_utils/l1_tx_utils.ts +24 -4
- package/src/l1_tx_utils/readonly_l1_tx_utils.ts +78 -179
- package/src/queries.ts +12 -3
- package/src/test/chain_monitor.ts +50 -48
- package/src/test/eth_cheat_codes.ts +9 -3
- package/src/test/rollup_cheat_codes.ts +45 -43
- package/src/test/start_anvil.ts +4 -0
- package/src/test/tx_delayer.ts +5 -3
- package/src/types.ts +62 -0
- package/src/utils.ts +30 -1
- package/dest/deploy_l1_contracts.d.ts +0 -226
- package/dest/deploy_l1_contracts.d.ts.map +0 -1
- package/dest/deploy_l1_contracts.js +0 -1473
- package/dest/index.d.ts +0 -18
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -17
- package/src/deploy_l1_contracts.ts +0 -1849
- package/src/index.ts +0 -17
package/dest/contracts/rollup.js
CHANGED
|
@@ -4,8 +4,10 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
4
4
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
}
|
|
7
|
+
import { CheckpointNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
7
8
|
import { memoize } from '@aztec/foundation/decorators';
|
|
8
9
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
10
|
+
import { makeBackoff, retry } from '@aztec/foundation/retry';
|
|
9
11
|
import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
|
|
10
12
|
import { RollupStorage } from '@aztec/l1-artifacts/RollupStorage';
|
|
11
13
|
import chunk from 'lodash.chunk';
|
|
@@ -113,8 +115,8 @@ export class RollupContract {
|
|
|
113
115
|
getEpochDuration() {
|
|
114
116
|
return this.rollup.read.getEpochDuration();
|
|
115
117
|
}
|
|
116
|
-
getSlotDuration() {
|
|
117
|
-
return this.rollup.read.getSlotDuration();
|
|
118
|
+
async getSlotDuration() {
|
|
119
|
+
return Number(await this.rollup.read.getSlotDuration());
|
|
118
120
|
}
|
|
119
121
|
getTargetCommitteeSize() {
|
|
120
122
|
return this.rollup.read.getTargetCommitteeSize();
|
|
@@ -125,8 +127,11 @@ export class RollupContract {
|
|
|
125
127
|
getLocalEjectionThreshold() {
|
|
126
128
|
return this.rollup.read.getLocalEjectionThreshold();
|
|
127
129
|
}
|
|
128
|
-
|
|
129
|
-
return this.rollup.read.
|
|
130
|
+
getLagInEpochsForValidatorSet() {
|
|
131
|
+
return this.rollup.read.getLagInEpochsForValidatorSet();
|
|
132
|
+
}
|
|
133
|
+
getLagInEpochsForRandao() {
|
|
134
|
+
return this.rollup.read.getLagInEpochsForRandao();
|
|
130
135
|
}
|
|
131
136
|
getActivationThreshold() {
|
|
132
137
|
return this.rollup.read.getActivationThreshold();
|
|
@@ -169,7 +174,7 @@ export class RollupContract {
|
|
|
169
174
|
return {
|
|
170
175
|
l1StartBlock,
|
|
171
176
|
l1GenesisTime,
|
|
172
|
-
slotDuration
|
|
177
|
+
slotDuration,
|
|
173
178
|
epochDuration: Number(epochDuration),
|
|
174
179
|
proofSubmissionEpochs: Number(proofSubmissionEpochs)
|
|
175
180
|
};
|
|
@@ -199,17 +204,17 @@ export class RollupContract {
|
|
|
199
204
|
}
|
|
200
205
|
return await slasher.getProposer();
|
|
201
206
|
}
|
|
202
|
-
|
|
203
|
-
return this.rollup.read.
|
|
207
|
+
getCheckpointReward() {
|
|
208
|
+
return this.rollup.read.getCheckpointReward();
|
|
204
209
|
}
|
|
205
|
-
|
|
206
|
-
return this.rollup.read.
|
|
210
|
+
async getCheckpointNumber() {
|
|
211
|
+
return CheckpointNumber.fromBigInt(await this.rollup.read.getPendingCheckpointNumber());
|
|
207
212
|
}
|
|
208
|
-
|
|
209
|
-
return this.rollup.read.
|
|
213
|
+
async getProvenCheckpointNumber() {
|
|
214
|
+
return CheckpointNumber.fromBigInt(await this.rollup.read.getProvenCheckpointNumber());
|
|
210
215
|
}
|
|
211
|
-
getSlotNumber() {
|
|
212
|
-
return this.rollup.read.getCurrentSlot();
|
|
216
|
+
async getSlotNumber() {
|
|
217
|
+
return SlotNumber.fromBigInt(await this.rollup.read.getCurrentSlot());
|
|
213
218
|
}
|
|
214
219
|
getL1FeesAt(timestamp) {
|
|
215
220
|
return this.rollup.read.getL1FeesAt([
|
|
@@ -245,8 +250,8 @@ export class RollupContract {
|
|
|
245
250
|
getCurrentSampleSeed() {
|
|
246
251
|
return this.rollup.read.getCurrentSampleSeed();
|
|
247
252
|
}
|
|
248
|
-
getCurrentEpoch() {
|
|
249
|
-
return this.rollup.read.getCurrentEpoch();
|
|
253
|
+
async getCurrentEpoch() {
|
|
254
|
+
return EpochNumber.fromBigInt(await this.rollup.read.getCurrentEpoch());
|
|
250
255
|
}
|
|
251
256
|
async getCurrentEpochCommittee() {
|
|
252
257
|
const { result } = await this.client.simulateContract({
|
|
@@ -284,17 +289,34 @@ export class RollupContract {
|
|
|
284
289
|
});
|
|
285
290
|
return result;
|
|
286
291
|
}
|
|
287
|
-
|
|
288
|
-
return this.rollup.read.
|
|
289
|
-
BigInt(
|
|
292
|
+
getCheckpoint(checkpointNumber) {
|
|
293
|
+
return this.rollup.read.getCheckpoint([
|
|
294
|
+
BigInt(checkpointNumber)
|
|
290
295
|
]);
|
|
291
296
|
}
|
|
292
|
-
|
|
293
|
-
|
|
297
|
+
/** Returns the pending checkpoint from the rollup contract */ getPendingCheckpoint() {
|
|
298
|
+
// We retry because of race conditions during prunes: we may get a pending checkpoint number which is immediately
|
|
299
|
+
// reorged out due to a prune happening, causing the subsequent getCheckpoint call to fail. So we try again in that case.
|
|
300
|
+
return retry(async ()=>{
|
|
301
|
+
const pendingCheckpointNumber = await this.getCheckpointNumber();
|
|
302
|
+
const pendingCheckpoint = await this.getCheckpoint(pendingCheckpointNumber);
|
|
303
|
+
return pendingCheckpoint;
|
|
304
|
+
}, 'getting pending checkpoint', makeBackoff([
|
|
305
|
+
0.5,
|
|
306
|
+
0.5,
|
|
307
|
+
0.5
|
|
308
|
+
]));
|
|
309
|
+
}
|
|
310
|
+
async getTips() {
|
|
311
|
+
const { pending, proven } = await this.rollup.read.getTips();
|
|
312
|
+
return {
|
|
313
|
+
pending: CheckpointNumber.fromBigInt(pending),
|
|
314
|
+
proven: CheckpointNumber.fromBigInt(proven)
|
|
315
|
+
};
|
|
294
316
|
}
|
|
295
317
|
getTimestampForSlot(slot) {
|
|
296
318
|
return this.rollup.read.getTimestampForSlot([
|
|
297
|
-
slot
|
|
319
|
+
BigInt(slot)
|
|
298
320
|
]);
|
|
299
321
|
}
|
|
300
322
|
getEntryQueueLength() {
|
|
@@ -303,16 +325,16 @@ export class RollupContract {
|
|
|
303
325
|
getAvailableValidatorFlushes() {
|
|
304
326
|
return this.rollup.read.getAvailableValidatorFlushes();
|
|
305
327
|
}
|
|
306
|
-
getNextFlushableEpoch() {
|
|
307
|
-
return this.rollup.read.getNextFlushableEpoch();
|
|
328
|
+
async getNextFlushableEpoch() {
|
|
329
|
+
return EpochNumber.fromBigInt(await this.rollup.read.getNextFlushableEpoch());
|
|
308
330
|
}
|
|
309
|
-
getCurrentEpochNumber() {
|
|
310
|
-
return this.rollup.read.getCurrentEpoch();
|
|
331
|
+
async getCurrentEpochNumber() {
|
|
332
|
+
return EpochNumber.fromBigInt(await this.rollup.read.getCurrentEpoch());
|
|
311
333
|
}
|
|
312
|
-
|
|
313
|
-
return this.rollup.read.
|
|
314
|
-
BigInt(
|
|
315
|
-
]);
|
|
334
|
+
async getEpochNumberForCheckpoint(checkpointNumber) {
|
|
335
|
+
return EpochNumber.fromBigInt(await this.rollup.read.getEpochForCheckpoint([
|
|
336
|
+
BigInt(checkpointNumber)
|
|
337
|
+
]));
|
|
316
338
|
}
|
|
317
339
|
async getRollupAddresses() {
|
|
318
340
|
const [inboxAddress, outboxAddress, feeJuicePortalAddress, rewardDistributorAddress, feeJuiceAddress, stakingAssetAddress, gseAddress] = (await Promise.all([
|
|
@@ -339,9 +361,9 @@ export class RollupContract {
|
|
|
339
361
|
return EthAddress.fromString(await this.rollup.read.getFeeAssetPortal());
|
|
340
362
|
}
|
|
341
363
|
async getEpochNumberForSlotNumber(slotNumber) {
|
|
342
|
-
return await this.rollup.read.getEpochAtSlot([
|
|
343
|
-
slotNumber
|
|
344
|
-
]);
|
|
364
|
+
return EpochNumber.fromBigInt(await this.rollup.read.getEpochAtSlot([
|
|
365
|
+
BigInt(slotNumber)
|
|
366
|
+
]));
|
|
345
367
|
}
|
|
346
368
|
getEpochProofPublicInputs(args) {
|
|
347
369
|
return this.rollup.read.getEpochProofPublicInputs(args);
|
|
@@ -365,17 +387,15 @@ export class RollupContract {
|
|
|
365
387
|
* @dev Throws if unable to propose
|
|
366
388
|
*
|
|
367
389
|
* @param archive - The archive that we expect to be current state
|
|
368
|
-
* @return [slot,
|
|
390
|
+
* @return [slot, checkpointNumber, timeOfNextL1Slot] - If you can propose, the L2 slot number, checkpoint number and
|
|
391
|
+
* timestamp of the next L1 block
|
|
369
392
|
* @throws otherwise
|
|
370
393
|
*/ async canProposeAtNextEthBlock(archive, account, slotDuration, opts = {}) {
|
|
371
|
-
if (typeof slotDuration === 'number') {
|
|
372
|
-
slotDuration = BigInt(slotDuration);
|
|
373
|
-
}
|
|
374
394
|
const latestBlock = await this.client.getBlock();
|
|
375
|
-
const timeOfNextL1Slot = latestBlock.timestamp + slotDuration;
|
|
395
|
+
const timeOfNextL1Slot = latestBlock.timestamp + BigInt(slotDuration);
|
|
376
396
|
const who = typeof account === 'string' ? account : account.address;
|
|
377
397
|
try {
|
|
378
|
-
const { result: [slot,
|
|
398
|
+
const { result: [slot, checkpointNumber] } = await this.client.simulateContract({
|
|
379
399
|
address: this.address,
|
|
380
400
|
abi: RollupAbi,
|
|
381
401
|
functionName: 'canProposeAtTime',
|
|
@@ -385,11 +405,11 @@ export class RollupContract {
|
|
|
385
405
|
who
|
|
386
406
|
],
|
|
387
407
|
account,
|
|
388
|
-
stateOverride: await this.
|
|
408
|
+
stateOverride: await this.makePendingCheckpointNumberOverride(opts.forcePendingCheckpointNumber)
|
|
389
409
|
});
|
|
390
410
|
return {
|
|
391
|
-
slot,
|
|
392
|
-
|
|
411
|
+
slot: SlotNumber.fromBigInt(slot),
|
|
412
|
+
checkpointNumber: CheckpointNumber.fromBigInt(checkpointNumber),
|
|
393
413
|
timeOfNextL1Slot
|
|
394
414
|
};
|
|
395
415
|
} catch (err) {
|
|
@@ -397,11 +417,11 @@ export class RollupContract {
|
|
|
397
417
|
}
|
|
398
418
|
}
|
|
399
419
|
/**
|
|
400
|
-
* Returns a state override that sets the pending
|
|
401
|
-
* Requires querying the current state of the contract to get the current proven
|
|
420
|
+
* Returns a state override that sets the pending checkpoint number to the specified value. Useful for simulations.
|
|
421
|
+
* Requires querying the current state of the contract to get the current proven checkpoint number, as they are both
|
|
402
422
|
* stored in the same slot. If the argument is undefined, it returns an empty override.
|
|
403
|
-
*/ async
|
|
404
|
-
if (
|
|
423
|
+
*/ async makePendingCheckpointNumberOverride(forcePendingCheckpointNumber) {
|
|
424
|
+
if (forcePendingCheckpointNumber === undefined) {
|
|
405
425
|
return [];
|
|
406
426
|
}
|
|
407
427
|
const slot = RollupContract.stfStorageSlot;
|
|
@@ -409,8 +429,8 @@ export class RollupContract {
|
|
|
409
429
|
address: this.address,
|
|
410
430
|
slot
|
|
411
431
|
});
|
|
412
|
-
const
|
|
413
|
-
const newValue = BigInt(
|
|
432
|
+
const currentProvenCheckpointNumber = currentValue ? hexToBigInt(currentValue) & (1n << 128n) - 1n : 0n;
|
|
433
|
+
const newValue = BigInt(forcePendingCheckpointNumber) << 128n | currentProvenCheckpointNumber;
|
|
414
434
|
return [
|
|
415
435
|
{
|
|
416
436
|
address: this.address,
|
|
@@ -423,14 +443,14 @@ export class RollupContract {
|
|
|
423
443
|
}
|
|
424
444
|
];
|
|
425
445
|
}
|
|
426
|
-
/** Creates a request to Rollup#invalidateBadAttestation to be simulated or sent */ buildInvalidateBadAttestationRequest(
|
|
446
|
+
/** Creates a request to Rollup#invalidateBadAttestation to be simulated or sent */ buildInvalidateBadAttestationRequest(checkpointNumber, attestationsAndSigners, committee, invalidIndex) {
|
|
427
447
|
return {
|
|
428
448
|
to: this.address,
|
|
429
449
|
data: encodeFunctionData({
|
|
430
450
|
abi: RollupAbi,
|
|
431
451
|
functionName: 'invalidateBadAttestation',
|
|
432
452
|
args: [
|
|
433
|
-
BigInt(
|
|
453
|
+
BigInt(checkpointNumber),
|
|
434
454
|
attestationsAndSigners,
|
|
435
455
|
committee.map((addr)=>addr.toString()),
|
|
436
456
|
BigInt(invalidIndex)
|
|
@@ -438,27 +458,27 @@ export class RollupContract {
|
|
|
438
458
|
})
|
|
439
459
|
};
|
|
440
460
|
}
|
|
441
|
-
/** Creates a request to Rollup#invalidateInsufficientAttestations to be simulated or sent */ buildInvalidateInsufficientAttestationsRequest(
|
|
461
|
+
/** Creates a request to Rollup#invalidateInsufficientAttestations to be simulated or sent */ buildInvalidateInsufficientAttestationsRequest(checkpointNumber, attestationsAndSigners, committee) {
|
|
442
462
|
return {
|
|
443
463
|
to: this.address,
|
|
444
464
|
data: encodeFunctionData({
|
|
445
465
|
abi: RollupAbi,
|
|
446
466
|
functionName: 'invalidateInsufficientAttestations',
|
|
447
467
|
args: [
|
|
448
|
-
BigInt(
|
|
468
|
+
BigInt(checkpointNumber),
|
|
449
469
|
attestationsAndSigners,
|
|
450
470
|
committee.map((addr)=>addr.toString())
|
|
451
471
|
]
|
|
452
472
|
})
|
|
453
473
|
};
|
|
454
474
|
}
|
|
455
|
-
/** Calls getHasSubmitted directly. Returns whether the given prover has submitted a proof with the given length for the given epoch. */ getHasSubmittedProof(epochNumber,
|
|
475
|
+
/** Calls getHasSubmitted directly. Returns whether the given prover has submitted a proof with the given length for the given epoch. */ getHasSubmittedProof(epochNumber, numberOfCheckpointsInEpoch, prover) {
|
|
456
476
|
if (prover instanceof EthAddress) {
|
|
457
477
|
prover = prover.toString();
|
|
458
478
|
}
|
|
459
479
|
return this.rollup.read.getHasSubmitted([
|
|
460
480
|
BigInt(epochNumber),
|
|
461
|
-
BigInt(
|
|
481
|
+
BigInt(numberOfCheckpointsInEpoch),
|
|
462
482
|
prover
|
|
463
483
|
]);
|
|
464
484
|
}
|
|
@@ -468,15 +488,15 @@ export class RollupContract {
|
|
|
468
488
|
inFeeAsset
|
|
469
489
|
]);
|
|
470
490
|
}
|
|
471
|
-
getSlotAt(timestamp) {
|
|
472
|
-
return this.rollup.read.getSlotAt([
|
|
491
|
+
async getSlotAt(timestamp) {
|
|
492
|
+
return SlotNumber.fromBigInt(await this.rollup.read.getSlotAt([
|
|
473
493
|
timestamp
|
|
474
|
-
]);
|
|
494
|
+
]));
|
|
475
495
|
}
|
|
476
|
-
async status(
|
|
496
|
+
async status(checkpointNumber, options) {
|
|
477
497
|
await checkBlockTag(options?.blockNumber, this.client);
|
|
478
498
|
return this.rollup.read.status([
|
|
479
|
-
|
|
499
|
+
BigInt(checkpointNumber)
|
|
480
500
|
], options);
|
|
481
501
|
}
|
|
482
502
|
async canPruneAtTime(timestamp, options) {
|
|
@@ -488,9 +508,9 @@ export class RollupContract {
|
|
|
488
508
|
archive() {
|
|
489
509
|
return this.rollup.read.archive();
|
|
490
510
|
}
|
|
491
|
-
archiveAt(
|
|
511
|
+
archiveAt(checkpointNumber) {
|
|
492
512
|
return this.rollup.read.archiveAt([
|
|
493
|
-
|
|
513
|
+
BigInt(checkpointNumber)
|
|
494
514
|
]);
|
|
495
515
|
}
|
|
496
516
|
getSequencerRewards(address) {
|
|
@@ -536,9 +556,9 @@ export class RollupContract {
|
|
|
536
556
|
address
|
|
537
557
|
]);
|
|
538
558
|
}
|
|
539
|
-
getBlobCommitmentsHash(
|
|
559
|
+
getBlobCommitmentsHash(checkpointNumber) {
|
|
540
560
|
return this.rollup.read.getBlobCommitmentsHash([
|
|
541
|
-
|
|
561
|
+
BigInt(checkpointNumber)
|
|
542
562
|
]);
|
|
543
563
|
}
|
|
544
564
|
getCurrentBlobCommitmentsHash() {
|
|
@@ -584,14 +604,14 @@ export class RollupContract {
|
|
|
584
604
|
}
|
|
585
605
|
});
|
|
586
606
|
}
|
|
587
|
-
|
|
588
|
-
return this.rollup.watchEvent.
|
|
607
|
+
listenToCheckpointInvalidated(callback) {
|
|
608
|
+
return this.rollup.watchEvent.CheckpointInvalidated({}, {
|
|
589
609
|
onLogs: (logs)=>{
|
|
590
610
|
for (const log of logs){
|
|
591
611
|
const args = log.args;
|
|
592
|
-
if (args.
|
|
612
|
+
if (args.checkpointNumber !== undefined) {
|
|
593
613
|
callback({
|
|
594
|
-
|
|
614
|
+
checkpointNumber: CheckpointNumber.fromBigInt(args.checkpointNumber)
|
|
595
615
|
});
|
|
596
616
|
}
|
|
597
617
|
}
|
|
@@ -649,7 +669,10 @@ _ts_decorate([
|
|
|
649
669
|
], RollupContract.prototype, "getLocalEjectionThreshold", null);
|
|
650
670
|
_ts_decorate([
|
|
651
671
|
memoize
|
|
652
|
-
], RollupContract.prototype, "
|
|
672
|
+
], RollupContract.prototype, "getLagInEpochsForValidatorSet", null);
|
|
673
|
+
_ts_decorate([
|
|
674
|
+
memoize
|
|
675
|
+
], RollupContract.prototype, "getLagInEpochsForRandao", null);
|
|
653
676
|
_ts_decorate([
|
|
654
677
|
memoize
|
|
655
678
|
], RollupContract.prototype, "getActivationThreshold", null);
|
|
@@ -41,4 +41,4 @@ export declare class SlasherContract {
|
|
|
41
41
|
*/
|
|
42
42
|
getProposer(): Promise<EthAddress>;
|
|
43
43
|
}
|
|
44
|
-
//# sourceMappingURL=
|
|
44
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2xhc2hlcl9jb250cmFjdC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnRyYWN0cy9zbGFzaGVyX2NvbnRyYWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQU0zRCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFFOUM7O0dBRUc7QUFDSCxxQkFBYSxlQUFlO0lBSXhCLE9BQU8sQ0FBQyxRQUFRLENBQUMsTUFBTTtJQUN2QixPQUFPLENBQUMsUUFBUSxDQUFDLE9BQU87SUFDeEIsT0FBTyxDQUFDLFFBQVEsQ0FBQyxHQUFHO0lBTHRCLE9BQU8sQ0FBQyxRQUFRLENBQXVEO0lBRXZFLFlBQ21CLE1BQU0sRUFBRSxVQUFVLEVBQ2xCLE9BQU8sRUFBRSxVQUFVLEVBQ25CLEdBQUcseUNBQW1DLEVBT3hEO0lBRUQ7Ozs7T0FJRztJQUNVLGVBQWUsQ0FBQyxjQUFjLEVBQUUsVUFBVSxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FPekU7SUFFRDs7O09BR0c7SUFDVSxpQkFBaUIsSUFBSSxPQUFPLENBQUMsT0FBTyxDQUFDLENBT2pEO0lBRUQ7OztPQUdHO0lBQ1UsU0FBUyxJQUFJLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FHNUM7SUFFRDs7O09BR0c7SUFDVSwwQkFBMEIsSUFBSSxPQUFPLENBQUMsTUFBTSxDQUFDLENBR3pEO0lBRUQ7OztPQUdHO0lBQ1UsYUFBYSxJQUFJLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FHaEQ7SUFFRDs7O09BR0c7SUFDVSxXQUFXLElBQUksT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUc5QztDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slasher_contract.d.ts","sourceRoot":"","sources":["../../src/contracts/slasher_contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAM3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,qBAAa,eAAe;IAIxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG;IALtB,OAAO,CAAC,QAAQ,CAAuD;
|
|
1
|
+
{"version":3,"file":"slasher_contract.d.ts","sourceRoot":"","sources":["../../src/contracts/slasher_contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAM3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C;;GAEG;AACH,qBAAa,eAAe;IAIxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,GAAG;IALtB,OAAO,CAAC,QAAQ,CAAuD;IAEvE,YACmB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,UAAU,EACnB,GAAG,yCAAmC,EAOxD;IAED;;;;OAIG;IACU,eAAe,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAOzE;IAED;;;OAGG;IACU,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CAOjD;IAED;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC,CAG5C;IAED;;;OAGG;IACU,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC,CAGzD;IAED;;;OAGG;IACU,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC,CAGhD;IAED;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,UAAU,CAAC,CAG9C;CACF"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { L1TxRequest } from '@aztec/ethereum/l1-tx-utils';
|
|
2
|
+
import type { ViemClient } from '@aztec/ethereum/types';
|
|
3
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
4
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
3
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
6
|
import { type Hex, type Log, type TypedDataDefinition } from 'viem';
|
|
@@ -36,7 +38,7 @@ export declare class TallySlashingProposerContract {
|
|
|
36
38
|
* @param slot - The slot number to check at
|
|
37
39
|
* @returns Whether the round is ready to execute
|
|
38
40
|
*/
|
|
39
|
-
isRoundReadyToExecute(round: bigint, slot:
|
|
41
|
+
isRoundReadyToExecute(round: bigint, slot: SlotNumber): Promise<boolean>;
|
|
40
42
|
/** Returns the slash actions and payload address for a given round (zero if no slash actions) */
|
|
41
43
|
getPayload(round: bigint): Promise<{
|
|
42
44
|
actions: {
|
|
@@ -58,9 +60,9 @@ export declare class TallySlashingProposerContract {
|
|
|
58
60
|
tryExtractVoteCastEvent(logs: Log[]): {
|
|
59
61
|
eventName: "VoteCast";
|
|
60
62
|
args: {
|
|
63
|
+
proposer: `0x${string}`;
|
|
61
64
|
round: bigint;
|
|
62
65
|
slot: bigint;
|
|
63
|
-
proposer: `0x${string}`;
|
|
64
66
|
};
|
|
65
67
|
} | undefined;
|
|
66
68
|
/** Tries to extract a RoundExecuted event from the given logs. */
|
|
@@ -78,11 +80,11 @@ export declare class TallySlashingProposerContract {
|
|
|
78
80
|
* @param signer - The signer to produce the signature
|
|
79
81
|
* @returns L1 transaction request
|
|
80
82
|
*/
|
|
81
|
-
buildVoteRequestFromSigner(votes: Hex, slot:
|
|
83
|
+
buildVoteRequestFromSigner(votes: Hex, slot: SlotNumber, signer: (msg: TypedDataDefinition) => Promise<Hex>): Promise<L1TxRequest>;
|
|
82
84
|
/** Returns the typed data definition to EIP712-sign for voting */
|
|
83
|
-
buildVoteTypedData(votes: Hex, slot:
|
|
85
|
+
buildVoteTypedData(votes: Hex, slot: SlotNumber): TypedDataDefinition;
|
|
84
86
|
/** Gets the digest to sign for voting directly from the contract */
|
|
85
|
-
getVoteDataDigest(votes: Hex, slot:
|
|
87
|
+
getVoteDataDigest(votes: Hex, slot: SlotNumber): Promise<Buffer32>;
|
|
86
88
|
/**
|
|
87
89
|
* Create a transaction to vote for slashing offenses
|
|
88
90
|
* @param votes - The encoded votes for slashing
|
|
@@ -135,4 +137,4 @@ export declare class TallySlashingProposerContract {
|
|
|
135
137
|
* @returns An array of numbers representing the slash votes
|
|
136
138
|
*/
|
|
137
139
|
export declare function decodeSlashConsensusVotes(buffer: Buffer): number[];
|
|
138
|
-
//# sourceMappingURL=
|
|
140
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFsbHlfc2xhc2hpbmdfcHJvcG9zZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250cmFjdHMvdGFsbHlfc2xhc2hpbmdfcHJvcG9zZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI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DLElBQUksRUFBRTtRQUFFLEtBQUssRUFBRSxNQUFNLENBQUM7UUFBQyxRQUFRLEVBQUUsTUFBTSxDQUFBO0tBQUUsS0FBSyxJQUFJLEdBQUcsTUFBTSxJQUFJLENBY2pHO0lBRUQ7Ozs7T0FJRztJQUNJLHFCQUFxQixDQUMxQixRQUFRLEVBQUUsQ0FBQyxJQUFJLEVBQUU7UUFBRSxLQUFLLEVBQUUsTUFBTSxDQUFDO1FBQUMsVUFBVSxFQUFFLE1BQU0sQ0FBQztRQUFDLFdBQVcsRUFBRSxHQUFHLENBQUE7S0FBRSxLQUFLLElBQUksR0FDaEYsTUFBTSxJQUFJLENBY1o7Q0FDRjtBQUVEOzs7Ozs7O0dBT0c7QUFDSCx3QkFBZ0IseUJBQXlCLENBQUMsTUFBTSxFQUFFLE1BQU0sR0FBRyxNQUFNLEVBQUUsQ0FlbEUifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tally_slashing_proposer.d.ts","sourceRoot":"","sources":["../../src/contracts/tally_slashing_proposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tally_slashing_proposer.d.ts","sourceRoot":"","sources":["../../src/contracts/tally_slashing_proposer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,GAAG,EACR,KAAK,mBAAmB,EAGzB,MAAM,MAAM,CAAC;AAEd;;;GAGG;AACH,qBAAa,6BAA6B;aAMtB,MAAM,EAAE,UAAU;IALpC,OAAO,CAAC,Q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qB,CAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,GAAG,CAAA;KAAE,KAAK,IAAI,GAChF,MAAM,IAAI,CAcZ;CACF;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAelE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { tryExtractEvent } from '@aztec/ethereum';
|
|
1
|
+
import { tryExtractEvent } from '@aztec/ethereum/utils';
|
|
2
2
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
@@ -76,7 +76,7 @@ import { encodeFunctionData, getContract } from 'viem';
|
|
|
76
76
|
*/ async isRoundReadyToExecute(round, slot) {
|
|
77
77
|
return await this.contract.read.isRoundReadyToExecute([
|
|
78
78
|
round,
|
|
79
|
-
slot
|
|
79
|
+
BigInt(slot)
|
|
80
80
|
]);
|
|
81
81
|
}
|
|
82
82
|
/** Returns the slash actions and payload address for a given round (zero if no slash actions) */ async getPayload(round) {
|
|
@@ -186,14 +186,14 @@ import { encodeFunctionData, getContract } from 'viem';
|
|
|
186
186
|
primaryType: 'Vote',
|
|
187
187
|
message: {
|
|
188
188
|
votes,
|
|
189
|
-
slot
|
|
189
|
+
slot: BigInt(slot)
|
|
190
190
|
}
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
193
|
/** Gets the digest to sign for voting directly from the contract */ async getVoteDataDigest(votes, slot) {
|
|
194
194
|
return Buffer32.fromString(await this.contract.read.getVoteSignatureDigest([
|
|
195
195
|
votes,
|
|
196
|
-
slot
|
|
196
|
+
BigInt(slot)
|
|
197
197
|
]));
|
|
198
198
|
}
|
|
199
199
|
/**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ViemClient } from '../types.js';
|
|
2
2
|
export declare function checkBlockTag(block: bigint | undefined, publicClient: ViemClient): Promise<void>;
|
|
3
|
-
//# sourceMappingURL=
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250cmFjdHMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBSzlDLHdCQUFzQixhQUFhLENBQUMsS0FBSyxFQUFFLE1BQU0sR0FBRyxTQUFTLEVBQUUsWUFBWSxFQUFFLFVBQVUsaUJBUXRGIn0=
|