@aztec/ethereum 0.0.0-test.1 → 0.0.1-commit.001888fc

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 (289) hide show
  1. package/dest/account.d.ts +2 -0
  2. package/dest/account.d.ts.map +1 -0
  3. package/dest/account.js +4 -0
  4. package/dest/chain.d.ts +1 -1
  5. package/dest/client.d.ts +14 -4
  6. package/dest/client.d.ts.map +1 -1
  7. package/dest/client.js +27 -3
  8. package/dest/config.d.ts +70 -23
  9. package/dest/config.d.ts.map +1 -1
  10. package/dest/config.js +155 -34
  11. package/dest/constants.d.ts +1 -1
  12. package/dest/contracts/empire_base.d.ts +27 -8
  13. package/dest/contracts/empire_base.d.ts.map +1 -1
  14. package/dest/contracts/empire_base.js +75 -2
  15. package/dest/contracts/empire_slashing_proposer.d.ts +69 -0
  16. package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -0
  17. package/dest/contracts/empire_slashing_proposer.js +216 -0
  18. package/dest/contracts/errors.d.ts +7 -0
  19. package/dest/contracts/errors.d.ts.map +1 -0
  20. package/dest/contracts/errors.js +12 -0
  21. package/dest/contracts/fee_asset_handler.d.ts +20 -0
  22. package/dest/contracts/fee_asset_handler.d.ts.map +1 -0
  23. package/dest/contracts/fee_asset_handler.js +59 -0
  24. package/dest/contracts/fee_asset_price_oracle.d.ts +101 -0
  25. package/dest/contracts/fee_asset_price_oracle.d.ts.map +1 -0
  26. package/dest/contracts/fee_asset_price_oracle.js +651 -0
  27. package/dest/contracts/fee_juice.d.ts +6 -7
  28. package/dest/contracts/fee_juice.d.ts.map +1 -1
  29. package/dest/contracts/fee_juice.js +27 -20
  30. package/dest/contracts/governance.d.ts +45 -32
  31. package/dest/contracts/governance.d.ts.map +1 -1
  32. package/dest/contracts/governance.js +98 -85
  33. package/dest/contracts/governance_proposer.d.ts +19 -13
  34. package/dest/contracts/governance_proposer.d.ts.map +1 -1
  35. package/dest/contracts/governance_proposer.js +441 -26
  36. package/dest/contracts/gse.d.ts +32 -0
  37. package/dest/contracts/gse.d.ts.map +1 -0
  38. package/dest/contracts/gse.js +72 -0
  39. package/dest/contracts/inbox.d.ts +47 -0
  40. package/dest/contracts/inbox.d.ts.map +1 -0
  41. package/dest/contracts/inbox.js +80 -0
  42. package/dest/contracts/index.d.ts +12 -3
  43. package/dest/contracts/index.d.ts.map +1 -1
  44. package/dest/contracts/index.js +11 -2
  45. package/dest/contracts/log.d.ts +13 -0
  46. package/dest/contracts/log.d.ts.map +1 -0
  47. package/dest/contracts/log.js +1 -0
  48. package/dest/contracts/multicall.d.ts +21 -0
  49. package/dest/contracts/multicall.d.ts.map +1 -0
  50. package/dest/contracts/multicall.js +157 -0
  51. package/dest/contracts/outbox.d.ts +41 -0
  52. package/dest/contracts/outbox.d.ts.map +1 -0
  53. package/dest/contracts/outbox.js +86 -0
  54. package/dest/contracts/registry.d.ts +12 -5
  55. package/dest/contracts/registry.d.ts.map +1 -1
  56. package/dest/contracts/registry.js +74 -17
  57. package/dest/contracts/rollup.d.ts +311 -53
  58. package/dest/contracts/rollup.d.ts.map +1 -1
  59. package/dest/contracts/rollup.js +1180 -116
  60. package/dest/contracts/slasher_contract.d.ts +44 -0
  61. package/dest/contracts/slasher_contract.d.ts.map +1 -0
  62. package/dest/contracts/slasher_contract.js +75 -0
  63. package/dest/contracts/tally_slashing_proposer.d.ts +140 -0
  64. package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -0
  65. package/dest/contracts/tally_slashing_proposer.js +320 -0
  66. package/dest/contracts/utils.d.ts +3 -0
  67. package/dest/contracts/utils.d.ts.map +1 -0
  68. package/dest/contracts/utils.js +11 -0
  69. package/dest/deploy_aztec_l1_contracts.d.ts +259 -0
  70. package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -0
  71. package/dest/deploy_aztec_l1_contracts.js +413 -0
  72. package/dest/deploy_l1_contract.d.ts +68 -0
  73. package/dest/deploy_l1_contract.d.ts.map +1 -0
  74. package/dest/deploy_l1_contract.js +312 -0
  75. package/dest/eth-signer/eth-signer.d.ts +21 -0
  76. package/dest/eth-signer/eth-signer.d.ts.map +1 -0
  77. package/dest/eth-signer/eth-signer.js +5 -0
  78. package/dest/eth-signer/index.d.ts +2 -0
  79. package/dest/eth-signer/index.d.ts.map +1 -0
  80. package/dest/eth-signer/index.js +1 -0
  81. package/dest/forwarder_proxy.d.ts +32 -0
  82. package/dest/forwarder_proxy.d.ts.map +1 -0
  83. package/dest/forwarder_proxy.js +93 -0
  84. package/dest/generated/l1-contracts-defaults.d.ts +30 -0
  85. package/dest/generated/l1-contracts-defaults.d.ts.map +1 -0
  86. package/dest/generated/l1-contracts-defaults.js +30 -0
  87. package/dest/l1_artifacts.d.ts +81744 -0
  88. package/dest/l1_artifacts.d.ts.map +1 -0
  89. package/dest/l1_artifacts.js +166 -0
  90. package/dest/l1_contract_addresses.d.ts +24 -4
  91. package/dest/l1_contract_addresses.d.ts.map +1 -1
  92. package/dest/l1_contract_addresses.js +25 -21
  93. package/dest/l1_reader.d.ts +6 -2
  94. package/dest/l1_reader.d.ts.map +1 -1
  95. package/dest/l1_reader.js +20 -9
  96. package/dest/l1_tx_utils/config.d.ts +65 -0
  97. package/dest/l1_tx_utils/config.d.ts.map +1 -0
  98. package/dest/l1_tx_utils/config.js +109 -0
  99. package/dest/l1_tx_utils/constants.d.ts +12 -0
  100. package/dest/l1_tx_utils/constants.d.ts.map +1 -0
  101. package/dest/l1_tx_utils/constants.js +39 -0
  102. package/dest/l1_tx_utils/factory.d.ts +32 -0
  103. package/dest/l1_tx_utils/factory.d.ts.map +1 -0
  104. package/dest/l1_tx_utils/factory.js +22 -0
  105. package/dest/l1_tx_utils/fee-strategies/index.d.ts +10 -0
  106. package/dest/l1_tx_utils/fee-strategies/index.d.ts.map +1 -0
  107. package/dest/l1_tx_utils/fee-strategies/index.js +12 -0
  108. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts +8 -0
  109. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts.map +1 -0
  110. package/dest/l1_tx_utils/fee-strategies/p75_competitive.js +129 -0
  111. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts +23 -0
  112. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts.map +1 -0
  113. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.js +191 -0
  114. package/dest/l1_tx_utils/fee-strategies/types.d.ts +51 -0
  115. package/dest/l1_tx_utils/fee-strategies/types.d.ts.map +1 -0
  116. package/dest/l1_tx_utils/fee-strategies/types.js +3 -0
  117. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts +41 -0
  118. package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts.map +1 -0
  119. package/dest/l1_tx_utils/forwarder_l1_tx_utils.js +42 -0
  120. package/dest/l1_tx_utils/index-blobs.d.ts +3 -0
  121. package/dest/l1_tx_utils/index-blobs.d.ts.map +1 -0
  122. package/dest/l1_tx_utils/index-blobs.js +2 -0
  123. package/dest/l1_tx_utils/index.d.ts +13 -0
  124. package/dest/l1_tx_utils/index.d.ts.map +1 -0
  125. package/dest/l1_tx_utils/index.js +13 -0
  126. package/dest/l1_tx_utils/interfaces.d.ts +76 -0
  127. package/dest/l1_tx_utils/interfaces.d.ts.map +1 -0
  128. package/dest/l1_tx_utils/interfaces.js +4 -0
  129. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts +233 -0
  130. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts.map +1 -0
  131. package/dest/l1_tx_utils/l1_fee_analyzer.js +506 -0
  132. package/dest/l1_tx_utils/l1_tx_utils.d.ts +105 -0
  133. package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -0
  134. package/dest/l1_tx_utils/l1_tx_utils.js +639 -0
  135. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +83 -0
  136. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -0
  137. package/dest/l1_tx_utils/readonly_l1_tx_utils.js +327 -0
  138. package/dest/l1_tx_utils/signer.d.ts +4 -0
  139. package/dest/l1_tx_utils/signer.d.ts.map +1 -0
  140. package/dest/l1_tx_utils/signer.js +16 -0
  141. package/dest/l1_tx_utils/tx_delayer.d.ts +56 -0
  142. package/dest/l1_tx_utils/tx_delayer.d.ts.map +1 -0
  143. package/dest/l1_tx_utils/tx_delayer.js +221 -0
  144. package/dest/l1_tx_utils/types.d.ts +67 -0
  145. package/dest/l1_tx_utils/types.d.ts.map +1 -0
  146. package/dest/l1_tx_utils/types.js +26 -0
  147. package/dest/l1_tx_utils/utils.d.ts +4 -0
  148. package/dest/l1_tx_utils/utils.d.ts.map +1 -0
  149. package/dest/l1_tx_utils/utils.js +14 -0
  150. package/dest/l1_types.d.ts +6 -0
  151. package/dest/l1_types.d.ts.map +1 -0
  152. package/dest/l1_types.js +1 -0
  153. package/dest/publisher_manager.d.ts +16 -0
  154. package/dest/publisher_manager.d.ts.map +1 -0
  155. package/dest/publisher_manager.js +88 -0
  156. package/dest/queries.d.ts +5 -3
  157. package/dest/queries.d.ts.map +1 -1
  158. package/dest/queries.js +61 -12
  159. package/dest/test/chain_monitor.d.ts +94 -0
  160. package/dest/test/chain_monitor.d.ts.map +1 -0
  161. package/dest/test/chain_monitor.js +244 -0
  162. package/dest/test/eth_cheat_codes.d.ts +229 -0
  163. package/dest/test/eth_cheat_codes.d.ts.map +1 -0
  164. package/dest/test/eth_cheat_codes.js +560 -0
  165. package/dest/test/eth_cheat_codes_with_state.d.ts +2 -2
  166. package/dest/test/eth_cheat_codes_with_state.d.ts.map +1 -1
  167. package/dest/test/eth_cheat_codes_with_state.js +1 -1
  168. package/dest/test/index.d.ts +4 -3
  169. package/dest/test/index.d.ts.map +1 -1
  170. package/dest/test/index.js +3 -2
  171. package/dest/test/rollup_cheat_codes.d.ts +90 -0
  172. package/dest/test/rollup_cheat_codes.d.ts.map +1 -0
  173. package/dest/test/rollup_cheat_codes.js +292 -0
  174. package/dest/test/start_anvil.d.ts +23 -2
  175. package/dest/test/start_anvil.d.ts.map +1 -1
  176. package/dest/test/start_anvil.js +133 -24
  177. package/dest/test/upgrade_utils.d.ts +6 -5
  178. package/dest/test/upgrade_utils.d.ts.map +1 -1
  179. package/dest/test/upgrade_utils.js +23 -16
  180. package/dest/types.d.ts +62 -8
  181. package/dest/types.d.ts.map +1 -1
  182. package/dest/types.js +3 -1
  183. package/dest/utils.d.ts +17 -3
  184. package/dest/utils.d.ts.map +1 -1
  185. package/dest/utils.js +111 -88
  186. package/dest/zkPassportVerifierAddress.d.ts +15 -0
  187. package/dest/zkPassportVerifierAddress.d.ts.map +1 -0
  188. package/dest/zkPassportVerifierAddress.js +11 -0
  189. package/package.json +51 -25
  190. package/src/account.ts +5 -0
  191. package/src/client.ts +51 -5
  192. package/src/config.ts +222 -43
  193. package/src/contracts/README.md +157 -0
  194. package/src/contracts/empire_base.ts +79 -7
  195. package/src/contracts/empire_slashing_proposer.ts +265 -0
  196. package/src/contracts/errors.ts +13 -0
  197. package/src/contracts/fee_asset_handler.ts +66 -0
  198. package/src/contracts/fee_asset_price_oracle.ts +280 -0
  199. package/src/contracts/fee_juice.ts +29 -15
  200. package/src/contracts/governance.ts +90 -78
  201. package/src/contracts/governance_proposer.ts +81 -25
  202. package/src/contracts/gse.ts +88 -0
  203. package/src/contracts/inbox.ts +115 -0
  204. package/src/contracts/index.ts +11 -2
  205. package/src/contracts/log.ts +13 -0
  206. package/src/contracts/multicall.ts +158 -0
  207. package/src/contracts/outbox.ts +98 -0
  208. package/src/contracts/registry.ts +81 -26
  209. package/src/contracts/rollup.ts +940 -89
  210. package/src/contracts/slasher_contract.ts +89 -0
  211. package/src/contracts/tally_slashing_proposer.ts +322 -0
  212. package/src/contracts/utils.ts +14 -0
  213. package/src/deploy_aztec_l1_contracts.ts +650 -0
  214. package/src/deploy_l1_contract.ts +362 -0
  215. package/src/eth-signer/eth-signer.ts +25 -0
  216. package/src/eth-signer/index.ts +1 -0
  217. package/src/forwarder_proxy.ts +108 -0
  218. package/src/generated/l1-contracts-defaults.ts +32 -0
  219. package/src/l1_artifacts.ts +254 -0
  220. package/src/l1_contract_addresses.ts +49 -34
  221. package/src/l1_reader.ts +30 -10
  222. package/src/l1_tx_utils/README.md +177 -0
  223. package/src/l1_tx_utils/config.ts +181 -0
  224. package/src/l1_tx_utils/constants.ts +29 -0
  225. package/src/l1_tx_utils/factory.ts +64 -0
  226. package/src/l1_tx_utils/fee-strategies/index.ts +22 -0
  227. package/src/l1_tx_utils/fee-strategies/p75_competitive.ts +163 -0
  228. package/src/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.ts +245 -0
  229. package/src/l1_tx_utils/fee-strategies/types.ts +56 -0
  230. package/src/l1_tx_utils/forwarder_l1_tx_utils.ts +108 -0
  231. package/src/l1_tx_utils/index-blobs.ts +2 -0
  232. package/src/l1_tx_utils/index.ts +15 -0
  233. package/src/l1_tx_utils/interfaces.ts +86 -0
  234. package/src/l1_tx_utils/l1_fee_analyzer.ts +803 -0
  235. package/src/l1_tx_utils/l1_tx_utils.ts +766 -0
  236. package/src/l1_tx_utils/readonly_l1_tx_utils.ts +423 -0
  237. package/src/l1_tx_utils/signer.ts +28 -0
  238. package/src/l1_tx_utils/tx_delayer.ts +294 -0
  239. package/src/l1_tx_utils/types.ts +85 -0
  240. package/src/l1_tx_utils/utils.ts +16 -0
  241. package/src/l1_types.ts +6 -0
  242. package/src/publisher_manager.ts +108 -0
  243. package/src/queries.ts +82 -16
  244. package/src/test/chain_monitor.ts +302 -0
  245. package/src/test/eth_cheat_codes.ts +588 -0
  246. package/src/test/eth_cheat_codes_with_state.ts +1 -1
  247. package/src/test/index.ts +3 -2
  248. package/src/test/rollup_cheat_codes.ts +330 -0
  249. package/src/test/start_anvil.ts +166 -22
  250. package/src/test/upgrade_utils.ts +30 -21
  251. package/src/types.ts +71 -7
  252. package/src/utils.ts +137 -93
  253. package/src/zkPassportVerifierAddress.ts +15 -0
  254. package/dest/contracts/forwarder.d.ts +0 -24
  255. package/dest/contracts/forwarder.d.ts.map +0 -1
  256. package/dest/contracts/forwarder.js +0 -101
  257. package/dest/contracts/slashing_proposer.d.ts +0 -21
  258. package/dest/contracts/slashing_proposer.d.ts.map +0 -1
  259. package/dest/contracts/slashing_proposer.js +0 -47
  260. package/dest/deploy_l1_contracts.d.ts +0 -21210
  261. package/dest/deploy_l1_contracts.d.ts.map +0 -1
  262. package/dest/deploy_l1_contracts.js +0 -687
  263. package/dest/eth_cheat_codes.d.ts +0 -147
  264. package/dest/eth_cheat_codes.d.ts.map +0 -1
  265. package/dest/eth_cheat_codes.js +0 -303
  266. package/dest/index.d.ts +0 -14
  267. package/dest/index.d.ts.map +0 -1
  268. package/dest/index.js +0 -13
  269. package/dest/l1_tx_utils.d.ts +0 -192
  270. package/dest/l1_tx_utils.d.ts.map +0 -1
  271. package/dest/l1_tx_utils.js +0 -641
  272. package/dest/l1_tx_utils_with_blobs.d.ts +0 -12
  273. package/dest/l1_tx_utils_with_blobs.d.ts.map +0 -1
  274. package/dest/l1_tx_utils_with_blobs.js +0 -64
  275. package/dest/test/delayed_tx_utils.d.ts +0 -8
  276. package/dest/test/delayed_tx_utils.d.ts.map +0 -1
  277. package/dest/test/delayed_tx_utils.js +0 -21
  278. package/dest/test/tx_delayer.d.ts +0 -25
  279. package/dest/test/tx_delayer.d.ts.map +0 -1
  280. package/dest/test/tx_delayer.js +0 -116
  281. package/src/contracts/forwarder.ts +0 -132
  282. package/src/contracts/slashing_proposer.ts +0 -51
  283. package/src/deploy_l1_contracts.ts +0 -948
  284. package/src/eth_cheat_codes.ts +0 -314
  285. package/src/index.ts +0 -13
  286. package/src/l1_tx_utils.ts +0 -847
  287. package/src/l1_tx_utils_with_blobs.ts +0 -86
  288. package/src/test/delayed_tx_utils.ts +0 -24
  289. package/src/test/tx_delayer.ts +0 -163
