@aztec/end-to-end 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/bench/client_flows/benchmark.d.ts +4 -3
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +25 -14
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +111 -90
- package/dest/bench/client_flows/config.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.d.ts +1 -1
- package/dest/bench/client_flows/data_extractor.js +8 -30
- package/dest/bench/utils.d.ts +4 -13
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +10 -34
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +8 -8
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +42 -42
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +12 -9
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +35 -35
- package/dest/e2e_deploy_contract/deploy_test.d.ts +12 -6
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +9 -18
- package/dest/e2e_epochs/epochs_test.d.ts +19 -12
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +30 -22
- package/dest/e2e_fees/bridging_race.notest.d.ts +1 -1
- package/dest/e2e_fees/bridging_race.notest.js +14 -11
- package/dest/e2e_fees/fees_test.d.ts +10 -8
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +35 -38
- package/dest/e2e_l1_publisher/write_json.d.ts +4 -2
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +9 -8
- package/dest/e2e_multi_validator/utils.d.ts +2 -2
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
- package/dest/e2e_multi_validator/utils.js +4 -10
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +7 -4
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +11 -12
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
- package/dest/e2e_p2p/inactivity_slash_test.js +139 -0
- package/dest/e2e_p2p/p2p_network.d.ts +238 -17
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +46 -19
- package/dest/e2e_p2p/shared.d.ts +16 -17
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +56 -55
- package/dest/e2e_token_contract/token_contract_test.d.ts +6 -5
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +14 -17
- package/dest/fixtures/e2e_prover_test.d.ts +12 -8
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +53 -58
- package/dest/fixtures/fixtures.d.ts +1 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +1 -1
- package/dest/fixtures/get_acvm_config.d.ts +2 -2
- package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
- package/dest/fixtures/get_acvm_config.js +1 -1
- package/dest/fixtures/get_bb_config.d.ts +2 -2
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +2 -2
- package/dest/fixtures/index.d.ts +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +2 -2
- package/dest/fixtures/logging.d.ts +1 -1
- package/dest/fixtures/setup_l1_contracts.d.ts +476 -5
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_l1_contracts.js +3 -3
- package/dest/fixtures/setup_p2p_test.d.ts +12 -11
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +50 -24
- package/dest/fixtures/snapshot_manager.d.ts +13 -10
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +66 -51
- package/dest/fixtures/token_utils.d.ts +10 -5
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +17 -18
- package/dest/fixtures/utils.d.ts +479 -35
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +106 -125
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +53 -0
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/index.d.ts +1 -1
- package/dest/quality_of_service/alert_checker.d.ts +2 -2
- package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.d.ts +20 -23
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +14 -16
- package/dest/shared/gas_portal_test_harness.d.ts +10 -17
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +11 -8
- package/dest/shared/index.d.ts +1 -1
- package/dest/shared/jest_setup.d.ts +1 -1
- package/dest/shared/jest_setup.js +1 -1
- package/dest/shared/submit-transactions.d.ts +6 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +8 -7
- package/dest/shared/uniswap_l1_l2.d.ts +12 -8
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +44 -58
- package/dest/simulators/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +4 -7
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +8 -5
- package/dest/simulators/token_simulator.d.ts +4 -2
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +22 -14
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +144 -86
- package/dest/spartan/tx_metrics.d.ts +39 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +95 -0
- package/dest/spartan/utils.d.ts +92 -17
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +386 -63
- package/package.json +43 -40
- package/src/bench/client_flows/benchmark.ts +8 -8
- package/src/bench/client_flows/client_flows_benchmark.ts +141 -114
- package/src/bench/client_flows/data_extractor.ts +9 -31
- package/src/bench/utils.ts +9 -37
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +46 -63
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +38 -51
- package/src/e2e_deploy_contract/deploy_test.ts +18 -36
- package/src/e2e_epochs/epochs_test.ts +41 -35
- package/src/e2e_fees/bridging_race.notest.ts +16 -11
- package/src/e2e_fees/fees_test.ts +42 -47
- package/src/e2e_l1_publisher/write_json.ts +12 -9
- package/src/e2e_multi_validator/utils.ts +5 -11
- package/src/e2e_nested_contract/nested_contract_test.ts +15 -13
- package/src/e2e_p2p/inactivity_slash_test.ts +184 -0
- package/src/e2e_p2p/p2p_network.ts +124 -82
- package/src/e2e_p2p/shared.ts +66 -58
- package/src/e2e_token_contract/token_contract_test.ts +17 -17
- package/src/fixtures/e2e_prover_test.ts +60 -97
- package/src/fixtures/fixtures.ts +1 -2
- package/src/fixtures/get_acvm_config.ts +2 -2
- package/src/fixtures/get_bb_config.ts +3 -2
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/setup_l1_contracts.ts +5 -4
- package/src/fixtures/setup_p2p_test.ts +79 -32
- package/src/fixtures/snapshot_manager.ts +87 -82
- package/src/fixtures/token_utils.ts +16 -24
- package/src/fixtures/utils.ts +142 -172
- package/src/fixtures/web3signer.ts +63 -0
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/guides/up_quick_start.sh +3 -11
- package/src/quality_of_service/alert_checker.ts +1 -1
- package/src/shared/cross_chain_test_harness.ts +23 -31
- package/src/shared/gas_portal_test_harness.ts +14 -21
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +12 -8
- package/src/shared/uniswap_l1_l2.ts +77 -86
- package/src/simulators/lending_simulator.ts +9 -6
- package/src/simulators/token_simulator.ts +5 -2
- package/src/spartan/DEVELOP.md +15 -3
- package/src/spartan/setup_test_wallets.ts +171 -127
- package/src/spartan/tx_metrics.ts +130 -0
- package/src/spartan/utils.ts +463 -64
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type Logger,
|
|
10
|
-
type PXE,
|
|
11
|
-
type PublicKeys,
|
|
12
|
-
type Wallet,
|
|
13
|
-
createLogger,
|
|
14
|
-
getContractInstanceFromInstantiationParams,
|
|
15
|
-
} from '@aztec/aztec.js';
|
|
1
|
+
import type { ContractArtifact } from '@aztec/aztec.js/abi';
|
|
2
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
+
import { type ContractBase, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
4
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
|
+
import type { PublicKeys } from '@aztec/aztec.js/keys';
|
|
6
|
+
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
7
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
8
|
+
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
16
9
|
import type { StatefulTestContract } from '@aztec/noir-test-contracts.js/StatefulTest';
|
|
17
10
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
11
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
18
12
|
|
|
19
13
|
import { type ISnapshotManager, createSnapshotManager, deployAccounts } from '../fixtures/snapshot_manager.js';
|
|
20
14
|
|
|
@@ -23,8 +17,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
23
17
|
export class DeployTest {
|
|
24
18
|
private snapshotManager: ISnapshotManager;
|
|
25
19
|
public logger: Logger;
|
|
26
|
-
public
|
|
27
|
-
public wallet!: AccountWallet;
|
|
20
|
+
public wallet!: TestWallet;
|
|
28
21
|
public defaultAccountAddress!: AztecAddress;
|
|
29
22
|
public aztecNode!: AztecNode;
|
|
30
23
|
public aztecNodeAdmin!: AztecNodeAdmin;
|
|
@@ -37,7 +30,7 @@ export class DeployTest {
|
|
|
37
30
|
async setup() {
|
|
38
31
|
await this.applyInitialAccountSnapshot();
|
|
39
32
|
const context = await this.snapshotManager.setup();
|
|
40
|
-
({
|
|
33
|
+
({ aztecNode: this.aztecNode, wallet: this.wallet } = context);
|
|
41
34
|
this.aztecNodeAdmin = context.aztecNode;
|
|
42
35
|
return this;
|
|
43
36
|
}
|
|
@@ -47,16 +40,10 @@ export class DeployTest {
|
|
|
47
40
|
}
|
|
48
41
|
|
|
49
42
|
private async applyInitialAccountSnapshot() {
|
|
50
|
-
await this.snapshotManager.snapshot(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const wallets = await Promise.all(deployedAccounts.map(a => getSchnorrWallet(pxe, a.address, a.signingKey)));
|
|
55
|
-
wallets.forEach((w, i) => this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
|
|
56
|
-
this.wallet = wallets[0];
|
|
57
|
-
this.defaultAccountAddress = this.wallet.getAddress();
|
|
58
|
-
},
|
|
59
|
-
);
|
|
43
|
+
await this.snapshotManager.snapshot('initial_account', deployAccounts(1, this.logger), ({ deployedAccounts }) => {
|
|
44
|
+
this.defaultAccountAddress = deployedAccounts[0].address;
|
|
45
|
+
return Promise.resolve();
|
|
46
|
+
});
|
|
60
47
|
}
|
|
61
48
|
|
|
62
49
|
async registerContract<T extends ContractBase>(
|
|
@@ -74,23 +61,18 @@ export class DeployTest {
|
|
|
74
61
|
const instance = await getContractInstanceFromInstantiationParams(contractArtifact.artifact, {
|
|
75
62
|
constructorArgs: initArgs ?? [],
|
|
76
63
|
constructorArtifact: constructorName,
|
|
77
|
-
salt,
|
|
64
|
+
salt: salt ?? Fr.random(),
|
|
78
65
|
publicKeys,
|
|
79
66
|
deployer,
|
|
80
67
|
});
|
|
81
|
-
await wallet.registerContract(
|
|
68
|
+
await wallet.registerContract(instance, contractArtifact.artifact);
|
|
82
69
|
return contractArtifact.at(instance.address, wallet);
|
|
83
70
|
}
|
|
84
|
-
|
|
85
|
-
async registerRandomAccount(): Promise<AztecAddress> {
|
|
86
|
-
const completeAddress = await this.pxe.registerAccount(Fr.random(), Fr.random());
|
|
87
|
-
return completeAddress.address;
|
|
88
|
-
}
|
|
89
71
|
}
|
|
90
72
|
|
|
91
73
|
export type StatefulContractCtorArgs = Parameters<StatefulTestContract['methods']['constructor']>;
|
|
92
74
|
|
|
93
75
|
export type ContractArtifactClass<T extends ContractBase> = {
|
|
94
|
-
at(address: AztecAddress, wallet: Wallet):
|
|
76
|
+
at(address: AztecAddress, wallet: Wallet): T;
|
|
95
77
|
artifact: ContractArtifact;
|
|
96
78
|
};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from '@aztec/aztec.js';
|
|
12
|
-
import { DefaultL1ContractsConfig, type ExtendedViemWalletClient, createExtendedL1Client } from '@aztec/ethereum';
|
|
2
|
+
import { getTimestampRangeForEpoch } from '@aztec/aztec.js/block';
|
|
3
|
+
import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
4
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
5
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
6
|
+
import { MerkleTreeId } from '@aztec/aztec.js/trees';
|
|
7
|
+
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
8
|
+
import { EpochCache } from '@aztec/epoch-cache';
|
|
9
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
10
|
+
import { DefaultL1ContractsConfig } from '@aztec/ethereum/config';
|
|
13
11
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
14
12
|
import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
13
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum/types';
|
|
14
|
+
import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
15
15
|
import { SecretValue } from '@aztec/foundation/config';
|
|
16
|
-
import { randomBytes } from '@aztec/foundation/crypto';
|
|
16
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
17
17
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
18
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
19
|
+
import { sleep } from '@aztec/foundation/sleep';
|
|
18
20
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
19
21
|
import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
20
|
-
import { ProverNode, ProverNodePublisher } from '@aztec/prover-node';
|
|
22
|
+
import { ProverNode, type ProverNodeConfig, ProverNodePublisher } from '@aztec/prover-node';
|
|
21
23
|
import type { TestProverNode } from '@aztec/prover-node/test';
|
|
22
24
|
import {
|
|
23
25
|
type SequencerClient,
|
|
@@ -26,7 +28,7 @@ import {
|
|
|
26
28
|
SequencerState,
|
|
27
29
|
} from '@aztec/sequencer-client';
|
|
28
30
|
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
29
|
-
import {
|
|
31
|
+
import { type BlockParameter, EthAddress } from '@aztec/stdlib/block';
|
|
30
32
|
import { type L1RollupConstants, getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
31
33
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
32
34
|
|
|
@@ -69,6 +71,7 @@ export class EpochsTestContext {
|
|
|
69
71
|
public constants!: L1RollupConstants;
|
|
70
72
|
public logger!: Logger;
|
|
71
73
|
public monitor!: ChainMonitor;
|
|
74
|
+
public epochCache!: EpochCache;
|
|
72
75
|
public proverDelayer!: Delayer;
|
|
73
76
|
public sequencerDelayer!: Delayer;
|
|
74
77
|
|
|
@@ -126,9 +129,6 @@ export class EpochsTestContext {
|
|
|
126
129
|
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
127
130
|
// Use numeric EthAddress for deterministic prover id
|
|
128
131
|
proverId: EthAddress.fromNumber(1),
|
|
129
|
-
// This must be enough so that the tx from the prover is delayed properly,
|
|
130
|
-
// but not so much to hang the sequencer and timeout the teardown
|
|
131
|
-
txPropagationMaxQueryAttempts: opts.txPropagationMaxQueryAttempts ?? 12,
|
|
132
132
|
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
133
133
|
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
134
134
|
slasherFlavor: 'none',
|
|
@@ -141,6 +141,7 @@ export class EpochsTestContext {
|
|
|
141
141
|
this.logger = context.logger;
|
|
142
142
|
this.l1Client = context.deployL1ContractsValues.l1Client;
|
|
143
143
|
this.rollup = RollupContract.getFromConfig(context.config);
|
|
144
|
+
this.epochCache = await EpochCache.create(this.rollup, context.config, { dateProvider: context.dateProvider });
|
|
144
145
|
|
|
145
146
|
// Loop that tracks L1 and L2 block numbers and logs whenever there's a new one.
|
|
146
147
|
this.monitor = new ChainMonitor(this.rollup, context.dateProvider, this.logger).start();
|
|
@@ -184,15 +185,20 @@ export class EpochsTestContext {
|
|
|
184
185
|
await this.context.teardown();
|
|
185
186
|
}
|
|
186
187
|
|
|
187
|
-
public async createProverNode() {
|
|
188
|
+
public async createProverNode(opts: { dontStart?: boolean } & Partial<ProverNodeConfig> = {}) {
|
|
188
189
|
this.logger.warn('Creating and syncing a simulated prover node...');
|
|
189
190
|
const proverNodePrivateKey = this.getNextPrivateKey();
|
|
190
191
|
const suffix = (this.proverNodes.length + 1).toString();
|
|
191
192
|
const proverNode = await withLogNameSuffix(suffix, () =>
|
|
192
193
|
createAndSyncProverNode(
|
|
193
194
|
proverNodePrivateKey,
|
|
194
|
-
{ ...this.context.config
|
|
195
|
-
{
|
|
195
|
+
{ ...this.context.config },
|
|
196
|
+
{
|
|
197
|
+
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
198
|
+
proverId: EthAddress.fromNumber(parseInt(suffix, 10)),
|
|
199
|
+
dontStart: opts.dontStart,
|
|
200
|
+
...opts,
|
|
201
|
+
},
|
|
196
202
|
this.context.aztecNode,
|
|
197
203
|
undefined,
|
|
198
204
|
{ dateProvider: this.context.dateProvider },
|
|
@@ -276,7 +282,7 @@ export class EpochsTestContext {
|
|
|
276
282
|
|
|
277
283
|
/** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */
|
|
278
284
|
public async waitUntilEpochStarts(epoch: number) {
|
|
279
|
-
const [start] = getTimestampRangeForEpoch(
|
|
285
|
+
const [start] = getTimestampRangeForEpoch(EpochNumber(epoch), this.constants);
|
|
280
286
|
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
281
287
|
await waitUntilL1Timestamp(
|
|
282
288
|
this.l1Client,
|
|
@@ -287,30 +293,30 @@ export class EpochsTestContext {
|
|
|
287
293
|
return start;
|
|
288
294
|
}
|
|
289
295
|
|
|
290
|
-
/** Waits until the given
|
|
291
|
-
public async
|
|
296
|
+
/** Waits until the given checkpoint number is mined. */
|
|
297
|
+
public async waitUntilCheckpointNumber(target: CheckpointNumber, timeout = 60) {
|
|
292
298
|
await retryUntil(
|
|
293
|
-
() => Promise.resolve(target <= this.monitor.
|
|
294
|
-
`Wait until
|
|
299
|
+
() => Promise.resolve(target <= this.monitor.checkpointNumber),
|
|
300
|
+
`Wait until checkpoint ${target}`,
|
|
295
301
|
timeout,
|
|
296
302
|
0.1,
|
|
297
303
|
);
|
|
298
304
|
}
|
|
299
305
|
|
|
300
|
-
/** Waits until the given
|
|
301
|
-
public async
|
|
306
|
+
/** Waits until the given checkpoint number is marked as proven. */
|
|
307
|
+
public async waitUntilProvenCheckpointNumber(target: CheckpointNumber, timeout = 60) {
|
|
302
308
|
await retryUntil(
|
|
303
|
-
() => Promise.resolve(
|
|
304
|
-
`Wait proven
|
|
309
|
+
() => Promise.resolve(target <= this.monitor.provenCheckpointNumber),
|
|
310
|
+
`Wait proven checkpoint ${target}`,
|
|
305
311
|
timeout,
|
|
306
312
|
0.1,
|
|
307
313
|
);
|
|
308
|
-
return this.monitor.
|
|
314
|
+
return this.monitor.provenCheckpointNumber;
|
|
309
315
|
}
|
|
310
316
|
|
|
311
317
|
/** Waits until the last slot of the proof submission window for a given epoch. */
|
|
312
318
|
public async waitUntilLastSlotOfProofSubmissionWindow(epochNumber: number | bigint) {
|
|
313
|
-
const deadline = getProofSubmissionDeadlineTimestamp(BigInt(epochNumber), this.constants);
|
|
319
|
+
const deadline = getProofSubmissionDeadlineTimestamp(EpochNumber.fromBigInt(BigInt(epochNumber)), this.constants);
|
|
314
320
|
const oneSlotBefore = deadline - BigInt(this.constants.slotDuration);
|
|
315
321
|
const date = new Date(Number(oneSlotBefore) * 1000);
|
|
316
322
|
this.logger.info(`Waiting until last slot of submission window for epoch ${epochNumber} at ${date}`, {
|
|
@@ -320,7 +326,7 @@ export class EpochsTestContext {
|
|
|
320
326
|
}
|
|
321
327
|
|
|
322
328
|
/** Waits for the aztec node to sync to the target block number. */
|
|
323
|
-
public async waitForNodeToSync(blockNumber:
|
|
329
|
+
public async waitForNodeToSync(blockNumber: BlockNumber, type: 'proven' | 'finalized' | 'historic') {
|
|
324
330
|
const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
|
|
325
331
|
let synched = false;
|
|
326
332
|
while (!synched) {
|
|
@@ -349,7 +355,7 @@ export class EpochsTestContext {
|
|
|
349
355
|
publicKeys: undefined,
|
|
350
356
|
deployer: undefined,
|
|
351
357
|
});
|
|
352
|
-
await wallet.registerContract(
|
|
358
|
+
await wallet.registerContract(instance, SpamContract.artifact);
|
|
353
359
|
return SpamContract.at(instance.address, wallet);
|
|
354
360
|
}
|
|
355
361
|
|
|
@@ -369,7 +375,7 @@ export class EpochsTestContext {
|
|
|
369
375
|
}
|
|
370
376
|
|
|
371
377
|
/** Verifies whether the given block number is found on the aztec node. */
|
|
372
|
-
public async verifyHistoricBlock(blockNumber:
|
|
378
|
+
public async verifyHistoricBlock(blockNumber: BlockParameter, expectedSuccess: boolean) {
|
|
373
379
|
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
374
380
|
// at a particular block, so we know whether that historic block is available or has been
|
|
375
381
|
// pruned. Note that `getBlock` would not work here, since it only hits the archiver.
|
|
@@ -424,7 +430,7 @@ export class EpochsTestContext {
|
|
|
424
430
|
sequencer.getSequencer().on(eventName, (args: Parameters<SequencerEvents[typeof eventName]>[0]) => {
|
|
425
431
|
const evt = makeEvent(i, eventName, args);
|
|
426
432
|
failEvents.push(evt);
|
|
427
|
-
this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, evt);
|
|
433
|
+
this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, undefined, evt);
|
|
428
434
|
});
|
|
429
435
|
});
|
|
430
436
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Fr
|
|
3
|
-
import {
|
|
1
|
+
import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
|
|
2
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
4
|
+
import { Fq } from '@aztec/foundation/curves/bn254';
|
|
5
|
+
import { sleep } from '@aztec/foundation/sleep';
|
|
4
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
+
import type { TestWallet } from '@aztec/test-wallet/server';
|
|
5
8
|
|
|
6
9
|
import { jest } from '@jest/globals';
|
|
7
10
|
import type { Hex } from 'viem';
|
|
@@ -27,7 +30,7 @@ describe('e2e_fees bridging_race', () => {
|
|
|
27
30
|
await t.applyPublicDeployAccountsSnapshot();
|
|
28
31
|
await t.applySetupFeeJuiceSnapshot();
|
|
29
32
|
|
|
30
|
-
({
|
|
33
|
+
({ wallet, logger } = await t.setup());
|
|
31
34
|
});
|
|
32
35
|
|
|
33
36
|
afterAll(async () => {
|
|
@@ -35,17 +38,19 @@ describe('e2e_fees bridging_race', () => {
|
|
|
35
38
|
});
|
|
36
39
|
|
|
37
40
|
let logger: Logger;
|
|
38
|
-
let pxe: PXE;
|
|
39
41
|
let bobsAddress: AztecAddress;
|
|
42
|
+
let wallet: TestWallet;
|
|
40
43
|
|
|
41
44
|
beforeEach(async () => {
|
|
42
45
|
const bobsSecretKey = Fr.random();
|
|
43
46
|
const bobsPrivateSigningKey = Fq.random();
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const bobsSalt = Fr.random();
|
|
48
|
+
const bobsAccountManager = await wallet.createAccount({
|
|
49
|
+
secret: bobsSecretKey,
|
|
50
|
+
salt: bobsSalt,
|
|
51
|
+
contract: new SchnorrAccountContract(bobsPrivateSigningKey),
|
|
52
|
+
});
|
|
53
|
+
bobsAddress = bobsAccountManager.address;
|
|
49
54
|
});
|
|
50
55
|
|
|
51
56
|
it('Alice bridges funds to Bob', async () => {
|
|
@@ -55,7 +60,7 @@ describe('e2e_fees bridging_race', () => {
|
|
|
55
60
|
const origApprove = l1TokenManager.approve.bind(l1TokenManager);
|
|
56
61
|
l1TokenManager.approve = async (amount: bigint, address: Hex, addressName = '') => {
|
|
57
62
|
await origApprove(amount, address, addressName);
|
|
58
|
-
const sleepTime = (Number(t.chainMonitor.
|
|
63
|
+
const sleepTime = (Number(t.chainMonitor.checkpointTimestamp) + AZTEC_SLOT_DURATION) * 1000 - Date.now() - 500;
|
|
59
64
|
logger.info(`Sleeping for ${sleepTime}ms until near end of L2 slot before sending L1 fee juice to L2 inbox`);
|
|
60
65
|
await sleep(sleepTime);
|
|
61
66
|
};
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type AztecAddress,
|
|
5
|
-
type AztecNode,
|
|
6
|
-
type Logger,
|
|
7
|
-
type PXE,
|
|
8
|
-
createLogger,
|
|
9
|
-
sleep,
|
|
10
|
-
} from '@aztec/aztec.js';
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
3
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
11
4
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
12
|
-
import {
|
|
5
|
+
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
6
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
7
|
+
import type { DeployL1ContractsArgs } from '@aztec/ethereum/deploy-l1-contracts';
|
|
13
8
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
9
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
14
10
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
11
|
+
import { sleep } from '@aztec/foundation/sleep';
|
|
15
12
|
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
16
13
|
import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription';
|
|
17
14
|
import { FPCContract } from '@aztec/noir-contracts.js/FPC';
|
|
@@ -22,6 +19,7 @@ import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
|
|
|
22
19
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
23
20
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
24
21
|
import { GasSettings } from '@aztec/stdlib/gas';
|
|
22
|
+
import { TestWallet } from '@aztec/test-wallet/server';
|
|
25
23
|
|
|
26
24
|
import { getContract } from 'viem';
|
|
27
25
|
|
|
@@ -56,17 +54,14 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
56
54
|
*/
|
|
57
55
|
export class FeesTest {
|
|
58
56
|
private snapshotManager: ISnapshotManager;
|
|
59
|
-
private wallets: AccountWallet[] = [];
|
|
60
57
|
private accounts: AztecAddress[] = [];
|
|
61
58
|
|
|
62
59
|
public logger: Logger;
|
|
63
|
-
public pxe!: PXE;
|
|
64
60
|
public aztecNode!: AztecNode;
|
|
65
61
|
public cheatCodes!: CheatCodes;
|
|
66
62
|
|
|
67
|
-
public
|
|
63
|
+
public wallet!: TestWallet;
|
|
68
64
|
public aliceAddress!: AztecAddress;
|
|
69
|
-
public bobWallet!: AccountWallet;
|
|
70
65
|
public bobAddress!: AztecAddress;
|
|
71
66
|
public sequencerAddress!: AztecAddress;
|
|
72
67
|
public coinbase!: EthAddress;
|
|
@@ -93,7 +88,7 @@ export class FeesTest {
|
|
|
93
88
|
public getGasBalanceFn!: BalancesFn;
|
|
94
89
|
public getBananaPublicBalanceFn!: BalancesFn;
|
|
95
90
|
public getBananaPrivateBalanceFn!: BalancesFn;
|
|
96
|
-
public getProverFee!: (blockNumber:
|
|
91
|
+
public getProverFee!: (blockNumber: BlockNumber) => Promise<bigint>;
|
|
97
92
|
|
|
98
93
|
public readonly ALICE_INITIAL_BANANAS = BigInt(1e22);
|
|
99
94
|
public readonly SUBSCRIPTION_AMOUNT = BigInt(1e19);
|
|
@@ -144,14 +139,15 @@ export class FeesTest {
|
|
|
144
139
|
}
|
|
145
140
|
|
|
146
141
|
async getBlockRewards() {
|
|
147
|
-
const blockReward = await this.rollupContract.
|
|
142
|
+
const blockReward = await this.rollupContract.getCheckpointReward();
|
|
143
|
+
const rewardConfig = await this.rollupContract.getRewardConfig();
|
|
148
144
|
|
|
149
145
|
const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(
|
|
150
|
-
|
|
146
|
+
EthAddress.fromString(rewardConfig.rewardDistributor),
|
|
151
147
|
);
|
|
152
148
|
|
|
153
149
|
const toDistribute = balance > blockReward ? blockReward : balance;
|
|
154
|
-
const sequencerBlockRewards = toDistribute /
|
|
150
|
+
const sequencerBlockRewards = (toDistribute * BigInt(rewardConfig.sequencerBps)) / 10000n;
|
|
155
151
|
const proverBlockRewards = toDistribute - sequencerBlockRewards;
|
|
156
152
|
|
|
157
153
|
return { sequencerBlockRewards, proverBlockRewards };
|
|
@@ -172,7 +168,7 @@ export class FeesTest {
|
|
|
172
168
|
.balance_of_private(address)
|
|
173
169
|
.simulate({ from: this.aliceAddress });
|
|
174
170
|
|
|
175
|
-
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress,
|
|
171
|
+
await mintTokensToPrivate(this.bananaCoin, this.aliceAddress, address, amount);
|
|
176
172
|
|
|
177
173
|
const balanceAfter = await this.bananaCoin.methods
|
|
178
174
|
.balance_of_private(address)
|
|
@@ -191,30 +187,27 @@ export class FeesTest {
|
|
|
191
187
|
await this.snapshotManager.snapshot(
|
|
192
188
|
'initial_accounts',
|
|
193
189
|
deployAccounts(this.numberOfAccounts, this.logger),
|
|
194
|
-
async ({ deployedAccounts }, {
|
|
195
|
-
this.
|
|
196
|
-
|
|
190
|
+
async ({ deployedAccounts }, { wallet, aztecNode, cheatCodes }) => {
|
|
191
|
+
this.wallet = wallet;
|
|
197
192
|
this.aztecNode = aztecNode;
|
|
198
193
|
this.gasSettings = GasSettings.default({ maxFeesPerGas: (await this.aztecNode.getCurrentBaseFees()).mul(2) });
|
|
199
|
-
this.cheatCodes =
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
202
|
-
this.
|
|
203
|
-
[this.aliceWallet, this.bobWallet] = this.wallets.slice(0, 2);
|
|
204
|
-
[this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts;
|
|
194
|
+
this.cheatCodes = cheatCodes;
|
|
195
|
+
this.accounts = deployedAccounts.map(a => a.address);
|
|
196
|
+
this.accounts.forEach((a, i) => this.logger.verbose(`Account ${i} address: ${a}`));
|
|
197
|
+
[this.aliceAddress, this.bobAddress, this.sequencerAddress] = this.accounts.slice(0, 3);
|
|
205
198
|
|
|
206
199
|
// We set Alice as the FPC admin to avoid the need for deployment of another account.
|
|
207
200
|
this.fpcAdmin = this.aliceAddress;
|
|
208
201
|
|
|
209
202
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
210
|
-
this.feeJuiceContract =
|
|
203
|
+
this.feeJuiceContract = FeeJuiceContract.at(canonicalFeeJuice.address, this.wallet);
|
|
211
204
|
},
|
|
212
205
|
);
|
|
213
206
|
}
|
|
214
207
|
|
|
215
208
|
async applyPublicDeployAccountsSnapshot() {
|
|
216
209
|
await this.snapshotManager.snapshot('public_deploy_accounts', () =>
|
|
217
|
-
ensureAccountContractsPublished(this.
|
|
210
|
+
ensureAccountContractsPublished(this.wallet, this.accounts),
|
|
218
211
|
);
|
|
219
212
|
}
|
|
220
213
|
|
|
@@ -225,7 +218,7 @@ export class FeesTest {
|
|
|
225
218
|
async (_data, context) => {
|
|
226
219
|
this.context = context;
|
|
227
220
|
|
|
228
|
-
this.feeJuiceContract =
|
|
221
|
+
this.feeJuiceContract = FeeJuiceContract.at(ProtocolContractAddress.FeeJuice, this.wallet);
|
|
229
222
|
|
|
230
223
|
this.getGasBalanceFn = getBalancesFn(
|
|
231
224
|
'⛽',
|
|
@@ -237,9 +230,8 @@ export class FeesTest {
|
|
|
237
230
|
this.feeJuiceBridgeTestHarness = await FeeJuicePortalTestingHarnessFactory.create({
|
|
238
231
|
aztecNode: context.aztecNode,
|
|
239
232
|
aztecNodeAdmin: context.aztecNode,
|
|
240
|
-
pxeService: context.pxe,
|
|
241
233
|
l1Client: context.deployL1ContractsValues.l1Client,
|
|
242
|
-
wallet: this.
|
|
234
|
+
wallet: this.wallet,
|
|
243
235
|
logger: this.logger,
|
|
244
236
|
});
|
|
245
237
|
},
|
|
@@ -250,14 +242,14 @@ export class FeesTest {
|
|
|
250
242
|
await this.snapshotManager.snapshot(
|
|
251
243
|
'deploy_banana_token',
|
|
252
244
|
async () => {
|
|
253
|
-
const bananaCoin = await BananaCoin.deploy(this.
|
|
245
|
+
const bananaCoin = await BananaCoin.deploy(this.wallet, this.aliceAddress, 'BC', 'BC', 18n)
|
|
254
246
|
.send({ from: this.aliceAddress })
|
|
255
247
|
.deployed();
|
|
256
248
|
this.logger.info(`BananaCoin deployed at ${bananaCoin.address}`);
|
|
257
249
|
return { bananaCoinAddress: bananaCoin.address };
|
|
258
250
|
},
|
|
259
|
-
|
|
260
|
-
this.bananaCoin =
|
|
251
|
+
({ bananaCoinAddress }) => {
|
|
252
|
+
this.bananaCoin = BananaCoin.at(bananaCoinAddress, this.wallet);
|
|
261
253
|
const logger = this.logger;
|
|
262
254
|
this.getBananaPublicBalanceFn = getBalancesFn(
|
|
263
255
|
'🍌.public',
|
|
@@ -271,6 +263,7 @@ export class FeesTest {
|
|
|
271
263
|
this.aliceAddress,
|
|
272
264
|
logger,
|
|
273
265
|
);
|
|
266
|
+
return Promise.resolve();
|
|
274
267
|
},
|
|
275
268
|
);
|
|
276
269
|
}
|
|
@@ -280,10 +273,10 @@ export class FeesTest {
|
|
|
280
273
|
'fpc_setup',
|
|
281
274
|
async context => {
|
|
282
275
|
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
283
|
-
expect((await context.
|
|
276
|
+
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
284
277
|
|
|
285
278
|
const bananaCoin = this.bananaCoin;
|
|
286
|
-
const bananaFPC = await FPCContract.deploy(this.
|
|
279
|
+
const bananaFPC = await FPCContract.deploy(this.wallet, bananaCoin.address, this.fpcAdmin)
|
|
287
280
|
.send({ from: this.aliceAddress })
|
|
288
281
|
.deployed();
|
|
289
282
|
|
|
@@ -298,8 +291,8 @@ export class FeesTest {
|
|
|
298
291
|
rollupAddress: context.deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
299
292
|
};
|
|
300
293
|
},
|
|
301
|
-
|
|
302
|
-
const bananaFPC =
|
|
294
|
+
(data, context) => {
|
|
295
|
+
const bananaFPC = FPCContract.at(data.bananaFPCAddress, this.wallet);
|
|
303
296
|
this.bananaFPC = bananaFPC;
|
|
304
297
|
|
|
305
298
|
this.getCoinbaseBalance = async () => {
|
|
@@ -316,8 +309,8 @@ export class FeesTest {
|
|
|
316
309
|
return await this.rollupContract.getSequencerRewards(this.coinbase);
|
|
317
310
|
};
|
|
318
311
|
|
|
319
|
-
this.getProverFee = async (blockNumber:
|
|
320
|
-
const block = await this.
|
|
312
|
+
this.getProverFee = async (blockNumber: BlockNumber) => {
|
|
313
|
+
const block = await this.aztecNode.getBlock(blockNumber);
|
|
321
314
|
|
|
322
315
|
// @todo @lherskind As we deal with #13601
|
|
323
316
|
// Right now the value is from `FeeLib.sol`
|
|
@@ -339,6 +332,7 @@ export class FeesTest {
|
|
|
339
332
|
const mana = block!.header.totalManaUsed.toBigInt();
|
|
340
333
|
return mulDiv(mana * proverCost, price, 10n ** 9n);
|
|
341
334
|
};
|
|
335
|
+
return Promise.resolve();
|
|
342
336
|
},
|
|
343
337
|
);
|
|
344
338
|
}
|
|
@@ -348,17 +342,18 @@ export class FeesTest {
|
|
|
348
342
|
'sponsored_fpc_setup',
|
|
349
343
|
async context => {
|
|
350
344
|
const feeJuiceContract = this.feeJuiceBridgeTestHarness.feeJuice;
|
|
351
|
-
expect((await context.
|
|
345
|
+
expect((await context.wallet.getContractMetadata(feeJuiceContract.address)).isContractPublished).toBe(true);
|
|
352
346
|
|
|
353
|
-
const sponsoredFPC = await setupSponsoredFPC(
|
|
347
|
+
const sponsoredFPC = await setupSponsoredFPC(this.wallet);
|
|
354
348
|
this.logger.info(`SponsoredFPC at ${sponsoredFPC.address}`);
|
|
355
349
|
|
|
356
350
|
return {
|
|
357
351
|
sponsoredFPCAddress: sponsoredFPC.address,
|
|
358
352
|
};
|
|
359
353
|
},
|
|
360
|
-
|
|
361
|
-
this.sponsoredFPC =
|
|
354
|
+
data => {
|
|
355
|
+
this.sponsoredFPC = SponsoredFPCContract.at(data.sponsoredFPCAddress, this.wallet);
|
|
356
|
+
return Promise.resolve();
|
|
362
357
|
},
|
|
363
358
|
);
|
|
364
359
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { AztecAddress
|
|
2
|
-
import {
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import type { L2Block } from '@aztec/aztec.js/block';
|
|
3
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
+
import { BatchedBlob, Blob, getEthBlobEvaluationInputs, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
|
|
3
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
6
|
|
|
5
7
|
import { writeFile } from 'fs/promises';
|
|
@@ -32,23 +34,24 @@ export async function writeJson(
|
|
|
32
34
|
|
|
33
35
|
const jsonObject = {
|
|
34
36
|
populate: {
|
|
35
|
-
l1ToL2Content: l1ToL2Content.map(asHex),
|
|
37
|
+
l1ToL2Content: l1ToL2Content.map(value => asHex(value)),
|
|
36
38
|
recipient: asHex(recipientAddress.toField()),
|
|
37
39
|
sender: deployerAddress,
|
|
38
40
|
},
|
|
39
41
|
messages: {
|
|
40
|
-
l2ToL1Messages: block.body.txEffects.flatMap(txEffect => txEffect.l2ToL1Msgs).map(asHex),
|
|
42
|
+
l2ToL1Messages: block.body.txEffects.flatMap(txEffect => txEffect.l2ToL1Msgs).map(value => asHex(value)),
|
|
41
43
|
},
|
|
42
|
-
|
|
44
|
+
checkpoint: {
|
|
43
45
|
// The json formatting in forge is a bit brittle, so we convert Fr to a number in the few values below.
|
|
44
46
|
// This should not be a problem for testing as long as the values are not larger than u32.
|
|
45
47
|
archive: asHex(block.archive.root),
|
|
46
|
-
blobCommitments:
|
|
47
|
-
batchedBlobInputs:
|
|
48
|
-
|
|
48
|
+
blobCommitments: getPrefixedEthBlobCommitments(blobs),
|
|
49
|
+
batchedBlobInputs: getEthBlobEvaluationInputs(batchedBlob),
|
|
50
|
+
checkpointNumber: block.number,
|
|
49
51
|
body: `0x${block.body.toBuffer().toString('hex')}`,
|
|
50
52
|
header: {
|
|
51
53
|
lastArchiveRoot: asHex(block.header.lastArchive.root),
|
|
54
|
+
blockHeadersHash: asHex(block.header.blockHeadersHash),
|
|
52
55
|
contentCommitment: {
|
|
53
56
|
blobsHash: asHex(block.header.contentCommitment.blobsHash),
|
|
54
57
|
inHash: asHex(block.header.contentCommitment.inHash),
|
|
@@ -64,7 +67,7 @@ export async function writeJson(
|
|
|
64
67
|
},
|
|
65
68
|
totalManaUsed: block.header.totalManaUsed.toNumber(),
|
|
66
69
|
},
|
|
67
|
-
headerHash: asHex(block.
|
|
70
|
+
headerHash: asHex(block.getCheckpointHeader().hash()),
|
|
68
71
|
numTxs: block.body.txEffects.length,
|
|
69
72
|
},
|
|
70
73
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getAddressFromPrivateKey } from '@aztec/ethereum';
|
|
1
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { getAddressFromPrivateKey } from '@aztec/ethereum/account';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import type { EthPrivateKey } from '@aztec/node-keystore';
|
|
5
5
|
|
|
@@ -157,9 +157,7 @@ export async function createKeyFile3(
|
|
|
157
157
|
schemaVersion: 1,
|
|
158
158
|
validators: [
|
|
159
159
|
{
|
|
160
|
-
attester:
|
|
161
|
-
address: validatorAddress.toChecksumString(),
|
|
162
|
-
},
|
|
160
|
+
attester: validatorAddress.toChecksumString(),
|
|
163
161
|
coinbase: coinbase.toChecksumString(),
|
|
164
162
|
publisher: [publisher1Key, publisher2Key],
|
|
165
163
|
feeRecipient: feeRecipient.toString(),
|
|
@@ -193,9 +191,7 @@ export async function createKeyFile4(
|
|
|
193
191
|
},
|
|
194
192
|
validators: [
|
|
195
193
|
{
|
|
196
|
-
attester:
|
|
197
|
-
address: validator1Address.toChecksumString(),
|
|
198
|
-
},
|
|
194
|
+
attester: validator1Address.toChecksumString(),
|
|
199
195
|
coinbase: coinbase1.toChecksumString(),
|
|
200
196
|
publisher: {
|
|
201
197
|
mnemonic: mnemonic,
|
|
@@ -206,9 +202,7 @@ export async function createKeyFile4(
|
|
|
206
202
|
feeRecipient: feeRecipient1.toString(),
|
|
207
203
|
},
|
|
208
204
|
{
|
|
209
|
-
attester:
|
|
210
|
-
address: validator2Address.toChecksumString(),
|
|
211
|
-
},
|
|
205
|
+
attester: validator2Address.toChecksumString(),
|
|
212
206
|
coinbase: coinbase2.toChecksumString(),
|
|
213
207
|
publisher: [publisher2Key, publisher3Key],
|
|
214
208
|
feeRecipient: feeRecipient2.toString(),
|