@aztec/aztec 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107
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/README.md +1 -1
- package/dest/bin/index.d.ts +1 -1
- package/dest/bin/index.js +11 -10
- package/dest/cli/aztec_start_action.d.ts +1 -1
- package/dest/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +9 -25
- package/dest/cli/aztec_start_options.d.ts +1 -1
- package/dest/cli/aztec_start_options.d.ts.map +1 -1
- package/dest/cli/aztec_start_options.js +22 -39
- package/dest/cli/cli.d.ts +1 -1
- package/dest/cli/cli.d.ts.map +1 -1
- package/dest/cli/cli.js +46 -1
- package/dest/cli/cmds/start_archiver.d.ts +1 -1
- package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
- package/dest/cli/cmds/start_archiver.js +9 -9
- package/dest/cli/cmds/start_bot.d.ts +4 -7
- package/dest/cli/cmds/start_bot.d.ts.map +1 -1
- package/dest/cli/cmds/start_bot.js +25 -14
- package/dest/cli/cmds/start_node.d.ts +1 -1
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +13 -21
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts +1 -1
- package/dest/cli/cmds/start_p2p_bootstrap.js +1 -1
- package/dest/cli/cmds/start_prover_agent.d.ts +1 -1
- package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_agent.js +11 -2
- package/dest/cli/cmds/start_prover_broker.d.ts +1 -1
- package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_broker.js +8 -3
- package/dest/cli/cmds/start_prover_node.d.ts +1 -1
- package/dest/cli/cmds/start_prover_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_node.js +16 -7
- package/dest/cli/cmds/start_txe.d.ts +1 -1
- package/dest/cli/index.d.ts +1 -1
- package/dest/cli/preload_crs.d.ts +1 -1
- package/dest/cli/release_version.d.ts +1 -1
- package/dest/cli/util.d.ts +12 -10
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +7 -7
- package/dest/cli/versioning.d.ts +1 -1
- package/dest/cli/versioning.js +3 -3
- package/dest/examples/token.d.ts +1 -1
- package/dest/examples/token.js +18 -16
- package/dest/examples/util.d.ts +3 -3
- package/dest/examples/util.d.ts.map +1 -1
- package/dest/examples/util.js +1 -1
- package/dest/index.d.ts +2 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/local-network/banana_fpc.d.ts +10 -0
- package/dest/local-network/banana_fpc.d.ts.map +1 -0
- package/dest/{sandbox → local-network}/banana_fpc.js +15 -19
- package/dest/local-network/index.d.ts +4 -0
- package/dest/local-network/index.d.ts.map +1 -0
- package/dest/local-network/index.js +3 -0
- package/dest/local-network/local-network.d.ts +72 -0
- package/dest/local-network/local-network.d.ts.map +1 -0
- package/dest/{sandbox/sandbox.js → local-network/local-network.js} +43 -57
- package/dest/local-network/sponsored_fpc.d.ts +5 -0
- package/dest/local-network/sponsored_fpc.d.ts.map +1 -0
- package/dest/{sandbox → local-network}/sponsored_fpc.js +7 -8
- package/dest/mnemonic.d.ts +1 -1
- package/dest/splash.d.ts +1 -1
- package/dest/testing/anvil_test_watcher.d.ts +4 -4
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +19 -18
- package/dest/testing/cheat_codes.d.ts +7 -10
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +9 -10
- package/dest/testing/index.d.ts +1 -2
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +0 -1
- package/package.json +39 -37
- package/src/bin/index.ts +12 -10
- package/src/cli/aztec_start_action.ts +9 -22
- package/src/cli/aztec_start_options.ts +23 -40
- package/src/cli/cli.ts +46 -1
- package/src/cli/cmds/start_archiver.ts +9 -9
- package/src/cli/cmds/start_bot.ts +36 -13
- package/src/cli/cmds/start_node.ts +16 -17
- package/src/cli/cmds/start_p2p_bootstrap.ts +1 -1
- package/src/cli/cmds/start_prover_agent.ts +7 -2
- package/src/cli/cmds/start_prover_broker.ts +17 -3
- package/src/cli/cmds/start_prover_node.ts +13 -8
- package/src/cli/util.ts +12 -10
- package/src/cli/versioning.ts +3 -3
- package/src/examples/token.ts +20 -17
- package/src/examples/util.ts +2 -2
- package/src/index.ts +5 -5
- package/src/{sandbox → local-network}/banana_fpc.ts +16 -21
- package/src/local-network/index.ts +7 -0
- package/src/{sandbox/sandbox.ts → local-network/local-network.ts} +68 -99
- package/src/local-network/sponsored_fpc.ts +26 -0
- package/src/testing/anvil_test_watcher.ts +18 -19
- package/src/testing/cheat_codes.ts +13 -13
- package/src/testing/index.ts +0 -1
- package/dest/cli/chain_l2_config.d.ts +0 -31
- package/dest/cli/chain_l2_config.d.ts.map +0 -1
- package/dest/cli/chain_l2_config.js +0 -261
- package/dest/cli/cmds/start_blob_sink.d.ts +0 -3
- package/dest/cli/cmds/start_blob_sink.d.ts.map +0 -1
- package/dest/cli/cmds/start_blob_sink.js +0 -33
- package/dest/cli/cmds/start_pxe.d.ts +0 -16
- package/dest/cli/cmds/start_pxe.d.ts.map +0 -1
- package/dest/cli/cmds/start_pxe.js +0 -31
- package/dest/cli/get_l1_config.d.ts +0 -7
- package/dest/cli/get_l1_config.d.ts.map +0 -1
- package/dest/cli/get_l1_config.js +0 -13
- package/dest/sandbox/banana_fpc.d.ts +0 -11
- package/dest/sandbox/banana_fpc.d.ts.map +0 -1
- package/dest/sandbox/index.d.ts +0 -4
- package/dest/sandbox/index.d.ts.map +0 -1
- package/dest/sandbox/index.js +0 -3
- package/dest/sandbox/sandbox.d.ts +0 -83
- package/dest/sandbox/sandbox.d.ts.map +0 -1
- package/dest/sandbox/sponsored_fpc.d.ts +0 -4
- package/dest/sandbox/sponsored_fpc.d.ts.map +0 -1
- package/dest/testing/aztec_cheat_codes.d.ts +0 -59
- package/dest/testing/aztec_cheat_codes.d.ts.map +0 -1
- package/dest/testing/aztec_cheat_codes.js +0 -62
- package/src/cli/chain_l2_config.ts +0 -341
- package/src/cli/cmds/start_blob_sink.ts +0 -57
- package/src/cli/cmds/start_pxe.ts +0 -49
- package/src/cli/get_l1_config.ts +0 -19
- package/src/sandbox/index.ts +0 -4
- package/src/sandbox/sponsored_fpc.ts +0 -27
- package/src/testing/aztec_cheat_codes.ts +0 -77
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import {
|
|
3
|
+
type ContractInstanceWithAddress,
|
|
4
|
+
getContractInstanceFromInstantiationParams,
|
|
5
|
+
} from '@aztec/aztec.js/contracts';
|
|
6
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
7
|
+
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
8
|
+
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
9
|
+
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
10
|
+
|
|
11
|
+
async function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress> {
|
|
12
|
+
return await getContractInstanceFromInstantiationParams(SponsoredFPCContract.artifact, {
|
|
13
|
+
salt: new Fr(SPONSORED_FPC_SALT),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export async function getSponsoredFPCAddress(): Promise<AztecAddress> {
|
|
18
|
+
return (await getSponsoredFPCInstance()).address;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export async function registerDeployedSponsoredFPCInWalletAndGetAddress(wallet: Wallet): Promise<AztecAddress> {
|
|
22
|
+
const fpc = await getSponsoredFPCInstance();
|
|
23
|
+
// The following is no-op if the contract is already registered
|
|
24
|
+
await wallet.registerContract(fpc, SponsoredFPCContract.artifact);
|
|
25
|
+
return fpc.address;
|
|
26
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ViemClient } from '@aztec/ethereum';
|
|
2
1
|
import { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
|
+
import type { ViemClient } from '@aztec/ethereum/types';
|
|
3
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
4
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
5
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
5
6
|
import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
@@ -16,11 +17,11 @@ import { type GetContractReturnType, getAddress, getContract } from 'viem';
|
|
|
16
17
|
* block within the slot. And if so, it will time travel into the next slot.
|
|
17
18
|
*/
|
|
18
19
|
export class AnvilTestWatcher {
|
|
19
|
-
private
|
|
20
|
+
private isLocalNetwork: boolean = false;
|
|
20
21
|
|
|
21
22
|
private rollup: GetContractReturnType<typeof RollupAbi, ViemClient>;
|
|
22
23
|
private rollupCheatCodes: RollupCheatCodes;
|
|
23
|
-
private l2SlotDuration!:
|
|
24
|
+
private l2SlotDuration!: number;
|
|
24
25
|
|
|
25
26
|
private filledRunningPromise?: RunningPromise;
|
|
26
27
|
private syncDateProviderPromise?: RunningPromise;
|
|
@@ -50,11 +51,12 @@ export class AnvilTestWatcher {
|
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
setIsMarkingAsProven(isMarkingAsProven: boolean) {
|
|
54
|
+
this.logger.warn(`Watcher is now ${isMarkingAsProven ? 'marking' : 'not marking'} blocks as proven`);
|
|
53
55
|
this.isMarkingAsProven = isMarkingAsProven;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
this.
|
|
58
|
+
setisLocalNetwork(isLocalNetwork: boolean) {
|
|
59
|
+
this.isLocalNetwork = isLocalNetwork;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
async start() {
|
|
@@ -67,7 +69,7 @@ export class AnvilTestWatcher {
|
|
|
67
69
|
|
|
68
70
|
// If auto mining is not supported (e.g., we are on a real network), then we
|
|
69
71
|
// will simple do nothing. But if on an anvil or the like, this make sure that
|
|
70
|
-
// the
|
|
72
|
+
// the local network and tests don't break because time is frozen and we never get to
|
|
71
73
|
// the next slot.
|
|
72
74
|
const isAutoMining = await this.cheatcodes.isAutoMining();
|
|
73
75
|
|
|
@@ -104,7 +106,7 @@ export class AnvilTestWatcher {
|
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
async syncDateProviderToL1IfBehind() {
|
|
107
|
-
// this doesn't apply to the
|
|
109
|
+
// this doesn't apply to the local network, because we don't have a date provider in the local network
|
|
108
110
|
if (!this.dateProvider) {
|
|
109
111
|
return;
|
|
110
112
|
}
|
|
@@ -122,17 +124,17 @@ export class AnvilTestWatcher {
|
|
|
122
124
|
|
|
123
125
|
async warpTimeIfNeeded() {
|
|
124
126
|
try {
|
|
125
|
-
const currentSlot = await this.rollup.read.getCurrentSlot();
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
const
|
|
127
|
+
const currentSlot = SlotNumber.fromBigInt(await this.rollup.read.getCurrentSlot());
|
|
128
|
+
const pendingCheckpointNumber = await this.rollup.read.getPendingCheckpointNumber();
|
|
129
|
+
const checkpointLog = await this.rollup.read.getCheckpoint([pendingCheckpointNumber]);
|
|
130
|
+
const nextSlot = SlotNumber(currentSlot + 1);
|
|
131
|
+
const nextSlotTimestamp = Number(await this.rollup.read.getTimestampForSlot([BigInt(nextSlot)]));
|
|
129
132
|
|
|
130
|
-
if (currentSlot ===
|
|
133
|
+
if (BigInt(currentSlot) === checkpointLog.slotNumber) {
|
|
131
134
|
// We should jump to the next slot
|
|
132
135
|
try {
|
|
133
136
|
await this.cheatcodes.warp(nextSlotTimestamp, {
|
|
134
137
|
resetBlockInterval: true,
|
|
135
|
-
updateDateProvider: this.dateProvider,
|
|
136
138
|
});
|
|
137
139
|
} catch (e) {
|
|
138
140
|
this.logger.error(`Failed to warp to timestamp ${nextSlotTimestamp}: ${e}`);
|
|
@@ -142,18 +144,15 @@ export class AnvilTestWatcher {
|
|
|
142
144
|
return;
|
|
143
145
|
}
|
|
144
146
|
|
|
145
|
-
// If we are not in
|
|
146
|
-
if (!this.
|
|
147
|
+
// If we are not in local network, we don't need to warp time
|
|
148
|
+
if (!this.isLocalNetwork) {
|
|
147
149
|
return;
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
const currentTimestamp = this.dateProvider?.now() ?? Date.now();
|
|
151
153
|
if (currentTimestamp > nextSlotTimestamp * 1000) {
|
|
152
154
|
try {
|
|
153
|
-
await this.cheatcodes.warp(nextSlotTimestamp, {
|
|
154
|
-
resetBlockInterval: true,
|
|
155
|
-
updateDateProvider: this.dateProvider,
|
|
156
|
-
});
|
|
155
|
+
await this.cheatcodes.warp(nextSlotTimestamp, { resetBlockInterval: true });
|
|
157
156
|
} catch (e) {
|
|
158
157
|
this.logger.error(`Failed to warp to timestamp ${nextSlotTimestamp}: ${e}`);
|
|
159
158
|
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { retryUntil } from '@aztec/aztec.js';
|
|
2
1
|
import { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { retryUntil } from '@aztec/foundation/retry';
|
|
4
|
+
import type { DateProvider } from '@aztec/foundation/timer';
|
|
3
5
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
4
|
-
import type { AztecNode
|
|
5
|
-
|
|
6
|
-
import { AztecCheatCodes } from './aztec_cheat_codes.js';
|
|
6
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A class that provides utility functions for interacting with the chain.
|
|
10
|
+
* @deprecated There used to be 3 kinds of cheat codes: eth, rollup and aztec. We have nuked the Aztec ones because
|
|
11
|
+
* they became unused (we now have better testing tools). If you are introducing a new functionality to the cheat
|
|
12
|
+
* codes, please consider whether it makes sense to just introduce new utils in your tests instead.
|
|
10
13
|
*/
|
|
11
14
|
export class CheatCodes {
|
|
12
15
|
constructor(
|
|
13
16
|
/** Cheat codes for L1.*/
|
|
14
17
|
public eth: EthCheatCodes,
|
|
15
|
-
/** Cheat codes for Aztec L2. */
|
|
16
|
-
public aztec: AztecCheatCodes,
|
|
17
18
|
/** Cheat codes for the Aztec Rollup contract on L1. */
|
|
18
19
|
public rollup: RollupCheatCodes,
|
|
19
20
|
) {}
|
|
20
21
|
|
|
21
|
-
static async create(rpcUrls: string[],
|
|
22
|
-
const ethCheatCodes = new EthCheatCodes(rpcUrls);
|
|
23
|
-
const aztecCheatCodes = new AztecCheatCodes(pxe);
|
|
22
|
+
static async create(rpcUrls: string[], node: AztecNode, dateProvider: DateProvider): Promise<CheatCodes> {
|
|
23
|
+
const ethCheatCodes = new EthCheatCodes(rpcUrls, dateProvider);
|
|
24
24
|
const rollupCheatCodes = new RollupCheatCodes(
|
|
25
25
|
ethCheatCodes,
|
|
26
|
-
await
|
|
26
|
+
await node.getNodeInfo().then(n => n.l1ContractAddresses),
|
|
27
27
|
);
|
|
28
|
-
return new CheatCodes(ethCheatCodes,
|
|
28
|
+
return new CheatCodes(ethCheatCodes, rollupCheatCodes);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
/**
|
|
@@ -38,7 +38,7 @@ export class CheatCodes {
|
|
|
38
38
|
* @param targetTimestamp - The target timestamp to warp to (in seconds)
|
|
39
39
|
*/
|
|
40
40
|
async warpL2TimeAtLeastTo(sequencerClient: SequencerClient, node: AztecNode, targetTimestamp: bigint | number) {
|
|
41
|
-
const currentL2BlockNumber = await node.getBlockNumber();
|
|
41
|
+
const currentL2BlockNumber: BlockNumber = await node.getBlockNumber();
|
|
42
42
|
|
|
43
43
|
// We warp the L1 timestamp
|
|
44
44
|
await this.eth.warp(targetTimestamp, { resetBlockInterval: true });
|
|
@@ -50,7 +50,7 @@ export class CheatCodes {
|
|
|
50
50
|
|
|
51
51
|
await retryUntil(
|
|
52
52
|
async () => {
|
|
53
|
-
const newL2BlockNumber = await node.getBlockNumber();
|
|
53
|
+
const newL2BlockNumber: BlockNumber = await node.getBlockNumber();
|
|
54
54
|
return newL2BlockNumber > currentL2BlockNumber;
|
|
55
55
|
},
|
|
56
56
|
'new block after warping L2 time',
|
package/src/testing/index.ts
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type L1ContractsConfig } from '@aztec/ethereum';
|
|
2
|
-
import type { NetworkNames } from '@aztec/foundation/config';
|
|
3
|
-
import type { SharedNodeConfig } from '@aztec/node-lib/config';
|
|
4
|
-
import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
5
|
-
export type L2ChainConfig = L1ContractsConfig & Omit<SlasherConfig, 'slashValidatorsNever' | 'slashValidatorsAlways'> & {
|
|
6
|
-
l1ChainId: number;
|
|
7
|
-
testAccounts: boolean;
|
|
8
|
-
sponsoredFPC: boolean;
|
|
9
|
-
p2pEnabled: boolean;
|
|
10
|
-
p2pBootstrapNodes: string[];
|
|
11
|
-
registryAddress: string;
|
|
12
|
-
slashFactoryAddress: string;
|
|
13
|
-
feeAssetHandlerAddress: string;
|
|
14
|
-
seqMinTxsPerBlock: number;
|
|
15
|
-
seqMaxTxsPerBlock: number;
|
|
16
|
-
realProofs: boolean;
|
|
17
|
-
snapshotsUrl: string;
|
|
18
|
-
autoUpdate: SharedNodeConfig['autoUpdate'];
|
|
19
|
-
autoUpdateUrl?: string;
|
|
20
|
-
maxTxPoolSize: number;
|
|
21
|
-
publicIncludeMetrics?: string[];
|
|
22
|
-
publicMetricsCollectorUrl?: string;
|
|
23
|
-
publicMetricsCollectFrom?: string[];
|
|
24
|
-
sentinelEnabled: boolean;
|
|
25
|
-
};
|
|
26
|
-
export declare const testnetIgnitionL2ChainConfig: L2ChainConfig;
|
|
27
|
-
export declare const alphaTestnetL2ChainConfig: L2ChainConfig;
|
|
28
|
-
export declare function getBootnodes(networkName: NetworkNames, cacheDir?: string): Promise<any>;
|
|
29
|
-
export declare function getL2ChainConfig(networkName: NetworkNames, cacheDir?: string): Promise<L2ChainConfig | undefined>;
|
|
30
|
-
export declare function enrichEnvironmentWithChainConfig(networkName: NetworkNames): Promise<void>;
|
|
31
|
-
//# sourceMappingURL=chain_l2_config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,KAAK,EAAU,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAOrE,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,IAAI,CAAC,aAAa,EAAE,sBAAsB,GAAG,uBAAuB,CAAC,GAAG;IACtE,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IAGpC,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEJ,eAAO,MAAM,4BAA4B,EAAE,aAqD1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aA4EvC,CAAC;AAIF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,gBAgC9E;AAED,wBAAsB,gBAAgB,CACpC,WAAW,EAAE,YAAY,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpC;AAgCD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAyF/E"}
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { EthAddress } from '@aztec/aztec.js';
|
|
2
|
-
import { DefaultL1ContractsConfig } from '@aztec/ethereum';
|
|
3
|
-
import { mkdir, readFile, stat, writeFile } from 'fs/promises';
|
|
4
|
-
import path, { dirname, join } from 'path';
|
|
5
|
-
import publicIncludeMetrics from '../../public_include_metric_prefixes.json' with {
|
|
6
|
-
type: 'json'
|
|
7
|
-
};
|
|
8
|
-
export const testnetIgnitionL2ChainConfig = {
|
|
9
|
-
l1ChainId: 11155111,
|
|
10
|
-
testAccounts: true,
|
|
11
|
-
sponsoredFPC: false,
|
|
12
|
-
p2pEnabled: true,
|
|
13
|
-
p2pBootstrapNodes: [],
|
|
14
|
-
registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3',
|
|
15
|
-
slashFactoryAddress: '',
|
|
16
|
-
feeAssetHandlerAddress: '',
|
|
17
|
-
seqMinTxsPerBlock: 0,
|
|
18
|
-
seqMaxTxsPerBlock: 0,
|
|
19
|
-
realProofs: true,
|
|
20
|
-
snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
|
|
21
|
-
autoUpdate: 'disabled',
|
|
22
|
-
autoUpdateUrl: undefined,
|
|
23
|
-
maxTxPoolSize: 100_000_000,
|
|
24
|
-
...DefaultL1ContractsConfig,
|
|
25
|
-
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
26
|
-
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
27
|
-
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
28
|
-
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
29
|
-
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
30
|
-
/** The mana target for the rollup */ manaTarget: 0n,
|
|
31
|
-
/** The proving cost per mana */ provingCostPerMana: 0n,
|
|
32
|
-
slasherFlavor: 'none',
|
|
33
|
-
slashAmountSmall: 0n,
|
|
34
|
-
slashAmountMedium: 0n,
|
|
35
|
-
slashAmountLarge: 0n,
|
|
36
|
-
slashMinPenaltyPercentage: 0.5,
|
|
37
|
-
slashMaxPenaltyPercentage: 200,
|
|
38
|
-
slashInactivityTargetPercentage: 0,
|
|
39
|
-
slashInactivityConsecutiveEpochThreshold: 1,
|
|
40
|
-
slashInactivityPenalty: 0n,
|
|
41
|
-
slashPrunePenalty: 0n,
|
|
42
|
-
slashDataWithholdingPenalty: 0n,
|
|
43
|
-
slashProposeInvalidAttestationsPenalty: 0n,
|
|
44
|
-
slashAttestDescendantOfInvalidPenalty: 0n,
|
|
45
|
-
slashBroadcastedInvalidBlockPenalty: 0n,
|
|
46
|
-
slashMaxPayloadSize: 50,
|
|
47
|
-
slashGracePeriodL2Slots: 0,
|
|
48
|
-
slashUnknownPenalty: 0n,
|
|
49
|
-
slashOffenseExpirationRounds: 10,
|
|
50
|
-
sentinelEnabled: false
|
|
51
|
-
};
|
|
52
|
-
export const alphaTestnetL2ChainConfig = {
|
|
53
|
-
l1ChainId: 11155111,
|
|
54
|
-
testAccounts: false,
|
|
55
|
-
sponsoredFPC: true,
|
|
56
|
-
p2pEnabled: true,
|
|
57
|
-
p2pBootstrapNodes: [],
|
|
58
|
-
registryAddress: '0xec4156431d0f3df66d4e24ba3d30dcb4c85fa309',
|
|
59
|
-
slashFactoryAddress: '0x8b1566249dc8fb47234037538ce491f9500480b1',
|
|
60
|
-
feeAssetHandlerAddress: '0x4f0376b8bcbdf72ddb38c38f48317c00e9c9aec3',
|
|
61
|
-
seqMinTxsPerBlock: 0,
|
|
62
|
-
seqMaxTxsPerBlock: 20,
|
|
63
|
-
realProofs: true,
|
|
64
|
-
snapshotsUrl: 'https://storage.googleapis.com/aztec-testnet/snapshots/',
|
|
65
|
-
autoUpdate: 'config-and-version',
|
|
66
|
-
autoUpdateUrl: 'https://storage.googleapis.com/aztec-testnet/auto-update/alpha-testnet.json',
|
|
67
|
-
maxTxPoolSize: 100_000_000,
|
|
68
|
-
publicIncludeMetrics,
|
|
69
|
-
publicMetricsCollectorUrl: 'https://telemetry.alpha-testnet.aztec-labs.com/v1/metrics',
|
|
70
|
-
publicMetricsCollectFrom: [
|
|
71
|
-
'sequencer'
|
|
72
|
-
],
|
|
73
|
-
// Deployment stuff
|
|
74
|
-
/** How many seconds an L1 slot lasts. */ ethereumSlotDuration: 12,
|
|
75
|
-
/** How many seconds an L2 slots lasts (must be multiple of ethereum slot duration). */ aztecSlotDuration: 36,
|
|
76
|
-
/** How many L2 slots an epoch lasts. */ aztecEpochDuration: 32,
|
|
77
|
-
/** The target validator committee size. */ aztecTargetCommitteeSize: 48,
|
|
78
|
-
/** The number of epochs after an epoch ends that proofs are still accepted. */ aztecProofSubmissionEpochs: 1,
|
|
79
|
-
/** The deposit amount for a validator */ activationThreshold: DefaultL1ContractsConfig.activationThreshold,
|
|
80
|
-
/** The minimum stake for a validator. */ ejectionThreshold: DefaultL1ContractsConfig.ejectionThreshold,
|
|
81
|
-
/** The slashing round size */ slashingRoundSizeInEpochs: 4,
|
|
82
|
-
/** Governance proposing round size */ governanceProposerRoundSize: 300,
|
|
83
|
-
/** The mana target for the rollup */ manaTarget: DefaultL1ContractsConfig.manaTarget,
|
|
84
|
-
/** The proving cost per mana */ provingCostPerMana: DefaultL1ContractsConfig.provingCostPerMana,
|
|
85
|
-
/** Exit delay for stakers */ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
86
|
-
/** Tally-style slashing */ slasherFlavor: 'tally',
|
|
87
|
-
/** Allow one round for vetoing */ slashingExecutionDelayInRounds: 1,
|
|
88
|
-
/** How long for a slash payload to be executed */ slashingLifetimeInRounds: 4,
|
|
89
|
-
/** Allow 2 rounds to discover faults */ slashingOffsetInRounds: 2,
|
|
90
|
-
/** No slash vetoer */ slashingVetoer: EthAddress.ZERO,
|
|
91
|
-
/** Use default slash amounts */ slashAmountSmall: DefaultL1ContractsConfig.slashAmountSmall,
|
|
92
|
-
slashAmountMedium: DefaultL1ContractsConfig.slashAmountMedium,
|
|
93
|
-
slashAmountLarge: DefaultL1ContractsConfig.slashAmountLarge,
|
|
94
|
-
// Slashing stuff
|
|
95
|
-
slashMinPenaltyPercentage: 0.5,
|
|
96
|
-
slashMaxPenaltyPercentage: 2.0,
|
|
97
|
-
slashInactivityTargetPercentage: 0.7,
|
|
98
|
-
slashInactivityConsecutiveEpochThreshold: 1,
|
|
99
|
-
slashInactivityPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
100
|
-
slashPrunePenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
101
|
-
slashDataWithholdingPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
102
|
-
slashProposeInvalidAttestationsPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
103
|
-
slashAttestDescendantOfInvalidPenalty: DefaultL1ContractsConfig.slashAmountLarge,
|
|
104
|
-
slashUnknownPenalty: DefaultL1ContractsConfig.slashAmountSmall,
|
|
105
|
-
slashBroadcastedInvalidBlockPenalty: DefaultL1ContractsConfig.slashAmountMedium,
|
|
106
|
-
slashMaxPayloadSize: 50,
|
|
107
|
-
slashGracePeriodL2Slots: 32 * 2,
|
|
108
|
-
slashOffenseExpirationRounds: 8,
|
|
109
|
-
sentinelEnabled: true
|
|
110
|
-
};
|
|
111
|
-
const BOOTNODE_CACHE_DURATION_MS = 60 * 60 * 1000; // 1 hour;
|
|
112
|
-
export async function getBootnodes(networkName, cacheDir) {
|
|
113
|
-
const cacheFile = cacheDir ? join(cacheDir, networkName, 'bootnodes.json') : undefined;
|
|
114
|
-
try {
|
|
115
|
-
if (cacheFile) {
|
|
116
|
-
const info = await stat(cacheFile);
|
|
117
|
-
if (info.mtimeMs + BOOTNODE_CACHE_DURATION_MS > Date.now()) {
|
|
118
|
-
return JSON.parse(await readFile(cacheFile, 'utf-8'))['bootnodes'];
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
} catch {
|
|
122
|
-
// no-op. Get the remote-file
|
|
123
|
-
}
|
|
124
|
-
const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
|
|
125
|
-
const response = await fetch(url);
|
|
126
|
-
if (!response.ok) {
|
|
127
|
-
throw new Error(`Failed to fetch basic contract addresses from ${url}. Check you are using a correct network name.`);
|
|
128
|
-
}
|
|
129
|
-
const json = await response.json();
|
|
130
|
-
try {
|
|
131
|
-
if (cacheFile) {
|
|
132
|
-
await mkdir(dirname(cacheFile), {
|
|
133
|
-
recursive: true
|
|
134
|
-
});
|
|
135
|
-
await writeFile(cacheFile, JSON.stringify(json), 'utf-8');
|
|
136
|
-
}
|
|
137
|
-
} catch {
|
|
138
|
-
// no-op
|
|
139
|
-
}
|
|
140
|
-
return json['bootnodes'];
|
|
141
|
-
}
|
|
142
|
-
export async function getL2ChainConfig(networkName, cacheDir) {
|
|
143
|
-
if (networkName === 'testnet-ignition') {
|
|
144
|
-
const config = {
|
|
145
|
-
...testnetIgnitionL2ChainConfig
|
|
146
|
-
};
|
|
147
|
-
config.p2pBootstrapNodes = await getBootnodes(networkName, cacheDir);
|
|
148
|
-
return config;
|
|
149
|
-
} else if (networkName === 'alpha-testnet' || networkName === 'testnet') {
|
|
150
|
-
const config = {
|
|
151
|
-
...alphaTestnetL2ChainConfig
|
|
152
|
-
};
|
|
153
|
-
config.p2pBootstrapNodes = await getBootnodes('alpha-testnet', cacheDir);
|
|
154
|
-
return config;
|
|
155
|
-
}
|
|
156
|
-
return undefined;
|
|
157
|
-
}
|
|
158
|
-
function enrichVar(envVar, value) {
|
|
159
|
-
// Don't override
|
|
160
|
-
if (process.env[envVar] || value === undefined) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
process.env[envVar] = value;
|
|
164
|
-
}
|
|
165
|
-
function enrichEthAddressVar(envVar, value) {
|
|
166
|
-
// EthAddress doesn't like being given empty strings
|
|
167
|
-
if (value === '') {
|
|
168
|
-
enrichVar(envVar, EthAddress.ZERO.toString());
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
enrichVar(envVar, value);
|
|
172
|
-
}
|
|
173
|
-
function getDefaultDataDir(networkName) {
|
|
174
|
-
let prefix;
|
|
175
|
-
if (networkName === 'testnet-ignition') {
|
|
176
|
-
prefix = 'testnet-ignition';
|
|
177
|
-
} else if (networkName === 'alpha-testnet' || networkName === 'testnet') {
|
|
178
|
-
prefix = 'alpha-testnet';
|
|
179
|
-
} else {
|
|
180
|
-
prefix = networkName;
|
|
181
|
-
}
|
|
182
|
-
return path.join(process.env.HOME || '~', '.aztec', prefix, 'data');
|
|
183
|
-
}
|
|
184
|
-
export async function enrichEnvironmentWithChainConfig(networkName) {
|
|
185
|
-
if (networkName === 'local') {
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
enrichVar('DATA_DIRECTORY', getDefaultDataDir(networkName));
|
|
189
|
-
const cacheDir = process.env.DATA_DIRECTORY ? join(process.env.DATA_DIRECTORY, 'cache') : undefined;
|
|
190
|
-
const config = await getL2ChainConfig(networkName, cacheDir);
|
|
191
|
-
if (!config) {
|
|
192
|
-
throw new Error(`Unknown network name: ${networkName}`);
|
|
193
|
-
}
|
|
194
|
-
enrichVar('BOOTSTRAP_NODES', config.p2pBootstrapNodes.join(','));
|
|
195
|
-
enrichVar('TEST_ACCOUNTS', config.testAccounts.toString());
|
|
196
|
-
enrichVar('SPONSORED_FPC', config.sponsoredFPC.toString());
|
|
197
|
-
enrichVar('P2P_ENABLED', config.p2pEnabled.toString());
|
|
198
|
-
enrichVar('L1_CHAIN_ID', config.l1ChainId.toString());
|
|
199
|
-
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
200
|
-
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
201
|
-
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
202
|
-
enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
|
|
203
|
-
enrichVar('SYNC_SNAPSHOTS_URL', config.snapshotsUrl);
|
|
204
|
-
enrichVar('P2P_MAX_TX_POOL_SIZE', config.maxTxPoolSize.toString());
|
|
205
|
-
if (config.autoUpdate) {
|
|
206
|
-
enrichVar('AUTO_UPDATE', config.autoUpdate?.toString());
|
|
207
|
-
}
|
|
208
|
-
if (config.autoUpdateUrl) {
|
|
209
|
-
enrichVar('AUTO_UPDATE_URL', config.autoUpdateUrl);
|
|
210
|
-
}
|
|
211
|
-
if (config.publicIncludeMetrics) {
|
|
212
|
-
enrichVar('PUBLIC_OTEL_INCLUDE_METRICS', config.publicIncludeMetrics.join(','));
|
|
213
|
-
}
|
|
214
|
-
if (config.publicMetricsCollectorUrl) {
|
|
215
|
-
enrichVar('PUBLIC_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT', config.publicMetricsCollectorUrl);
|
|
216
|
-
}
|
|
217
|
-
if (config.publicMetricsCollectFrom) {
|
|
218
|
-
enrichVar('PUBLIC_OTEL_COLLECT_FROM', config.publicMetricsCollectFrom.join(','));
|
|
219
|
-
}
|
|
220
|
-
enrichEthAddressVar('REGISTRY_CONTRACT_ADDRESS', config.registryAddress);
|
|
221
|
-
enrichEthAddressVar('SLASH_FACTORY_CONTRACT_ADDRESS', config.slashFactoryAddress);
|
|
222
|
-
enrichEthAddressVar('FEE_ASSET_HANDLER_CONTRACT_ADDRESS', config.feeAssetHandlerAddress);
|
|
223
|
-
// Deployment stuff
|
|
224
|
-
enrichVar('ETHEREUM_SLOT_DURATION', config.ethereumSlotDuration.toString());
|
|
225
|
-
enrichVar('AZTEC_SLOT_DURATION', config.aztecSlotDuration.toString());
|
|
226
|
-
enrichVar('AZTEC_EPOCH_DURATION', config.aztecEpochDuration.toString());
|
|
227
|
-
enrichVar('AZTEC_TARGET_COMMITTEE_SIZE', config.aztecTargetCommitteeSize.toString());
|
|
228
|
-
enrichVar('AZTEC_PROOF_SUBMISSION_EPOCHS', config.aztecProofSubmissionEpochs.toString());
|
|
229
|
-
enrichVar('AZTEC_ACTIVATION_THRESHOLD', config.activationThreshold.toString());
|
|
230
|
-
enrichVar('AZTEC_EJECTION_THRESHOLD', config.ejectionThreshold.toString());
|
|
231
|
-
enrichVar('AZTEC_SLASHING_QUORUM', config.slashingQuorum?.toString());
|
|
232
|
-
enrichVar('AZTEC_SLASHING_ROUND_SIZE_IN_EPOCHS', config.slashingRoundSizeInEpochs.toString());
|
|
233
|
-
enrichVar('AZTEC_GOVERNANCE_PROPOSER_QUORUM', config.governanceProposerQuorum?.toString());
|
|
234
|
-
enrichVar('AZTEC_GOVERNANCE_PROPOSER_ROUND_SIZE', config.governanceProposerRoundSize.toString());
|
|
235
|
-
enrichVar('AZTEC_MANA_TARGET', config.manaTarget.toString());
|
|
236
|
-
enrichVar('AZTEC_PROVING_COST_PER_MANA', config.provingCostPerMana.toString());
|
|
237
|
-
enrichVar('AZTEC_SLASH_AMOUNT_SMALL', config.slashAmountSmall.toString());
|
|
238
|
-
enrichVar('AZTEC_SLASH_AMOUNT_MEDIUM', config.slashAmountMedium.toString());
|
|
239
|
-
enrichVar('AZTEC_SLASH_AMOUNT_LARGE', config.slashAmountLarge.toString());
|
|
240
|
-
enrichVar('AZTEC_SLASHING_LIFETIME_IN_ROUNDS', config.slashingLifetimeInRounds.toString());
|
|
241
|
-
enrichVar('AZTEC_SLASHING_EXECUTION_DELAY_IN_ROUNDS', config.slashingExecutionDelayInRounds.toString());
|
|
242
|
-
enrichVar('AZTEC_SLASHING_OFFSET_IN_ROUNDS', config.slashingOffsetInRounds.toString());
|
|
243
|
-
enrichVar('AZTEC_SLASHER_FLAVOR', config.slasherFlavor);
|
|
244
|
-
enrichVar('AZTEC_EXIT_DELAY_SECONDS', config.exitDelaySeconds.toString());
|
|
245
|
-
enrichEthAddressVar('AZTEC_SLASHING_VETOER', config.slashingVetoer.toString());
|
|
246
|
-
// Slashing
|
|
247
|
-
enrichVar('SLASH_MIN_PENALTY_PERCENTAGE', config.slashMinPenaltyPercentage.toString());
|
|
248
|
-
enrichVar('SLASH_MAX_PENALTY_PERCENTAGE', config.slashMaxPenaltyPercentage.toString());
|
|
249
|
-
enrichVar('SLASH_PRUNE_PENALTY', config.slashPrunePenalty.toString());
|
|
250
|
-
enrichVar('SLASH_DATA_WITHHOLDING_PENALTY', config.slashDataWithholdingPenalty.toString());
|
|
251
|
-
enrichVar('SLASH_INACTIVITY_TARGET_PERCENTAGE', config.slashInactivityTargetPercentage.toString());
|
|
252
|
-
enrichVar('SLASH_INACTIVITY_CONSECUTIVE_EPOCH_THRESHOLD', config.slashInactivityConsecutiveEpochThreshold.toString());
|
|
253
|
-
enrichVar('SLASH_INACTIVITY_PENALTY', config.slashInactivityPenalty.toString());
|
|
254
|
-
enrichVar('SLASH_PROPOSE_INVALID_ATTESTATIONS_PENALTY', config.slashProposeInvalidAttestationsPenalty.toString());
|
|
255
|
-
enrichVar('SLASH_ATTEST_DESCENDANT_OF_INVALID_PENALTY', config.slashAttestDescendantOfInvalidPenalty.toString());
|
|
256
|
-
enrichVar('SLASH_UNKNOWN_PENALTY', config.slashUnknownPenalty.toString());
|
|
257
|
-
enrichVar('SLASH_INVALID_BLOCK_PENALTY', config.slashBroadcastedInvalidBlockPenalty.toString());
|
|
258
|
-
enrichVar('SLASH_OFFENSE_EXPIRATION_ROUNDS', config.slashOffenseExpirationRounds.toString());
|
|
259
|
-
enrichVar('SLASH_MAX_PAYLOAD_SIZE', config.slashMaxPayloadSize.toString());
|
|
260
|
-
enrichVar('SENTINEL_ENABLED', config.sentinelEnabled.toString());
|
|
261
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start_blob_sink.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_blob_sink.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAMnD,wBAAsB,aAAa,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,iBA4CxG"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { blobSinkConfigMappings, createBlobSinkServer, getBlobSinkConfigFromEnv } from '@aztec/blob-sink/server';
|
|
2
|
-
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
3
|
-
import { getL1Config } from '../get_l1_config.js';
|
|
4
|
-
import { extractRelevantOptions } from '../util.js';
|
|
5
|
-
export async function startBlobSink(options, signalHandlers, userLog) {
|
|
6
|
-
if (options.prover || options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) {
|
|
7
|
-
userLog(`Starting a blob sink with --node, --sequencer, --pxe, --p2p-bootstrap, --prover or --txe is not supported.`);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
let blobSinkConfig = {
|
|
11
|
-
...getBlobSinkConfigFromEnv(),
|
|
12
|
-
...extractRelevantOptions(options, blobSinkConfigMappings, 'blobSink')
|
|
13
|
-
};
|
|
14
|
-
if (!blobSinkConfig.l1Contracts?.registryAddress || blobSinkConfig.l1Contracts.registryAddress.isZero()) {
|
|
15
|
-
throw new Error('REGISTRY_CONTRACT_ADDRESS not set');
|
|
16
|
-
}
|
|
17
|
-
if (!blobSinkConfig.l1RpcUrls || blobSinkConfig.l1RpcUrls.length === 0) {
|
|
18
|
-
throw new Error('ETHEREUM_HOSTS not set');
|
|
19
|
-
}
|
|
20
|
-
if (typeof blobSinkConfig.l1ChainId !== 'number') {
|
|
21
|
-
throw new Error('L1_CHAIN_ID');
|
|
22
|
-
}
|
|
23
|
-
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
24
|
-
const { config: chainConfig, addresses } = await getL1Config(blobSinkConfig.l1Contracts.registryAddress, blobSinkConfig.l1RpcUrls, blobSinkConfig.l1ChainId, blobSinkConfig.rollupVersion);
|
|
25
|
-
blobSinkConfig = {
|
|
26
|
-
...blobSinkConfig,
|
|
27
|
-
l1Contracts: addresses,
|
|
28
|
-
...chainConfig
|
|
29
|
-
};
|
|
30
|
-
const blobSink = await createBlobSinkServer(blobSinkConfig, telemetry);
|
|
31
|
-
signalHandlers.push(blobSink.stop.bind(blobSink));
|
|
32
|
-
await blobSink.start();
|
|
33
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
2
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
import { type CliPXEOptions, type PXEService, type PXEServiceConfig } from '@aztec/pxe/server';
|
|
4
|
-
import { type AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
|
-
export type { PXEServiceConfig, CliPXEOptions };
|
|
6
|
-
export declare function startPXE(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, userLog: LogFn): Promise<{
|
|
7
|
-
pxe: PXEService;
|
|
8
|
-
config: PXEServiceConfig & CliPXEOptions;
|
|
9
|
-
}>;
|
|
10
|
-
export declare function addPXE(options: any, _signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, userLog: LogFn, deps?: {
|
|
11
|
-
node?: AztecNode;
|
|
12
|
-
}): Promise<{
|
|
13
|
-
pxe: PXEService;
|
|
14
|
-
config: PXEServiceConfig & CliPXEOptions;
|
|
15
|
-
}>;
|
|
16
|
-
//# sourceMappingURL=start_pxe.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start_pxe.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_pxe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,gBAAgB,EAGtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,SAAS,EAAoC,MAAM,iCAAiC,CAAC;AAMnG,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,CAAC;AAEhD,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,GAAG,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,gBAAgB,GAAG,aAAa,CAAA;CAAE,CAAC,CAExE;AAED,wBAAsB,MAAM,CAC1B,OAAO,EAAE,GAAG,EACZ,eAAe,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACxC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,EACd,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,SAAS,CAAA;CAAO,GAC9B,OAAO,CAAC;IAAE,GAAG,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,gBAAgB,GAAG,aAAa,CAAA;CAAE,CAAC,CAgBxE"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { allPxeConfigMappings, createPXEService } from '@aztec/pxe/server';
|
|
2
|
-
import { PXESchema, createAztecNodeClient } from '@aztec/stdlib/interfaces/client';
|
|
3
|
-
import { makeTracedFetch } from '@aztec/telemetry-client';
|
|
4
|
-
import { extractRelevantOptions } from '../util.js';
|
|
5
|
-
import { getVersions } from '../versioning.js';
|
|
6
|
-
export async function startPXE(options, signalHandlers, services, userLog) {
|
|
7
|
-
return await addPXE(options, signalHandlers, services, userLog, {});
|
|
8
|
-
}
|
|
9
|
-
export async function addPXE(options, _signalHandlers, services, userLog, deps = {}) {
|
|
10
|
-
const pxeConfig = extractRelevantOptions(options, allPxeConfigMappings, 'pxe');
|
|
11
|
-
const nodeUrl = pxeConfig.nodeUrl;
|
|
12
|
-
if (!nodeUrl && !deps.node) {
|
|
13
|
-
userLog('Aztec Node URL (nodeUrl | AZTEC_NODE_URL) option is required to start PXE without --node option');
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
const node = deps.node ?? createAztecNodeClient(nodeUrl, getVersions(pxeConfig), makeTracedFetch([
|
|
17
|
-
1,
|
|
18
|
-
2,
|
|
19
|
-
3
|
|
20
|
-
], true));
|
|
21
|
-
const pxe = await createPXEService(node, pxeConfig);
|
|
22
|
-
// Add PXE to services list
|
|
23
|
-
services.pxe = [
|
|
24
|
-
pxe,
|
|
25
|
-
PXESchema
|
|
26
|
-
];
|
|
27
|
-
return {
|
|
28
|
-
pxe,
|
|
29
|
-
config: pxeConfig
|
|
30
|
-
};
|
|
31
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type L1ContractAddresses, getL1ContractsConfig } from '@aztec/ethereum';
|
|
2
|
-
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
-
export declare function getL1Config(registryAddress: EthAddress, l1RpcUrls: string[], l1ChainId: number, rollupVersion?: number | 'canonical'): Promise<{
|
|
4
|
-
addresses: L1ContractAddresses;
|
|
5
|
-
config: Awaited<ReturnType<typeof getL1ContractsConfig>>;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=get_l1_config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_l1_config.d.ts","sourceRoot":"","sources":["../../src/cli/get_l1_config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAoB,oBAAoB,EAAmB,MAAM,iBAAiB,CAAC;AACpH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,wBAAsB,WAAW,CAC/B,eAAe,EAAE,UAAU,EAC3B,SAAS,EAAE,MAAM,EAAE,EACnB,SAAS,EAAE,MAAM,EACjB,aAAa,GAAE,MAAM,GAAG,WAAyB,GAChD,OAAO,CAAC;IAAE,SAAS,EAAE,mBAAmB,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAA;CAAE,CAAC,CAUvG"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RegistryContract, getL1ContractsConfig, getPublicClient } from '@aztec/ethereum';
|
|
2
|
-
export async function getL1Config(registryAddress, l1RpcUrls, l1ChainId, rollupVersion = 'canonical') {
|
|
3
|
-
const publicClient = getPublicClient({
|
|
4
|
-
l1RpcUrls,
|
|
5
|
-
l1ChainId
|
|
6
|
-
});
|
|
7
|
-
const addresses = await RegistryContract.collectAddresses(publicClient, registryAddress, rollupVersion);
|
|
8
|
-
const config = await getL1ContractsConfig(publicClient, addresses);
|
|
9
|
-
return {
|
|
10
|
-
addresses,
|
|
11
|
-
config
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type InitialAccountData } from '@aztec/accounts/testing';
|
|
2
|
-
import type { Wallet } from '@aztec/aztec.js';
|
|
3
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
4
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
6
|
-
export declare function getBananaCoinAddress(initialAccounts: InitialAccountData[]): Promise<AztecAddress>;
|
|
7
|
-
export declare function getBananaFPCAddress(initialAccounts: InitialAccountData[]): Promise<AztecAddress>;
|
|
8
|
-
export declare function setupBananaFPC(initialAccounts: InitialAccountData[], deployer: Wallet, log: LogFn): Promise<void>;
|
|
9
|
-
export declare function getDeployedBananaCoinAddress(pxe: PXE): Promise<AztecAddress>;
|
|
10
|
-
export declare function getDeployedBananaFPCAddress(pxe: PXE): Promise<AztecAddress>;
|
|
11
|
-
//# sourceMappingURL=banana_fpc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"banana_fpc.d.ts","sourceRoot":"","sources":["../../src/sandbox/banana_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA0B,MAAM,yBAAyB,CAAC;AAC1F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAuB3D,wBAAsB,oBAAoB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE/E;AAWD,wBAAsB,mBAAmB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE9E;AAED,wBAAsB,cAAc,CAAC,eAAe,EAAE,kBAAkB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAcvG;AAED,wBAAsB,4BAA4B,CAAC,GAAG,EAAE,GAAG,yBAQ1D;AAED,wBAAsB,2BAA2B,CAAC,GAAG,EAAE,GAAG,yBAQzD"}
|
package/dest/sandbox/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dest/sandbox/index.js
DELETED