@@ -0,0 +1,294 @@
1
+ import { omit } from '@aztec/foundation/collection';
2
+ import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
3
+ import { retryUntil } from '@aztec/foundation/retry';
4
+ import type { DateProvider } from '@aztec/foundation/timer';
5
+
6
+ import { inspect } from 'util';
7
+ import {
8
+ type Client,
9
+ type Hex,
10
+ type PublicClient,
11
+ type TransactionSerializableEIP4844,
12
+ type TransactionSerialized,
13
+ keccak256,
14
+ parseTransaction,
15
+ publicActions,
16
+ recoverTransactionAddress,
17
+ serializeTransaction,
18
+ walletActions,
19
+ } from 'viem';
20
+
21
+ import type { ExtendedViemWalletClient, ViemClient } from '../types.js';
22
+
23
+ const MAX_WAIT_TIME_SECONDS = 180;
24
+
25
+ export function waitUntilBlock<T extends Client>(
26
+ client: T,
27
+ blockNumber: number | bigint,
28
+ logger?: Logger,
29
+ timeout?: number,
30
+ ) {
31
+ const publicClient =
32
+ 'getBlockNumber' in client && typeof client.getBlockNumber === 'function'
33
+ ? (client as unknown as PublicClient)
34
+ : client.extend(publicActions);
35
+
36
+ return retryUntil(
37
+ async () => {
38
+ const currentBlockNumber = await publicClient.getBlockNumber({ cacheTime: 0 });
39
+ logger?.debug(`Block number is ${currentBlockNumber} (waiting until ${blockNumber})`);
40
+ return currentBlockNumber >= BigInt(blockNumber);
41
+ },
42
+ `Wait until L1 block ${blockNumber}`,
43
+ timeout ?? MAX_WAIT_TIME_SECONDS,
44
+ 0.1,
45
+ );
46
+ }
47
+
48
+ export function waitUntilL1Timestamp<T extends Client>(
49
+ client: T,
50
+ timestamp: number | bigint,
51
+ logger?: Logger,
52
+ timeout?: number,
53
+ ) {
54
+ const publicClient =
55
+ 'getBlockNumber' in client && typeof client.getBlockNumber === 'function'
56
+ ? (client as unknown as PublicClient)
57
+ : client.extend(publicActions);
58
+
59
+ let lastBlock: bigint | undefined = undefined;
60
+ return retryUntil(
61
+ async () => {
62
+ const currentBlockNumber = await publicClient.getBlockNumber({ cacheTime: 0 });
63
+ if (currentBlockNumber === lastBlock) {
64
+ return false;
65
+ }
66
+ lastBlock = currentBlockNumber;
67
+ const currentBlock = await publicClient.getBlock({ includeTransactions: false, blockNumber: currentBlockNumber });
68
+ const currentTs = currentBlock.timestamp;
69
+ logger?.debug(`Block timstamp is ${currentTs} (waiting until ${timestamp})`);
70
+ return currentTs >= BigInt(timestamp);
71
+ },
72
+ `Wait until L1 timestamp ${timestamp}`,
73
+ timeout ?? MAX_WAIT_TIME_SECONDS,
74
+ 0.1,
75
+ );
76
+ }
77
+
78
+ /** Manages tx delaying for testing, intercepting sendRawTransaction calls to delay or cancel them. */
79
+ export class Delayer {
80
+ private logger: Logger;
81
+
82
+ public maxInclusionTimeIntoSlot: number | undefined = undefined;
83
+ public ethereumSlotDuration: bigint;
84
+ public nextWait: { l1Timestamp: bigint } | { l1BlockNumber: bigint } | { indefinitely: true } | undefined = undefined;
85
+ public sentTxHashes: Hex[] = [];
86
+ public cancelledTxs: Hex[] = [];
87
+
88
+ constructor(
89
+ public dateProvider: DateProvider,
90
+ opts: { ethereumSlotDuration: bigint | number },
91
+ bindings: LoggerBindings,
92
+ ) {
93
+ this.ethereumSlotDuration = BigInt(opts.ethereumSlotDuration);
94
+ this.logger = createLogger('ethereum:tx_delayer', bindings);
95
+ }
96
+
97
+ /** Returns the logger instance used by this delayer. */
98
+ getLogger(): Logger {
99
+ return this.logger;
100
+ }
101
+
102
+ /** Returns the hashes of all effectively sent txs. */
103
+ getSentTxHashes() {
104
+ return this.sentTxHashes;
105
+ }
106
+
107
+ /** Returns the raw hex for all cancelled txs. */
108
+ getCancelledTxs(): Hex[] {
109
+ return this.cancelledTxs;
110
+ }
111
+
112
+ /** Delays the next tx to be sent so it lands on the given L1 block number. */
113
+ pauseNextTxUntilBlock(l1BlockNumber: number | bigint) {
114
+ this.nextWait = { l1BlockNumber: BigInt(l1BlockNumber) };
115
+ }
116
+
117
+ /** Delays the next tx to be sent so it lands on the given timestamp. */
118
+ pauseNextTxUntilTimestamp(l1Timestamp: number | bigint) {
119
+ this.nextWait = { l1Timestamp: BigInt(l1Timestamp) };
120
+ }
121
+
122
+ /** Delays the next tx to be sent indefinitely. */
123
+ cancelNextTx() {
124
+ this.nextWait = { indefinitely: true };
125
+ }
126
+
127
+ /**
128
+ * Sets max inclusion time into slot. If more than this many seconds have passed
129
+ * since the last L1 block was mined, then any tx will not be mined in the current
130
+ * L1 slot but will be deferred for the next one.
131
+ */
132
+ setMaxInclusionTimeIntoSlot(seconds: number | undefined) {
133
+ this.maxInclusionTimeIntoSlot = seconds;
134
+ }
135
+ }
136
+
137
+ /**
138
+ * Creates a new Delayer instance. Exposed so callers can create a single shared delayer
139
+ * and pass it to multiple `wrapClientWithDelayer` calls.
140
+ */
141
+ export function createDelayer(
142
+ dateProvider: DateProvider,
143
+ opts: { ethereumSlotDuration: bigint | number },
144
+ bindings: LoggerBindings,
145
+ ): Delayer {
146
+ return new Delayer(dateProvider, opts, bindings);
147
+ }
148
+
149
+ /** Tries to recover the sender address from a serialized signed transaction. */
150
+ async function tryRecoverSender(serializedTransaction: Hex): Promise<string | undefined> {
151
+ try {
152
+ return await recoverTransactionAddress({
153
+ serializedTransaction: serializedTransaction as TransactionSerialized,
154
+ });
155
+ } catch {
156
+ return undefined;
157
+ }
158
+ }
159
+
160
+ /**
161
+ * Wraps a viem client with tx delaying logic. Returns the wrapped client.
162
+ * The delayer intercepts sendRawTransaction calls and delays them based on the delayer's state.
163
+ */
164
+ export function wrapClientWithDelayer<T extends ViemClient>(client: T, delayer: Delayer): T {
165
+ const logger = delayer.getLogger();
166
+
167
+ // Cast to ExtendedViemWalletClient for the extend chain since it has sendRawTransaction.
168
+ // The sendRawTransaction override is applied to all clients regardless of type.
169
+ const withRawTx = (client as unknown as ExtendedViemWalletClient)
170
+ // Tweak sendRawTransaction so it uses the delay defined in the delayer.
171
+ // Note that this will only work with local accounts (ie accounts for which we have the private key).
172
+ // Transactions signed by the node will not be delayed since they use sendTransaction directly,
173
+ // but we do not use them in our codebase at all.
174
+ .extend(client => ({
175
+ async sendRawTransaction(...args) {
176
+ let wait: Promise<unknown> | undefined;
177
+ let txHash: Hex | undefined;
178
+
179
+ const { serializedTransaction } = args[0];
180
+ const publicClient = client as unknown as PublicClient;
181
+ const sender = await tryRecoverSender(serializedTransaction);
182
+
183
+ if (delayer.nextWait !== undefined) {
184
+ // Check if we have been instructed to delay the next tx.
185
+ const waitUntil = delayer.nextWait;
186
+ delayer.nextWait = undefined;
187
+
188
+ // Compute the tx hash manually so we emulate sendRawTransaction response
189
+ txHash = computeTxHash(serializedTransaction);
190
+
191
+ // Cancel tx outright if instructed
192
+ if ('indefinitely' in waitUntil && waitUntil.indefinitely) {
193
+ logger.info(`Cancelling tx ${txHash}`, { sender });
194
+ delayer.cancelledTxs.push(serializedTransaction);
195
+ return Promise.resolve(txHash);
196
+ }
197
+
198
+ // Or wait until the desired block number or timestamp
199
+ wait =
200
+ 'l1BlockNumber' in waitUntil
201
+ ? waitUntilBlock(publicClient, waitUntil.l1BlockNumber - 1n, logger)
202
+ : 'l1Timestamp' in waitUntil
203
+ ? waitUntilL1Timestamp(publicClient, waitUntil.l1Timestamp - delayer.ethereumSlotDuration, logger)
204
+ : undefined;
205
+
206
+ logger.info(`Delaying tx ${txHash} until ${inspect(waitUntil)}`, {
207
+ sender,
208
+ argsLen: args.length,
209
+ ...omit(parseTransaction(serializedTransaction), 'data', 'sidecars'),
210
+ });
211
+ } else if (delayer.maxInclusionTimeIntoSlot !== undefined) {
212
+ // Check if we need to delay txs sent too close to the end of the slot.
213
+ const currentBlock = await publicClient.getBlock({ includeTransactions: false });
214
+ const { timestamp: lastBlockTimestamp, number } = currentBlock;
215
+ const now = delayer.dateProvider.now();
216
+
217
+ txHash = computeTxHash(serializedTransaction);
218
+ const logData = {
219
+ sender,
220
+ ...omit(parseTransaction(serializedTransaction), 'data', 'sidecars'),
221
+ lastBlockTimestamp,
222
+ now,
223
+ maxInclusionTimeIntoSlot: delayer.maxInclusionTimeIntoSlot,
224
+ };
225
+
226
+ if (now / 1000 - Number(lastBlockTimestamp) > delayer.maxInclusionTimeIntoSlot) {
227
+ // If the last block was mined more than `maxInclusionTimeIntoSlot` seconds ago, then we cannot include
228
+ // any txs in the current slot, so we delay the tx until the next slot.
229
+ logger.info(`Delaying inclusion of tx ${txHash} until the next slot since it was sent too late`, logData);
230
+ wait = waitUntilBlock(publicClient, number + 1n, logger);
231
+ } else {
232
+ logger.debug(`Immediately sending tx ${txHash} as it was received early enough in the slot`, logData);
233
+ }
234
+ }
235
+
236
+ if (wait !== undefined) {
237
+ // Do not await here so we can return the tx hash immediately as if it had been sent on the spot.
238
+ // Instead, delay it so it lands on the desired block number or timestamp, assuming anvil will
239
+ // mine it immediately.
240
+ void wait!
241
+ .then(async () => {
242
+ const clientTxHash = await client.sendRawTransaction(...args);
243
+ if (clientTxHash !== txHash) {
244
+ logger.error(`Tx hash returned by the client does not match computed one`, {
245
+ clientTxHash,
246
+ computedTxHash: txHash,
247
+ });
248
+ }
249
+ logger.info(`Sent previously delayed tx ${clientTxHash}`, { sender });
250
+ delayer.sentTxHashes.push(clientTxHash);
251
+ })
252
+ .catch(err => logger.error(`Error sending tx after delay`, err));
253
+ return Promise.resolve(txHash!);
254
+ } else {
255
+ const txHash = await client.sendRawTransaction(...args);
256
+ logger.debug(`Sent tx immediately ${txHash}`, { sender });
257
+ delayer.sentTxHashes.push(txHash);
258
+ return txHash;
259
+ }
260
+ },
261
+ }));
262
+
263
+ // Only re-bind wallet actions (sendTransaction, writeContract, deployContract) for wallet clients.
264
+ // This is needed for tests that use wallet actions directly rather than sendRawTransaction.
265
+ const isWalletClient = 'account' in client && client.account !== undefined;
266
+ const extended = isWalletClient
267
+ ? withRawTx
268
+ // Re-extend with sendTransaction so it uses the modified sendRawTransaction.
269
+ .extend(client => ({ sendTransaction: walletActions(client).sendTransaction }))
270
+ // And with the actions that depend on the modified sendTransaction
271
+ .extend(client => ({
272
+ writeContract: walletActions(client).writeContract,
273
+ deployContract: walletActions(client).deployContract,
274
+ }))
275
+ : withRawTx;
276
+
277
+ return extended as T;
278
+ }
279
+
280
+ /**
281
+ * Compute the tx hash given the serialized tx. Note that if this is a blob tx, we need to
282
+ * exclude the blobs, commitments, and proofs from the hash.
283
+ */
284
+ function computeTxHash(serializedTransaction: Hex) {
285
+ if (serializedTransaction.startsWith('0x03')) {
286
+ const parsed = parseTransaction(serializedTransaction);
287
+ if (parsed.blobs || parsed.sidecars) {
288
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
289
+ const { blobs, sidecars, ...rest } = parsed;
290
+ return keccak256(serializeTransaction({ type: 'eip4844', ...rest } as TransactionSerializableEIP4844));
291
+ }
292
+ }
293
+ return keccak256(serializedTransaction);
294
+ }
@@ -0,0 +1,85 @@
1
+ import type { BlobKzgInstance } from '@aztec/blob-lib/types';
2
+ import { EthAddress } from '@aztec/foundation/eth-address';
3
+ import type { ViemTransactionSignature } from '@aztec/foundation/eth-signature';
4
+
5
+ import type { Abi, Address, Hex, TransactionReceipt, TransactionSerializable } from 'viem';
6
+
7
+ import type { L1TxUtilsConfig } from './config.js';
8
+
9
+ export interface L1TxRequest {
10
+ to: Address | null;
11
+ data?: Hex;
12
+ value?: bigint;
13
+ abi?: Abi;
14
+ }
15
+
16
+ export type L1TxConfig = Partial<L1TxUtilsConfig> & { gasLimit?: bigint; txTimeoutAt?: Date };
17
+
18
+ export interface L1BlobInputs {
19
+ blobs: Uint8Array[];
20
+ kzg: BlobKzgInstance;
21
+ maxFeePerBlobGas?: bigint;
22
+ }
23
+
24
+ export interface GasPrice {
25
+ maxFeePerGas: bigint;
26
+ maxPriorityFeePerGas: bigint;
27
+ maxFeePerBlobGas?: bigint;
28
+ }
29
+
30
+ export type TransactionStats = {
31
+ /** Address of the sender. */
32
+ sender: string;
33
+ /** Hash of the transaction. */
34
+ transactionHash: string;
35
+ /** Size in bytes of the tx calldata */
36
+ calldataSize: number;
37
+ /** Gas required to pay for the calldata inclusion (depends on size and number of zeros) */
38
+ calldataGas: number;
39
+ };
40
+
41
+ export enum TxUtilsState {
42
+ IDLE,
43
+ SENT,
44
+ SPEED_UP,
45
+ CANCELLED,
46
+ NOT_MINED,
47
+ MINED,
48
+ }
49
+
50
+ export const TerminalTxUtilsState = [TxUtilsState.IDLE, TxUtilsState.MINED, TxUtilsState.NOT_MINED];
51
+
52
+ export type L1TxState = {
53
+ id: number;
54
+ txHashes: Hex[];
55
+ cancelTxHashes: Hex[];
56
+ gasLimit: bigint;
57
+ gasPrice: GasPrice;
58
+ txConfigOverrides: L1TxConfig;
59
+ request: L1TxRequest;
60
+ status: TxUtilsState;
61
+ nonce: number;
62
+ sentAtL1Ts: Date;
63
+ lastSentAtL1Ts: Date;
64
+ receipt?: TransactionReceipt;
65
+ blobInputs: L1BlobInputs | undefined;
66
+ };
67
+
68
+ export type SigningCallback = (
69
+ transaction: TransactionSerializable,
70
+ signingAddress: EthAddress,
71
+ ) => Promise<ViemTransactionSignature>;
72
+
73
+ export class UnknownMinedTxError extends Error {
74
+ constructor(nonce: number, account: string) {
75
+ super(`Nonce ${nonce} from account ${account} is MINED but not by one of our expected transactions`);
76
+ this.name = 'UnknownMinedTxError';
77
+ }
78
+ }
79
+
80
+ export class DroppedTransactionError extends Error {
81
+ constructor(nonce: number, account: string) {
82
+ super(`Transaction with nonce ${nonce} from account ${account} was dropped from the mempool`);
83
+ this.name = 'DroppedTransactionError';
84
+ }
85
+ }
@@ -0,0 +1,16 @@
1
+ import { compactArray } from '@aztec/foundation/collection';
2
+
3
+ import type { ContractFunctionExecutionError } from 'viem';
4
+
5
+ export function tryGetCustomErrorNameContractFunction(err: ContractFunctionExecutionError) {
6
+ return compactArray([err.shortMessage, ...(err.metaMessages ?? []).slice(0, 2).map(s => s.trim())]).join(' ');
7
+ }
8
+
9
+ /*
10
+ * Returns cost of calldata usage in Ethereum.
11
+ * @param data - Calldata.
12
+ * @returns 4 for each zero byte, 16 for each nonzero.
13
+ */
14
+ export function getCalldataGasUsage(data: Uint8Array) {
15
+ return data.filter(byte => byte === 0).length * 4 + data.filter(byte => byte !== 0).length * 16;
16
+ }
@@ -0,0 +1,6 @@
1
+ import type { Buffer32 } from '@aztec/foundation/buffer';
2
+
3
+ export type L1BlockId = {
4
+ l1BlockNumber: bigint;
5
+ l1BlockHash: Buffer32;
6
+ };
@@ -0,0 +1,108 @@
1
+ import { pick } from '@aztec/foundation/collection';
2
+ import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
3
+
4
+ import { L1TxUtils, TxUtilsState } from './l1_tx_utils/index.js';
5
+
6
+ // Defines the order in which we prioritise publishers based on their state (first is better)
7
+ const sortOrder = [
8
+ // Always prefer sending from idle publishers
9
+ TxUtilsState.IDLE,
10
+ // Then from publishers that have sent a tx and it got mined
11
+ TxUtilsState.MINED,
12
+ // Then from publishers that have sent a tx but it's in-flight
13
+ TxUtilsState.SPEED_UP,
14
+ TxUtilsState.SENT,
15
+ // We leave cancelled and not-mined states for last, since these represent failures to mines and could be problematic
16
+ TxUtilsState.CANCELLED,
17
+ TxUtilsState.NOT_MINED,
18
+ ];
19
+
20
+ // Which states represent a busy publisher that we should avoid if possible
21
+ const busyStates: TxUtilsState[] = [
22
+ TxUtilsState.SENT,
23
+ TxUtilsState.SPEED_UP,
24
+ TxUtilsState.CANCELLED,
25
+ TxUtilsState.NOT_MINED,
26
+ ];
27
+
28
+ export type PublisherFilter<UtilsType extends L1TxUtils> = (utils: UtilsType) => boolean;
29
+
30
+ export class PublisherManager<UtilsType extends L1TxUtils = L1TxUtils> {
31
+ private log: Logger;
32
+ private config: { publisherAllowInvalidStates?: boolean };
33
+
34
+ constructor(
35
+ private publishers: UtilsType[],
36
+ config: { publisherAllowInvalidStates?: boolean },
37
+ bindings?: LoggerBindings,
38
+ ) {
39
+ this.log = createLogger('publisher:manager', bindings);
40
+ this.log.info(`PublisherManager initialized with ${publishers.length} publishers.`);
41
+ this.publishers = publishers;
42
+ this.config = pick(config, 'publisherAllowInvalidStates');
43
+ }
44
+
45
+ /** Loads the state of all publishers and resumes monitoring any pending txs */
46
+ public async loadState(): Promise<void> {
47
+ await Promise.all(this.publishers.map(pub => pub.loadStateAndResumeMonitoring()));
48
+ }
49
+
50
+ // Finds and prioritises available publishers based on
51
+ // 1. Validity as per the provided filter function
52
+ // 2. Validity based on the state the publisher is in
53
+ // 3. Priority based on state as defined by sortOrder
54
+ // 4. Then priority based on highest balance
55
+ // 5. Then priority based on least recently used
56
+ public async getAvailablePublisher(filter: PublisherFilter<UtilsType> = () => true): Promise<UtilsType> {
57
+ this.log.debug(`Getting available publisher`, {
58
+ publishers: this.publishers.map(p => ({
59
+ address: p.getSenderAddress(),
60
+ state: p.state,
61
+ lastMined: p.lastMinedAtBlockNumber,
62
+ })),
63
+ });
64
+
65
+ // Extract the valid publishers
66
+ let validPublishers = this.publishers.filter((pub: UtilsType) => !busyStates.includes(pub.state) && filter(pub));
67
+
68
+ // If none found but we allow invalid (busy) states, try again including them
69
+ if (validPublishers.length === 0 && this.config.publisherAllowInvalidStates) {
70
+ this.log.warn(`No valid publishers found. Trying again including invalid states.`);
71
+ validPublishers = this.publishers.filter(pub => filter(pub));
72
+ }
73
+
74
+ // Error if none found
75
+ if (validPublishers.length === 0) {
76
+ throw new Error(`Failed to find an available publisher.`);
77
+ }
78
+
79
+ // Get the balances
80
+ const publishersWithBalance = await Promise.all(
81
+ validPublishers.map(async pub => {
82
+ return { balance: await pub.getSenderBalance(), publisher: pub };
83
+ }),
84
+ );
85
+
86
+ // Sort based on state, then balance, then time since last use
87
+ const sortedPublishers = publishersWithBalance.sort((a, b) => {
88
+ const stateComparison = sortOrder.indexOf(a.publisher.state) - sortOrder.indexOf(b.publisher.state);
89
+ if (stateComparison !== 0) {
90
+ return stateComparison;
91
+ }
92
+ const balanceComparison = Number(b.balance - a.balance);
93
+ if (balanceComparison !== 0) {
94
+ return balanceComparison;
95
+ }
96
+ const lastUsedComparison = Number(
97
+ (a.publisher.lastMinedAtBlockNumber ?? 0n) - (b.publisher.lastMinedAtBlockNumber ?? 0n),
98
+ );
99
+ return lastUsedComparison;
100
+ });
101
+
102
+ return sortedPublishers[0].publisher;
103
+ }
104
+
105
+ public interrupt() {
106
+ this.publishers.forEach(pub => pub.interrupt());
107
+ }
108
+ }
package/src/queries.ts CHANGED
@@ -1,7 +1,9 @@
1
- import type { EthAddress } from '@aztec/foundation/eth-address';
1
+ import { EthAddress } from '@aztec/foundation/eth-address';
2
2
 
