@aztec/ethereum 0.0.1-commit.03f7ef2 → 0.0.1-commit.1142ef1

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 (66) hide show
  1. package/dest/config.d.ts +4 -1
  2. package/dest/config.d.ts.map +1 -1
  3. package/dest/config.js +6 -0
  4. package/dest/contracts/fee_asset_handler.d.ts +6 -5
  5. package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
  6. package/dest/contracts/fee_asset_handler.js +9 -9
  7. package/dest/contracts/governance_proposer.js +382 -8
  8. package/dest/contracts/inbox.d.ts +5 -1
  9. package/dest/contracts/inbox.d.ts.map +1 -1
  10. package/dest/contracts/inbox.js +4 -0
  11. package/dest/contracts/index.d.ts +2 -1
  12. package/dest/contracts/index.d.ts.map +1 -1
  13. package/dest/contracts/index.js +1 -0
  14. package/dest/contracts/outbox.d.ts +41 -0
  15. package/dest/contracts/outbox.d.ts.map +1 -0
  16. package/dest/contracts/outbox.js +86 -0
  17. package/dest/contracts/rollup.d.ts +128 -95
  18. package/dest/contracts/rollup.d.ts.map +1 -1
  19. package/dest/contracts/rollup.js +602 -127
  20. package/dest/deploy_aztec_l1_contracts.d.ts +12 -2
  21. package/dest/deploy_aztec_l1_contracts.d.ts.map +1 -1
  22. package/dest/deploy_aztec_l1_contracts.js +61 -11
  23. package/dest/l1_artifacts.d.ts +3550 -1102
  24. package/dest/l1_artifacts.d.ts.map +1 -1
  25. package/dest/l1_tx_utils/fee-strategies/index.d.ts +3 -2
  26. package/dest/l1_tx_utils/fee-strategies/index.d.ts.map +1 -1
  27. package/dest/l1_tx_utils/fee-strategies/index.js +2 -1
  28. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts +2 -12
  29. package/dest/l1_tx_utils/fee-strategies/p75_competitive.d.ts.map +1 -1
  30. package/dest/l1_tx_utils/fee-strategies/p75_competitive.js +35 -17
  31. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts +2 -11
  32. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.d.ts.map +1 -1
  33. package/dest/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.js +36 -18
  34. package/dest/l1_tx_utils/fee-strategies/types.d.ts +14 -27
  35. package/dest/l1_tx_utils/fee-strategies/types.d.ts.map +1 -1
  36. package/dest/l1_tx_utils/fee-strategies/types.js +0 -21
  37. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts +2 -2
  38. package/dest/l1_tx_utils/l1_fee_analyzer.d.ts.map +1 -1
  39. package/dest/l1_tx_utils/l1_fee_analyzer.js +3 -3
  40. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +1 -5
  41. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -1
  42. package/dest/l1_tx_utils/readonly_l1_tx_utils.js +14 -51
  43. package/dest/queries.d.ts +1 -1
  44. package/dest/queries.d.ts.map +1 -1
  45. package/dest/queries.js +8 -3
  46. package/dest/test/chain_monitor.js +1 -2
  47. package/dest/test/rollup_cheat_codes.d.ts +2 -1
  48. package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
  49. package/dest/test/rollup_cheat_codes.js +9 -1
  50. package/package.json +5 -5
  51. package/src/config.ts +8 -0
  52. package/src/contracts/fee_asset_handler.ts +8 -7
  53. package/src/contracts/inbox.ts +5 -0
  54. package/src/contracts/index.ts +1 -0
  55. package/src/contracts/outbox.ts +98 -0
  56. package/src/contracts/rollup.ts +240 -92
  57. package/src/deploy_aztec_l1_contracts.ts +62 -13
  58. package/src/l1_tx_utils/fee-strategies/index.ts +1 -1
  59. package/src/l1_tx_utils/fee-strategies/p75_competitive.ts +45 -41
  60. package/src/l1_tx_utils/fee-strategies/p75_competitive_blob_txs_only.ts +48 -44
  61. package/src/l1_tx_utils/fee-strategies/types.ts +14 -46
  62. package/src/l1_tx_utils/l1_fee_analyzer.ts +2 -3
  63. package/src/l1_tx_utils/readonly_l1_tx_utils.ts +20 -59
  64. package/src/queries.ts +8 -2
  65. package/src/test/chain_monitor.ts +1 -1
  66. package/src/test/rollup_cheat_codes.ts +10 -1
package/src/queries.ts CHANGED
@@ -3,6 +3,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
3
3
  import type { L1ContractsConfig } from './config.js';
4
4
  import { ReadOnlyGovernanceContract } from './contracts/governance.js';
5
5
  import { GovernanceProposerContract } from './contracts/governance_proposer.js';
6
+ import { InboxContract } from './contracts/inbox.js';
6
7
  import { RollupContract } from './contracts/rollup.js';
7
8
  import type { ViemPublicClient } from './types.js';
8
9
 
