@aztec/aztec 0.0.1-fake-ceab37513c → 0.0.6-commit.a2d1860fe9
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 +14 -9
- package/dest/cli/admin_api_key_store.d.ts +45 -0
- package/dest/cli/admin_api_key_store.d.ts.map +1 -0
- package/dest/cli/admin_api_key_store.js +98 -0
- 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 +59 -34
- 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 +46 -45
- package/dest/cli/cli.d.ts +1 -1
- package/dest/cli/cli.js +7 -7
- package/dest/cli/cmds/compile.d.ts +4 -0
- package/dest/cli/cmds/compile.d.ts.map +1 -0
- package/dest/cli/cmds/compile.js +95 -0
- package/dest/cli/cmds/migrate_ha_db.d.ts +3 -0
- package/dest/cli/cmds/migrate_ha_db.d.ts.map +1 -0
- package/dest/cli/cmds/migrate_ha_db.js +27 -0
- 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 +12 -14
- 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 +18 -18
- 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 +71 -27
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts +2 -2
- package/dest/cli/cmds/start_p2p_bootstrap.d.ts.map +1 -1
- package/dest/cli/cmds/start_p2p_bootstrap.js +2 -3
- 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 +4 -4
- 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 +4 -4
- 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 -19
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +16 -11
- 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 +21 -19
- 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 +17 -21
- 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 +73 -0
- package/dest/local-network/local-network.d.ts.map +1 -0
- package/dest/{sandbox/sandbox.js → local-network/local-network.js} +83 -66
- 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 +12 -4
- package/dest/testing/anvil_test_watcher.d.ts.map +1 -1
- package/dest/testing/anvil_test_watcher.js +69 -31
- package/dest/testing/cheat_codes.d.ts +7 -8
- package/dest/testing/cheat_codes.d.ts.map +1 -1
- package/dest/testing/cheat_codes.js +9 -10
- package/dest/testing/epoch_test_settler.d.ts +19 -0
- package/dest/testing/epoch_test_settler.d.ts.map +1 -0
- package/dest/testing/epoch_test_settler.js +62 -0
- package/dest/testing/index.d.ts +2 -2
- package/dest/testing/index.d.ts.map +1 -1
- package/dest/testing/index.js +1 -1
- package/package.json +41 -37
- package/scripts/aztec.sh +62 -0
- package/scripts/extract_function.js +47 -0
- package/scripts/flamegraph.sh +59 -0
- package/scripts/init.sh +35 -0
- package/scripts/new.sh +59 -0
- package/scripts/setup_project.sh +31 -0
- package/src/bin/index.ts +15 -9
- package/src/cli/admin_api_key_store.ts +128 -0
- package/src/cli/aztec_start_action.ts +62 -26
- package/src/cli/aztec_start_options.ts +47 -43
- package/src/cli/cli.ts +11 -11
- package/src/cli/cmds/compile.ts +107 -0
- package/src/cli/cmds/migrate_ha_db.ts +43 -0
- package/src/cli/cmds/start_archiver.ts +8 -19
- package/src/cli/cmds/start_bot.ts +27 -15
- package/src/cli/cmds/start_node.ts +64 -23
- package/src/cli/cmds/start_p2p_bootstrap.ts +3 -3
- package/src/cli/cmds/start_prover_agent.ts +4 -12
- package/src/cli/cmds/start_prover_broker.ts +7 -3
- package/src/cli/util.ts +23 -26
- package/src/cli/versioning.ts +3 -3
- package/src/examples/token.ts +20 -19
- package/src/examples/util.ts +2 -2
- package/src/index.ts +5 -5
- package/src/{sandbox → local-network}/banana_fpc.ts +24 -25
- package/src/local-network/index.ts +7 -0
- package/src/local-network/local-network.ts +267 -0
- package/src/local-network/sponsored_fpc.ts +26 -0
- package/src/testing/anvil_test_watcher.ts +77 -34
- package/src/testing/cheat_codes.ts +13 -13
- package/src/testing/epoch_test_settler.ts +71 -0
- package/src/testing/index.ts +1 -1
- 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_prover_node.d.ts +0 -7
- package/dest/cli/cmds/start_prover_node.d.ts.map +0 -1
- package/dest/cli/cmds/start_prover_node.js +0 -108
- 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/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 -84
- 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/cmds/start_blob_sink.ts +0 -57
- package/src/cli/cmds/start_prover_node.ts +0 -124
- package/src/cli/cmds/start_pxe.ts +0 -49
- package/src/sandbox/index.ts +0 -4
- package/src/sandbox/sandbox.ts +0 -253
- package/src/sandbox/sponsored_fpc.ts +0 -27
- package/src/testing/aztec_cheat_codes.ts +0 -77
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
2
|
+
import { type EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
|
+
import { type EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
4
|
+
import type { Logger } from '@aztec/foundation/log';
|
|
5
|
+
import { EpochMonitor } from '@aztec/prover-node';
|
|
6
|
+
import type { EthAddress, L2BlockSource } from '@aztec/stdlib/block';
|
|
7
|
+
import { computeL2ToL1MembershipWitnessFromMessagesInEpoch } from '@aztec/stdlib/messaging';
|
|
8
|
+
|
|
9
|
+
export class EpochTestSettler {
|
|
10
|
+
private rollupCheatCodes: RollupCheatCodes;
|
|
11
|
+
private epochMonitor?: EpochMonitor;
|
|
12
|
+
|
|
13
|
+
constructor(
|
|
14
|
+
cheatcodes: EthCheatCodes,
|
|
15
|
+
rollupAddress: EthAddress,
|
|
16
|
+
private l2BlockSource: L2BlockSource,
|
|
17
|
+
private log: Logger,
|
|
18
|
+
private options: { pollingIntervalMs: number; provingDelayMs?: number },
|
|
19
|
+
) {
|
|
20
|
+
this.rollupCheatCodes = new RollupCheatCodes(cheatcodes, { rollupAddress });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async start() {
|
|
24
|
+
const { epochDuration } = await this.rollupCheatCodes.getConfig();
|
|
25
|
+
this.epochMonitor = new EpochMonitor(this.l2BlockSource, { epochDuration: Number(epochDuration) }, this.options);
|
|
26
|
+
this.epochMonitor.start(this);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async stop() {
|
|
30
|
+
await this.epochMonitor?.stop();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async handleEpochReadyToProve(epoch: EpochNumber): Promise<boolean> {
|
|
34
|
+
const checkpointedBlocks = await this.l2BlockSource.getCheckpointedBlocksForEpoch(epoch);
|
|
35
|
+
const blocks = checkpointedBlocks.map(b => b.block);
|
|
36
|
+
this.log.info(
|
|
37
|
+
`Settling epoch ${epoch} with blocks ${blocks[0]?.header.getBlockNumber()} to ${blocks.at(-1)?.header.getBlockNumber()}`,
|
|
38
|
+
{ blocks: blocks.map(b => b.toBlockInfo()) },
|
|
39
|
+
);
|
|
40
|
+
const messagesInEpoch: Fr[][][][] = [];
|
|
41
|
+
let previousSlotNumber = SlotNumber.ZERO;
|
|
42
|
+
let checkpointIndex = -1;
|
|
43
|
+
|
|
44
|
+
for (const block of blocks) {
|
|
45
|
+
const slotNumber = block.header.globalVariables.slotNumber;
|
|
46
|
+
if (slotNumber !== previousSlotNumber) {
|
|
47
|
+
checkpointIndex++;
|
|
48
|
+
messagesInEpoch[checkpointIndex] = [];
|
|
49
|
+
previousSlotNumber = slotNumber;
|
|
50
|
+
}
|
|
51
|
+
messagesInEpoch[checkpointIndex].push(block.body.txEffects.map(txEffect => txEffect.l2ToL1Msgs));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const [firstMessage] = messagesInEpoch.flat(3);
|
|
55
|
+
if (firstMessage) {
|
|
56
|
+
const { root: outHash } = computeL2ToL1MembershipWitnessFromMessagesInEpoch(messagesInEpoch, firstMessage);
|
|
57
|
+
await this.rollupCheatCodes.insertOutbox(epoch, outHash.toBigInt());
|
|
58
|
+
} else {
|
|
59
|
+
this.log.info(`No L2 to L1 messages in epoch ${epoch}`);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const lastCheckpoint = checkpointedBlocks.at(-1)?.checkpointNumber;
|
|
63
|
+
if (lastCheckpoint !== undefined) {
|
|
64
|
+
await this.rollupCheatCodes.markAsProven(lastCheckpoint);
|
|
65
|
+
} else {
|
|
66
|
+
this.log.warn(`No checkpoint found for epoch ${epoch}`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
}
|
package/src/testing/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { AnvilTestWatcher } from './anvil_test_watcher.js';
|
|
2
2
|
export { EthCheatCodes, RollupCheatCodes } from '@aztec/ethereum/test';
|
|
3
|
-
export { AztecCheatCodes } from './aztec_cheat_codes.js';
|
|
4
3
|
export { CheatCodes } from './cheat_codes.js';
|
|
4
|
+
export { EpochTestSettler } from './epoch_test_settler.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start_blob_sink.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_blob_sink.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAKnD,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 { getL1Config } from '@aztec/cli/config';
|
|
3
|
-
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
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,7 +0,0 @@
|
|
|
1
|
-
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
2
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
3
|
-
import { type ProverNodeConfig } from '@aztec/prover-node';
|
|
4
|
-
export declare function startProverNode(options: any, signalHandlers: (() => Promise<void>)[], services: NamespacedApiHandlers, userLog: LogFn): Promise<{
|
|
5
|
-
config: ProverNodeConfig;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=start_prover_node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start_prover_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_node.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,oBAAoB,CAAC;AAS5B,wBAAsB,eAAe,CACnC,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,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,CA+FvC"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { getInitialTestAccounts } from '@aztec/accounts/testing';
|
|
2
|
-
import { Fr } from '@aztec/aztec.js';
|
|
3
|
-
import { getSponsoredFPCAddress } from '@aztec/cli/cli-utils';
|
|
4
|
-
import { getL1Config } from '@aztec/cli/config';
|
|
5
|
-
import { getPublicClient } from '@aztec/ethereum';
|
|
6
|
-
import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
|
|
7
|
-
import { ProvingJobConsumerSchema, createProvingJobBrokerClient } from '@aztec/prover-client/broker';
|
|
8
|
-
import { createProverNode, getProverNodeConfigFromEnv, proverNodeConfigMappings } from '@aztec/prover-node';
|
|
9
|
-
import { P2PApiSchema, ProverNodeApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
10
|
-
import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
|
|
11
|
-
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
12
|
-
import { extractRelevantOptions, preloadCrsDataForVerifying, setupUpdateMonitor } from '../util.js';
|
|
13
|
-
import { getVersions } from '../versioning.js';
|
|
14
|
-
import { startProverBroker } from './start_prover_broker.js';
|
|
15
|
-
export async function startProverNode(options, signalHandlers, services, userLog) {
|
|
16
|
-
if (options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) {
|
|
17
|
-
userLog(`Starting a prover-node with --node, --sequencer, --pxe, --p2p-bootstrap, or --txe is not supported.`);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
let proverConfig = {
|
|
21
|
-
...getProverNodeConfigFromEnv(),
|
|
22
|
-
...extractRelevantOptions(options, proverNodeConfigMappings, 'proverNode')
|
|
23
|
-
};
|
|
24
|
-
if (!proverConfig.l1Contracts.registryAddress || proverConfig.l1Contracts.registryAddress.isZero()) {
|
|
25
|
-
throw new Error('L1 registry address is required to start a Prover Node');
|
|
26
|
-
}
|
|
27
|
-
const followsCanonicalRollup = typeof proverConfig.rollupVersion !== 'number';
|
|
28
|
-
const { addresses, config } = await getL1Config(proverConfig.l1Contracts.registryAddress, proverConfig.l1RpcUrls, proverConfig.l1ChainId, proverConfig.rollupVersion);
|
|
29
|
-
process.env.ROLLUP_CONTRACT_ADDRESS ??= addresses.rollupAddress.toString();
|
|
30
|
-
proverConfig.l1Contracts = addresses;
|
|
31
|
-
proverConfig = {
|
|
32
|
-
...proverConfig,
|
|
33
|
-
...config
|
|
34
|
-
};
|
|
35
|
-
const testAccounts = proverConfig.testAccounts ? (await getInitialTestAccounts()).map((a)=>a.address) : [];
|
|
36
|
-
const sponsoredFPCAccounts = proverConfig.sponsoredFPC ? [
|
|
37
|
-
await getSponsoredFPCAddress()
|
|
38
|
-
] : [];
|
|
39
|
-
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts);
|
|
40
|
-
userLog(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
|
|
41
|
-
const { genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
|
|
42
|
-
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
43
|
-
if (!Fr.fromHexString(config.genesisArchiveTreeRoot).equals(genesisArchiveRoot)) {
|
|
44
|
-
throw new Error(`The computed genesis archive tree root ${genesisArchiveRoot} does not match the expected genesis archive tree root ${config.genesisArchiveTreeRoot} for the rollup deployed at ${addresses.rollupAddress}`);
|
|
45
|
-
}
|
|
46
|
-
const telemetry = initTelemetryClient(extractRelevantOptions(options, telemetryClientConfigMappings, 'tel'));
|
|
47
|
-
let broker;
|
|
48
|
-
if (proverConfig.proverBrokerUrl) {
|
|
49
|
-
// at 1TPS we'd enqueue ~1k tube proofs and ~1k AVM proofs immediately
|
|
50
|
-
// set a lower connection limit such that we don't overload the server
|
|
51
|
-
// Keep retrying up to 30s
|
|
52
|
-
const fetch = makeTracedFetch([
|
|
53
|
-
1,
|
|
54
|
-
2,
|
|
55
|
-
3,
|
|
56
|
-
3,
|
|
57
|
-
3,
|
|
58
|
-
3,
|
|
59
|
-
3,
|
|
60
|
-
3,
|
|
61
|
-
3,
|
|
62
|
-
3,
|
|
63
|
-
3
|
|
64
|
-
], false, makeUndiciFetch(new Agent({
|
|
65
|
-
connections: 100
|
|
66
|
-
})));
|
|
67
|
-
broker = createProvingJobBrokerClient(proverConfig.proverBrokerUrl, getVersions(proverConfig), fetch);
|
|
68
|
-
} else if (options.proverBroker) {
|
|
69
|
-
({ broker } = await startProverBroker(options, signalHandlers, services, userLog));
|
|
70
|
-
} else {
|
|
71
|
-
userLog(`--prover-broker-url or --prover-broker is required to start a Prover Node`);
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
if (proverConfig.proverAgentCount === 0) {
|
|
75
|
-
userLog(`Running prover node without local prover agent. Connect one or more prover agents to this node or pass --proverAgent.proverAgentCount`);
|
|
76
|
-
}
|
|
77
|
-
await preloadCrsDataForVerifying(proverConfig, userLog);
|
|
78
|
-
const proverNode = await createProverNode(proverConfig, {
|
|
79
|
-
telemetry,
|
|
80
|
-
broker
|
|
81
|
-
}, {
|
|
82
|
-
prefilledPublicData
|
|
83
|
-
});
|
|
84
|
-
services.proverNode = [
|
|
85
|
-
proverNode,
|
|
86
|
-
ProverNodeApiSchema
|
|
87
|
-
];
|
|
88
|
-
if (proverNode.getP2P()) {
|
|
89
|
-
services.p2p = [
|
|
90
|
-
proverNode.getP2P(),
|
|
91
|
-
P2PApiSchema
|
|
92
|
-
];
|
|
93
|
-
}
|
|
94
|
-
if (!proverConfig.proverBrokerUrl) {
|
|
95
|
-
services.provingJobSource = [
|
|
96
|
-
proverNode.getProver().getProvingJobSource(),
|
|
97
|
-
ProvingJobConsumerSchema
|
|
98
|
-
];
|
|
99
|
-
}
|
|
100
|
-
signalHandlers.push(proverNode.stop.bind(proverNode));
|
|
101
|
-
await proverNode.start();
|
|
102
|
-
if (proverConfig.autoUpdate !== 'disabled' && proverConfig.autoUpdateUrl) {
|
|
103
|
-
await setupUpdateMonitor(proverConfig.autoUpdate, new URL(proverConfig.autoUpdateUrl), followsCanonicalRollup, getPublicClient(proverConfig), proverConfig.l1Contracts.registryAddress, signalHandlers);
|
|
104
|
-
}
|
|
105
|
-
return {
|
|
106
|
-
config: proverConfig
|
|
107
|
-
};
|
|
108
|
-
}
|
|
@@ -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,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
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env -S node --no-warnings
|
|
2
|
-
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { EthAddress } from '@aztec/aztec.js';
|
|
4
|
-
import { type BlobSinkClientInterface } from '@aztec/blob-sink/client';
|
|
5
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
6
|
-
import { type LogFn } from '@aztec/foundation/log';
|
|
7
|
-
import { DateProvider } from '@aztec/foundation/timer';
|
|
8
|
-
import { type PXEServiceConfig } from '@aztec/pxe/server';
|
|
9
|
-
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
10
|
-
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
11
|
-
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
12
|
-
import { type HDAccount, type PrivateKeyAccount } from 'viem';
|
|
13
|
-
/**
|
|
14
|
-
* Function to deploy our L1 contracts to the sandbox L1
|
|
15
|
-
* @param aztecNodeConfig - The Aztec Node Config
|
|
16
|
-
* @param hdAccount - Account for publishing L1 contracts
|
|
17
|
-
*/
|
|
18
|
-
export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, hdAccount: HDAccount | PrivateKeyAccount, contractDeployLogger?: import("@aztec/aztec.js").Logger, opts?: {
|
|
19
|
-
assumeProvenThroughBlockNumber?: number;
|
|
20
|
-
salt?: number;
|
|
21
|
-
genesisArchiveRoot?: Fr;
|
|
22
|
-
feeJuicePortalInitialBalance?: bigint;
|
|
23
|
-
}): Promise<{
|
|
24
|
-
rollupAddress: EthAddress;
|
|
25
|
-
registryAddress: EthAddress;
|
|
26
|
-
inboxAddress: EthAddress;
|
|
27
|
-
outboxAddress: EthAddress;
|
|
28
|
-
feeJuiceAddress: EthAddress;
|
|
29
|
-
feeJuicePortalAddress: EthAddress;
|
|
30
|
-
coinIssuerAddress: EthAddress;
|
|
31
|
-
rewardDistributorAddress: EthAddress;
|
|
32
|
-
governanceProposerAddress: EthAddress;
|
|
33
|
-
governanceAddress: EthAddress;
|
|
34
|
-
stakingAssetAddress: EthAddress;
|
|
35
|
-
} & {
|
|
36
|
-
slashFactoryAddress?: EthAddress | undefined;
|
|
37
|
-
feeAssetHandlerAddress?: EthAddress | undefined;
|
|
38
|
-
stakingAssetHandlerAddress?: EthAddress | undefined;
|
|
39
|
-
zkPassportVerifierAddress?: EthAddress | undefined;
|
|
40
|
-
gseAddress?: EthAddress | undefined;
|
|
41
|
-
dateGatedRelayerAddress?: EthAddress | undefined;
|
|
42
|
-
} & {
|
|
43
|
-
rollupAddress: EthAddress;
|
|
44
|
-
} & {
|
|
45
|
-
rollupAddress: EthAddress;
|
|
46
|
-
}>;
|
|
47
|
-
/** Sandbox settings. */
|
|
48
|
-
export type SandboxConfig = AztecNodeConfig & {
|
|
49
|
-
/** Mnemonic used to derive the L1 deployer private key.*/
|
|
50
|
-
l1Mnemonic: string;
|
|
51
|
-
/** Salt used to deploy L1 contracts.*/
|
|
52
|
-
deployAztecContractsSalt: string;
|
|
53
|
-
/** Whether to expose PXE service on sandbox start.*/
|
|
54
|
-
noPXE: boolean;
|
|
55
|
-
/** Whether to deploy test accounts on sandbox start.*/
|
|
56
|
-
testAccounts: boolean;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Create and start a new Aztec Node and PXE. Deploys L1 contracts.
|
|
60
|
-
* Does not start any HTTP services nor populate any initial accounts.
|
|
61
|
-
* @param config - Optional Sandbox settings.
|
|
62
|
-
*/
|
|
63
|
-
export declare function createSandbox(config: Partial<SandboxConfig> | undefined, userLog: LogFn): Promise<{
|
|
64
|
-
node: AztecNodeService;
|
|
65
|
-
pxe: import("@aztec/pxe/server").PXEService;
|
|
66
|
-
stop: () => Promise<void>;
|
|
67
|
-
}>;
|
|
68
|
-
/**
|
|
69
|
-
* Create and start a new Aztec RPC HTTP Server
|
|
70
|
-
* @param config - Optional Aztec node settings.
|
|
71
|
-
*/
|
|
72
|
-
export declare function createAztecNode(config?: Partial<AztecNodeConfig>, deps?: {
|
|
73
|
-
telemetry?: TelemetryClient;
|
|
74
|
-
blobSinkClient?: BlobSinkClientInterface;
|
|
75
|
-
dateProvider?: DateProvider;
|
|
76
|
-
}, options?: {
|
|
77
|
-
prefilledPublicData?: PublicDataTreeLeaf[];
|
|
78
|
-
}): Promise<AztecNodeService>;
|
|
79
|
-
/**
|
|
80
|
-
* Create and start a new Aztec PXE HTTP Server
|
|
81
|
-
* @param config - Optional PXE settings.
|
|
82
|
-
*/
|
|
83
|
-
export declare function createAztecPXE(node: AztecNode, config?: Partial<PXEServiceConfig>): Promise<import("@aztec/pxe/server").PXEService>;
|
|
84
|
-
//# sourceMappingURL=sandbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAa7F,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,YAAY,EAAoB,MAAM,yBAAyB,CAAC;AAGzE,OAAO,EAAE,KAAK,gBAAgB,EAAyC,MAAM,mBAAmB,CAAC;AACjG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAA2D,MAAM,MAAM,CAAC;AAcvH;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GAAG,iBAAiB,EACxC,oBAAoB,mCAAS,EAC7B,IAAI,GAAE;IACJ,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,EAAE,CAAC;IACxB,4BAA4B,CAAC,EAAE,MAAM,CAAC;CAClC;;;;;;;;;;;;;;;;;;;;;;;GAkCP;AAED,wBAAwB;AACxB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,wBAAwB,EAAE,MAAM,CAAC;IACjC,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,aAAa,CAAC,YAAK,EAAE,OAAO,EAAE,KAAK;;;;GA4GtF;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,EACrC,IAAI,GAAE;IAAE,SAAS,CAAC,EAAE,eAAe,CAAC;IAAC,cAAc,CAAC,EAAE,uBAAuB,CAAC;IAAC,YAAY,CAAC,EAAE,YAAY,CAAA;CAAO,EACjH,OAAO,GAAE;IAAE,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAAO,6BAW7D;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,GAAE,OAAO,CAAC,gBAAgB,CAAM,mDAI3F"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type PXE } from '@aztec/aztec.js';
|
|
2
|
-
export declare function getSponsoredFPCAddress(): Promise<import("@aztec/aztec.js").AztecAddress>;
|
|
3
|
-
export declare function getDeployedSponsoredFPCAddress(pxe: PXE): Promise<import("@aztec/aztec.js").AztecAddress>;
|
|
4
|
-
//# sourceMappingURL=sponsored_fpc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sponsored_fpc.d.ts","sourceRoot":"","sources":["../../src/sandbox/sponsored_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,GAAG,EAET,MAAM,iBAAiB,CAAC;AAUzB,wBAAsB,sBAAsB,oDAE3C;AAED,wBAAsB,8BAA8B,CAAC,GAAG,EAAE,GAAG,mDAO5D"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
4
|
-
import type { Note } from '@aztec/stdlib/note';
|
|
5
|
-
/**
|
|
6
|
-
* A class that provides utility functions for interacting with the aztec chain.
|
|
7
|
-
*/
|
|
8
|
-
export declare class AztecCheatCodes {
|
|
9
|
-
/**
|
|
10
|
-
* The PXE Service to use for interacting with the chain
|
|
11
|
-
*/
|
|
12
|
-
pxe: PXE;
|
|
13
|
-
/**
|
|
14
|
-
* The logger to use for the aztec cheatcodes
|
|
15
|
-
*/
|
|
16
|
-
logger: import("@aztec/foundation/log").Logger;
|
|
17
|
-
constructor(
|
|
18
|
-
/**
|
|
19
|
-
* The PXE Service to use for interacting with the chain
|
|
20
|
-
*/
|
|
21
|
-
pxe: PXE,
|
|
22
|
-
/**
|
|
23
|
-
* The logger to use for the aztec cheatcodes
|
|
24
|
-
*/
|
|
25
|
-
logger?: import("@aztec/foundation/log").Logger);
|
|
26
|
-
/**
|
|
27
|
-
* Computes the slot value for a given map and key.
|
|
28
|
-
* @param mapSlot - The slot of the map (specified in Aztec.nr contract)
|
|
29
|
-
* @param key - The key to lookup in the map
|
|
30
|
-
* @returns The storage slot of the value in the map
|
|
31
|
-
*/
|
|
32
|
-
computeSlotInMap(mapSlot: Fr | bigint, key: Fr | bigint | AztecAddress): Promise<Fr>;
|
|
33
|
-
/**
|
|
34
|
-
* Get the current blocknumber
|
|
35
|
-
* @returns The current block number
|
|
36
|
-
*/
|
|
37
|
-
blockNumber(): Promise<number>;
|
|
38
|
-
/**
|
|
39
|
-
* Get the current timestamp
|
|
40
|
-
* @returns The current timestamp
|
|
41
|
-
*/
|
|
42
|
-
timestamp(): Promise<number>;
|
|
43
|
-
/**
|
|
44
|
-
* Loads the value stored at the given slot in the public storage of the given contract.
|
|
45
|
-
* @param who - The address of the contract
|
|
46
|
-
* @param slot - The storage slot to lookup
|
|
47
|
-
* @returns The value stored at the given slot
|
|
48
|
-
*/
|
|
49
|
-
loadPublic(who: AztecAddress, slot: Fr | bigint): Promise<Fr>;
|
|
50
|
-
/**
|
|
51
|
-
* Loads the value stored at the given slot in the private storage of the given contract.
|
|
52
|
-
* @param contract - The address of the contract
|
|
53
|
-
* @param recipient - The address whose public key was used to encrypt the note
|
|
54
|
-
* @param slot - The storage slot to lookup
|
|
55
|
-
* @returns The notes stored at the given slot
|
|
56
|
-
*/
|
|
57
|
-
loadPrivate(recipient: AztecAddress, contract: AztecAddress, slot: Fr | bigint): Promise<Note[]>;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=aztec_cheat_codes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_cheat_codes.d.ts","sourceRoot":"","sources":["../../src/testing/aztec_cheat_codes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;GAEG;AACH,qBAAa,eAAe;IAExB;;OAEG;IACI,GAAG,EAAE,GAAG;IACf;;OAEG;IACI,MAAM;;IAPb;;OAEG;IACI,GAAG,EAAE,GAAG;IACf;;OAEG;IACI,MAAM,yCAAsC;IAGrD;;;;;OAKG;IACI,gBAAgB,CAAC,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,EAAE,CAAC;IAK3F;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAI3C;;;OAGG;IACU,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;IAKzC;;;;;OAKG;IACU,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC;IAK1E;;;;;;OAMG;IACU,WAAW,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;CAQ9G"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
-
import { deriveStorageSlotInMap } from '@aztec/stdlib/hash';
|
|
4
|
-
/**
|
|
5
|
-
* A class that provides utility functions for interacting with the aztec chain.
|
|
6
|
-
*/ export class AztecCheatCodes {
|
|
7
|
-
pxe;
|
|
8
|
-
logger;
|
|
9
|
-
constructor(/**
|
|
10
|
-
* The PXE Service to use for interacting with the chain
|
|
11
|
-
*/ pxe, /**
|
|
12
|
-
* The logger to use for the aztec cheatcodes
|
|
13
|
-
*/ logger = createLogger('aztecjs:cheat_codes')){
|
|
14
|
-
this.pxe = pxe;
|
|
15
|
-
this.logger = logger;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Computes the slot value for a given map and key.
|
|
19
|
-
* @param mapSlot - The slot of the map (specified in Aztec.nr contract)
|
|
20
|
-
* @param key - The key to lookup in the map
|
|
21
|
-
* @returns The storage slot of the value in the map
|
|
22
|
-
*/ computeSlotInMap(mapSlot, key) {
|
|
23
|
-
const keyFr = typeof key === 'bigint' ? new Fr(key) : key.toField();
|
|
24
|
-
return deriveStorageSlotInMap(mapSlot, keyFr);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Get the current blocknumber
|
|
28
|
-
* @returns The current block number
|
|
29
|
-
*/ async blockNumber() {
|
|
30
|
-
return await this.pxe.getBlockNumber();
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get the current timestamp
|
|
34
|
-
* @returns The current timestamp
|
|
35
|
-
*/ async timestamp() {
|
|
36
|
-
const res = await this.pxe.getBlock(await this.blockNumber());
|
|
37
|
-
return Number(res?.header.globalVariables.timestamp ?? 0);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Loads the value stored at the given slot in the public storage of the given contract.
|
|
41
|
-
* @param who - The address of the contract
|
|
42
|
-
* @param slot - The storage slot to lookup
|
|
43
|
-
* @returns The value stored at the given slot
|
|
44
|
-
*/ async loadPublic(who, slot) {
|
|
45
|
-
const storageValue = await this.pxe.getPublicStorageAt(who, new Fr(slot));
|
|
46
|
-
return storageValue;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Loads the value stored at the given slot in the private storage of the given contract.
|
|
50
|
-
* @param contract - The address of the contract
|
|
51
|
-
* @param recipient - The address whose public key was used to encrypt the note
|
|
52
|
-
* @param slot - The storage slot to lookup
|
|
53
|
-
* @returns The notes stored at the given slot
|
|
54
|
-
*/ async loadPrivate(recipient, contract, slot) {
|
|
55
|
-
const extendedNotes = await this.pxe.getNotes({
|
|
56
|
-
recipient,
|
|
57
|
-
contractAddress: contract,
|
|
58
|
-
storageSlot: new Fr(slot)
|
|
59
|
-
});
|
|
60
|
-
return extendedNotes.map((extendedNote)=>extendedNote.note);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type BlobSinkConfig,
|
|
3
|
-
blobSinkConfigMappings,
|
|
4
|
-
createBlobSinkServer,
|
|
5
|
-
getBlobSinkConfigFromEnv,
|
|
6
|
-
} from '@aztec/blob-sink/server';
|
|
7
|
-
import { getL1Config } from '@aztec/cli/config';
|
|
8
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
9
|
-
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
10
|
-
|
|
11
|
-
import { extractRelevantOptions } from '../util.js';
|
|
12
|
-
|
|
13
|
-
export async function startBlobSink(options: any, signalHandlers: (() => Promise<void>)[], userLog: LogFn) {
|
|
14
|
-
if (options.prover || options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) {
|
|
15
|
-
userLog(
|
|
16
|
-
`Starting a blob sink with --node, --sequencer, --pxe, --p2p-bootstrap, --prover or --txe is not supported.`,
|
|
17
|
-
);
|
|
18
|
-
process.exit(1);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let blobSinkConfig: BlobSinkConfig = {
|
|
22
|
-
...getBlobSinkConfigFromEnv(), // get default config from env
|
|
23
|
-
...extractRelevantOptions<BlobSinkConfig>(options, blobSinkConfigMappings, 'blobSink'), // override with command line options
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
if (!blobSinkConfig.l1Contracts?.registryAddress || blobSinkConfig.l1Contracts.registryAddress.isZero()) {
|
|
27
|
-
throw new Error('REGISTRY_CONTRACT_ADDRESS not set');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (!blobSinkConfig.l1RpcUrls || blobSinkConfig.l1RpcUrls.length === 0) {
|
|
31
|
-
throw new Error('ETHEREUM_HOSTS not set');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (typeof blobSinkConfig.l1ChainId !== 'number') {
|
|
35
|
-
throw new Error('L1_CHAIN_ID');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
39
|
-
|
|
40
|
-
const { config: chainConfig, addresses } = await getL1Config(
|
|
41
|
-
blobSinkConfig.l1Contracts.registryAddress,
|
|
42
|
-
blobSinkConfig.l1RpcUrls,
|
|
43
|
-
blobSinkConfig.l1ChainId,
|
|
44
|
-
blobSinkConfig.rollupVersion,
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
blobSinkConfig = {
|
|
48
|
-
...blobSinkConfig,
|
|
49
|
-
l1Contracts: addresses,
|
|
50
|
-
...chainConfig,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const blobSink = await createBlobSinkServer(blobSinkConfig, telemetry);
|
|
54
|
-
signalHandlers.push(blobSink.stop.bind(blobSink));
|
|
55
|
-
|
|
56
|
-
await blobSink.start();
|
|
57
|
-
}
|