@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.
- package/dest/account.d.ts +1 -1
- package/dest/chain.d.ts +1 -1
- package/dest/client.d.ts +2 -2
- package/dest/client.d.ts.map +1 -1
- package/dest/config.d.ts +16 -8
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +160 -62
- package/dest/constants.d.ts +1 -1
- package/dest/contracts/empire_base.d.ts +7 -6
- package/dest/contracts/empire_base.d.ts.map +1 -1
- package/dest/contracts/empire_base.js +1 -1
- package/dest/contracts/empire_slashing_proposer.d.ts +7 -6
- package/dest/contracts/empire_slashing_proposer.d.ts.map +1 -1
- package/dest/contracts/empire_slashing_proposer.js +9 -3
- package/dest/contracts/errors.d.ts +1 -1
- package/dest/contracts/errors.d.ts.map +1 -1
- package/dest/contracts/fee_asset_handler.d.ts +4 -4
- package/dest/contracts/fee_asset_handler.d.ts.map +1 -1
- package/dest/contracts/fee_juice.d.ts +1 -1
- package/dest/contracts/fee_juice.d.ts.map +1 -1
- package/dest/contracts/governance.d.ts +16 -16
- package/dest/contracts/governance.d.ts.map +1 -1
- package/dest/contracts/governance.js +7 -3
- package/dest/contracts/governance_proposer.d.ts +6 -6
- package/dest/contracts/governance_proposer.d.ts.map +1 -1
- package/dest/contracts/governance_proposer.js +9 -4
- package/dest/contracts/gse.d.ts +1 -1
- package/dest/contracts/gse.d.ts.map +1 -1
- package/dest/contracts/inbox.d.ts +1 -1
- package/dest/contracts/inbox.d.ts.map +1 -1
- package/dest/contracts/index.d.ts +1 -1
- package/dest/contracts/multicall.d.ts +5 -7
- package/dest/contracts/multicall.d.ts.map +1 -1
- package/dest/contracts/multicall.js +6 -4
- package/dest/contracts/registry.d.ts +1 -1
- package/dest/contracts/registry.d.ts.map +1 -1
- package/dest/contracts/rollup.d.ts +83 -72
- package/dest/contracts/rollup.d.ts.map +1 -1
- package/dest/contracts/rollup.js +144 -139
- package/dest/contracts/slasher_contract.d.ts +11 -1
- package/dest/contracts/slasher_contract.d.ts.map +1 -1
- package/dest/contracts/slasher_contract.js +18 -0
- package/dest/contracts/tally_slashing_proposer.d.ts +30 -9
- package/dest/contracts/tally_slashing_proposer.d.ts.map +1 -1
- package/dest/contracts/tally_slashing_proposer.js +58 -8
- package/dest/contracts/utils.d.ts +1 -1
- package/dest/deploy_l1_contracts.d.ts +477 -15
- package/dest/deploy_l1_contracts.d.ts.map +1 -1
- package/dest/deploy_l1_contracts.js +610 -386
- package/dest/eth-signer/eth-signer.d.ts +1 -1
- package/dest/eth-signer/index.d.ts +1 -1
- package/dest/forwarder_proxy.d.ts +32 -0
- package/dest/forwarder_proxy.d.ts.map +1 -0
- package/dest/forwarder_proxy.js +93 -0
- package/dest/l1_artifacts.d.ts +14258 -6015
- package/dest/l1_artifacts.d.ts.map +1 -1
- package/dest/l1_artifacts.js +10 -5
- package/dest/l1_contract_addresses.d.ts +8 -4
- package/dest/l1_contract_addresses.d.ts.map +1 -1
- package/dest/l1_contract_addresses.js +16 -26
- package/dest/l1_reader.d.ts +4 -2
- package/dest/l1_reader.d.ts.map +1 -1
- package/dest/l1_reader.js +14 -8
- package/dest/l1_tx_utils/config.d.ts +59 -0
- package/dest/l1_tx_utils/config.d.ts.map +1 -0
- package/dest/l1_tx_utils/config.js +96 -0
- package/dest/l1_tx_utils/constants.d.ts +6 -0
- package/dest/l1_tx_utils/constants.d.ts.map +1 -0
- package/dest/l1_tx_utils/constants.js +14 -0
- package/dest/l1_tx_utils/factory.d.ts +24 -0
- package/dest/l1_tx_utils/factory.d.ts.map +1 -0
- package/dest/l1_tx_utils/factory.js +12 -0
- package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts +41 -0
- package/dest/l1_tx_utils/forwarder_l1_tx_utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/forwarder_l1_tx_utils.js +48 -0
- package/dest/l1_tx_utils/index-blobs.d.ts +3 -0
- package/dest/l1_tx_utils/index-blobs.d.ts.map +1 -0
- package/dest/l1_tx_utils/index-blobs.js +2 -0
- package/dest/l1_tx_utils/index.d.ts +10 -0
- package/dest/l1_tx_utils/index.d.ts.map +1 -0
- package/dest/l1_tx_utils/index.js +10 -0
- package/dest/l1_tx_utils/interfaces.d.ts +76 -0
- package/dest/l1_tx_utils/interfaces.d.ts.map +1 -0
- package/dest/l1_tx_utils/interfaces.js +4 -0
- package/dest/l1_tx_utils/l1_tx_utils.d.ts +94 -0
- package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/l1_tx_utils.js +623 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts +26 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.d.ts.map +1 -0
- package/dest/l1_tx_utils/l1_tx_utils_with_blobs.js +26 -0
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +94 -0
- package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/readonly_l1_tx_utils.js +431 -0
- package/dest/l1_tx_utils/signer.d.ts +4 -0
- package/dest/l1_tx_utils/signer.d.ts.map +1 -0
- package/dest/l1_tx_utils/signer.js +16 -0
- package/dest/l1_tx_utils/types.d.ts +67 -0
- package/dest/l1_tx_utils/types.d.ts.map +1 -0
- package/dest/l1_tx_utils/types.js +26 -0
- package/dest/l1_tx_utils/utils.d.ts +4 -0
- package/dest/l1_tx_utils/utils.d.ts.map +1 -0
- package/dest/l1_tx_utils/utils.js +14 -0
- package/dest/l1_types.d.ts +1 -1
- package/dest/publisher_manager.d.ts +8 -3
- package/dest/publisher_manager.d.ts.map +1 -1
- package/dest/publisher_manager.js +36 -8
- package/dest/queries.d.ts +1 -1
- package/dest/queries.d.ts.map +1 -1
- package/dest/queries.js +13 -12
- package/dest/test/chain_monitor.d.ts +33 -19
- package/dest/test/chain_monitor.d.ts.map +1 -1
- package/dest/test/chain_monitor.js +100 -33
- package/dest/test/delayed_tx_utils.d.ts +3 -3
- package/dest/test/delayed_tx_utils.d.ts.map +1 -1
- package/dest/test/delayed_tx_utils.js +2 -2
- package/dest/test/eth_cheat_codes.d.ts +36 -14
- package/dest/test/eth_cheat_codes.d.ts.map +1 -1
- package/dest/test/eth_cheat_codes.js +124 -31
- package/dest/test/eth_cheat_codes_with_state.d.ts +1 -1
- package/dest/test/eth_cheat_codes_with_state.d.ts.map +1 -1
- package/dest/test/index.d.ts +1 -1
- package/dest/test/rollup_cheat_codes.d.ts +23 -20
- package/dest/test/rollup_cheat_codes.d.ts.map +1 -1
- package/dest/test/rollup_cheat_codes.js +79 -42
- package/dest/test/start_anvil.d.ts +2 -1
- package/dest/test/start_anvil.d.ts.map +1 -1
- package/dest/test/start_anvil.js +2 -1
- package/dest/test/tx_delayer.d.ts +1 -1
- package/dest/test/tx_delayer.d.ts.map +1 -1
- package/dest/test/tx_delayer.js +3 -2
- package/dest/test/upgrade_utils.d.ts +1 -1
- package/dest/test/upgrade_utils.d.ts.map +1 -1
- package/dest/test/upgrade_utils.js +3 -2
- package/dest/types.d.ts +57 -2
- package/dest/types.d.ts.map +1 -1
- package/dest/utils.d.ts +2 -2
- package/dest/utils.d.ts.map +1 -1
- package/dest/utils.js +10 -161
- package/dest/zkPassportVerifierAddress.d.ts +1 -1
- package/dest/zkPassportVerifierAddress.js +1 -1
- package/package.json +27 -13
- package/src/client.ts +1 -1
- package/src/config.ts +177 -65
- package/src/contracts/empire_base.ts +7 -6
- package/src/contracts/empire_slashing_proposer.ts +18 -8
- package/src/contracts/fee_asset_handler.ts +1 -1
- package/src/contracts/governance.ts +3 -3
- package/src/contracts/governance_proposer.ts +14 -9
- package/src/contracts/multicall.ts +12 -10
- package/src/contracts/rollup.ts +170 -171
- package/src/contracts/slasher_contract.ts +22 -0
- package/src/contracts/tally_slashing_proposer.ts +63 -12
- package/src/deploy_l1_contracts.ts +610 -337
- package/src/forwarder_proxy.ts +108 -0
- package/src/l1_artifacts.ts +14 -6
- package/src/l1_contract_addresses.ts +17 -26
- package/src/l1_reader.ts +17 -9
- package/src/l1_tx_utils/README.md +177 -0
- package/src/l1_tx_utils/config.ts +161 -0
- package/src/l1_tx_utils/constants.ts +18 -0
- package/src/l1_tx_utils/factory.ts +64 -0
- package/src/l1_tx_utils/forwarder_l1_tx_utils.ts +119 -0
- package/src/l1_tx_utils/index-blobs.ts +2 -0
- package/src/l1_tx_utils/index.ts +12 -0
- package/src/l1_tx_utils/interfaces.ts +86 -0
- package/src/l1_tx_utils/l1_tx_utils.ts +738 -0
- package/src/l1_tx_utils/l1_tx_utils_with_blobs.ts +77 -0
- package/src/l1_tx_utils/readonly_l1_tx_utils.ts +557 -0
- package/src/l1_tx_utils/signer.ts +28 -0
- package/src/l1_tx_utils/types.ts +85 -0
- package/src/l1_tx_utils/utils.ts +16 -0
- package/src/publisher_manager.ts +51 -9
- package/src/queries.ts +16 -8
- package/src/test/chain_monitor.ts +118 -36
- package/src/test/delayed_tx_utils.ts +2 -2
- package/src/test/eth_cheat_codes.ts +149 -30
- package/src/test/rollup_cheat_codes.ts +94 -52
- package/src/test/start_anvil.ts +2 -0
- package/src/test/tx_delayer.ts +4 -2
- package/src/test/upgrade_utils.ts +3 -2
- package/src/types.ts +62 -0
- package/src/utils.ts +12 -184
- package/src/zkPassportVerifierAddress.ts +1 -1
- package/dest/index.d.ts +0 -18
- package/dest/index.d.ts.map +0 -1
- package/dest/index.js +0 -17
- package/dest/l1_tx_utils.d.ts +0 -250
- package/dest/l1_tx_utils.d.ts.map +0 -1
- package/dest/l1_tx_utils.js +0 -826
- package/dest/l1_tx_utils_with_blobs.d.ts +0 -19
- package/dest/l1_tx_utils_with_blobs.d.ts.map +0 -1
- package/dest/l1_tx_utils_with_blobs.js +0 -85
- package/src/index.ts +0 -17
- package/src/l1_tx_utils.ts +0 -1105
- package/src/l1_tx_utils_with_blobs.ts +0 -144
|
@@ -1,22 +1,23 @@
|
|
|
1
|
+
import type { SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
3
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
3
4
|
import { EmpireBaseAbi } from '@aztec/l1-artifacts/EmpireBaseAbi';
|
|
4
5
|
|
|
5
6
|
import { type Hex, type TypedDataDefinition, encodeFunctionData } from 'viem';
|
|
6
7
|
|
|
7
|
-
import type { L1TxRequest } from '../l1_tx_utils.js';
|
|
8
|
+
import type { L1TxRequest } from '../l1_tx_utils/index.js';
|
|
8
9
|
|
|
9
10
|
export interface IEmpireBase {
|
|
10
11
|
get address(): EthAddress;
|
|
11
12
|
getRoundInfo(
|
|
12
13
|
rollupAddress: Hex,
|
|
13
14
|
round: bigint,
|
|
14
|
-
): Promise<{ lastSignalSlot:
|
|
15
|
-
computeRound(slot:
|
|
15
|
+
): Promise<{ lastSignalSlot: SlotNumber; payloadWithMostSignals: Hex; executed: boolean }>;
|
|
16
|
+
computeRound(slot: SlotNumber): Promise<bigint>;
|
|
16
17
|
createSignalRequest(payload: Hex): L1TxRequest;
|
|
17
18
|
createSignalRequestWithSignature(
|
|
18
19
|
payload: Hex,
|
|
19
|
-
|
|
20
|
+
slot: SlotNumber,
|
|
20
21
|
chainId: number,
|
|
21
22
|
signerAddress: Hex,
|
|
22
23
|
signer: (msg: TypedDataDefinition) => Promise<Hex>,
|
|
@@ -51,7 +52,7 @@ export function encodeSignalWithSignature(payload: Hex, signature: Signature) {
|
|
|
51
52
|
export async function signSignalWithSig(
|
|
52
53
|
signer: (msg: TypedDataDefinition) => Promise<Hex>,
|
|
53
54
|
payload: Hex,
|
|
54
|
-
slot:
|
|
55
|
+
slot: SlotNumber,
|
|
55
56
|
instance: Hex,
|
|
56
57
|
verifyingContract: Hex,
|
|
57
58
|
chainId: number,
|
|
@@ -79,7 +80,7 @@ export async function signSignalWithSig(
|
|
|
79
80
|
|
|
80
81
|
const message = {
|
|
81
82
|
payload,
|
|
82
|
-
slot,
|
|
83
|
+
slot: BigInt(slot),
|
|
83
84
|
instance,
|
|
84
85
|
};
|
|
85
86
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
4
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
@@ -14,7 +15,7 @@ import {
|
|
|
14
15
|
getContract,
|
|
15
16
|
} from 'viem';
|
|
16
17
|
|
|
17
|
-
import type { L1TxRequest, L1TxUtils } from '../l1_tx_utils.js';
|
|
18
|
+
import type { L1TxRequest, L1TxUtils } from '../l1_tx_utils/index.js';
|
|
18
19
|
import type { ViemClient } from '../types.js';
|
|
19
20
|
import { FormattedViemError, tryExtractEvent } from '../utils.js';
|
|
20
21
|
import { type IEmpireBase, encodeSignal, encodeSignalWithSignature, signSignalWithSig } from './empire_base.js';
|
|
@@ -33,10 +34,14 @@ export class EmpireSlashingProposerContract extends EventEmitter implements IEmp
|
|
|
33
34
|
|
|
34
35
|
constructor(
|
|
35
36
|
public readonly client: ViemClient,
|
|
36
|
-
address: Hex,
|
|
37
|
+
address: Hex | EthAddress,
|
|
37
38
|
) {
|
|
38
39
|
super();
|
|
39
|
-
this.proposer = getContract({
|
|
40
|
+
this.proposer = getContract({
|
|
41
|
+
address: typeof address === 'string' ? address : address.toString(),
|
|
42
|
+
abi: EmpireSlashingProposerAbi,
|
|
43
|
+
client,
|
|
44
|
+
});
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
public get address() {
|
|
@@ -63,8 +68,8 @@ export class EmpireSlashingProposerContract extends EventEmitter implements IEmp
|
|
|
63
68
|
return this.proposer.read.getCurrentRound();
|
|
64
69
|
}
|
|
65
70
|
|
|
66
|
-
public computeRound(slot:
|
|
67
|
-
return this.proposer.read.computeRound([slot]);
|
|
71
|
+
public computeRound(slot: SlotNumber): Promise<bigint> {
|
|
72
|
+
return this.proposer.read.computeRound([BigInt(slot)]);
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
public getInstance() {
|
|
@@ -74,8 +79,13 @@ export class EmpireSlashingProposerContract extends EventEmitter implements IEmp
|
|
|
74
79
|
public async getRoundInfo(
|
|
75
80
|
rollupAddress: Hex,
|
|
76
81
|
round: bigint,
|
|
77
|
-
): Promise<{ lastSignalSlot:
|
|
78
|
-
|
|
82
|
+
): Promise<{ lastSignalSlot: SlotNumber; payloadWithMostSignals: Hex; executed: boolean }> {
|
|
83
|
+
const result = await this.proposer.read.getRoundData([rollupAddress, round]);
|
|
84
|
+
return {
|
|
85
|
+
lastSignalSlot: SlotNumber.fromBigInt(result.lastSignalSlot),
|
|
86
|
+
payloadWithMostSignals: result.payloadWithMostSignals,
|
|
87
|
+
executed: result.executed,
|
|
88
|
+
};
|
|
79
89
|
}
|
|
80
90
|
|
|
81
91
|
public getPayloadSignals(rollupAddress: Hex, round: bigint, payload: Hex): Promise<bigint> {
|
|
@@ -91,7 +101,7 @@ export class EmpireSlashingProposerContract extends EventEmitter implements IEmp
|
|
|
91
101
|
|
|
92
102
|
public async createSignalRequestWithSignature(
|
|
93
103
|
payload: Hex,
|
|
94
|
-
slot:
|
|
104
|
+
slot: SlotNumber,
|
|
95
105
|
chainId: number,
|
|
96
106
|
signerAddress: Hex,
|
|
97
107
|
signer: (msg: TypedDataDefinition) => Promise<Hex>,
|
|
@@ -3,7 +3,7 @@ import { FeeAssetHandlerAbi } from '@aztec/l1-artifacts/FeeAssetHandlerAbi';
|
|
|
3
3
|
|
|
4
4
|
import { type Hex, encodeFunctionData, getContract } from 'viem';
|
|
5
5
|
|
|
6
|
-
import type { L1TxUtils } from '../l1_tx_utils.js';
|
|
6
|
+
import type { L1TxUtils } from '../l1_tx_utils/index.js';
|
|
7
7
|
|
|
8
8
|
export class FeeAssetHandlerContract {
|
|
9
9
|
public address: EthAddress;
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from 'viem';
|
|
15
15
|
|
|
16
16
|
import type { L1ContractAddresses } from '../l1_contract_addresses.js';
|
|
17
|
-
import { createL1TxUtilsFromViemWallet } from '../l1_tx_utils.js';
|
|
17
|
+
import { createL1TxUtilsFromViemWallet } from '../l1_tx_utils/index.js';
|
|
18
18
|
import { type ExtendedViemWalletClient, type ViemClient, isExtendedClient } from '../types.js';
|
|
19
19
|
|
|
20
20
|
export type L1GovernanceContractAddresses = Pick<
|
|
@@ -187,7 +187,7 @@ export class GovernanceContract extends ReadOnlyGovernanceContract {
|
|
|
187
187
|
retries: number;
|
|
188
188
|
logger: Logger;
|
|
189
189
|
}) {
|
|
190
|
-
const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, logger);
|
|
190
|
+
const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, { logger });
|
|
191
191
|
const retryDelaySeconds = 12;
|
|
192
192
|
|
|
193
193
|
voteAmount = voteAmount ?? (await this.getPower());
|
|
@@ -244,7 +244,7 @@ export class GovernanceContract extends ReadOnlyGovernanceContract {
|
|
|
244
244
|
retries: number;
|
|
245
245
|
logger: Logger;
|
|
246
246
|
}) {
|
|
247
|
-
const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, logger);
|
|
247
|
+
const l1TxUtils = createL1TxUtilsFromViemWallet(this.client, { logger });
|
|
248
248
|
const retryDelaySeconds = 12;
|
|
249
249
|
let success = false;
|
|
250
250
|
for (let i = 0; i < retries; i++) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { memoize } from '@aztec/foundation/decorators';
|
|
2
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
4
|
import { GovernanceProposerAbi } from '@aztec/l1-artifacts/GovernanceProposerAbi';
|
|
@@ -11,7 +12,7 @@ import {
|
|
|
11
12
|
getContract,
|
|
12
13
|
} from 'viem';
|
|
13
14
|
|
|
14
|
-
import type {
|
|
15
|
+
import type { L1TxRequest, L1TxUtils } from '../l1_tx_utils/index.js';
|
|
15
16
|
import type { ViemClient } from '../types.js';
|
|
16
17
|
import { type IEmpireBase, encodeSignal, encodeSignalWithSignature, signSignalWithSig } from './empire_base.js';
|
|
17
18
|
import { extractProposalIdFromLogs } from './governance.js';
|
|
@@ -54,15 +55,20 @@ export class GovernanceProposerContract implements IEmpireBase {
|
|
|
54
55
|
return this.proposer.read.getInstance();
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
public computeRound(slot:
|
|
58
|
-
return this.proposer.read.computeRound([slot]);
|
|
58
|
+
public computeRound(slot: SlotNumber): Promise<bigint> {
|
|
59
|
+
return this.proposer.read.computeRound([BigInt(slot)]);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
public async getRoundInfo(
|
|
62
63
|
rollupAddress: Hex,
|
|
63
64
|
round: bigint,
|
|
64
|
-
): Promise<{ lastSignalSlot:
|
|
65
|
-
|
|
65
|
+
): Promise<{ lastSignalSlot: SlotNumber; payloadWithMostSignals: Hex; executed: boolean }> {
|
|
66
|
+
const result = await this.proposer.read.getRoundData([rollupAddress, round]);
|
|
67
|
+
return {
|
|
68
|
+
lastSignalSlot: SlotNumber.fromBigInt(result.lastSignalSlot),
|
|
69
|
+
payloadWithMostSignals: result.payloadWithMostSignals,
|
|
70
|
+
executed: result.executed,
|
|
71
|
+
};
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
public getPayloadSignals(rollupAddress: Hex, round: bigint, payload: Hex): Promise<bigint> {
|
|
@@ -78,7 +84,7 @@ export class GovernanceProposerContract implements IEmpireBase {
|
|
|
78
84
|
|
|
79
85
|
public async createSignalRequestWithSignature(
|
|
80
86
|
payload: Hex,
|
|
81
|
-
slot:
|
|
87
|
+
slot: SlotNumber,
|
|
82
88
|
chainId: number,
|
|
83
89
|
signerAddress: Hex,
|
|
84
90
|
signer: (msg: TypedDataDefinition) => Promise<Hex>,
|
|
@@ -102,10 +108,9 @@ export class GovernanceProposerContract implements IEmpireBase {
|
|
|
102
108
|
l1TxUtils: L1TxUtils,
|
|
103
109
|
): Promise<{
|
|
104
110
|
receipt: TransactionReceipt;
|
|
105
|
-
gasPrice: GasPrice;
|
|
106
111
|
proposalId: bigint;
|
|
107
112
|
}> {
|
|
108
|
-
const { receipt
|
|
113
|
+
const { receipt } = await l1TxUtils.sendAndMonitorTransaction({
|
|
109
114
|
to: this.address.toString(),
|
|
110
115
|
data: encodeFunctionData({
|
|
111
116
|
abi: this.proposer.abi,
|
|
@@ -114,6 +119,6 @@ export class GovernanceProposerContract implements IEmpireBase {
|
|
|
114
119
|
}),
|
|
115
120
|
});
|
|
116
121
|
const proposalId = extractProposalIdFromLogs(receipt.logs);
|
|
117
|
-
return { receipt,
|
|
122
|
+
return { receipt, proposalId };
|
|
118
123
|
}
|
|
119
124
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { toHex as toPaddedHex } from '@aztec/foundation/bigint-buffer';
|
|
2
|
+
import { TimeoutError } from '@aztec/foundation/error';
|
|
2
3
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
4
|
|
|
4
5
|
import { type EncodeFunctionDataParameters, type Hex, encodeFunctionData, multicall3Abi } from 'viem';
|
|
5
6
|
|
|
6
|
-
import type { L1BlobInputs,
|
|
7
|
+
import type { L1BlobInputs, L1TxConfig, L1TxRequest, L1TxUtils } from '../l1_tx_utils/index.js';
|
|
7
8
|
import type { ExtendedViemWalletClient } from '../types.js';
|
|
8
9
|
import { FormattedViemError, formatViemError } from '../utils.js';
|
|
9
10
|
import { RollupContract } from './rollup.js';
|
|
@@ -14,7 +15,7 @@ export class Multicall3 {
|
|
|
14
15
|
static async forward(
|
|
15
16
|
requests: L1TxRequest[],
|
|
16
17
|
l1TxUtils: L1TxUtils,
|
|
17
|
-
gasConfig:
|
|
18
|
+
gasConfig: L1TxConfig | undefined,
|
|
18
19
|
blobConfig: L1BlobInputs | undefined,
|
|
19
20
|
rollupAddress: Hex,
|
|
20
21
|
logger: Logger,
|
|
@@ -35,18 +36,15 @@ export class Multicall3 {
|
|
|
35
36
|
const encodedForwarderData = encodeFunctionData(forwarderFunctionData);
|
|
36
37
|
|
|
37
38
|
try {
|
|
38
|
-
const { receipt,
|
|
39
|
-
{
|
|
40
|
-
to: MULTI_CALL_3_ADDRESS,
|
|
41
|
-
data: encodedForwarderData,
|
|
42
|
-
},
|
|
39
|
+
const { receipt, state } = await l1TxUtils.sendAndMonitorTransaction(
|
|
40
|
+
{ to: MULTI_CALL_3_ADDRESS, data: encodedForwarderData },
|
|
43
41
|
gasConfig,
|
|
44
42
|
blobConfig,
|
|
45
43
|
);
|
|
46
44
|
|
|
47
45
|
if (receipt.status === 'success') {
|
|
48
46
|
const stats = await l1TxUtils.getTransactionStats(receipt.transactionHash);
|
|
49
|
-
return { receipt,
|
|
47
|
+
return { receipt, stats };
|
|
50
48
|
} else {
|
|
51
49
|
logger.error('Forwarder transaction failed', undefined, { receipt });
|
|
52
50
|
|
|
@@ -58,7 +56,7 @@ export class Multicall3 {
|
|
|
58
56
|
let errorMsg: string | undefined;
|
|
59
57
|
|
|
60
58
|
if (blobConfig) {
|
|
61
|
-
const maxFeePerBlobGas = blobConfig.maxFeePerBlobGas ?? gasPrice.maxFeePerBlobGas;
|
|
59
|
+
const maxFeePerBlobGas = blobConfig.maxFeePerBlobGas ?? state.gasPrice.maxFeePerBlobGas;
|
|
62
60
|
if (maxFeePerBlobGas === undefined) {
|
|
63
61
|
errorMsg = 'maxFeePerBlobGas is required to get the error message';
|
|
64
62
|
} else {
|
|
@@ -89,9 +87,13 @@ export class Multicall3 {
|
|
|
89
87
|
errorMsg = await l1TxUtils.tryGetErrorFromRevertedTx(encodedForwarderData, args, undefined, []);
|
|
90
88
|
}
|
|
91
89
|
|
|
92
|
-
return { receipt,
|
|
90
|
+
return { receipt, errorMsg };
|
|
93
91
|
}
|
|
94
92
|
} catch (err) {
|
|
93
|
+
if (err instanceof TimeoutError) {
|
|
94
|
+
throw err;
|
|
95
|
+
}
|
|
96
|
+
|
|
95
97
|
for (const request of requests) {
|
|
96
98
|
logger.debug('Simulating request', { request });
|
|
97
99
|
const result = await l1TxUtils
|