@@ -25,6 +26,8 @@ export async function getL1ContractsConfig(
25
26
  const rollup = new RollupContract(publicClient, rollupAddress.toString());
26
27
  const slasherProposer = await rollup.getSlashingProposer();
27
28
  const slasher = await rollup.getSlasherContract();
29
+ const rollupAddresses = await rollup.getRollupAddresses();
30
+ const inboxContract = new InboxContract(publicClient, rollupAddresses.inboxAddress.toString());
28
31
 
29
32
  const [
30
33
  l1StartBlock,
@@ -35,6 +38,7 @@ export async function getL1ContractsConfig(
35
38
  aztecTargetCommitteeSize,
36
39
  lagInEpochsForValidatorSet,
37
40
  lagInEpochsForRandao,
41
+ inboxLag,
38
42
  activationThreshold,
39
43
  ejectionThreshold,
40
44
  localEjectionThreshold,
@@ -62,6 +66,7 @@ export async function getL1ContractsConfig(
62
66
  rollup.getTargetCommitteeSize(),
63
67
  rollup.getLagInEpochsForValidatorSet(),
64
68
  rollup.getLagInEpochsForRandao(),
69
+ inboxContract.getLag(),
65
70
  rollup.getActivationThreshold(),
66
71
  rollup.getEjectionThreshold(),
67
72
  rollup.getLocalEjectionThreshold(),
@@ -91,13 +96,14 @@ export async function getL1ContractsConfig(
91
96
  aztecTargetCommitteeSize: Number(aztecTargetCommitteeSize),
92
97
  lagInEpochsForValidatorSet: Number(lagInEpochsForValidatorSet),
93
98
  lagInEpochsForRandao: Number(lagInEpochsForRandao),
99
+ inboxLag: Number(inboxLag),
94
100
  governanceProposerQuorum: Number(governanceProposerQuorum),
95
101
  governanceProposerRoundSize: Number(governanceProposerRoundSize),
96
102
  activationThreshold,
97
103
  ejectionThreshold,
98
104
  localEjectionThreshold,
99
105
  slashingQuorum: Number(slashingQuorum),
100
- slashingRoundSizeInEpochs: Number(slashingRoundSize / aztecEpochDuration),
106
+ slashingRoundSizeInEpochs: Number(Number(slashingRoundSize) / aztecEpochDuration),
101
107
  slashingLifetimeInRounds: Number(slashingLifetimeInRounds),
102
108
  slashingExecutionDelayInRounds: Number(slashingExecutionDelayInRounds),
103
109
  slashingVetoer,
@@ -105,7 +111,7 @@ export async function getL1ContractsConfig(
105
111
  manaTarget,
106
112
  provingCostPerMana: provingCostPerMana,
107
113
  rollupVersion: Number(rollupVersion),
108
- genesisArchiveTreeRoot,
114
+ genesisArchiveTreeRoot: genesisArchiveTreeRoot.toString(),
109
115
  exitDelaySeconds: Number(exitDelay),
110
116
  slasherFlavor: slasherProposer?.type ?? 'tally',
111
117
  slashingOffsetInRounds: Number(slashingOffsetInRounds),
@@ -156,7 +156,7 @@ export class ChainMonitor extends EventEmitter<ChainMonitorEventMap> {
156
156
  let committee: EthAddress[] | undefined;
157
157
  if (l2Epoch !== this.l2EpochNumber) {
158
158
  this.l2EpochNumber = l2Epoch;
159
- committee = (await this.rollup.getCurrentEpochCommittee())?.map(addr => EthAddress.fromString(addr));
159
+ committee = await this.rollup.getCurrentEpochCommittee();
160
160
  this.emit('l2-epoch', { l2EpochNumber: l2Epoch, timestamp, committee });
161
161
  msg += ` starting new epoch ${this.l2EpochNumber} `;
162
162
  }
@@ -1,4 +1,4 @@
1
- import { RollupContract } from '@aztec/ethereum/contracts';
1
+ import { OutboxContract, RollupContract } from '@aztec/ethereum/contracts';
2
2
  import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
3
3
  import type { ViemPublicClient } from '@aztec/ethereum/types';
4
4
  import { CheckpointNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
@@ -250,6 +250,15 @@ export class RollupCheatCodes {
250
250
  });
251
251
  }
252
252
 
253
+ public insertOutbox(epoch: EpochNumber, outHash: bigint) {
254
+ return this.ethCheatCodes.execWithPausedAnvil(async () => {
255
+ const outboxAddress = await this.rollup.read.getOutbox();
256
+ const epochRootSlot = OutboxContract.getEpochRootStorageSlot(epoch);
257
+ await this.ethCheatCodes.store(EthAddress.fromString(outboxAddress), epochRootSlot, outHash);
258
+ this.logger.warn(`Advanced outbox to epoch ${epoch} with out hash ${outHash}`);
259
+ });
260
+ }
261
+
253
262
  /**
254
263
  * Executes an action impersonated as the owner of the Rollup contract.
255
264
  * @param action - The action to execute