@aztec/ethereum 0.80.0 → 0.82.0

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/config.d.ts CHANGED
@@ -21,6 +21,10 @@ export type L1ContractsConfig = {
21
21
  governanceProposerQuorum: number;
22
22
  /** Governance proposing round size */
23
23
  governanceProposerRoundSize: number;
24
+ /** The mana target for the rollup */
25
+ manaTarget: bigint;
26
+ /** The proving cost per mana */
27
+ provingCostPerMana: bigint;
24
28
  } & L1TxUtilsConfig;
25
29
  export declare const DefaultL1ContractsConfig: {
26
30
  ethereumSlotDuration: number;
@@ -33,6 +37,8 @@ export declare const DefaultL1ContractsConfig: {
33
37
  slashingRoundSize: number;
34
38
  governanceProposerQuorum: number;
35
39
  governanceProposerRoundSize: number;
40
+ manaTarget: bigint;
41
+ provingCostPerMana: bigint;
36
42
  };
37
43
  export declare const l1ContractsConfigMappings: ConfigMappingsType<L1ContractsConfig>;
38
44
  export declare function getL1ContractsConfigEnvVars(): L1ContractsConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,eAAe,EAA2B,MAAM,kBAAkB,CAAC;AAEjF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,yCAAyC;IACzC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uFAAuF;IACvF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wCAAwC;IACxC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,wBAAwB,EAAE,MAAM,CAAC;IACjC,sFAAsF;IACtF,0BAA0B,EAAE,MAAM,CAAC;IACnC,yCAAyC;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,8BAA8B;IAC9B,iB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+D3E,CAAC;AAEF,wBAAgB,2BAA2B,IAAI,iBAAiB,CAE/D"}
package/dest/config.js CHANGED
@@ -10,7 +10,9 @@ export const DefaultL1ContractsConfig = {
10
10
  slashingQuorum: 6,
11
11
  slashingRoundSize: 10,
12
12
  governanceProposerQuorum: 6,
13
- governanceProposerRoundSize: 10
13
+ governanceProposerRoundSize: 10,
14
+ manaTarget: BigInt(100e6),
15
+ provingCostPerMana: BigInt(100)
14
16
  };
15
17
  export const l1ContractsConfigMappings = {
16
18
  ethereumSlotDuration: {
@@ -63,6 +65,16 @@ export const l1ContractsConfigMappings = {
63
65
  description: 'The governance proposing round size',
64
66
  ...numberConfigHelper(DefaultL1ContractsConfig.governanceProposerRoundSize)
65
67
  },
68
+ manaTarget: {
69
+ env: 'AZTEC_MANA_TARGET',
70
+ description: 'The mana target for the rollup',
71
+ ...bigintConfigHelper(DefaultL1ContractsConfig.manaTarget)
72
+ },
73
+ provingCostPerMana: {
74
+ env: 'AZTEC_PROVING_COST_PER_MANA',
75
+ description: 'The proving cost per mana',
76
+ ...bigintConfigHelper(DefaultL1ContractsConfig.provingCostPerMana)
77
+ },
66
78
  ...l1TxUtilsConfigMappings
67
79
  };
68
80
  export function getL1ContractsConfigEnvVars() {
@@ -0,0 +1,18 @@
1
+ import { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { type Hex } from 'viem';
3
+ import type { L1TxUtils } from '../l1_tx_utils.js';
4
+ export declare class FeeAssetHandlerContract {
5
+ readonly txUtils: L1TxUtils;
6
+ address: EthAddress;
7
+ constructor(address: Hex, txUtils: L1TxUtils);
8
+ getMintAmount(): Promise<bigint>;
9
+ mint(recipient: Hex): Promise<{
10
+ receipt: import("viem").TransactionReceipt;
11
+ gasPrice: import("../l1_tx_utils.js").GasPrice;
12
+ }>;
13
+ setMintAmount(amount: bigint): Promise<{
14
+ receipt: import("viem").TransactionReceipt;
15
+ gasPrice: import("../l1_tx_utils.js").GasPrice;
16
+ }>;
17
+ }
18
+ //# sourceMappingURL=fee_asset_handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fee_asset_handler.d.ts","sourceRoot":"","sources":["../../src/contracts/fee_asset_handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EAAE,KAAK,GAAG,EAAmC,MAAM,MAAM,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,qBAAa,uBAAuB;aAGQ,OAAO,EAAE,SAAS;IAFrD,OAAO,EAAE,UAAU,CAAC;gBAEf,OAAO,EAAE,GAAG,EAAkB,OAAO,EAAE,SAAS;IAIrD,aAAa;IASb,IAAI,CAAC,SAAS,EAAE,GAAG;;;;IAWnB,aAAa,CAAC,MAAM,EAAE,MAAM;;;;CAUpC"}
@@ -0,0 +1,43 @@
1
+ import { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts/FeeAssetHandlerAbi';
3
+ import { encodeFunctionData, getContract } from 'viem';
4
+ export class FeeAssetHandlerContract {
5
+ txUtils;
6
+ address;
7
+ constructor(address, txUtils){
8
+ this.txUtils = txUtils;
9
+ this.address = EthAddress.fromString(address);
10
+ }
11
+ getMintAmount() {
12
+ const contract = getContract({
13
+ abi: FeeAssetHandlerAbi,
14
+ address: this.address.toString(),
15
+ client: this.txUtils.publicClient
16
+ });
17
+ return contract.read.mintAmount();
18
+ }
19
+ mint(recipient) {
20
+ return this.txUtils.sendAndMonitorTransaction({
21
+ to: this.address.toString(),
22
+ data: encodeFunctionData({
23
+ abi: FeeAssetHandlerAbi,
24
+ functionName: 'mint',
25
+ args: [
26
+ recipient
27
+ ]
28
+ })
29
+ });
30
+ }
31
+ setMintAmount(amount) {
32
+ return this.txUtils.sendAndMonitorTransaction({
33
+ to: this.address.toString(),
34
+ data: encodeFunctionData({
35
+ abi: FeeAssetHandlerAbi,
36
+ functionName: 'setMintAmount',
37
+ args: [
38
+ amount
39
+ ]
40
+ })
41
+ });
42
+ }
43
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './empire_base.js';
2
+ export * from './fee_asset_handler.js';
2
3
  export * from './fee_juice.js';
3
4
  export * from './forwarder.js';
4
5
  export * from './governance.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './empire_base.js';
2
+ export * from './fee_asset_handler.js';
2
3
  export * from './fee_juice.js';
3
4
  export * from './forwarder.js';
4
5
  export * from './governance.js';
@@ -2,7 +2,8 @@
2
2
  /// <reference types="node" resolution-mode="require"/>
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
4
  import type { ViemSignature } from '@aztec/foundation/eth-signature';
5
- import { type Account, type Hex } from 'viem';
5
+ import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
6
+ import { type Account, type GetContractReturnType, type Hex } from 'viem';
6
7
  import type { DeployL1ContractsReturnType } from '../deploy_l1_contracts.js';
7
8
  import type { L1ContractAddresses } from '../l1_contract_addresses.js';
8
9
  import type { L1ReaderConfig } from '../l1_reader.js';
@@ -26,6 +27,7 @@ export declare class RollupContract {
26
27
  static getFromConfig(config: L1ReaderConfig): RollupContract;
27
28
  constructor(client: ViemPublicClient, address: Hex | EthAddress);
28
29
  get address(): `0x${string}`;
30
+ getContract(): GetContractReturnType<typeof RollupAbi, ViemPublicClient>;
29
31
  getSlashingProposer(): Promise<SlashingProposerContract>;
30
32
  getL1StartBlock(): Promise<bigint>;
31
33
  getL1GenesisTime(): Promise<bigint>;
@@ -34,6 +36,11 @@ export declare class RollupContract {
34
36
  getSlotDuration(): Promise<bigint>;
35
37
  getTargetCommitteeSize(): Promise<bigint>;
36
38
  getMinimumStake(): Promise<bigint>;
39
+ getManaTarget(): Promise<bigint>;
40
+ getProvingCostPerMana(): Promise<bigint>;
41
+ getProvingCostPerManaInFeeAsset(): Promise<bigint>;
42
+ getManaLimit(): Promise<bigint>;
43
+ getSlasher(): Promise<`0x${string}`>;
37
44
  getSlashingProposerAddress(): Promise<EthAddress>;
38
45
  getBlockNumber(): Promise<bigint>;
39
46
  getProvenBlockNumber(): Promise<bigint>;
@@ -45,13 +52,6 @@ export declare class RollupContract {
45
52
  getCurrentProposer(): Promise<`0x${string}`>;
46
53
  getProposerAt(timestamp: bigint): Promise<`0x${string}`>;
47
54
  getBlock(blockNumber: bigint): Promise<{
48
- feeHeader: {
49
- excessMana: bigint;
50
- manaUsed: bigint;
51
- feeAssetPriceNumerator: bigint;
52
- congestionCost: bigint;
53
- provingCost: bigint;
54
- };
55
55
  archive: `0x${string}`;
56
56
  blockHash: `0x${string}`;
57
57
  slotNumber: bigint;
@@ -87,6 +87,30 @@ export declare class RollupContract {
87
87
  */
88
88
  canProposeAtNextEthBlock(archive: Buffer, account: `0x${string}` | Account, slotDuration: bigint | number): Promise<[bigint, bigint]>;
89
89
  /** Calls getHasSubmitted directly. Returns whether the given prover has submitted a proof with the given length for the given epoch. */
90
- getHasSubmittedProof(epochNumber: number, numberOfBlocksInEpoch: number, prover: EthAddress): Promise<boolean>;
90
+ getHasSubmittedProof(epochNumber: number, numberOfBlocksInEpoch: number, prover: Hex | EthAddress): Promise<boolean>;
91
+ getManaBaseFeeAt(timestamp: bigint, inFeeAsset: boolean): Promise<bigint>;
92
+ getVersion(): Promise<bigint>;
93
+ getSlotAt(timestamp: bigint): Promise<bigint>;
94
+ status(blockNumber: bigint, options?: {
95
+ blockNumber?: bigint;
96
+ }): Promise<readonly [bigint, `0x${string}`, bigint, `0x${string}`, `0x${string}`, bigint]>;
97
+ canPruneAtTime(timestamp: bigint, options?: {
98
+ blockNumber?: bigint;
99
+ }): Promise<boolean>;
100
+ archive(): Promise<`0x${string}`>;
101
+ archiveAt(blockNumber: bigint): Promise<`0x${string}`>;
102
+ getSequencerRewards(address: Hex | EthAddress): Promise<bigint>;
103
+ getSpecificProverRewardsForEpoch(epoch: bigint, prover: Hex | EthAddress): Promise<bigint>;
104
+ getAttesters(): Promise<readonly `0x${string}`[]>;
105
+ getEpochCommittee(epoch: bigint): Promise<readonly `0x${string}`[]>;
106
+ getInfo(address: Hex | EthAddress): Promise<{
107
+ stake: bigint;
108
+ withdrawer: `0x${string}`;
109
+ proposer: `0x${string}`;
110
+ status: number;
111
+ }>;
112
+ getBlobPublicInputsHash(blockNumber: bigint): Promise<`0x${string}`>;
113
+ getStakingAsset(): Promise<`0x${string}`>;
114
+ getProposerForAttester(attester: Hex | EthAddress): Promise<`0x${string}`>;
91
115
  }
92
116
  //# sourceMappingURL=rollup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/contracts/rollup.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAKrE,OAAO,EAAE,KAAK,OAAO,EAA8B,KAAK,GAAG,EAA2B,MAAM,MAAM,CAAC;AAGnG,OAAO,KAAK,EAA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 @@ export class RollupContract {
46
46
  get address() {
47
47
  return this.rollup.address;
48
48
  }
49
+ getContract() {
50
+ return this.rollup;
51
+ }
49
52
  async getSlashingProposer() {
50
53
  const slasherAddress = await this.rollup.read.getSlasher();
51
54
  const slasher = getContract({
@@ -77,8 +80,23 @@ export class RollupContract {
77
80
  getMinimumStake() {
78
81
  return this.rollup.read.getMinimumStake();
79
82
  }
83
+ getManaTarget() {
84
+ return this.rollup.read.getManaTarget();
85
+ }
86
+ getProvingCostPerMana() {
87
+ return this.rollup.read.getProvingCostPerManaInEth();
88
+ }
89
+ getProvingCostPerManaInFeeAsset() {
90
+ return this.rollup.read.getProvingCostPerManaInFeeAsset();
91
+ }
92
+ getManaLimit() {
93
+ return this.rollup.read.getManaLimit();
94
+ }
95
+ getSlasher() {
96
+ return this.rollup.read.getSlasher();
97
+ }
80
98
  async getSlashingProposerAddress() {
81
- const slasherAddress = await this.rollup.read.getSlasher();
99
+ const slasherAddress = await this.getSlasher();
82
100
  const slasher = getContract({
83
101
  address: getAddress(slasherAddress.toString()),
84
102
  abi: SlasherAbi,
@@ -95,10 +113,16 @@ export class RollupContract {
95
113
  getSlotNumber() {
96
114
  return this.rollup.read.getCurrentSlot();
97
115
  }
98
- getCommitteeAt(timestamp) {
99
- return this.rollup.read.getCommitteeAt([
100
- timestamp
101
- ]);
116
+ async getCommitteeAt(timestamp) {
117
+ const { result } = await this.client.simulateContract({
118
+ address: this.address,
119
+ abi: RollupAbi,
120
+ functionName: 'getCommitteeAt',
121
+ args: [
122
+ timestamp
123
+ ]
124
+ });
125
+ return result;
102
126
  }
103
127
  getSampleSeedAt(timestamp) {
104
128
  return this.rollup.read.getSampleSeedAt([
@@ -108,16 +132,34 @@ export class RollupContract {
108
132
  getCurrentSampleSeed() {
109
133
  return this.rollup.read.getCurrentSampleSeed();
110
134
  }
111
- getCurrentEpochCommittee() {
112
- return this.rollup.read.getCurrentEpochCommittee();
135
+ async getCurrentEpochCommittee() {
136
+ const { result } = await this.client.simulateContract({
137
+ address: this.address,
138
+ abi: RollupAbi,
139
+ functionName: 'getCurrentEpochCommittee',
140
+ args: []
141
+ });
142
+ return result;
113
143
  }
114
- getCurrentProposer() {
115
- return this.rollup.read.getCurrentProposer();
144
+ async getCurrentProposer() {
145
+ const { result } = await this.client.simulateContract({
146
+ address: this.address,
147
+ abi: RollupAbi,
148
+ functionName: 'getCurrentProposer',
149
+ args: []
150
+ });
151
+ return result;
116
152
  }
117
- getProposerAt(timestamp) {
118
- return this.rollup.read.getProposerAt([
119
- timestamp
120
- ]);
153
+ async getProposerAt(timestamp) {
154
+ const { result } = await this.client.simulateContract({
155
+ address: this.address,
156
+ abi: RollupAbi,
157
+ functionName: 'getProposerAt',
158
+ args: [
159
+ timestamp
160
+ ]
161
+ });
162
+ return result;
121
163
  }
122
164
  getBlock(blockNumber) {
123
165
  return this.rollup.read.getBlock([
@@ -167,7 +209,11 @@ export class RollupContract {
167
209
  }
168
210
  async validateHeader(args, account) {
169
211
  try {
170
- await this.rollup.read.validateHeader(args, {
212
+ await this.client.simulateContract({
213
+ address: this.address,
214
+ abi: RollupAbi,
215
+ functionName: 'validateHeader',
216
+ args,
171
217
  account
172
218
  });
173
219
  } catch (error) {
@@ -188,10 +234,14 @@ export class RollupContract {
188
234
  }
189
235
  const timeOfNextL1Slot = (await this.client.getBlock()).timestamp + slotDuration;
190
236
  try {
191
- const [slot, blockNumber] = await this.rollup.read.canProposeAtTime([
192
- timeOfNextL1Slot,
193
- `0x${archive.toString('hex')}`
194
- ], {
237
+ const { result: [slot, blockNumber] } = await this.client.simulateContract({
238
+ address: this.address,
239
+ abi: RollupAbi,
240
+ functionName: 'canProposeAtTime',
241
+ args: [
242
+ timeOfNextL1Slot,
243
+ `0x${archive.toString('hex')}`
244
+ ],
195
245
  account
196
246
  });
197
247
  return [
@@ -203,10 +253,94 @@ export class RollupContract {
203
253
  }
204
254
  }
205
255
  /** Calls getHasSubmitted directly. Returns whether the given prover has submitted a proof with the given length for the given epoch. */ getHasSubmittedProof(epochNumber, numberOfBlocksInEpoch, prover) {
256
+ if (prover instanceof EthAddress) {
257
+ prover = prover.toString();
258
+ }
206
259
  return this.rollup.read.getHasSubmitted([
207
260
  BigInt(epochNumber),
208
261
  BigInt(numberOfBlocksInEpoch),
209
- prover.toString()
262
+ prover
263
+ ]);
264
+ }
265
+ getManaBaseFeeAt(timestamp, inFeeAsset) {
266
+ return this.rollup.read.getManaBaseFeeAt([
267
+ timestamp,
268
+ inFeeAsset
269
+ ]);
270
+ }
271
+ getVersion() {
272
+ return this.rollup.read.getVersion();
273
+ }
274
+ getSlotAt(timestamp) {
275
+ return this.rollup.read.getSlotAt([
276
+ timestamp
277
+ ]);
278
+ }
279
+ status(blockNumber, options) {
280
+ return this.rollup.read.status([
281
+ blockNumber
282
+ ], options);
283
+ }
284
+ canPruneAtTime(timestamp, options) {
285
+ return this.rollup.read.canPruneAtTime([
286
+ timestamp
287
+ ], options);
288
+ }
289
+ archive() {
290
+ return this.rollup.read.archive();
291
+ }
292
+ archiveAt(blockNumber) {
293
+ return this.rollup.read.archiveAt([
294
+ blockNumber
295
+ ]);
296
+ }
297
+ getSequencerRewards(address) {
298
+ if (address instanceof EthAddress) {
299
+ address = address.toString();
300
+ }
301
+ return this.rollup.read.getSequencerRewards([
302
+ address
303
+ ]);
304
+ }
305
+ getSpecificProverRewardsForEpoch(epoch, prover) {
306
+ if (prover instanceof EthAddress) {
307
+ prover = prover.toString();
308
+ }
309
+ return this.rollup.read.getSpecificProverRewardsForEpoch([
310
+ epoch,
311
+ prover
312
+ ]);
313
+ }
314
+ getAttesters() {
315
+ return this.rollup.read.getAttesters();
316
+ }
317
+ getEpochCommittee(epoch) {
318
+ return this.rollup.read.getEpochCommittee([
319
+ epoch
320
+ ]);
321
+ }
322
+ getInfo(address) {
323
+ if (address instanceof EthAddress) {
324
+ address = address.toString();
325
+ }
326
+ return this.rollup.read.getInfo([
327
+ address
328
+ ]);
329
+ }
330
+ getBlobPublicInputsHash(blockNumber) {
331
+ return this.rollup.read.getBlobPublicInputsHash([
332
+ blockNumber
333
+ ]);
334
+ }
335
+ getStakingAsset() {
336
+ return this.rollup.read.getStakingAsset();
337
+ }
338
+ getProposerForAttester(attester) {
339
+ if (attester instanceof EthAddress) {
340
+ attester = attester.toString();
341
+ }
342
+ return this.rollup.read.getProposerForAttester([
343
+ attester
210
344
  ]);
211
345
  }
212
346
  }
@@ -234,3 +368,15 @@ _ts_decorate([
234
368
  _ts_decorate([
235
369
  memoize
236
370
  ], RollupContract.prototype, "getMinimumStake", null);
371
+ _ts_decorate([
372
+ memoize
373
+ ], RollupContract.prototype, "getManaTarget", null);
374
+ _ts_decorate([
375
+ memoize
376
+ ], RollupContract.prototype, "getProvingCostPerMana", null);
377
+ _ts_decorate([
378
+ memoize
379
+ ], RollupContract.prototype, "getProvingCostPerManaInFeeAsset", null);
380
+ _ts_decorate([
381
+ memoize
382
+ ], RollupContract.prototype, "getManaLimit", null);