3
- import type { L1ContractsConfig } from './config.js';
4
- import { GovernanceContract } from './contracts/governance.js';
3
+ import { DefaultL1ContractsConfig, type L1ContractsConfig } from './config.js';
4
+ import { ReadOnlyGovernanceContract } from './contracts/governance.js';
5
+ import { GovernanceProposerContract } from './contracts/governance_proposer.js';
6
+ import { InboxContract } from './contracts/inbox.js';
5
7
  import { RollupContract } from './contracts/rollup.js';
6
8
  import type { ViemPublicClient } from './types.js';
7
9
 
@@ -9,50 +11,114 @@ import type { ViemPublicClient } from './types.js';
9
11
  export async function getL1ContractsConfig(
10
12
  publicClient: ViemPublicClient,
11
13
  addresses: { governanceAddress: EthAddress; rollupAddress?: EthAddress },
12
- ): Promise<Omit<L1ContractsConfig, 'ethereumSlotDuration'> & { l1StartBlock: bigint; l1GenesisTime: bigint }> {
13
- const governance = new GovernanceContract(addresses.governanceAddress.toString(), publicClient, undefined);
14
- const governanceProposer = await governance.getProposer();
15
- const rollupAddress = addresses.rollupAddress ?? (await governance.getGovernanceAddresses()).rollupAddress;
14
+ ): Promise<
15
+ Omit<L1ContractsConfig, 'ethereumSlotDuration'> & {
16
+ l1StartBlock: bigint;
17
+ l1GenesisTime: bigint;
18
+ rollupVersion: number;
19
+ genesisArchiveTreeRoot: `0x${string}`;
20
+ }
21
+ > {
22
+ const governance = new ReadOnlyGovernanceContract(addresses.governanceAddress.toString(), publicClient);
23
+ const governanceProposerAddress = await governance.getGovernanceProposerAddress();
24
+ const governanceProposer = new GovernanceProposerContract(publicClient, governanceProposerAddress.toString());
25
+ const rollupAddress = addresses.rollupAddress ?? (await governanceProposer.getRollupAddress());
16
26
  const rollup = new RollupContract(publicClient, rollupAddress.toString());
17
27
  const slasherProposer = await rollup.getSlashingProposer();
28
+ const slasher = await rollup.getSlasherContract();
29
+ const rollupAddresses = await rollup.getRollupAddresses();
30
+ const inboxContract = new InboxContract(publicClient, rollupAddresses.inboxAddress.toString());
18
31
 
19
32
  const [
20
33
  l1StartBlock,
21
34
  l1GenesisTime,
22
35
  aztecEpochDuration,
23
- aztecProofSubmissionWindow,
24
36
  aztecSlotDuration,
37
+ aztecProofSubmissionEpochs,
25
38
  aztecTargetCommitteeSize,
26
- minimumStake,
39
+ lagInEpochsForValidatorSet,
40
+ lagInEpochsForRandao,
41
+ inboxLag,
42
+ activationThreshold,
43
+ ejectionThreshold,
44
+ localEjectionThreshold,
27
45
  governanceProposerQuorum,
28
46
  governanceProposerRoundSize,
29
47
  slashingQuorum,
30
48
  slashingRoundSize,
49
+ slashingLifetimeInRounds,
50
+ slashingExecutionDelayInRounds,
51
+ slashingOffsetInRounds,
52
+ slashingAmounts,
53
+ slashingVetoer,
54
+ slashingDisableDuration,
55
+ manaTarget,
56
+ provingCostPerMana,
57
+ rollupVersion,
58
+ genesisArchiveTreeRoot,
59
+ exitDelay,
31
60
  ] = await Promise.all([
32
61
  rollup.getL1StartBlock(),
33
62
  rollup.getL1GenesisTime(),
34
63
  rollup.getEpochDuration(),
35
- rollup.getProofSubmissionWindow(),
36
64
  rollup.getSlotDuration(),
65
+ rollup.getProofSubmissionEpochs(),
37
66
  rollup.getTargetCommitteeSize(),
38
- rollup.getMinimumStake(),
67
+ rollup.getLagInEpochsForValidatorSet(),
68
+ rollup.getLagInEpochsForRandao(),
69
+ inboxContract.getLag(),
70
+ rollup.getActivationThreshold(),
71
+ rollup.getEjectionThreshold(),
72
+ rollup.getLocalEjectionThreshold(),
39
73
  governanceProposer.getQuorumSize(),
40
74
  governanceProposer.getRoundSize(),
41
- slasherProposer.getQuorumSize(),
42
- slasherProposer.getRoundSize(),
75
+ slasherProposer?.getQuorumSize() ?? 0n,
76
+ slasherProposer?.getRoundSize() ?? 0n,
77
+ slasherProposer?.getLifetimeInRounds() ?? 0n,
78
+ slasherProposer?.getExecutionDelayInRounds() ?? 0n,
79
+ slasherProposer?.type === 'tally' ? slasherProposer.getSlashOffsetInRounds() : 0n,
80
+ slasherProposer?.type === 'tally' ? slasherProposer.getSlashingAmounts() : [0n, 0n, 0n],
81
+ slasher?.getVetoer() ?? EthAddress.ZERO,
82
+ slasher?.getSlashingDisableDuration() ?? 0,
83
+ rollup.getManaTarget(),
84
+ rollup.getProvingCostPerMana(),
85
+ rollup.getVersion(),
86
+ rollup.getGenesisArchiveTreeRoot(),
87
+ rollup.getExitDelay(),
43
88
  ] as const);
44
89
 
45
90
  return {
46
91
  l1StartBlock,
47
92
  l1GenesisTime,
48
93
  aztecEpochDuration: Number(aztecEpochDuration),
49
- aztecProofSubmissionWindow: Number(aztecProofSubmissionWindow),
50
94
  aztecSlotDuration: Number(aztecSlotDuration),
95
+ aztecProofSubmissionEpochs: Number(aztecProofSubmissionEpochs),
51
96
  aztecTargetCommitteeSize: Number(aztecTargetCommitteeSize),
97
+ lagInEpochsForValidatorSet: Number(lagInEpochsForValidatorSet),
98
+ lagInEpochsForRandao: Number(lagInEpochsForRandao),
99
+ inboxLag: Number(inboxLag),
52
100
  governanceProposerQuorum: Number(governanceProposerQuorum),
53
101
  governanceProposerRoundSize: Number(governanceProposerRoundSize),
54
- minimumStake,
102
+ governanceVotingDuration: DefaultL1ContractsConfig.governanceVotingDuration,
103
+ activationThreshold,
104
+ ejectionThreshold,
105
+ localEjectionThreshold,
55
106
  slashingQuorum: Number(slashingQuorum),
56
- slashingRoundSize: Number(slashingRoundSize),
107
+ slashingRoundSizeInEpochs: Number(Number(slashingRoundSize) / aztecEpochDuration),
108
+ slashingLifetimeInRounds: Number(slashingLifetimeInRounds),
109
+ slashingExecutionDelayInRounds: Number(slashingExecutionDelayInRounds),
110
+ slashingVetoer,
111
+ slashingDisableDuration,
112
+ manaTarget,
113
+ provingCostPerMana: provingCostPerMana,
114
+ rollupVersion: Number(rollupVersion),
115
+ genesisArchiveTreeRoot: genesisArchiveTreeRoot.toString(),
116
+ exitDelaySeconds: Number(exitDelay),
117
+ slasherFlavor: slasherProposer?.type ?? 'tally',
118
+ slashingOffsetInRounds: Number(slashingOffsetInRounds),
119
+ slashAmountSmall: slashingAmounts[0],
120
+ slashAmountMedium: slashingAmounts[1],
121
+ slashAmountLarge: slashingAmounts[2],
122
+ initialEthPerFeeAsset: DefaultL1ContractsConfig.initialEthPerFeeAsset,
57
123
  };
58
124
  }