@aztec/ethereum 3.0.0-canary.a9708bd → 3.0.0-devnet.20251212

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.
Files changed (195) hide show
  1. package/dest/account.d.ts +1 -1
  2. package/dest/chain.d.ts +1 -1
  3. package/dest/client.d.ts +2 -2
  4. package/dest/client.d.ts.map +1 -1
  5. package/dest/config.d.ts +16 -8
  6. package/dest/config.d.ts.map +1 -1
  7. package/dest/config.js +160 -62
  8. package/dest/constants.d.ts +1 -1
  9. package/dest/contracts/empire_base.d.ts +7 -6
  10. package/dest/contracts/empire_base.d.ts.map +1 -1
  11. package/dest/contracts/empire_base.js +1 -1
  12. package/dest/contracts/empire_slashing_proposer.d.ts +7 -6
  13. package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -1
  14. package/dest/contracts/empire_slashing_proposer.js +9 -3
  15. package/dest/contracts/errors.d.ts +1 -1
  16. package/dest/contracts/errors.d.ts.map +1 -1
  17. package/dest/contracts/fee_asset_handler.d.ts +4 -4
  18. package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
  19. package/dest/contracts/fee_juice.d.ts +1 -1
  20. package/dest/contracts/fee_juice.d.ts.map +1 -1
  21. package/dest/contracts/governance.d.ts +16 -16
  22. package/dest/contracts/governance.d.ts.map +1 -1
  23. package/dest/contracts/governance.js +7 -3
  24. package/dest/contracts/governance_proposer.d.ts +6 -6
  25. package/dest/contracts/governance_proposer.d.ts.map +1 -1
  26. package/dest/contracts/governance_proposer.js +9 -4
  27. package/dest/contracts/gse.d.ts +1 -1
  28. package/dest/contracts/gse.d.ts.map +1 -1
  29. package/dest/contracts/inbox.d.ts +1 -1
  30. package/dest/contracts/inbox.d.ts.map +1 -1
  31. package/dest/contracts/index.d.ts +1 -1
  32. package/dest/contracts/multicall.d.ts +5 -7
  33. package/dest/contracts/multicall.d.ts.map +1 -1
  34. package/dest/contracts/multicall.js +6 -4
  35. package/dest/contracts/registry.d.ts +1 -1
  36. package/dest/contracts/registry.d.ts.map +1 -1
  37. package/dest/contracts/rollup.d.ts +83 -72
  38. package/dest/contracts/rollup.d.ts.map +1 -1
  39. package/dest/contracts/rollup.js +144 -139
  40. package/dest/contracts/slasher_contract.d.ts +11 -1
  41. package/dest/contracts/slasher_contract.d.ts.map +1 -1
  42. package/dest/contracts/slasher_contract.js +18 -0
  43. package/dest/contracts/tally_slashing_proposer.d.ts +30 -9
  44. package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -1
  45. package/dest/contracts/tally_slashing_proposer.js +58 -8
  46. package/dest/contracts/utils.d.ts +1 -1
  47. package/dest/deploy_l1_contracts.d.ts +477 -15
  48. package/dest/deploy_l1_contracts.d.ts.map +1 -1
  49. package/dest/deploy_l1_contracts.js +610 -386
  50. package/dest/eth-signer/eth-signer.d.ts +1 -1
  51. package/dest/eth-signer/index.d.ts +1 -1
  52. package/dest/forwarder_proxy.d.ts +32 -0
  53. package/dest/forwarder_proxy.d.ts.map +1 -0
  54. package/dest/forwarder_proxy.js +93 -0
  55. package/dest/l1_artifacts.d.ts +14258 -6015
  56. package/dest/l1_artifacts.d.ts.map +1 -1
  57. package/dest/l1_artifacts.js +10 -5
  58. package/dest/l1_contract_addresses.d.ts +8 -4
  59. package/dest/l1_contract_addresses.d.ts.map +1 -1
  60. package/dest/l1_contract_addresses.js +16 -26
  61. package/dest/l1_reader.d.ts +4 -2
  62. package/dest/l1_reader.d.ts.map +1 -1
  63. package/dest/l1_reader.js +14 -8
  64. package/dest/l1_tx_utils/config.d.ts +59 -0
  65. package/dest/l1_tx_utils/config.d.ts.map +1 -0
  66. package/dest/l1_tx_utils/config.js +96 -0
  67. package/dest/l1_tx_utils/constants.d.ts +6 -0
  68. package/dest/l1_tx_utils/constants.d.ts.map +1 -0
  69. package/dest/l1_tx_utils/constants.js +14 -0
  70. package/dest/l1_tx_utils/factory.d.ts +24 -0
  71. package/dest/l1_tx_utils/factory.d.ts.map +1 -0
  72. package/dest/l1_tx_utils/factory.js +12 -0
  73. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts +41 -0
  74. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts.map +1 -0
  75. package/dest/l1_tx_utils/forwarder_l1_tx_utils.js +48 -0
  76. package/dest/l1_tx_utils/index-blobs.d.ts +3 -0
  77. package/dest/l1_tx_utils/index-blobs.d.ts.map +1 -0
  78. package/dest/l1_tx_utils/index-blobs.js +2 -0
  79. package/dest/l1_tx_utils/index.d.ts +10 -0
  80. package/dest/l1_tx_utils/index.d.ts.map +1 -0
  81. package/dest/l1_tx_utils/index.js +10 -0
  82. package/dest/l1_tx_utils/interfaces.d.ts +76 -0
  83. package/dest/l1_tx_utils/interfaces.d.ts.map +1 -0
  84. package/dest/l1_tx_utils/interfaces.js +4 -0
  85. package/dest/l1_tx_utils/l1_tx_utils.d.ts +94 -0
  86. package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -0
  87. package/dest/l1_tx_utils/l1_tx_utils.js +623 -0
  88. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +26 -0
  89. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +1 -0
  90. package/dest/l1_tx_utils/l1_tx_utils_with_blobs.js +26 -0
  91. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +94 -0
  92. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -0
  93. package/dest/l1_tx_utils/readonly_l1_tx_utils.js +431 -0
  94. package/dest/l1_tx_utils/signer.d.ts +4 -0
  95. package/dest/l1_tx_utils/signer.d.ts.map +1 -0
  96. package/dest/l1_tx_utils/signer.js +16 -0
  97. package/dest/l1_tx_utils/types.d.ts +67 -0
  98. package/dest/l1_tx_utils/types.d.ts.map +1 -0
  99. package/dest/l1_tx_utils/types.js +26 -0
  100. package/dest/l1_tx_utils/utils.d.ts +4 -0
  101. package/dest/l1_tx_utils/utils.d.ts.map +1 -0
  102. package/dest/l1_tx_utils/utils.js +14 -0
  103. package/dest/l1_types.d.ts +1 -1
  104. package/dest/publisher_manager.d.ts +8 -3
  105. package/dest/publisher_manager.d.ts.map +1 -1
  106. package/dest/publisher_manager.js +36 -8
  107. package/dest/queries.d.ts +1 -1
  108. package/dest/queries.d.ts.map +1 -1
  109. package/dest/queries.js +13 -12
  110. package/dest/test/chain_monitor.d.ts +33 -19
  111. package/dest/test/chain_monitor.d.ts.map +1 -1
  112. package/dest/test/chain_monitor.js +100 -33
  113. package/dest/test/delayed_tx_utils.d.ts +3 -3
  114. package/dest/test/delayed_tx_utils.d.ts.map +1 -1
  115. package/dest/test/delayed_tx_utils.js +2 -2
  116. package/dest/test/eth_cheat_codes.d.ts +36 -14
  117. package/dest/test/eth_cheat_codes.d.ts.map +1 -1
  118. package/dest/test/eth_cheat_codes.js +124 -31
  119. package/dest/test/eth_cheat_codes_with_state.d.ts +1 -1
  120. package/dest/test/eth_cheat_codes_with_state.d.ts.map +1 -1
  121. package/dest/test/index.d.ts +1 -1
  122. package/dest/test/rollup_cheat_codes.d.ts +23 -20
  123. package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
  124. package/dest/test/rollup_cheat_codes.js +79 -42
  125. package/dest/test/start_anvil.d.ts +2 -1
  126. package/dest/test/start_anvil.d.ts.map +1 -1
  127. package/dest/test/start_anvil.js +2 -1
  128. package/dest/test/tx_delayer.d.ts +1 -1
  129. package/dest/test/tx_delayer.d.ts.map +1 -1
  130. package/dest/test/tx_delayer.js +3 -2
  131. package/dest/test/upgrade_utils.d.ts +1 -1
  132. package/dest/test/upgrade_utils.d.ts.map +1 -1
  133. package/dest/test/upgrade_utils.js +3 -2
  134. package/dest/types.d.ts +57 -2
  135. package/dest/types.d.ts.map +1 -1
  136. package/dest/utils.d.ts +2 -2
  137. package/dest/utils.d.ts.map +1 -1
  138. package/dest/utils.js +10 -161
  139. package/dest/zkPassportVerifierAddress.d.ts +1 -1
  140. package/dest/zkPassportVerifierAddress.js +1 -1
  141. package/package.json +27 -13
  142. package/src/client.ts +1 -1
  143. package/src/config.ts +177 -65
  144. package/src/contracts/empire_base.ts +7 -6
  145. package/src/contracts/empire_slashing_proposer.ts +18 -8
  146. package/src/contracts/fee_asset_handler.ts +1 -1
  147. package/src/contracts/governance.ts +3 -3
  148. package/src/contracts/governance_proposer.ts +14 -9
  149. package/src/contracts/multicall.ts +12 -10
  150. package/src/contracts/rollup.ts +170 -171
  151. package/src/contracts/slasher_contract.ts +22 -0
  152. package/src/contracts/tally_slashing_proposer.ts +63 -12
  153. package/src/deploy_l1_contracts.ts +610 -337
  154. package/src/forwarder_proxy.ts +108 -0
  155. package/src/l1_artifacts.ts +14 -6
  156. package/src/l1_contract_addresses.ts +17 -26
  157. package/src/l1_reader.ts +17 -9
  158. package/src/l1_tx_utils/README.md +177 -0
  159. package/src/l1_tx_utils/config.ts +161 -0
  160. package/src/l1_tx_utils/constants.ts +18 -0
  161. package/src/l1_tx_utils/factory.ts +64 -0
  162. package/src/l1_tx_utils/forwarder_l1_tx_utils.ts +119 -0
  163. package/src/l1_tx_utils/index-blobs.ts +2 -0
  164. package/src/l1_tx_utils/index.ts +12 -0
  165. package/src/l1_tx_utils/interfaces.ts +86 -0
  166. package/src/l1_tx_utils/l1_tx_utils.ts +738 -0
  167. package/src/l1_tx_utils/l1_tx_utils_with_blobs.ts +77 -0
  168. package/src/l1_tx_utils/readonly_l1_tx_utils.ts +557 -0
  169. package/src/l1_tx_utils/signer.ts +28 -0
  170. package/src/l1_tx_utils/types.ts +85 -0
  171. package/src/l1_tx_utils/utils.ts +16 -0
  172. package/src/publisher_manager.ts +51 -9
  173. package/src/queries.ts +16 -8
  174. package/src/test/chain_monitor.ts +118 -36
  175. package/src/test/delayed_tx_utils.ts +2 -2
  176. package/src/test/eth_cheat_codes.ts +149 -30
  177. package/src/test/rollup_cheat_codes.ts +94 -52
  178. package/src/test/start_anvil.ts +2 -0
  179. package/src/test/tx_delayer.ts +4 -2
  180. package/src/test/upgrade_utils.ts +3 -2
  181. package/src/types.ts +62 -0
  182. package/src/utils.ts +12 -184
  183. package/src/zkPassportVerifierAddress.ts +1 -1
  184. package/dest/index.d.ts +0 -18
  185. package/dest/index.d.ts.map +0 -1
  186. package/dest/index.js +0 -17
  187. package/dest/l1_tx_utils.d.ts +0 -250
  188. package/dest/l1_tx_utils.d.ts.map +0 -1
  189. package/dest/l1_tx_utils.js +0 -826
  190. package/dest/l1_tx_utils_with_blobs.d.ts +0 -19
  191. package/dest/l1_tx_utils_with_blobs.d.ts.map +0 -1
  192. package/dest/l1_tx_utils_with_blobs.js +0 -85
  193. package/src/index.ts +0 -17
  194. package/src/l1_tx_utils.ts +0 -1105
  195. package/src/l1_tx_utils_with_blobs.ts +0 -144
