@aztec/aztec 0.82.0 → 0.82.1-alpha-testnet.1
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/cli/aztec_start_action.d.ts.map +1 -1
- package/dest/cli/aztec_start_action.js +2 -1
- package/dest/cli/chain_l2_config.d.ts +3 -1
- package/dest/cli/chain_l2_config.d.ts.map +1 -1
- package/dest/cli/chain_l2_config.js +24 -1
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +2 -1
- package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_agent.js +2 -1
- package/dest/cli/cmds/start_prover_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_node.js +2 -1
- package/dest/cli/util.d.ts +14 -0
- package/dest/cli/util.d.ts.map +1 -1
- package/dest/cli/util.js +26 -0
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -1
- package/dest/sandbox/index.d.ts +0 -1
- package/dest/sandbox/index.d.ts.map +1 -1
- package/dest/sandbox/index.js +0 -1
- package/dest/sandbox/sandbox.d.ts +15 -15
- package/dest/sandbox/sandbox.d.ts.map +1 -1
- package/dest/sandbox/sandbox.js +7 -4
- package/dest/sandbox/sponsored_fpc.d.ts +1 -3
- package/dest/sandbox/sponsored_fpc.d.ts.map +1 -1
- package/dest/sandbox/sponsored_fpc.js +2 -9
- package/package.json +30 -29
- package/src/cli/aztec_start_action.ts +1 -0
- package/src/cli/chain_l2_config.ts +24 -1
- package/src/cli/cmds/start_node.ts +3 -1
- package/src/cli/cmds/start_prover_agent.ts +3 -1
- package/src/cli/cmds/start_prover_node.ts +3 -1
- package/src/cli/util.ts +32 -0
- package/src/index.ts +0 -1
- package/src/sandbox/index.ts +0 -1
- package/src/sandbox/sandbox.ts +5 -4
- package/src/sandbox/sponsored_fpc.ts +3 -19
- package/dest/sandbox/sponsored_fee_payment_method.d.ts +0 -23
- package/dest/sandbox/sponsored_fee_payment_method.d.ts.map +0 -1
- package/dest/sandbox/sponsored_fee_payment_method.js +0 -37
- package/src/sandbox/sponsored_fee_payment_method.ts +0 -51
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAa3D,wBAAsB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"aztec_start_action.d.ts","sourceRoot":"","sources":["../../src/cli/aztec_start_action.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAa3D,wBAAsB,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,iBAyGjF"}
|
|
@@ -25,7 +25,8 @@ export async function aztecStart(options, userLog, debugLogger) {
|
|
|
25
25
|
l1RpcUrls: options.l1RpcUrls,
|
|
26
26
|
l1Salt: nodeOptions.deployAztecContractsSalt,
|
|
27
27
|
noPXE: sandboxOptions.noPXE,
|
|
28
|
-
testAccounts: sandboxOptions.testAccounts
|
|
28
|
+
testAccounts: sandboxOptions.testAccounts,
|
|
29
|
+
realProofs: false
|
|
29
30
|
}, userLog);
|
|
30
31
|
// Start Node and PXE JSON-RPC server
|
|
31
32
|
signalHandlers.push(stop);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type NetworkNames = 'testnet-ignition';
|
|
1
|
+
export type NetworkNames = 'testnet-ignition' | 'alpha-testnet';
|
|
2
2
|
export type L2ChainConfig = {
|
|
3
3
|
l1ChainId: number;
|
|
4
4
|
ethereumSlotDuration: number;
|
|
@@ -11,8 +11,10 @@ export type L2ChainConfig = {
|
|
|
11
11
|
registryAddress: string;
|
|
12
12
|
seqMinTxsPerBlock: number;
|
|
13
13
|
seqMaxTxsPerBlock: number;
|
|
14
|
+
realProofs: boolean;
|
|
14
15
|
};
|
|
15
16
|
export declare const testnetIgnitionL2ChainConfig: L2ChainConfig;
|
|
17
|
+
export declare const alphaTestnetL2ChainConfig: L2ChainConfig;
|
|
16
18
|
export declare function getBootnodes(networkName: NetworkNames): Promise<any>;
|
|
17
19
|
export declare function getL2ChainConfig(networkName: NetworkNames): Promise<L2ChainConfig | undefined>;
|
|
18
20
|
export declare function enrichEnvironmentWithChainConfig(networkName: NetworkNames): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,GAAG,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"chain_l2_config.d.ts","sourceRoot":"","sources":["../../src/cli/chain_l2_config.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,YAAY,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAEhE,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;IACnC,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAa1C,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAavC,CAAC;AAEF,wBAAsB,YAAY,CAAC,WAAW,EAAE,YAAY,gBAW3D;AAED,wBAAsB,gBAAgB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC,CAWpG;AAUD,wBAAsB,gCAAgC,CAAC,WAAW,EAAE,YAAY,iBAmB/E"}
|
|
@@ -10,7 +10,22 @@ export const testnetIgnitionL2ChainConfig = {
|
|
|
10
10
|
p2pBootstrapNodes: [],
|
|
11
11
|
registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3',
|
|
12
12
|
seqMinTxsPerBlock: 0,
|
|
13
|
-
seqMaxTxsPerBlock:
|
|
13
|
+
seqMaxTxsPerBlock: 0,
|
|
14
|
+
realProofs: true
|
|
15
|
+
};
|
|
16
|
+
export const alphaTestnetL2ChainConfig = {
|
|
17
|
+
l1ChainId: 11155111,
|
|
18
|
+
ethereumSlotDuration: 12,
|
|
19
|
+
aztecSlotDuration: 36,
|
|
20
|
+
aztecEpochDuration: 32,
|
|
21
|
+
aztecProofSubmissionWindow: 64,
|
|
22
|
+
testAccounts: false,
|
|
23
|
+
p2pEnabled: true,
|
|
24
|
+
p2pBootstrapNodes: [],
|
|
25
|
+
registryAddress: '',
|
|
26
|
+
seqMinTxsPerBlock: 0,
|
|
27
|
+
seqMaxTxsPerBlock: 4,
|
|
28
|
+
realProofs: true
|
|
14
29
|
};
|
|
15
30
|
export async function getBootnodes(networkName) {
|
|
16
31
|
const url = `http://static.aztec.network/${networkName}/bootnodes.json`;
|
|
@@ -28,6 +43,12 @@ export async function getL2ChainConfig(networkName) {
|
|
|
28
43
|
};
|
|
29
44
|
config.p2pBootstrapNodes = await getBootnodes(networkName);
|
|
30
45
|
return config;
|
|
46
|
+
} else if (networkName === 'alpha-testnet') {
|
|
47
|
+
const config = {
|
|
48
|
+
...alphaTestnetL2ChainConfig
|
|
49
|
+
};
|
|
50
|
+
config.p2pBootstrapNodes = await getBootnodes(networkName);
|
|
51
|
+
return config;
|
|
31
52
|
}
|
|
32
53
|
return undefined;
|
|
33
54
|
}
|
|
@@ -55,4 +76,6 @@ export async function enrichEnvironmentWithChainConfig(networkName) {
|
|
|
55
76
|
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
56
77
|
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
57
78
|
enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
|
|
79
|
+
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
80
|
+
enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
|
|
58
81
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAEpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,qBAAqB,EACpC,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAEpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,qBAAqB,EACpC,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,CA2ItC"}
|
|
@@ -8,7 +8,7 @@ import { getGenesisValues } from '@aztec/world-state/testing';
|
|
|
8
8
|
import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
9
9
|
import { createAztecNode, deployContractsToL1 } from '../../sandbox/index.js';
|
|
10
10
|
import { getL1Config } from '../get_l1_config.js';
|
|
11
|
-
import { extractNamespacedOptions, extractRelevantOptions } from '../util.js';
|
|
11
|
+
import { extractNamespacedOptions, extractRelevantOptions, preloadCrsDataForVerifying } from '../util.js';
|
|
12
12
|
export async function startNode(options, signalHandlers, services, adminServices, userLog) {
|
|
13
13
|
// options specifically namespaced with --node.<option>
|
|
14
14
|
const nodeSpecificOptions = extractNamespacedOptions(options, 'node');
|
|
@@ -25,6 +25,7 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
25
25
|
userLog(`Running a Prover Node within a Node is not yet supported`);
|
|
26
26
|
process.exit(1);
|
|
27
27
|
}
|
|
28
|
+
await preloadCrsDataForVerifying(nodeConfig, userLog);
|
|
28
29
|
const initialFundedAccounts = nodeConfig.testAccounts ? await getInitialTestAccounts() : [];
|
|
29
30
|
const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address));
|
|
30
31
|
// Deploy contracts if needed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_prover_agent.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAenD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"start_prover_agent.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_agent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAenD,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,iBA+Cf"}
|
|
@@ -4,7 +4,7 @@ import { buildServerCircuitProver } from '@aztec/prover-client';
|
|
|
4
4
|
import { InlineProofStore, ProvingAgent, createProvingJobBrokerClient, proverAgentConfigMappings } from '@aztec/prover-client/broker';
|
|
5
5
|
import { getProverNodeAgentConfigFromEnv } from '@aztec/prover-node';
|
|
6
6
|
import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
|
|
7
|
-
import { extractRelevantOptions } from '../util.js';
|
|
7
|
+
import { extractRelevantOptions, preloadCrsDataForServerSideProving } from '../util.js';
|
|
8
8
|
import { getVersions } from '../versioning.js';
|
|
9
9
|
export async function startProverAgent(options, signalHandlers, services, userLog) {
|
|
10
10
|
if (options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) {
|
|
@@ -21,6 +21,7 @@ export async function startProverAgent(options, signalHandlers, services, userLo
|
|
|
21
21
|
if (!config.proverBrokerUrl) {
|
|
22
22
|
process.exit(1);
|
|
23
23
|
}
|
|
24
|
+
await preloadCrsDataForServerSideProving(config, userLog);
|
|
24
25
|
const fetch = makeTracedFetch([
|
|
25
26
|
1,
|
|
26
27
|
2,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_prover_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_node.ts"],"names":[],"mappings":"AAEA,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;AAa5B,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,
|
|
1
|
+
{"version":3,"file":"start_prover_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_node.ts"],"names":[],"mappings":"AAEA,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;AAa5B,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,CA6FvC"}
|
|
@@ -9,7 +9,7 @@ import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } f
|
|
|
9
9
|
import { getGenesisValues } from '@aztec/world-state/testing';
|
|
10
10
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
11
11
|
import { getL1Config } from '../get_l1_config.js';
|
|
12
|
-
import { extractRelevantOptions } from '../util.js';
|
|
12
|
+
import { extractRelevantOptions, preloadCrsDataForVerifying } from '../util.js';
|
|
13
13
|
import { getVersions } from '../versioning.js';
|
|
14
14
|
import { startProverBroker } from './start_prover_broker.js';
|
|
15
15
|
export async function startProverNode(options, signalHandlers, services, userLog) {
|
|
@@ -77,6 +77,7 @@ export async function startProverNode(options, signalHandlers, services, userLog
|
|
|
77
77
|
if (proverConfig.proverAgentCount === 0) {
|
|
78
78
|
userLog(`Running prover node without local prover agent. Connect one or more prover agents to this node or pass --proverAgent.proverAgentCount`);
|
|
79
79
|
}
|
|
80
|
+
await preloadCrsDataForVerifying(proverConfig, userLog);
|
|
80
81
|
const initialFundedAccounts = proverConfig.testAccounts ? await getInitialTestAccounts() : [];
|
|
81
82
|
const { prefilledPublicData } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address));
|
|
82
83
|
const proverNode = await createProverNode(proverConfig, {
|
package/dest/cli/util.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
1
2
|
import type { AccountManager, Fr } from '@aztec/aztec.js';
|
|
2
3
|
import type { ConfigMappingsType } from '@aztec/foundation/config';
|
|
3
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
5
|
import type { PXEService } from '@aztec/pxe/server';
|
|
6
|
+
import type { ProverConfig } from '@aztec/stdlib/interfaces/server';
|
|
5
7
|
import type { Command } from 'commander';
|
|
6
8
|
import { type AztecStartOption } from './aztec_start_options.js';
|
|
7
9
|
export declare const installSignalHandlers: (logFn: LogFn, cb?: Array<() => Promise<void>>) => void;
|
|
@@ -43,4 +45,16 @@ export declare const extractNamespacedOptions: (options: Record<string, any>, na
|
|
|
43
45
|
* @returns Key-value map of relevant options.
|
|
44
46
|
*/
|
|
45
47
|
export declare const extractRelevantOptions: <T>(options: Record<string, any>, mappings: ConfigMappingsType<T>, namespace: string) => T;
|
|
48
|
+
/**
|
|
49
|
+
* Downloads just enough points to be able to verify ClientIVC proofs.
|
|
50
|
+
* @param opts - Whether proof are to be verifier
|
|
51
|
+
* @param log - Logging function
|
|
52
|
+
*/
|
|
53
|
+
export declare function preloadCrsDataForVerifying({ realProofs }: Pick<AztecNodeConfig, 'realProofs'>, log: LogFn): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Downloads enough points to be able to prove every server-side circuit
|
|
56
|
+
* @param opts - Whether real proof are to be generated
|
|
57
|
+
* @param log - Logging function
|
|
58
|
+
*/
|
|
59
|
+
export declare function preloadCrsDataForServerSideProving({ realProofs }: Pick<ProverConfig, 'realProofs'>, log: LogFn): Promise<void>;
|
|
46
60
|
//# sourceMappingURL=util.d.ts.map
|
package/dest/cli/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/cli/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/cli/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,gBAAgB,EAAqB,MAAM,0BAA0B,CAAC;AAEpF,eAAO,MAAM,qBAAqB,UAAW,KAAK,OAAO,MAAM,MAAM,QAAQ,IAAI,CAAC,CAAC,SAclF,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,sBAAsB,EAAE;IACtB;;OAEG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB;;OAEG;IACH,SAAS,EAAE,EAAE,CAAC;CACf,EAAE,EACH,GAAG,EAAE,UAAU,qBAyBhB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAAA;CAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAiB/F;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAKR;AAmBD,eAAO,MAAM,UAAU,QAAS,OAAO,WAAW,gBAAgB,EAAE,SASnE,CAAC;AAEF,eAAO,MAAM,uBAAuB,cAwBnC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,YAAa,OAAO,MAAM,EAAE,GAAG,CAAC,aAAa,MAAM,wBASvF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,eACxB,OAAO,MAAM,EAAE,GAAG,CAAC,YAClB,mBAAmB,CAAC,CAAC,aACpB,MAAM,KAChB,CA8BF,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,0BAA0B,CAC9C,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EACnD,GAAG,EAAE,KAAK,GACT,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;;;GAIG;AACH,wBAAsB,kCAAkC,CACtD,EAAE,UAAU,EAAE,EAAE,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,EAChD,GAAG,EAAE,KAAK,GACT,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
package/dest/cli/util.js
CHANGED
|
@@ -152,3 +152,29 @@ export const printAztecStartHelpText = ()=>{
|
|
|
152
152
|
});
|
|
153
153
|
return relevantOptions;
|
|
154
154
|
};
|
|
155
|
+
/**
|
|
156
|
+
* Downloads just enough points to be able to verify ClientIVC proofs.
|
|
157
|
+
* @param opts - Whether proof are to be verifier
|
|
158
|
+
* @param log - Logging function
|
|
159
|
+
*/ export async function preloadCrsDataForVerifying({ realProofs }, log) {
|
|
160
|
+
if (realProofs) {
|
|
161
|
+
const { Crs, GrumpkinCrs } = await import('@aztec/bb.js');
|
|
162
|
+
await Promise.all([
|
|
163
|
+
Crs.new(2 ** 1, undefined, log),
|
|
164
|
+
GrumpkinCrs.new(2 ** 16 + 1, undefined, log)
|
|
165
|
+
]);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Downloads enough points to be able to prove every server-side circuit
|
|
170
|
+
* @param opts - Whether real proof are to be generated
|
|
171
|
+
* @param log - Logging function
|
|
172
|
+
*/ export async function preloadCrsDataForServerSideProving({ realProofs }, log) {
|
|
173
|
+
if (realProofs) {
|
|
174
|
+
const { Crs, GrumpkinCrs } = await import('@aztec/bb.js');
|
|
175
|
+
await Promise.all([
|
|
176
|
+
Crs.new(2 ** 25 - 1, undefined, log),
|
|
177
|
+
GrumpkinCrs.new(2 ** 18 + 1, undefined, log)
|
|
178
|
+
]);
|
|
179
|
+
}
|
|
180
|
+
}
|
package/dest/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createSandbox, getDeployedBananaCoinAddress, getDeployedBananaFPCAddress, getDeployedSponsoredFPCAddress,
|
|
1
|
+
export { createSandbox, getDeployedBananaCoinAddress, getDeployedBananaFPCAddress, getDeployedSponsoredFPCAddress, } from './sandbox/index.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dest/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,oBAAoB,CAAC"}
|
package/dest/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createSandbox, getDeployedBananaCoinAddress, getDeployedBananaFPCAddress, getDeployedSponsoredFPCAddress
|
|
1
|
+
export { createSandbox, getDeployedBananaCoinAddress, getDeployedBananaFPCAddress, getDeployedSponsoredFPCAddress } from './sandbox/index.js';
|
package/dest/sandbox/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './sandbox.js';
|
|
2
2
|
export { getDeployedBananaCoinAddress, getDeployedBananaFPCAddress } from './banana_fpc.js';
|
|
3
3
|
export { getDeployedSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
4
|
-
export { SponsoredFeePaymentMethod } from './sponsored_fee_payment_method.js';
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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
|
|
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
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export * from './sandbox.js';
|
|
2
2
|
export { getDeployedBananaCoinAddress, getDeployedBananaFPCAddress } from './banana_fpc.js';
|
|
3
3
|
export { getDeployedSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
4
|
-
export { SponsoredFeePaymentMethod } from './sponsored_fee_payment_method.js';
|
|
@@ -19,24 +19,24 @@ export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, hd
|
|
|
19
19
|
genesisArchiveRoot?: Fr;
|
|
20
20
|
genesisBlockHash?: Fr;
|
|
21
21
|
}): Promise<{
|
|
22
|
-
rollupAddress: import("@aztec/
|
|
23
|
-
registryAddress: import("@aztec/
|
|
24
|
-
inboxAddress: import("@aztec/
|
|
25
|
-
outboxAddress: import("@aztec/
|
|
26
|
-
feeJuiceAddress: import("@aztec/
|
|
27
|
-
feeJuicePortalAddress: import("@aztec/
|
|
28
|
-
coinIssuerAddress: import("@aztec/
|
|
29
|
-
rewardDistributorAddress: import("@aztec/
|
|
30
|
-
governanceProposerAddress: import("@aztec/
|
|
31
|
-
governanceAddress: import("@aztec/
|
|
32
|
-
stakingAssetAddress: import("@aztec/
|
|
22
|
+
rollupAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
23
|
+
registryAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
24
|
+
inboxAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
25
|
+
outboxAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
26
|
+
feeJuiceAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
27
|
+
feeJuicePortalAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
28
|
+
coinIssuerAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
29
|
+
rewardDistributorAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
30
|
+
governanceProposerAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
31
|
+
governanceAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
32
|
+
stakingAssetAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
33
33
|
} & {
|
|
34
|
-
slashFactoryAddress?: import("@aztec/
|
|
35
|
-
feeAssetHandlerAddress?: import("@aztec/
|
|
34
|
+
slashFactoryAddress?: import("@aztec/foundation/schemas").EthAddress | undefined;
|
|
35
|
+
feeAssetHandlerAddress?: import("@aztec/foundation/schemas").EthAddress | undefined;
|
|
36
36
|
} & {
|
|
37
|
-
rollupAddress: import("@aztec/
|
|
37
|
+
rollupAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
38
38
|
} & {
|
|
39
|
-
rollupAddress: import("@aztec/
|
|
39
|
+
rollupAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
40
40
|
}>;
|
|
41
41
|
/** Sandbox settings. */
|
|
42
42
|
export type SandboxConfig = AztecNodeConfig & {
|
|
@@ -1 +1 @@
|
|
|
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;AAE7F,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAU7F,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AAGjE,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;AAavH;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GAAG,iBAAiB,EACxC,oBAAoB,yCAAS,EAC7B,IAAI,GAAE;IAAE,8BAA8B,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,EAAE,CAAA;CAAO;;;;;;;;;;;;;;;;;;;GA6BtH;AAED,wBAAwB;AACxB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,MAAM,oCAA6B,EAAE,OAAO,EAAE,KAAK;;;;
|
|
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;AAE7F,OAAO,EAAE,KAAK,uBAAuB,EAAwB,MAAM,yBAAyB,CAAC;AAU7F,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,uBAAuB,CAAC;AAGjE,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;AAavH;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,SAAS,GAAG,iBAAiB,EACxC,oBAAoB,yCAAS,EAC7B,IAAI,GAAE;IAAE,8BAA8B,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,EAAE,CAAA;CAAO;;;;;;;;;;;;;;;;;;;GA6BtH;AAED,wBAAwB;AACxB,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG;IAC5C,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,uDAAuD;IACvD,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,MAAM,oCAA6B,EAAE,OAAO,EAAE,KAAK;;;;GA8FtF;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,CAAA;CAAO,EACpF,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"}
|
package/dest/sandbox/sandbox.js
CHANGED
|
@@ -4,7 +4,7 @@ import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/acco
|
|
|
4
4
|
import { AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
5
|
import { AnvilTestWatcher, EthCheatCodes } from '@aztec/aztec.js/testing';
|
|
6
6
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
7
|
-
import { setupCanonicalL2FeeJuice } from '@aztec/cli/
|
|
7
|
+
import { setupCanonicalL2FeeJuice, setupSponsoredFPC } from '@aztec/cli/cli-utils';
|
|
8
8
|
import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants';
|
|
9
9
|
import { NULL_KEY, createEthereumChain, deployL1Contracts, getL1ContractsConfigEnvVars, waitForPublicClient } from '@aztec/ethereum';
|
|
10
10
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -20,7 +20,7 @@ import { foundry } from 'viem/chains';
|
|
|
20
20
|
import { createAccountLogs } from '../cli/util.js';
|
|
21
21
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
22
22
|
import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
|
|
23
|
-
import { getSponsoredFPCAddress
|
|
23
|
+
import { getSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
24
24
|
const logger = createLogger('sandbox');
|
|
25
25
|
const localAnvil = foundry;
|
|
26
26
|
/**
|
|
@@ -125,7 +125,10 @@ const localAnvil = foundry;
|
|
|
125
125
|
}, {
|
|
126
126
|
prefilledPublicData
|
|
127
127
|
});
|
|
128
|
-
const
|
|
128
|
+
const pxeServiceConfig = {
|
|
129
|
+
proverEnabled: aztecNodeConfig.realProofs
|
|
130
|
+
};
|
|
131
|
+
const pxe = await createAztecPXE(node, pxeServiceConfig);
|
|
129
132
|
await setupCanonicalL2FeeJuice(pxe, aztecNodeConfig.l1Contracts.feeJuicePortalAddress, logger.info);
|
|
130
133
|
if (initialAccounts.length) {
|
|
131
134
|
userLog('Setting up funded test accounts...');
|
|
@@ -138,7 +141,7 @@ const localAnvil = foundry;
|
|
|
138
141
|
userLog(accLogs.join(''));
|
|
139
142
|
const deployer = await getSchnorrWallet(pxe, initialAccounts[0].address, initialAccounts[0].signingKey);
|
|
140
143
|
await setupBananaFPC(initialAccounts, deployer, userLog);
|
|
141
|
-
await setupSponsoredFPC(
|
|
144
|
+
await setupSponsoredFPC(pxe, userLog);
|
|
142
145
|
}
|
|
143
146
|
const stop = async ()=>{
|
|
144
147
|
await node.stop();
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type PXE
|
|
2
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
1
|
+
import { type PXE } from '@aztec/aztec.js';
|
|
3
2
|
export declare function getSponsoredFPCAddress(): Promise<import("@aztec/aztec.js").AztecAddress>;
|
|
4
|
-
export declare function setupSponsoredFPC(deployer: Wallet, log: LogFn): Promise<void>;
|
|
5
3
|
export declare function getDeployedSponsoredFPCAddress(pxe: PXE): Promise<import("@aztec/aztec.js").AztecAddress>;
|
|
6
4
|
//# sourceMappingURL=sponsored_fpc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sponsored_fpc.d.ts","sourceRoot":"","sources":["../../src/sandbox/sponsored_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"sponsored_fpc.d.ts","sourceRoot":"","sources":["../../src/sandbox/sponsored_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,GAAG,EAAuC,MAAM,iBAAiB,CAAC;AAUtH,wBAAsB,sBAAsB,oDAE3C;AAED,wBAAsB,8BAA8B,CAAC,GAAG,EAAE,GAAG,mDAO5D"}
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import { Fr, getContractInstanceFromDeployParams } from '@aztec/aztec.js';
|
|
2
|
+
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
2
3
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
3
|
-
const SPONSORED_FPC_SALT = new Fr(0);
|
|
4
4
|
async function getSponsoredFPCInstance() {
|
|
5
5
|
return await getContractInstanceFromDeployParams(SponsoredFPCContract.artifact, {
|
|
6
|
-
salt: SPONSORED_FPC_SALT
|
|
6
|
+
salt: new Fr(SPONSORED_FPC_SALT)
|
|
7
7
|
});
|
|
8
8
|
}
|
|
9
9
|
export async function getSponsoredFPCAddress() {
|
|
10
10
|
return (await getSponsoredFPCInstance()).address;
|
|
11
11
|
}
|
|
12
|
-
export async function setupSponsoredFPC(deployer, log) {
|
|
13
|
-
const deployed = await SponsoredFPCContract.deploy(deployer).send({
|
|
14
|
-
contractAddressSalt: SPONSORED_FPC_SALT,
|
|
15
|
-
universalDeploy: true
|
|
16
|
-
}).deployed();
|
|
17
|
-
log(`SponsoredFPC: ${deployed.address}`);
|
|
18
|
-
}
|
|
19
12
|
export async function getDeployedSponsoredFPCAddress(pxe) {
|
|
20
13
|
const fpc = await getSponsoredFPCAddress();
|
|
21
14
|
const contracts = await pxe.getContracts();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "0.82.
|
|
3
|
+
"version": "0.82.1-alpha-testnet.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js"
|
|
@@ -29,34 +29,35 @@
|
|
|
29
29
|
"../package.common.json"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@aztec/accounts": "0.82.
|
|
33
|
-
"@aztec/archiver": "0.82.
|
|
34
|
-
"@aztec/aztec-faucet": "0.82.
|
|
35
|
-
"@aztec/aztec-node": "0.82.
|
|
36
|
-
"@aztec/aztec.js": "0.82.
|
|
37
|
-
"@aztec/bb-prover": "0.82.
|
|
38
|
-
"@aztec/
|
|
39
|
-
"@aztec/
|
|
40
|
-
"@aztec/
|
|
41
|
-
"@aztec/
|
|
42
|
-
"@aztec/cli
|
|
43
|
-
"@aztec/
|
|
44
|
-
"@aztec/
|
|
45
|
-
"@aztec/
|
|
46
|
-
"@aztec/
|
|
47
|
-
"@aztec/
|
|
48
|
-
"@aztec/
|
|
49
|
-
"@aztec/noir-
|
|
50
|
-
"@aztec/
|
|
51
|
-
"@aztec/p2p
|
|
52
|
-
"@aztec/
|
|
53
|
-
"@aztec/
|
|
54
|
-
"@aztec/prover-
|
|
55
|
-
"@aztec/
|
|
56
|
-
"@aztec/
|
|
57
|
-
"@aztec/
|
|
58
|
-
"@aztec/
|
|
59
|
-
"@aztec/
|
|
32
|
+
"@aztec/accounts": "0.82.1-alpha-testnet.1",
|
|
33
|
+
"@aztec/archiver": "0.82.1-alpha-testnet.1",
|
|
34
|
+
"@aztec/aztec-faucet": "0.82.1-alpha-testnet.1",
|
|
35
|
+
"@aztec/aztec-node": "0.82.1-alpha-testnet.1",
|
|
36
|
+
"@aztec/aztec.js": "0.82.1-alpha-testnet.1",
|
|
37
|
+
"@aztec/bb-prover": "0.82.1-alpha-testnet.1",
|
|
38
|
+
"@aztec/bb.js": "0.82.1-alpha-testnet.1",
|
|
39
|
+
"@aztec/blob-sink": "0.82.1-alpha-testnet.1",
|
|
40
|
+
"@aztec/bot": "0.82.1-alpha-testnet.1",
|
|
41
|
+
"@aztec/builder": "0.82.1-alpha-testnet.1",
|
|
42
|
+
"@aztec/cli": "0.82.1-alpha-testnet.1",
|
|
43
|
+
"@aztec/cli-wallet": "0.82.1-alpha-testnet.1",
|
|
44
|
+
"@aztec/constants": "0.82.1-alpha-testnet.1",
|
|
45
|
+
"@aztec/entrypoints": "0.82.1-alpha-testnet.1",
|
|
46
|
+
"@aztec/ethereum": "0.82.1-alpha-testnet.1",
|
|
47
|
+
"@aztec/foundation": "0.82.1-alpha-testnet.1",
|
|
48
|
+
"@aztec/kv-store": "0.82.1-alpha-testnet.1",
|
|
49
|
+
"@aztec/noir-contracts.js": "0.82.1-alpha-testnet.1",
|
|
50
|
+
"@aztec/noir-protocol-circuits-types": "0.82.1-alpha-testnet.1",
|
|
51
|
+
"@aztec/p2p": "0.82.1-alpha-testnet.1",
|
|
52
|
+
"@aztec/p2p-bootstrap": "0.82.1-alpha-testnet.1",
|
|
53
|
+
"@aztec/protocol-contracts": "0.82.1-alpha-testnet.1",
|
|
54
|
+
"@aztec/prover-client": "0.82.1-alpha-testnet.1",
|
|
55
|
+
"@aztec/prover-node": "0.82.1-alpha-testnet.1",
|
|
56
|
+
"@aztec/pxe": "0.82.1-alpha-testnet.1",
|
|
57
|
+
"@aztec/stdlib": "0.82.1-alpha-testnet.1",
|
|
58
|
+
"@aztec/telemetry-client": "0.82.1-alpha-testnet.1",
|
|
59
|
+
"@aztec/txe": "0.82.1-alpha-testnet.1",
|
|
60
|
+
"@aztec/world-state": "0.82.1-alpha-testnet.1",
|
|
60
61
|
"@types/chalk": "^2.2.0",
|
|
61
62
|
"abitype": "^0.8.11",
|
|
62
63
|
"chalk": "^5.3.0",
|
|
@@ -2,7 +2,7 @@ import type { EnvVar } from '@aztec/foundation/config';
|
|
|
2
2
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
|
|
5
|
-
export type NetworkNames = 'testnet-ignition';
|
|
5
|
+
export type NetworkNames = 'testnet-ignition' | 'alpha-testnet';
|
|
6
6
|
|
|
7
7
|
export type L2ChainConfig = {
|
|
8
8
|
l1ChainId: number;
|
|
@@ -16,6 +16,7 @@ export type L2ChainConfig = {
|
|
|
16
16
|
registryAddress: string;
|
|
17
17
|
seqMinTxsPerBlock: number;
|
|
18
18
|
seqMaxTxsPerBlock: number;
|
|
19
|
+
realProofs: boolean;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
|
|
@@ -29,7 +30,23 @@ export const testnetIgnitionL2ChainConfig: L2ChainConfig = {
|
|
|
29
30
|
p2pBootstrapNodes: [],
|
|
30
31
|
registryAddress: '0x12b3ebc176a1646b911391eab3760764f2e05fe3',
|
|
31
32
|
seqMinTxsPerBlock: 0,
|
|
33
|
+
seqMaxTxsPerBlock: 0,
|
|
34
|
+
realProofs: true,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const alphaTestnetL2ChainConfig: L2ChainConfig = {
|
|
38
|
+
l1ChainId: 11155111,
|
|
39
|
+
ethereumSlotDuration: 12,
|
|
40
|
+
aztecSlotDuration: 36,
|
|
41
|
+
aztecEpochDuration: 32,
|
|
42
|
+
aztecProofSubmissionWindow: 64,
|
|
43
|
+
testAccounts: false,
|
|
44
|
+
p2pEnabled: true,
|
|
45
|
+
p2pBootstrapNodes: [],
|
|
46
|
+
registryAddress: '', // To be updated
|
|
47
|
+
seqMinTxsPerBlock: 0,
|
|
32
48
|
seqMaxTxsPerBlock: 4,
|
|
49
|
+
realProofs: true,
|
|
33
50
|
};
|
|
34
51
|
|
|
35
52
|
export async function getBootnodes(networkName: NetworkNames) {
|
|
@@ -50,6 +67,10 @@ export async function getL2ChainConfig(networkName: NetworkNames): Promise<L2Cha
|
|
|
50
67
|
const config = { ...testnetIgnitionL2ChainConfig };
|
|
51
68
|
config.p2pBootstrapNodes = await getBootnodes(networkName);
|
|
52
69
|
return config;
|
|
70
|
+
} else if (networkName === 'alpha-testnet') {
|
|
71
|
+
const config = { ...alphaTestnetL2ChainConfig };
|
|
72
|
+
config.p2pBootstrapNodes = await getBootnodes(networkName);
|
|
73
|
+
return config;
|
|
53
74
|
}
|
|
54
75
|
return undefined;
|
|
55
76
|
}
|
|
@@ -79,4 +100,6 @@ export async function enrichEnvironmentWithChainConfig(networkName: NetworkNames
|
|
|
79
100
|
enrichVar('SEQ_MIN_TX_PER_BLOCK', config.seqMinTxsPerBlock.toString());
|
|
80
101
|
enrichVar('SEQ_MAX_TX_PER_BLOCK', config.seqMaxTxsPerBlock.toString());
|
|
81
102
|
enrichVar('DATA_DIRECTORY', path.join(process.env.HOME || '~', '.aztec', networkName, 'data'));
|
|
103
|
+
enrichVar('PROVER_REAL_PROOFS', config.realProofs.toString());
|
|
104
|
+
enrichVar('PXE_PROVER_ENABLED', config.realProofs.toString());
|
|
82
105
|
}
|
|
@@ -16,7 +16,7 @@ import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts';
|
|
|
16
16
|
|
|
17
17
|
import { createAztecNode, deployContractsToL1 } from '../../sandbox/index.js';
|
|
18
18
|
import { getL1Config } from '../get_l1_config.js';
|
|
19
|
-
import { extractNamespacedOptions, extractRelevantOptions } from '../util.js';
|
|
19
|
+
import { extractNamespacedOptions, extractRelevantOptions, preloadCrsDataForVerifying } from '../util.js';
|
|
20
20
|
|
|
21
21
|
export async function startNode(
|
|
22
22
|
options: any,
|
|
@@ -45,6 +45,8 @@ export async function startNode(
|
|
|
45
45
|
process.exit(1);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
await preloadCrsDataForVerifying(nodeConfig, userLog);
|
|
49
|
+
|
|
48
50
|
const initialFundedAccounts = nodeConfig.testAccounts ? await getInitialTestAccounts() : [];
|
|
49
51
|
const { genesisBlockHash, genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(
|
|
50
52
|
initialFundedAccounts.map(a => a.address),
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { getProverNodeAgentConfigFromEnv } from '@aztec/prover-node';
|
|
14
14
|
import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
|
|
15
15
|
|
|
16
|
-
import { extractRelevantOptions } from '../util.js';
|
|
16
|
+
import { extractRelevantOptions, preloadCrsDataForServerSideProving } from '../util.js';
|
|
17
17
|
import { getVersions } from '../versioning.js';
|
|
18
18
|
|
|
19
19
|
export async function startProverAgent(
|
|
@@ -40,6 +40,8 @@ export async function startProverAgent(
|
|
|
40
40
|
process.exit(1);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
await preloadCrsDataForServerSideProving(config, userLog);
|
|
44
|
+
|
|
43
45
|
const fetch = makeTracedFetch([1, 2, 3], false, makeUndiciFetch(new Agent({ connections: 10 })));
|
|
44
46
|
const broker = createProvingJobBrokerClient(config.proverBrokerUrl, getVersions(), fetch);
|
|
45
47
|
|
|
@@ -18,7 +18,7 @@ import { getGenesisValues } from '@aztec/world-state/testing';
|
|
|
18
18
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
19
19
|
|
|
20
20
|
import { getL1Config } from '../get_l1_config.js';
|
|
21
|
-
import { extractRelevantOptions } from '../util.js';
|
|
21
|
+
import { extractRelevantOptions, preloadCrsDataForVerifying } from '../util.js';
|
|
22
22
|
import { getVersions } from '../versioning.js';
|
|
23
23
|
import { startProverBroker } from './start_prover_broker.js';
|
|
24
24
|
|
|
@@ -99,6 +99,8 @@ export async function startProverNode(
|
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
await preloadCrsDataForVerifying(proverConfig, userLog);
|
|
103
|
+
|
|
102
104
|
const initialFundedAccounts = proverConfig.testAccounts ? await getInitialTestAccounts() : [];
|
|
103
105
|
const { prefilledPublicData } = await getGenesisValues(initialFundedAccounts.map(a => a.address));
|
|
104
106
|
|
package/src/cli/util.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
1
2
|
import type { AccountManager, Fr } from '@aztec/aztec.js';
|
|
2
3
|
import type { ConfigMappingsType } from '@aztec/foundation/config';
|
|
3
4
|
import type { LogFn } from '@aztec/foundation/log';
|
|
4
5
|
import type { PXEService } from '@aztec/pxe/server';
|
|
6
|
+
import type { ProverConfig } from '@aztec/stdlib/interfaces/server';
|
|
5
7
|
|
|
6
8
|
import chalk from 'chalk';
|
|
7
9
|
import type { Command } from 'commander';
|
|
@@ -214,3 +216,33 @@ export const extractRelevantOptions = <T>(
|
|
|
214
216
|
|
|
215
217
|
return relevantOptions;
|
|
216
218
|
};
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Downloads just enough points to be able to verify ClientIVC proofs.
|
|
222
|
+
* @param opts - Whether proof are to be verifier
|
|
223
|
+
* @param log - Logging function
|
|
224
|
+
*/
|
|
225
|
+
export async function preloadCrsDataForVerifying(
|
|
226
|
+
{ realProofs }: Pick<AztecNodeConfig, 'realProofs'>,
|
|
227
|
+
log: LogFn,
|
|
228
|
+
): Promise<void> {
|
|
229
|
+
if (realProofs) {
|
|
230
|
+
const { Crs, GrumpkinCrs } = await import('@aztec/bb.js');
|
|
231
|
+
await Promise.all([Crs.new(2 ** 1, undefined, log), GrumpkinCrs.new(2 ** 16 + 1, undefined, log)]);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Downloads enough points to be able to prove every server-side circuit
|
|
237
|
+
* @param opts - Whether real proof are to be generated
|
|
238
|
+
* @param log - Logging function
|
|
239
|
+
*/
|
|
240
|
+
export async function preloadCrsDataForServerSideProving(
|
|
241
|
+
{ realProofs }: Pick<ProverConfig, 'realProofs'>,
|
|
242
|
+
log: LogFn,
|
|
243
|
+
): Promise<void> {
|
|
244
|
+
if (realProofs) {
|
|
245
|
+
const { Crs, GrumpkinCrs } = await import('@aztec/bb.js');
|
|
246
|
+
await Promise.all([Crs.new(2 ** 25 - 1, undefined, log), GrumpkinCrs.new(2 ** 18 + 1, undefined, log)]);
|
|
247
|
+
}
|
|
248
|
+
}
|
package/src/index.ts
CHANGED
package/src/sandbox/index.ts
CHANGED
|
@@ -2,4 +2,3 @@ export * from './sandbox.js';
|
|
|
2
2
|
|
|
3
3
|
export { getDeployedBananaCoinAddress, getDeployedBananaFPCAddress } from './banana_fpc.js';
|
|
4
4
|
export { getDeployedSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
5
|
-
export { SponsoredFeePaymentMethod } from './sponsored_fee_payment_method.js';
|
package/src/sandbox/sandbox.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { deployFundedSchnorrAccounts, getInitialTestAccounts } from '@aztec/acco
|
|
|
4
4
|
import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec/aztec-node';
|
|
5
5
|
import { AnvilTestWatcher, EthCheatCodes } from '@aztec/aztec.js/testing';
|
|
6
6
|
import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
7
|
-
import { setupCanonicalL2FeeJuice } from '@aztec/cli/
|
|
7
|
+
import { setupCanonicalL2FeeJuice, setupSponsoredFPC } from '@aztec/cli/cli-utils';
|
|
8
8
|
import { GENESIS_ARCHIVE_ROOT, GENESIS_BLOCK_HASH } from '@aztec/constants';
|
|
9
9
|
import {
|
|
10
10
|
NULL_KEY,
|
|
@@ -34,7 +34,7 @@ import { foundry } from 'viem/chains';
|
|
|
34
34
|
import { createAccountLogs } from '../cli/util.js';
|
|
35
35
|
import { DefaultMnemonic } from '../mnemonic.js';
|
|
36
36
|
import { getBananaFPCAddress, setupBananaFPC } from './banana_fpc.js';
|
|
37
|
-
import { getSponsoredFPCAddress
|
|
37
|
+
import { getSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
38
38
|
|
|
39
39
|
const logger = createLogger('sandbox');
|
|
40
40
|
|
|
@@ -165,7 +165,8 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
|
|
|
165
165
|
// Create a local blob sink client inside the sandbox, no http connectivity
|
|
166
166
|
const blobSinkClient = createBlobSinkClient();
|
|
167
167
|
const node = await createAztecNode(aztecNodeConfig, { telemetry, blobSinkClient }, { prefilledPublicData });
|
|
168
|
-
const
|
|
168
|
+
const pxeServiceConfig = { proverEnabled: aztecNodeConfig.realProofs };
|
|
169
|
+
const pxe = await createAztecPXE(node, pxeServiceConfig);
|
|
169
170
|
|
|
170
171
|
await setupCanonicalL2FeeJuice(pxe, aztecNodeConfig.l1Contracts.feeJuicePortalAddress, logger.info);
|
|
171
172
|
|
|
@@ -181,7 +182,7 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
|
|
|
181
182
|
|
|
182
183
|
const deployer = await getSchnorrWallet(pxe, initialAccounts[0].address, initialAccounts[0].signingKey);
|
|
183
184
|
await setupBananaFPC(initialAccounts, deployer, userLog);
|
|
184
|
-
await setupSponsoredFPC(
|
|
185
|
+
await setupSponsoredFPC(pxe, userLog);
|
|
185
186
|
}
|
|
186
187
|
|
|
187
188
|
const stop = async () => {
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
Fr,
|
|
4
|
-
type PXE,
|
|
5
|
-
type Wallet,
|
|
6
|
-
getContractInstanceFromDeployParams,
|
|
7
|
-
} from '@aztec/aztec.js';
|
|
8
|
-
import type { LogFn } from '@aztec/foundation/log';
|
|
1
|
+
import { type ContractInstanceWithAddress, Fr, type PXE, getContractInstanceFromDeployParams } from '@aztec/aztec.js';
|
|
2
|
+
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
9
3
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
10
4
|
|
|
11
|
-
const SPONSORED_FPC_SALT = new Fr(0);
|
|
12
|
-
|
|
13
5
|
async function getSponsoredFPCInstance(): Promise<ContractInstanceWithAddress> {
|
|
14
6
|
return await getContractInstanceFromDeployParams(SponsoredFPCContract.artifact, {
|
|
15
|
-
salt: SPONSORED_FPC_SALT,
|
|
7
|
+
salt: new Fr(SPONSORED_FPC_SALT),
|
|
16
8
|
});
|
|
17
9
|
}
|
|
18
10
|
|
|
@@ -20,14 +12,6 @@ export async function getSponsoredFPCAddress() {
|
|
|
20
12
|
return (await getSponsoredFPCInstance()).address;
|
|
21
13
|
}
|
|
22
14
|
|
|
23
|
-
export async function setupSponsoredFPC(deployer: Wallet, log: LogFn) {
|
|
24
|
-
const deployed = await SponsoredFPCContract.deploy(deployer)
|
|
25
|
-
.send({ contractAddressSalt: SPONSORED_FPC_SALT, universalDeploy: true })
|
|
26
|
-
.deployed();
|
|
27
|
-
|
|
28
|
-
log(`SponsoredFPC: ${deployed.address}`);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
15
|
export async function getDeployedSponsoredFPCAddress(pxe: PXE) {
|
|
32
16
|
const fpc = await getSponsoredFPCAddress();
|
|
33
17
|
const contracts = await pxe.getContracts();
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { FeePaymentMethod } from '@aztec/aztec.js';
|
|
2
|
-
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
3
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
5
|
-
/**
|
|
6
|
-
* A payment method that uses the SponsoredFPCContract to pay the fee unconditionally.
|
|
7
|
-
*/
|
|
8
|
-
export declare class SponsoredFeePaymentMethod implements FeePaymentMethod {
|
|
9
|
-
/**
|
|
10
|
-
* Contract which will pay the fee.
|
|
11
|
-
*/
|
|
12
|
-
private paymentContract;
|
|
13
|
-
constructor(
|
|
14
|
-
/**
|
|
15
|
-
* Contract which will pay the fee.
|
|
16
|
-
*/
|
|
17
|
-
paymentContract: AztecAddress);
|
|
18
|
-
static new(pxe: PXE): Promise<SponsoredFeePaymentMethod>;
|
|
19
|
-
getAsset(): Promise<AztecAddress>;
|
|
20
|
-
getFeePayer(): Promise<AztecAddress>;
|
|
21
|
-
getExecutionPayload(): Promise<ExecutionPayload>;
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=sponsored_fee_payment_method.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sponsored_fee_payment_method.d.ts","sourceRoot":"","sources":["../../src/sandbox/sponsored_fee_payment_method.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAI3D;;GAEG;AACH,qBAAa,yBAA0B,YAAW,gBAAgB;IAE9D;;OAEG;IACH,OAAO,CAAC,eAAe;;IAHvB;;OAEG;IACK,eAAe,EAAE,YAAY;WAG1B,GAAG,CAAC,GAAG,EAAE,GAAG;IAKzB,QAAQ,IAAI,OAAO,CAAC,YAAY,CAAC;IAIjC,WAAW,IAAI,OAAO,CAAC,YAAY,CAAC;IAI9B,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;CAiBvD"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
2
|
-
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
3
|
-
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
4
|
-
import { getDeployedSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
5
|
-
/**
|
|
6
|
-
* A payment method that uses the SponsoredFPCContract to pay the fee unconditionally.
|
|
7
|
-
*/ export class SponsoredFeePaymentMethod {
|
|
8
|
-
paymentContract;
|
|
9
|
-
constructor(/**
|
|
10
|
-
* Contract which will pay the fee.
|
|
11
|
-
*/ paymentContract){
|
|
12
|
-
this.paymentContract = paymentContract;
|
|
13
|
-
}
|
|
14
|
-
static async new(pxe) {
|
|
15
|
-
const sponsoredFPC = await getDeployedSponsoredFPCAddress(pxe);
|
|
16
|
-
return new SponsoredFeePaymentMethod(sponsoredFPC);
|
|
17
|
-
}
|
|
18
|
-
getAsset() {
|
|
19
|
-
return Promise.resolve(ProtocolContractAddress.FeeJuice);
|
|
20
|
-
}
|
|
21
|
-
getFeePayer() {
|
|
22
|
-
return Promise.resolve(this.paymentContract);
|
|
23
|
-
}
|
|
24
|
-
async getExecutionPayload() {
|
|
25
|
-
return new ExecutionPayload([
|
|
26
|
-
{
|
|
27
|
-
name: 'sponsor_unconditionally',
|
|
28
|
-
to: this.paymentContract,
|
|
29
|
-
selector: await FunctionSelector.fromSignature('sponsor_unconditionally()'),
|
|
30
|
-
type: FunctionType.PRIVATE,
|
|
31
|
-
isStatic: false,
|
|
32
|
-
args: [],
|
|
33
|
-
returnTypes: []
|
|
34
|
-
}
|
|
35
|
-
], [], []);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { FeePaymentMethod } from '@aztec/aztec.js';
|
|
2
|
-
import { ExecutionPayload } from '@aztec/entrypoints/payload';
|
|
3
|
-
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
4
|
-
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
5
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
-
import type { PXE } from '@aztec/stdlib/interfaces/client';
|
|
7
|
-
|
|
8
|
-
import { getDeployedSponsoredFPCAddress } from './sponsored_fpc.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* A payment method that uses the SponsoredFPCContract to pay the fee unconditionally.
|
|
12
|
-
*/
|
|
13
|
-
export class SponsoredFeePaymentMethod implements FeePaymentMethod {
|
|
14
|
-
constructor(
|
|
15
|
-
/**
|
|
16
|
-
* Contract which will pay the fee.
|
|
17
|
-
*/
|
|
18
|
-
private paymentContract: AztecAddress,
|
|
19
|
-
) {}
|
|
20
|
-
|
|
21
|
-
static async new(pxe: PXE) {
|
|
22
|
-
const sponsoredFPC = await getDeployedSponsoredFPCAddress(pxe);
|
|
23
|
-
return new SponsoredFeePaymentMethod(sponsoredFPC);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
getAsset(): Promise<AztecAddress> {
|
|
27
|
-
return Promise.resolve(ProtocolContractAddress.FeeJuice);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
getFeePayer(): Promise<AztecAddress> {
|
|
31
|
-
return Promise.resolve(this.paymentContract);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async getExecutionPayload(): Promise<ExecutionPayload> {
|
|
35
|
-
return new ExecutionPayload(
|
|
36
|
-
[
|
|
37
|
-
{
|
|
38
|
-
name: 'sponsor_unconditionally',
|
|
39
|
-
to: this.paymentContract,
|
|
40
|
-
selector: await FunctionSelector.fromSignature('sponsor_unconditionally()'),
|
|
41
|
-
type: FunctionType.PRIVATE,
|
|
42
|
-
isStatic: false,
|
|
43
|
-
args: [],
|
|
44
|
-
returnTypes: [],
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
[],
|
|
48
|
-
[],
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
}
|