@@ -4,13 +4,13 @@ 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';
9
10
  import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
10
11
  import { RollupStorage } from '@aztec/l1-artifacts/RollupStorage';
11
- import { SlasherAbi } from '@aztec/l1-artifacts/SlasherAbi';
12
12
  import chunk from 'lodash.chunk';
13
- import { encodeFunctionData, getAddress, getContract, hexToBigInt, keccak256 } from 'viem';
13
+ import { encodeFunctionData, getContract, hexToBigInt, keccak256 } from 'viem';
14
14
  import { getPublicClient } from '../client.js';
15
15
  import { formatViemError } from '../utils.js';
16
16
  import { EmpireSlashingProposerContract } from './empire_slashing_proposer.js';
@@ -68,16 +68,11 @@ export class RollupContract {
68
68
  return this.rollup;
69
69
  }
70
70
  async getSlashingProposer() {
71
- const slasherAddress = await this.rollup.read.getSlasher();
72
- if (EthAddress.fromString(slasherAddress).isZero()) {
71
+ const slasher = await this.getSlasherContract();
72
+ if (!slasher) {
73
73
  return undefined;
74
74
  }
75
- const slasher = getContract({
76
- address: slasherAddress,
77
- abi: SlasherAbi,
78
- client: this.client
79
- });
80
- const proposerAddress = await slasher.read.PROPOSER();
75
+ const proposerAddress = await slasher.getProposer();
81
76
  const proposerAbi = [
82
77
  {
83
78
  type: 'function',
@@ -94,7 +89,7 @@ export class RollupContract {
94
89
  }
95
90
  ];
96
91
  const proposer = getContract({
97
- address: proposerAddress,
92
+ address: proposerAddress.toString(),
98
93
  abi: proposerAbi,
99
94
  client: this.client
100
95
  });
@@ -119,8 +114,8 @@ export class RollupContract {
119
114
  getEpochDuration() {
120
115
  return this.rollup.read.getEpochDuration();
121
116
  }
122
- getSlotDuration() {
123
- return this.rollup.read.getSlotDuration();
117
+ async getSlotDuration() {
118
+ return Number(await this.rollup.read.getSlotDuration());
124
119
  }
125
120
  getTargetCommitteeSize() {
126
121
  return this.rollup.read.getTargetCommitteeSize();
@@ -128,6 +123,15 @@ export class RollupContract {
128
123
  getEjectionThreshold() {
129
124
  return this.rollup.read.getEjectionThreshold();
130
125
  }
126
+ getLocalEjectionThreshold() {
127
+ return this.rollup.read.getLocalEjectionThreshold();
128
+ }
129
+ getLagInEpochsForValidatorSet() {
130
+ return this.rollup.read.getLagInEpochsForValidatorSet();
131
+ }
132
+ getLagInEpochsForRandao() {
133
+ return this.rollup.read.getLagInEpochsForRandao();
134
+ }
131
135
  getActivationThreshold() {
132
136
  return this.rollup.read.getActivationThreshold();
133
137
  }
@@ -150,19 +154,41 @@ export class RollupContract {
150
154
  return this.rollup.read.getVersion();
151
155
  }
152
156
  async getGenesisArchiveTreeRoot() {
153
- const block = await this.rollup.read.getBlock([
157
+ return await this.rollup.read.archiveAt([
154
158
  0n
155
159
  ]);
156
- return block.archive;
157
160
  }
158
- getSlasher() {
161
+ /**
162
+ * Returns rollup constants used for epoch queries.
163
+ * Return type is `L1RollupConstants` which is defined in stdlib,
164
+ * so we cant reference it until we move this contract to that package.
165
+ */ async getRollupConstants() {
166
+ const [l1StartBlock, l1GenesisTime, slotDuration, epochDuration, proofSubmissionEpochs] = await Promise.all([
167
+ this.getL1StartBlock(),
168
+ this.getL1GenesisTime(),
169
+ this.getSlotDuration(),
170
+ this.getEpochDuration(),
171
+ this.getProofSubmissionEpochs()
172
+ ]);
173
+ return {
174
+ l1StartBlock,
175
+ l1GenesisTime,
176
+ slotDuration,
177
+ epochDuration: Number(epochDuration),
178
+ proofSubmissionEpochs: Number(proofSubmissionEpochs)
179
+ };
180
+ }
181
+ getSlasherAddress() {
159
182
  return this.rollup.read.getSlasher();
160
183
  }
161
184
  /**
162
185
  * Returns a SlasherContract instance for interacting with the slasher contract.
163
186
  */ async getSlasherContract() {
164
- const slasherAddress = await this.getSlasher();
165
- return new SlasherContract(this.client, EthAddress.fromString(slasherAddress));
187
+ const slasherAddress = EthAddress.fromString(await this.getSlasherAddress());
188
+ if (slasherAddress.isZero()) {
189
+ return undefined;
190
+ }
191
+ return new SlasherContract(this.client, slasherAddress);
166
192
  }
167
193
  getOwner() {
168
194
  return this.rollup.read.owner();
@@ -171,25 +197,23 @@ export class RollupContract {
171
197
  return this.rollup.read.getActiveAttesterCount();
172
198
  }
173
199
  async getSlashingProposerAddress() {
174
- const slasherAddress = await this.getSlasher();
175
- const slasher = getContract({
176
- address: getAddress(slasherAddress.toString()),
177
- abi: SlasherAbi,
178
- client: this.client
179
- });
180
- return EthAddress.fromString(await slasher.read.PROPOSER());
200
+ const slasher = await this.getSlasherContract();
201
+ if (!slasher) {
202
+ return EthAddress.ZERO;
203
+ }
204
+ return await slasher.getProposer();
181
205
  }
182
- getBlockReward() {
183
- return this.rollup.read.getBlockReward();
206
+ getCheckpointReward() {
207
+ return this.rollup.read.getCheckpointReward();
184
208
  }
185
- getBlockNumber() {
186
- return this.rollup.read.getPendingBlockNumber();
209
+ async getCheckpointNumber() {
210
+ return CheckpointNumber.fromBigInt(await this.rollup.read.getPendingCheckpointNumber());
187
211
  }
188
- getProvenBlockNumber() {
189
- return this.rollup.read.getProvenBlockNumber();
212
+ async getProvenCheckpointNumber() {
213
+ return CheckpointNumber.fromBigInt(await this.rollup.read.getProvenCheckpointNumber());
190
214
  }
191
- getSlotNumber() {
192
- return this.rollup.read.getCurrentSlot();
215
+ async getSlotNumber() {
216
+ return SlotNumber.fromBigInt(await this.rollup.read.getCurrentSlot());
193
217
  }
194
218
  getL1FeesAt(timestamp) {
195
219
  return this.rollup.read.getL1FeesAt([
@@ -225,8 +249,8 @@ export class RollupContract {
225
249
  getCurrentSampleSeed() {
226
250
  return this.rollup.read.getCurrentSampleSeed();
227
251
  }
228
- getCurrentEpoch() {
229
- return this.rollup.read.getCurrentEpoch();
252
+ async getCurrentEpoch() {
253
+ return EpochNumber.fromBigInt(await this.rollup.read.getCurrentEpoch());
230
254
  }
231
255
  async getCurrentEpochCommittee() {
232
256
  const { result } = await this.client.simulateContract({
@@ -264,27 +288,39 @@ export class RollupContract {
264
288
  });
265
289
  return result;
266
290
  }
267
- getBlock(blockNumber) {
268
- return this.rollup.read.getBlock([
269
- blockNumber
291
+ getCheckpoint(checkpointNumber) {
292
+ return this.rollup.read.getCheckpoint([
293
+ BigInt(checkpointNumber)
270
294
  ]);
271
295
  }
272
- getTips() {
273
- return this.rollup.read.getTips();
296
+ async getTips() {
297
+ const { pending, proven } = await this.rollup.read.getTips();
298
+ return {
299
+ pending: CheckpointNumber.fromBigInt(pending),
300
+ proven: CheckpointNumber.fromBigInt(proven)
301
+ };
274
302
  }
275
303
  getTimestampForSlot(slot) {
276
304
  return this.rollup.read.getTimestampForSlot([
277
- slot
305
+ BigInt(slot)
278
306
  ]);
279
307
  }
280
308
  getEntryQueueLength() {
281
309
  return this.rollup.read.getEntryQueueLength();
282
310
  }
283
- async getEpochNumber(blockNumber) {
284
- blockNumber ??= await this.getBlockNumber();
285
- return this.rollup.read.getEpochForBlock([
286
- BigInt(blockNumber)
287
- ]);
311
+ getAvailableValidatorFlushes() {
312
+ return this.rollup.read.getAvailableValidatorFlushes();
313
+ }
314
+ async getNextFlushableEpoch() {
315
+ return EpochNumber.fromBigInt(await this.rollup.read.getNextFlushableEpoch());
316
+ }
317
+ async getCurrentEpochNumber() {
318
+ return EpochNumber.fromBigInt(await this.rollup.read.getCurrentEpoch());
319
+ }
320
+ async getEpochNumberForCheckpoint(checkpointNumber) {
321
+ return EpochNumber.fromBigInt(await this.rollup.read.getEpochForCheckpoint([
322
+ BigInt(checkpointNumber)
323
+ ]));
288
324
  }
289
325
  async getRollupAddresses() {
290
326
  const [inboxAddress, outboxAddress, feeJuicePortalAddress, rewardDistributorAddress, feeJuiceAddress, stakingAssetAddress, gseAddress] = (await Promise.all([
@@ -311,9 +347,9 @@ export class RollupContract {
311
347
  return EthAddress.fromString(await this.rollup.read.getFeeAssetPortal());
312
348
  }
313
349
  async getEpochNumberForSlotNumber(slotNumber) {
314
- return await this.rollup.read.getEpochAtSlot([
315
- slotNumber
316
- ]);
350
+ return EpochNumber.fromBigInt(await this.rollup.read.getEpochAtSlot([
351
+ BigInt(slotNumber)
352
+ ]));
317
353
  }
318
354
  getEpochProofPublicInputs(args) {
319
355
  return this.rollup.read.getEpochProofPublicInputs(args);
@@ -332,80 +368,20 @@ export class RollupContract {
332
368
  }
333
369
  }
334
370
  /**
335
- * Packs an array of committee attestations into the format expected by the Solidity contract
336
- *
337
- * @param attestations - Array of committee attestations with addresses and signatures
338
- * @returns Packed attestations with bitmap and tightly packed signature/address data
339
- */ static packAttestations(attestations) {
340
- const length = attestations.length;
341
- // Calculate bitmap size (1 bit per attestation, rounded up to nearest byte)
342
- const bitmapSize = Math.ceil(length / 8);
343
- const signatureIndices = new Uint8Array(bitmapSize);
344
- // Calculate total data size needed
345
- let totalDataSize = 0;
346
- for(let i = 0; i < length; i++){
347
- const signature = attestations[i].signature;
348
- // Check if signature is empty (v = 0)
349
- const isEmpty = signature.v === 0;
350
- if (!isEmpty) {
351
- totalDataSize += 65; // v (1) + r (32) + s (32)
352
- } else {
353
- totalDataSize += 20; // address only
354
- }
355
- }
356
- const signaturesOrAddresses = new Uint8Array(totalDataSize);
357
- let dataIndex = 0;
358
- // Pack the data
359
- for(let i = 0; i < length; i++){
360
- const attestation = attestations[i];
361
- const signature = attestation.signature;
362
- // Check if signature is empty
363
- const isEmpty = signature.v === 0;
364
- if (!isEmpty) {
365
- // Set bit in bitmap (bit 7-0 in each byte, left to right)
366
- const byteIndex = Math.floor(i / 8);
367
- const bitIndex = 7 - i % 8;
368
- signatureIndices[byteIndex] |= 1 << bitIndex;
369
- // Pack signature: v + r + s
370
- signaturesOrAddresses[dataIndex] = signature.v;
371
- dataIndex++;
372
- // Pack r (32 bytes)
373
- const rBytes = Buffer.from(signature.r.slice(2), 'hex');
374
- signaturesOrAddresses.set(rBytes, dataIndex);
375
- dataIndex += 32;
376
- // Pack s (32 bytes)
377
- const sBytes = Buffer.from(signature.s.slice(2), 'hex');
378
- signaturesOrAddresses.set(sBytes, dataIndex);
379
- dataIndex += 32;
380
- } else {
381
- // Pack address only (20 bytes)
382
- const addrBytes = Buffer.from(attestation.addr.slice(2), 'hex');
383
- signaturesOrAddresses.set(addrBytes, dataIndex);
384
- dataIndex += 20;
385
- }
386
- }
387
- return {
388
- signatureIndices: `0x${Buffer.from(signatureIndices).toString('hex')}`,
389
- signaturesOrAddresses: `0x${Buffer.from(signaturesOrAddresses).toString('hex')}`
390
- };
391
- }
392
- /**
393
371
  * @notice Calls `canProposeAtTime` with the time of the next Ethereum block and the sender address
394
372
  *
395
373
  * @dev Throws if unable to propose
396
374
  *
397
375
  * @param archive - The archive that we expect to be current state
398
- * @return [slot, blockNumber] - If you can propose, the L2 slot number and L2 block number of the next Ethereum block,
376
+ * @return [slot, checkpointNumber, timeOfNextL1Slot] - If you can propose, the L2 slot number, checkpoint number and
377
+ * timestamp of the next L1 block
399
378
  * @throws otherwise
400
379
  */ async canProposeAtNextEthBlock(archive, account, slotDuration, opts = {}) {
401
- if (typeof slotDuration === 'number') {
402
- slotDuration = BigInt(slotDuration);
403
- }
404
380
  const latestBlock = await this.client.getBlock();
405
- const timeOfNextL1Slot = latestBlock.timestamp + slotDuration;
381
+ const timeOfNextL1Slot = latestBlock.timestamp + BigInt(slotDuration);
406
382
  const who = typeof account === 'string' ? account : account.address;
407
383
  try {
408
- const { result: [slot, blockNumber] } = await this.client.simulateContract({
384
+ const { result: [slot, checkpointNumber] } = await this.client.simulateContract({
409
385
  address: this.address,
410
386
  abi: RollupAbi,
411
387
  functionName: 'canProposeAtTime',
@@ -415,11 +391,11 @@ export class RollupContract {
415
391
  who
416
392
  ],
417
393
  account,
418
- stateOverride: await this.makePendingBlockNumberOverride(opts.forcePendingBlockNumber)
394
+ stateOverride: await this.makePendingCheckpointNumberOverride(opts.forcePendingCheckpointNumber)
419
395
  });
420
396
  return {
421
- slot,
422
- blockNumber,
397
+ slot: SlotNumber.fromBigInt(slot),
398
+ checkpointNumber: CheckpointNumber.fromBigInt(checkpointNumber),
423
399
  timeOfNextL1Slot
424
400
  };
425
401
  } catch (err) {
@@ -427,11 +403,11 @@ export class RollupContract {
427
403
  }
428
404
  }
429
405
  /**
430
- * Returns a state override that sets the pending block number to the specified value. Useful for simulations.
431
- * Requires querying the current state of the contract to get the current proven block number, as they are both
406
+ * Returns a state override that sets the pending checkpoint number to the specified value. Useful for simulations.
407
+ * Requires querying the current state of the contract to get the current proven checkpoint number, as they are both
432
408
  * stored in the same slot. If the argument is undefined, it returns an empty override.
433
- */ async makePendingBlockNumberOverride(forcePendingBlockNumber) {
434
- if (forcePendingBlockNumber === undefined) {
409
+ */ async makePendingCheckpointNumberOverride(forcePendingCheckpointNumber) {
410
+ if (forcePendingCheckpointNumber === undefined) {
435
411
  return [];
436
412
  }
437
413
  const slot = RollupContract.stfStorageSlot;
@@ -439,8 +415,8 @@ export class RollupContract {
439
415
  address: this.address,
440
416
  slot
441
417
  });
442
- const currentProvenBlockNumber = currentValue ? hexToBigInt(currentValue) & (1n << 128n) - 1n : 0n;
443
- const newValue = BigInt(forcePendingBlockNumber) << 128n | currentProvenBlockNumber;
418
+ const currentProvenCheckpointNumber = currentValue ? hexToBigInt(currentValue) & (1n << 128n) - 1n : 0n;
419
+ const newValue = BigInt(forcePendingCheckpointNumber) << 128n | currentProvenCheckpointNumber;
444
420
  return [
445
421
  {
446
422
  address: this.address,
@@ -453,42 +429,42 @@ export class RollupContract {
453
429
  }
454
430
  ];
455
431
  }
456
- /** Creates a request to Rollup#invalidateBadAttestation to be simulated or sent */ buildInvalidateBadAttestationRequest(blockNumber, attestations, committee, invalidIndex) {
432
+ /** Creates a request to Rollup#invalidateBadAttestation to be simulated or sent */ buildInvalidateBadAttestationRequest(checkpointNumber, attestationsAndSigners, committee, invalidIndex) {
457
433
  return {
458
434
  to: this.address,
459
435
  data: encodeFunctionData({
460
436
  abi: RollupAbi,
461
437
  functionName: 'invalidateBadAttestation',
462
438
  args: [
463
- BigInt(blockNumber),
464
- RollupContract.packAttestations(attestations),
439
+ BigInt(checkpointNumber),
440
+ attestationsAndSigners,
465
441
  committee.map((addr)=>addr.toString()),
466
442
  BigInt(invalidIndex)
467
443
  ]
468
444
  })
469
445
  };
470
446
  }
471
- /** Creates a request to Rollup#invalidateInsufficientAttestations to be simulated or sent */ buildInvalidateInsufficientAttestationsRequest(blockNumber, attestations, committee) {
447
+ /** Creates a request to Rollup#invalidateInsufficientAttestations to be simulated or sent */ buildInvalidateInsufficientAttestationsRequest(checkpointNumber, attestationsAndSigners, committee) {
472
448
  return {
473
449
  to: this.address,
474
450
  data: encodeFunctionData({
475
451
  abi: RollupAbi,
476
452
  functionName: 'invalidateInsufficientAttestations',
477
453
  args: [
478
- BigInt(blockNumber),
479
- RollupContract.packAttestations(attestations),
454
+ BigInt(checkpointNumber),
455
+ attestationsAndSigners,
480
456
  committee.map((addr)=>addr.toString())
481
457
  ]
482
458
  })
483
459
  };
484
460
  }
485
- /** Calls getHasSubmitted directly. Returns whether the given prover has submitted a proof with the given length for the given epoch. */ getHasSubmittedProof(epochNumber, numberOfBlocksInEpoch, prover) {
461
+ /** Calls getHasSubmitted directly. Returns whether the given prover has submitted a proof with the given length for the given epoch. */ getHasSubmittedProof(epochNumber, numberOfCheckpointsInEpoch, prover) {
486
462
  if (prover instanceof EthAddress) {
487
463
  prover = prover.toString();
488
464
  }
489
465
  return this.rollup.read.getHasSubmitted([
490
466
  BigInt(epochNumber),
491
- BigInt(numberOfBlocksInEpoch),
467
+ BigInt(numberOfCheckpointsInEpoch),
492
468
  prover
493
469
  ]);
494
470
  }
@@ -498,15 +474,15 @@ export class RollupContract {
498
474
  inFeeAsset
499
475
  ]);
500
476
  }
501
- getSlotAt(timestamp) {
502
- return this.rollup.read.getSlotAt([
477
+ async getSlotAt(timestamp) {
478
+ return SlotNumber.fromBigInt(await this.rollup.read.getSlotAt([
503
479
  timestamp
504
- ]);
480
+ ]));
505
481
  }
506
- async status(blockNumber, options) {
482
+ async status(checkpointNumber, options) {
507
483
  await checkBlockTag(options?.blockNumber, this.client);
508
484
  return this.rollup.read.status([
509
- blockNumber
485
+ BigInt(checkpointNumber)
510
486
  ], options);
511
487
  }
512
488
  async canPruneAtTime(timestamp, options) {
@@ -518,9 +494,9 @@ export class RollupContract {
518
494
  archive() {
519
495
  return this.rollup.read.archive();
520
496
  }
521
- archiveAt(blockNumber) {
497
+ archiveAt(checkpointNumber) {
522
498
  return this.rollup.read.archiveAt([
523
- blockNumber
499
+ BigInt(checkpointNumber)
524
500
  ]);
525
501
  }
526
502
  getSequencerRewards(address) {
@@ -566,9 +542,9 @@ export class RollupContract {
566
542
  address
567
543
  ]);
568
544
  }
569
- getBlobCommitmentsHash(blockNumber) {
545
+ getBlobCommitmentsHash(checkpointNumber) {
570
546
  return this.rollup.read.getBlobCommitmentsHash([
571
- blockNumber
547
+ BigInt(checkpointNumber)
572
548
  ]);
573
549
  }
574
550
  getCurrentBlobCommitmentsHash() {
@@ -577,6 +553,9 @@ export class RollupContract {
577
553
  getStakingAsset() {
578
554
  return this.rollup.read.getStakingAsset();
579
555
  }
556
+ getRewardConfig() {
557
+ return this.rollup.read.getRewardConfig();
558
+ }
580
559
  setupEpoch(l1TxUtils) {
581
560
  return l1TxUtils.sendAndMonitorTransaction({
582
561
  to: this.address,
@@ -611,6 +590,20 @@ export class RollupContract {
611
590
  }
612
591
  });
613
592
  }
593
+ listenToCheckpointInvalidated(callback) {
594
+ return this.rollup.watchEvent.CheckpointInvalidated({}, {
595
+ onLogs: (logs)=>{
596
+ for (const log of logs){
597
+ const args = log.args;
598
+ if (args.checkpointNumber !== undefined) {
599
+ callback({
600
+ checkpointNumber: CheckpointNumber.fromBigInt(args.checkpointNumber)
601
+ });
602
+ }
603
+ }
604
+ }
605
+ });
606
+ }
614
607
  async getSlashEvents(l1BlockHash) {
615
608
  const events = await this.rollup.getEvents.Slashed({}, {
616
609
  blockHash: l1BlockHash,
@@ -657,6 +650,15 @@ _ts_decorate([
657
650
  _ts_decorate([
658
651
  memoize
659
652
  ], RollupContract.prototype, "getEjectionThreshold", null);
653
+ _ts_decorate([
654
+ memoize
655
+ ], RollupContract.prototype, "getLocalEjectionThreshold", null);
656
+ _ts_decorate([
657
+ memoize
658
+ ], RollupContract.prototype, "getLagInEpochsForValidatorSet", null);
659
+ _ts_decorate([
660
+ memoize
661
+ ], RollupContract.prototype, "getLagInEpochsForRandao", null);
660
662
  _ts_decorate([
661
663
  memoize
662
664
  ], RollupContract.prototype, "getActivationThreshold", null);
@@ -681,3 +683,6 @@ _ts_decorate([
681
683
  _ts_decorate([
682
684
  memoize
683
685
  ], RollupContract.prototype, "getGenesisArchiveTreeRoot", null);
686
+ _ts_decorate([
687
+ memoize
688
+ ], RollupContract.prototype, "getRollupConstants", null);
@@ -15,11 +15,21 @@ export declare class SlasherContract {
15
15
  * @returns True if the payload is vetoed, false otherwise
16
16
  */
17
17
  isPayloadVetoed(payloadAddress: EthAddress): Promise<boolean>;
18
+ /**
19
+ * Checks if slashing is currently enabled. Slashing can be disabled by the vetoer.
20
+ * @returns True if slashing is enabled, false otherwise
21
+ */
22
+ isSlashingEnabled(): Promise<boolean>;
18
23
  /**
19
24
  * Gets the current vetoer address.
20
25
  * @returns The vetoer address
21
26
  */
22
27
  getVetoer(): Promise<EthAddress>;
28
+ /**
29
+ * Gets the disable duration by the vetoer.
30
+ * @returns The disable duration in seconds
31
+ */
32
+ getSlashingDisableDuration(): Promise<number>;
23
33
  /**
24
34
  * Gets the current governance address.
25
35
  * @returns The governance address
@@ -31,4 +41,4 @@ export declare class SlasherContract {
31
41
  */
32
42
  getProposer(): Promise<EthAddress>;
33
43
  }
34
- //# sourceMappingURL=slasher_contract.d.ts.map
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;gBAGpD,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,UAAU,EACnB,GAAG,yCAAmC;IASzD;;;;OAIG;IACU,eAAe,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAS1E;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,UAAU,CAAC;IAK7C;;;OAGG;IACU,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC;IAKjD;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,UAAU,CAAC;CAIhD"}
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"}
@@ -34,6 +34,17 @@ import { getContract } from 'viem';
34
34
  }
35
35
  }
36
36
  /**
37
+ * Checks if slashing is currently enabled. Slashing can be disabled by the vetoer.
38
+ * @returns True if slashing is enabled, false otherwise
39
+ */ async isSlashingEnabled() {
40
+ try {
41
+ return await this.contract.read.isSlashingEnabled();
42
+ } catch (error) {
43
+ this.log.error(`Error checking if slashing is enabled`, error);
44
+ throw error;
45
+ }
46
+ }
47
+ /**
37
48
  * Gets the current vetoer address.
38
49
  * @returns The vetoer address
39
50
  */ async getVetoer() {
@@ -41,6 +52,13 @@ import { getContract } from 'viem';
41
52
  return EthAddress.fromString(vetoer);
42
53
  }
43
54
  /**
55
+ * Gets the disable duration by the vetoer.
56
+ * @returns The disable duration in seconds
57
+ */ async getSlashingDisableDuration() {
58
+ const duration = await this.contract.read.SLASHING_DISABLE_DURATION();
59
+ return Number(duration);
60
+ }
61
+ /**
44
62
  * Gets the current governance address.
45
63
  * @returns The governance address
46
64
  */ async getGovernance() {
@@ -1,13 +1,14 @@
1
- import { type L1TxRequest, type ViemClient } from '@aztec/ethereum';
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
- import EventEmitter from 'events';
5
6
  import { type Hex, type Log, type TypedDataDefinition } from 'viem';
6
7
  /**
7
8
  * Wrapper around the TallySlashingProposer contract that provides
8
9
  * a TypeScript interface for interacting with the consensus-based slashing system.
9
10
  */
10
- export declare class TallySlashingProposerContract extends EventEmitter {
11
+ export declare class TallySlashingProposerContract {
11
12
  readonly client: ViemClient;
12
13
  private readonly contract;
13
14
  readonly type: "tally";
@@ -29,9 +30,15 @@ export declare class TallySlashingProposerContract extends EventEmitter {
29
30
  */
30
31
  getRound(round: bigint): Promise<{
31
32
  isExecuted: boolean;
32
- readyToExecute: boolean;
33
33
  voteCount: bigint;
34
34
  }>;
35
+ /**
36
+ * Check if a round is ready to execute at a given slot
37
+ * @param round - The round number to check
38
+ * @param slot - The slot number to check at
39
+ * @returns Whether the round is ready to execute
40
+ */
41
+ isRoundReadyToExecute(round: bigint, slot: SlotNumber): Promise<boolean>;
35
42
  /** Returns the slash actions and payload address for a given round (zero if no slash actions) */
36
43
  getPayload(round: bigint): Promise<{
37
44
  actions: {
@@ -53,9 +60,9 @@ export declare class TallySlashingProposerContract extends EventEmitter {
53
60
  tryExtractVoteCastEvent(logs: Log[]): {
54
61
  eventName: "VoteCast";
55
62
  args: {
63
+ proposer: `0x${string}`;
56
64
  round: bigint;
57
65
  slot: bigint;
58
- proposer: `0x${string}`;
59
66
  };
60
67
  } | undefined;
61
68
  /** Tries to extract a RoundExecuted event from the given logs. */
@@ -73,11 +80,11 @@ export declare class TallySlashingProposerContract extends EventEmitter {
73
80
  * @param signer - The signer to produce the signature
74
81
  * @returns L1 transaction request
75
82
  */
76
- buildVoteRequestFromSigner(votes: Hex, slot: bigint, signer: (msg: TypedDataDefinition) => Promise<Hex>): Promise<L1TxRequest>;
83
+ buildVoteRequestFromSigner(votes: Hex, slot: SlotNumber, signer: (msg: TypedDataDefinition) => Promise<Hex>): Promise<L1TxRequest>;
77
84
  /** Returns the typed data definition to EIP712-sign for voting */
78
- buildVoteTypedData(votes: Hex, slot: bigint): TypedDataDefinition;
85
+ buildVoteTypedData(votes: Hex, slot: SlotNumber): TypedDataDefinition;
79
86
  /** Gets the digest to sign for voting directly from the contract */
80
- getVoteDataDigest(votes: Hex, slot: bigint): Promise<Buffer32>;
87
+ getVoteDataDigest(votes: Hex, slot: SlotNumber): Promise<Buffer32>;
81
88
  /**
82
89
  * Create a transaction to vote for slashing offenses
83
90
  * @param votes - The encoded votes for slashing
@@ -96,6 +103,11 @@ export declare class TallySlashingProposerContract extends EventEmitter {
96
103
  * @returns L1 transaction request
97
104
  */
98
105
  buildExecuteRoundRequest(round: bigint, committees: EthAddress[][]): L1TxRequest;
106
+ /** Returns the last vote emitted for a given round */
107
+ getLastVote(round: bigint): Promise<{
108
+ validator: EthAddress;
109
+ slashAmount: bigint;
110
+ }[]>;
99
111
  /**
100
112
  * Listen for VoteCast events
101
113
  * @param callback - Callback function to handle vote cast events
@@ -116,4 +128,13 @@ export declare class TallySlashingProposerContract extends EventEmitter {
116
128
  l1BlockHash: Hex;
117
129
  }) => void): () => void;
118
130
  }
119
- //# sourceMappingURL=tally_slashing_proposer.d.ts.map
131
+ /**
132
+ * Decodes a Buffer containing slash votes back into an array of numbers.
133
+ * Each vote is represented as a 2-bit value (0, 1, 2, or 3) representing slashing units.
134
+ * @dev This should live in stdlib next to encodeSlashConsensusVotes but is here since we
135
+ * do not have a dependency to stdlib from the ethereum package. We need a larger refactor to fix this.
136
+ * @param buffer - The Buffer containing encoded slash votes
137
+ * @returns An array of numbers representing the slash votes
138
+ */
139
+ export declare function decodeSlashConsensusVotes(buffer: Buffer): number[];
140
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFsbHlfc2xhc2hpbmdfcHJvcG9zZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250cmFjdHMvdGFsbHlfc2xhc2hpbmdfcHJvcG9zZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDL0QsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFeEQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQzdELE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUNwRCxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFLM0QsT0FBTyxFQUVMLEtBQUssR0FBRyxFQUNSLEtBQUssR0FBRyxFQUNSLEtBQUssbUJBQW1CLEVBR3pCLE1BQU0sTUFBTSxDQUFDO0FBRWQ7OztHQUdHO0FBQ0gscUJBQWEsNkJBQTZCO2FBTXRCLE1BQU0sRUFBRSxVQUFVO0lBTHBDLE9BQU8sQ0FBQyxRQUFRLENBQUMsUUFBUSxDQUFxRTtJQUU5RixTQUFnQixJQUFJLFVBQW9CO0lBRXhDLFlBQ2tCLE1BQU0sRUFBRSxVQUFVLEVBQ2xDLE9BQU8sRUFBRSxHQUFHLEdBQUcsVUFBVSxFQU8xQjtJQUVELElBQVcsT0FBT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