@aztec/aztec 5.0.0-private.20260318 → 5.0.0-rc.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.
Files changed (108) hide show
  1. package/dest/bin/index.js +1 -1
  2. package/dest/cli/aztec_start_action.d.ts +1 -1
  3. package/dest/cli/aztec_start_action.d.ts.map +1 -1
  4. package/dest/cli/aztec_start_action.js +16 -24
  5. package/dest/cli/aztec_start_options.d.ts +2 -2
  6. package/dest/cli/aztec_start_options.d.ts.map +1 -1
  7. package/dest/cli/aztec_start_options.js +14 -14
  8. package/dest/cli/cmds/compile.d.ts +1 -1
  9. package/dest/cli/cmds/compile.d.ts.map +1 -1
  10. package/dest/cli/cmds/compile.js +8 -8
  11. package/dest/cli/cmds/profile.d.ts +1 -1
  12. package/dest/cli/cmds/profile.d.ts.map +1 -1
  13. package/dest/cli/cmds/profile.js +1 -1
  14. package/dest/cli/cmds/profile_gates.d.ts +2 -2
  15. package/dest/cli/cmds/profile_gates.d.ts.map +1 -1
  16. package/dest/cli/cmds/profile_gates.js +21 -3
  17. package/dest/cli/cmds/standby.d.ts +3 -5
  18. package/dest/cli/cmds/standby.d.ts.map +1 -1
  19. package/dest/cli/cmds/standby.js +3 -3
  20. package/dest/cli/cmds/start_bot.d.ts +1 -1
  21. package/dest/cli/cmds/start_bot.d.ts.map +1 -1
  22. package/dest/cli/cmds/start_bot.js +8 -4
  23. package/dest/cli/cmds/start_node.d.ts +1 -1
  24. package/dest/cli/cmds/start_node.d.ts.map +1 -1
  25. package/dest/cli/cmds/start_node.js +13 -40
  26. package/dest/cli/cmds/start_prover_agent.d.ts +1 -1
  27. package/dest/cli/cmds/start_prover_agent.d.ts.map +1 -1
  28. package/dest/cli/cmds/start_prover_agent.js +5 -17
  29. package/dest/cli/cmds/start_prover_broker.d.ts +1 -1
  30. package/dest/cli/cmds/start_prover_broker.d.ts.map +1 -1
  31. package/dest/cli/cmds/start_prover_broker.js +11 -8
  32. package/dest/cli/cmds/start_txe.d.ts +2 -2
  33. package/dest/cli/cmds/start_txe.d.ts.map +1 -1
  34. package/dest/cli/cmds/start_txe.js +6 -5
  35. package/dest/cli/cmds/utils/collect_crate_dirs.d.ts +21 -0
  36. package/dest/cli/cmds/utils/collect_crate_dirs.d.ts.map +1 -0
  37. package/dest/cli/cmds/utils/collect_crate_dirs.js +114 -0
  38. package/dest/cli/cmds/utils/needs_recompile.d.ts +1 -1
  39. package/dest/cli/cmds/utils/needs_recompile.d.ts.map +1 -1
  40. package/dest/cli/cmds/utils/needs_recompile.js +9 -53
  41. package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts +4 -0
  42. package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.d.ts.map +1 -0
  43. package/dest/cli/cmds/utils/warn_if_aztec_version_mismatch.js +61 -0
  44. package/dest/cli/util.js +7 -5
  45. package/dest/examples/token.js +3 -3
  46. package/dest/local-network/auth_registry.d.ts +5 -0
  47. package/dest/local-network/auth_registry.d.ts.map +1 -0
  48. package/dest/local-network/auth_registry.js +17 -0
  49. package/dest/local-network/banana_fpc.d.ts +3 -2
  50. package/dest/local-network/banana_fpc.d.ts.map +1 -1
  51. package/dest/local-network/banana_fpc.js +11 -7
  52. package/dest/local-network/local-network.d.ts +6 -29
  53. package/dest/local-network/local-network.d.ts.map +1 -1
  54. package/dest/local-network/local-network.js +45 -70
  55. package/dest/testing/cheat_codes.d.ts +18 -17
  56. package/dest/testing/cheat_codes.d.ts.map +1 -1
  57. package/dest/testing/cheat_codes.js +70 -36
  58. package/dest/testing/epoch_test_settler.d.ts +2 -2
  59. package/dest/testing/epoch_test_settler.d.ts.map +1 -1
  60. package/dest/testing/epoch_test_settler.js +6 -25
  61. package/dest/testing/index.d.ts +1 -2
  62. package/dest/testing/index.d.ts.map +1 -1
  63. package/dest/testing/index.js +0 -1
  64. package/package.json +34 -33
  65. package/scripts/add_crate.sh +11 -60
  66. package/scripts/aztec.sh +6 -2
  67. package/scripts/init.sh +5 -5
  68. package/scripts/new.sh +2 -2
  69. package/scripts/setup_workspace.sh +3 -2
  70. package/scripts/templates/blank/contract/Nargo.toml +6 -0
  71. package/scripts/templates/blank/contract/src/main.nr +10 -0
  72. package/scripts/templates/blank/test/Nargo.toml +7 -0
  73. package/scripts/templates/blank/test/src/lib.nr +11 -0
  74. package/scripts/templates/counter/contract/Nargo.toml +7 -0
  75. package/scripts/templates/counter/contract/src/main.nr +48 -0
  76. package/scripts/templates/counter/test/Nargo.toml +7 -0
  77. package/scripts/templates/counter/test/src/lib.nr +32 -0
  78. package/src/bin/index.ts +1 -1
  79. package/src/cli/aztec_start_action.ts +14 -17
  80. package/src/cli/aztec_start_options.ts +21 -22
  81. package/src/cli/cmds/compile.ts +10 -9
  82. package/src/cli/cmds/profile.ts +2 -1
  83. package/src/cli/cmds/profile_gates.ts +20 -4
  84. package/src/cli/cmds/standby.ts +4 -4
  85. package/src/cli/cmds/start_bot.ts +9 -6
  86. package/src/cli/cmds/start_node.ts +20 -23
  87. package/src/cli/cmds/start_prover_agent.ts +5 -8
  88. package/src/cli/cmds/start_prover_broker.ts +10 -11
  89. package/src/cli/cmds/start_txe.ts +7 -5
  90. package/src/cli/cmds/utils/collect_crate_dirs.ts +118 -0
  91. package/src/cli/cmds/utils/needs_recompile.ts +8 -61
  92. package/src/cli/cmds/utils/warn_if_aztec_version_mismatch.ts +76 -0
  93. package/src/cli/util.ts +7 -7
  94. package/src/examples/token.ts +3 -3
  95. package/src/local-network/auth_registry.ts +19 -0
  96. package/src/local-network/banana_fpc.ts +12 -8
  97. package/src/local-network/local-network.ts +49 -80
  98. package/src/testing/cheat_codes.ts +89 -39
  99. package/src/testing/epoch_test_settler.ts +8 -31
  100. package/src/testing/index.ts +0 -1
  101. package/dest/cli/cmds/start_archiver.d.ts +0 -9
  102. package/dest/cli/cmds/start_archiver.d.ts.map +0 -1
  103. package/dest/cli/cmds/start_archiver.js +0 -48
  104. package/dest/testing/anvil_test_watcher.d.ts +0 -42
  105. package/dest/testing/anvil_test_watcher.d.ts.map +0 -1
  106. package/dest/testing/anvil_test_watcher.js +0 -181
  107. package/src/cli/cmds/start_archiver.ts +0 -50
  108. package/src/testing/anvil_test_watcher.ts +0 -210
@@ -1,15 +1,15 @@
1
1
  import { times } from '@aztec/foundation/collection';
2
2
  import { Agent, makeUndiciFetch } from '@aztec/foundation/json-rpc/undici';
3
3
  import { buildServerCircuitProver } from '@aztec/prover-client';
4
- import { ProvingAgent, createProofStore, createProvingJobBrokerClient, proverAgentConfigMappings } from '@aztec/prover-client/broker';
4
+ import { ProvingAgent, createProofStore, createProvingJobBrokerClient, proverAgentConfigMappings, proverBrokerBackoff } from '@aztec/prover-client/broker';
5
5
  import { getProverNodeAgentConfigFromEnv } from '@aztec/prover-node';
6
6
  import { ProverAgentApiSchema } from '@aztec/stdlib/interfaces/server';
7
7
  import { initTelemetryClient, makeTracedFetch, telemetryClientConfigMappings } from '@aztec/telemetry-client';
8
8
  import { extractRelevantOptions, preloadCrsDataForServerSideProving } from '../util.js';
9
9
  import { getVersions } from '../versioning.js';
10
10
  export async function startProverAgent(options, signalHandlers, services, userLog) {
11
- if (options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) {
12
- userLog(`Starting a prover agent with --node, --sequencer, --pxe, --p2p-bootstrap, or --txe is not supported.`);
11
+ if (options.node || options.sequencer || options.p2pBootstrap || options.txe) {
12
+ userLog(`Starting a prover agent with --node, --sequencer, --p2p-bootstrap, or --txe is not supported.`);
13
13
  process.exit(1);
14
14
  }
15
15
  const config = {
@@ -25,20 +25,8 @@ export async function startProverAgent(options, signalHandlers, services, userLo
25
25
  process.exit(1);
26
26
  }
27
27
  await preloadCrsDataForServerSideProving(config, userLog);
28
- const fetch = makeTracedFetch(// retry connections every 3s, up to 30s before giving up
29
- [
30
- 1,
31
- 2,
32
- 3,
33
- 3,
34
- 3,
35
- 3,
36
- 3,
37
- 3,
38
- 3,
39
- 3,
40
- 3
41
- ], false, makeUndiciFetch(new Agent({
28
+ // Retry indefinitely until the epoch proving times out and the chain reorgs
29
+ const fetch = makeTracedFetch(proverBrokerBackoff, false, makeUndiciFetch(new Agent({
42
30
  connections: 10
43
31
  })));
44
32
  const broker = createProvingJobBrokerClient(config.proverBrokerUrl, getVersions(), fetch);
@@ -6,4 +6,4 @@ export declare function startProverBroker(options: any, signalHandlers: (() => P
6
6
  broker: ProvingJobBroker;
7
7
  config: ProverBrokerConfig;
8
8
  }>;
9
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfcHJvdmVyX2Jyb2tlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3N0YXJ0X3Byb3Zlcl9icm9rZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxLQUFLLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUMvRSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUduRCxPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFLeEIsTUFBTSw2QkFBNkIsQ0FBQztBQUVyQyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBTXhFLHdCQUFzQixpQkFBaUIsQ0FDckMsT0FBTyxFQUFFLEdBQUcsRUFDWixjQUFjLEVBQUUsQ0FBQyxNQUFNLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLEVBQ3ZDLFFBQVEsRUFBRSxxQkFBcUIsRUFDL0IsT0FBTyxFQUFFLEtBQUssR0FDYixPQUFPLENBQUM7SUFBRSxNQUFNLEVBQUUsZ0JBQWdCLENBQUM7SUFBQyxNQUFNLEVBQUUsa0JBQWtCLENBQUE7Q0FBRSxDQUFDLENBNENuRSJ9
9
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfcHJvdmVyX2Jyb2tlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NsaS9jbWRzL3N0YXJ0X3Byb3Zlcl9icm9rZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxLQUFLLEVBQUUscUJBQXFCLEVBQUUsTUFBTSxtQ0FBbUMsQ0FBQztBQUMvRSxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUduRCxPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFLeEIsTUFBTSw2QkFBNkIsQ0FBQztBQUVyQyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBTXhFLHdCQUFzQixpQkFBaUIsQ0FDckMsT0FBTyxFQUFFLEdBQUcsRUFDWixjQUFjLEVBQUUsQ0FBQyxNQUFNLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxFQUFFLEVBQ3ZDLFFBQVEsRUFBRSxxQkFBcUIsRUFDL0IsT0FBTyxFQUFFLEtBQUssR0FDYixPQUFPLENBQUM7SUFBRSxNQUFNLEVBQUUsZ0JBQWdCLENBQUM7SUFBQyxNQUFNLEVBQUUsa0JBQWtCLENBQUE7Q0FBRSxDQUFDLENBMkNuRSJ9
@@ -1 +1 @@
1
- {"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,wBAAsB,iBAAiB,CACrC,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,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC,CA4CnE"}
1
+ {"version":3,"file":"start_prover_broker.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_broker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMxE,wBAAsB,iBAAiB,CACrC,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,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,CAAC,CA2CnE"}
@@ -8,27 +8,30 @@ import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } fro
8
8
  import { extractRelevantOptions } from '../util.js';
9
9
  import { computeExpectedGenesisRoot, waitForCompatibleRollup } from './standby.js';
10
10
  export async function startProverBroker(options, signalHandlers, services, userLog) {
11
- if (options.node || options.sequencer || options.pxe || options.p2pBootstrap || options.txe) {
12
- userLog(`Starting a prover broker with --node, --sequencer, --pxe, --p2p-bootstrap, or --txe is not supported.`);
11
+ if (options.node || options.sequencer || options.p2pBootstrap || options.txe) {
12
+ userLog(`Starting a prover broker with --node, --sequencer, --p2p-bootstrap, or --txe is not supported.`);
13
13
  process.exit(1);
14
14
  }
15
- const config = {
15
+ const baseConfig = {
16
16
  ...getProverNodeBrokerConfigFromEnv(),
17
17
  ...extractRelevantOptions(options, proverBrokerConfigMappings, 'proverBroker')
18
18
  };
19
- if (!config.l1Contracts.registryAddress || config.l1Contracts.registryAddress.isZero()) {
19
+ if (!baseConfig.registryAddress || baseConfig.registryAddress.isZero()) {
20
20
  throw new Error('L1 registry address is required to start Aztec Node without --deploy-aztec-contracts option');
21
21
  }
22
22
  const genesisConfig = getGenesisStateConfigEnvVars();
23
23
  const { genesisArchiveRoot } = await computeExpectedGenesisRoot(genesisConfig, userLog);
24
- await waitForCompatibleRollup(config, {
24
+ await waitForCompatibleRollup(baseConfig, {
25
25
  genesisArchiveRoot,
26
26
  vkTreeRoot: getVKTreeRoot(),
27
27
  protocolContractsHash
28
28
  }, options.port, userLog);
29
- const { addresses, config: rollupConfig } = await getL1Config(config.l1Contracts.registryAddress, config.l1RpcUrls, config.l1ChainId, config.rollupVersion);
30
- config.l1Contracts = addresses;
31
- config.rollupVersion = rollupConfig.rollupVersion;
29
+ const { addresses, config: rollupConfig } = await getL1Config(baseConfig.registryAddress, baseConfig.l1RpcUrls, baseConfig.l1ChainId, baseConfig.rollupVersion);
30
+ const config = {
31
+ ...baseConfig,
32
+ ...addresses,
33
+ rollupVersion: rollupConfig.rollupVersion
34
+ };
32
35
  const client = await initTelemetryClient(getTelemetryClientConfig());
33
36
  const broker = await createAndStartProvingBroker(config, client);
34
37
  services.proverBroker = [
@@ -1,3 +1,3 @@
1
1
  import type { Logger } from '@aztec/foundation/log';
2
- export declare function startTXE(options: any, debugLogger: Logger): Promise<void>;
3
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfdHhlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpL2NtZHMvc3RhcnRfdHhlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBR3BELHdCQUFzQixRQUFRLENBQUMsT0FBTyxFQUFFLEdBQUcsRUFBRSxXQUFXLEVBQUUsTUFBTSxpQkFVL0QifQ==
2
+ export declare function startTXE(options: any, signalHandlers: Array<() => Promise<void>>, debugLogger: Logger): Promise<void>;
3
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhcnRfdHhlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpL2NtZHMvc3RhcnRfdHhlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBR3BELHdCQUFzQixRQUFRLENBQUMsT0FBTyxFQUFFLEdBQUcsRUFBRSxjQUFjLEVBQUUsS0FBSyxDQUFDLE1BQU0sT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsV0FBVyxFQUFFLE1BQU0saUJBWTNHIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"start_txe.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_txe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,iBAU/D"}
1
+ {"version":3,"file":"start_txe.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_txe.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,wBAAsB,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,iBAY3G"}
@@ -1,11 +1,12 @@
1
1
  import { startHttpRpcServer } from '@aztec/foundation/json-rpc/server';
2
- import { createTXERpcServer } from '@aztec/txe';
3
- export async function startTXE(options, debugLogger) {
2
+ import { createTXERpcServer } from '@aztec/txe/server';
3
+ export async function startTXE(options, signalHandlers, debugLogger) {
4
4
  debugLogger.info(`Setting up TXE...`);
5
- const txeServer = createTXERpcServer(debugLogger);
6
- const { port } = await startHttpRpcServer(txeServer, {
5
+ const txeServer = await createTXERpcServer(debugLogger);
6
+ const httpServer = await startHttpRpcServer(txeServer, {
7
7
  port: options.port,
8
8
  timeoutMs: 1e3 * 60 * 5
9
9
  });
10
- debugLogger.info(`TXE listening on port ${port}`);
10
+ signalHandlers.push(()=>new Promise((resolve)=>httpServer.close(()=>resolve())));
11
+ debugLogger.info(`TXE listening on port ${httpServer.port}`);
11
12
  }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Recursively collects crate directories starting from startCrateDir by following dependencies declared in Nargo.toml
3
+ * files.
4
+ *
5
+ * When `skipGitDeps` is false (default), git-based deps are followed and fetched into the nargo cache
6
+ * (`$HOME/nargo/<domain>/<repo-path>/<tag>`) if not already present.
7
+ *
8
+ * When `skipGitDeps` is true, git-based deps are ignored entirely.
9
+ */
10
+ export declare function collectCrateDirs(startCrateDir: string, opts?: {
11
+ skipGitDeps?: boolean;
12
+ }): Promise<string[]>;
13
+ /**
14
+ * Computes the local nargo cache path for a git dependency, mirroring nargo's own `git_dep_location` function.
15
+ * Path format: `$HOME/nargo/<domain>/<repo-path>/<tag>`
16
+ * e.g. `~/nargo/github.com/AztecProtocol/aztec-packages/v0.82.0`
17
+ *
18
+ * Source: noir/noir-repo/tooling/nargo_toml/src/git.rs
19
+ */
20
+ export declare function nargoGitDepPath(gitUrl: string, tag: string): string;
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGVjdF9jcmF0ZV9kaXJzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpL2NtZHMvdXRpbHMvY29sbGVjdF9jcmF0ZV9kaXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVFBOzs7Ozs7OztHQVFHO0FBQ0gsd0JBQXNCLGdCQUFnQixDQUFDLGFBQWEsRUFBRSxNQUFNLEVBQUUsSUFBSSxDQUFDLEVBQUU7SUFBRSxXQUFXLENBQUMsRUFBRSxPQUFPLENBQUE7Q0FBRSxHQUFHLE9BQU8sQ0FBQyxNQUFNLEVBQUUsQ0FBQyxDQWlFakg7QUFFRDs7Ozs7O0dBTUc7QUFDSCx3QkFBZ0IsZUFBZSxDQUFDLE1BQU0sRUFBRSxNQUFNLEVBQUUsR0FBRyxFQUFFLE1BQU0sR0FBRyxNQUFNLENBS25FIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collect_crate_dirs.d.ts","sourceRoot":"","sources":["../../../../src/cli/cmds/utils/collect_crate_dirs.ts"],"names":[],"mappings":"AAQA;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAiEjH;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAKnE"}
@@ -0,0 +1,114 @@
1
+ import TOML from '@iarna/toml';
2
+ import { existsSync } from 'fs';
3
+ import { mkdir, readFile, stat } from 'fs/promises';
4
+ import { homedir } from 'os';
5
+ import { dirname, join, resolve } from 'path';
6
+ import { run } from './spawn.js';
7
+ /**
8
+ * Recursively collects crate directories starting from startCrateDir by following dependencies declared in Nargo.toml
9
+ * files.
10
+ *
11
+ * When `skipGitDeps` is false (default), git-based deps are followed and fetched into the nargo cache
12
+ * (`$HOME/nargo/<domain>/<repo-path>/<tag>`) if not already present.
13
+ *
14
+ * When `skipGitDeps` is true, git-based deps are ignored entirely.
15
+ */ export async function collectCrateDirs(startCrateDir, opts) {
16
+ const { skipGitDeps = false } = opts ?? {};
17
+ const visited = new Set();
18
+ async function visit(crateDir) {
19
+ const absDir = resolve(crateDir);
20
+ if (visited.has(absDir)) {
21
+ return;
22
+ }
23
+ visited.add(absDir);
24
+ const tomlPath = join(absDir, 'Nargo.toml');
25
+ const content = await readFile(tomlPath, 'utf-8').catch(()=>{
26
+ throw new Error(`Incorrectly defined dependency. Nargo.toml not found in ${absDir}`);
27
+ });
28
+ const parsed = TOML.parse(content);
29
+ const members = parsed.workspace?.members;
30
+ // A Nargo.toml is either a workspace root (has workspace.members) or a single crate (has dependencies).
31
+ if (Array.isArray(members)) {
32
+ // The crate is a workspace root and has members defined so we visit the members
33
+ for (const member of members){
34
+ await visit(resolve(absDir, member));
35
+ }
36
+ } else {
37
+ // Single crate — follow its deps
38
+ const deps = parsed.dependencies ?? {};
39
+ for (const dep of Object.values(deps)){
40
+ if (!dep || typeof dep !== 'object') {
41
+ continue;
42
+ }
43
+ if (typeof dep.path === 'string') {
44
+ // Dependency contains "path" hence it's a local dependency. We just check it's a real directory and then we
45
+ // recursively search through it
46
+ const depPath = resolve(absDir, dep.path);
47
+ const s = await stat(depPath);
48
+ if (!s.isDirectory()) {
49
+ throw new Error(`Dependency path "${dep.path}" in ${tomlPath} resolves to ${depPath} which is not a directory`);
50
+ }
51
+ await visit(depPath);
52
+ } else if (!skipGitDeps && typeof dep.git === 'string' && typeof dep.tag === 'string') {
53
+ // Dependency contains "git" hence it's a git dependency. We ensure it has been fetched and fetch it if
54
+ // it's not the case and then we recursively search through it.
55
+ await fetchAndVisit(dep.git, dep.tag, dep.directory);
56
+ }
57
+ }
58
+ }
59
+ }
60
+ async function fetchAndVisit(gitUrl, tag, directory) {
61
+ // `directory` is set when the dep lives in a subdirectory of a repository, e.g.:
62
+ // aztec = { git = "https://github.com/AztecProtocol/aztec-packages", tag = "v0.82.0",
63
+ // directory = "noir-projects/aztec-nr/aztec" }
64
+ // In that case nargo clones the whole repo and the crate root is <cachePath>/<directory>.
65
+ const cachePath = nargoGitDepPath(gitUrl, tag);
66
+ const crateDir = directory ? join(cachePath, directory) : cachePath;
67
+ await ensureGitDepCached(gitUrl, tag, cachePath);
68
+ await visit(crateDir);
69
+ }
70
+ await visit(startCrateDir);
71
+ return [
72
+ ...visited
73
+ ];
74
+ }
75
+ /**
76
+ * Computes the local nargo cache path for a git dependency, mirroring nargo's own `git_dep_location` function.
77
+ * Path format: `$HOME/nargo/<domain>/<repo-path>/<tag>`
78
+ * e.g. `~/nargo/github.com/AztecProtocol/aztec-packages/v0.82.0`
79
+ *
80
+ * Source: noir/noir-repo/tooling/nargo_toml/src/git.rs
81
+ */ export function nargoGitDepPath(gitUrl, tag) {
82
+ const url = new URL(gitUrl);
83
+ const domain = url.hostname;
84
+ const repoPath = url.pathname.replace(/^\//, '');
85
+ return join(process.env.HOME ?? homedir(), 'nargo', domain, repoPath, tag);
86
+ }
87
+ /**
88
+ * Ensures a git dep is present in the nargo cache, cloning it if it isn't. Mirrors nargo's `clone_git_repo`.
89
+ * If cloning fails (e.g. no network), throws with a message suggesting `nargo check` to prime the cache.
90
+ *
91
+ * Source: noir/noir-repo/tooling/nargo_toml/src/git.rs
92
+ */ async function ensureGitDepCached(gitUrl, tag, cachePath) {
93
+ if (existsSync(cachePath)) {
94
+ return;
95
+ }
96
+ await mkdir(dirname(cachePath), {
97
+ recursive: true
98
+ });
99
+ try {
100
+ await run('git', [
101
+ '-c',
102
+ 'advice.detachedHead=false',
103
+ 'clone',
104
+ '--depth',
105
+ '1',
106
+ '--branch',
107
+ tag,
108
+ gitUrl,
109
+ cachePath
110
+ ]);
111
+ } catch (err) {
112
+ throw new Error(`Failed to fetch git dependency ${gitUrl}@${tag}: ${err?.message ?? err}.\n` + `Try running \`nargo check\` first to prime the dependency cache.`);
113
+ }
114
+ }
@@ -7,4 +7,4 @@
7
7
  * Note: The above implies that if there is a random json file in the target dir we would be always recompiling.
8
8
  */
9
9
  export declare function needsRecompile(): Promise<boolean>;
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVlZHNfcmVjb21waWxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpL2NtZHMvdXRpbHMvbmVlZHNfcmVjb21waWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBOzs7Ozs7O0dBT0c7QUFDSCx3QkFBc0IsY0FBYyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FRdkQifQ==
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVlZHNfcmVjb21waWxlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpL2NtZHMvdXRpbHMvbmVlZHNfcmVjb21waWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUtBOzs7Ozs7O0dBT0c7QUFDSCx3QkFBc0IsY0FBYyxJQUFJLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FXdkQifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"needs_recompile.d.ts","sourceRoot":"","sources":["../../../../src/cli/cmds/utils/needs_recompile.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAQvD"}
1
+ {"version":3,"file":"needs_recompile.d.ts","sourceRoot":"","sources":["../../../../src/cli/cmds/utils/needs_recompile.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAWvD"}
@@ -1,6 +1,6 @@
1
- import TOML from '@iarna/toml';
2
- import { readFile, readdir, stat } from 'fs/promises';
3
- import { join, resolve } from 'path';
1
+ import { readdir, stat } from 'fs/promises';
2
+ import { join } from 'path';
3
+ import { collectCrateDirs } from './collect_crate_dirs.js';
4
4
  /**
5
5
  * Returns true if recompilation is needed: either no artifacts exist in target/ or any .nr or Nargo.toml source file
6
6
  * (including path-based dependencies) is newer than the oldest artifact. We compare against the oldest artifact so
@@ -13,7 +13,12 @@ import { join, resolve } from 'path';
13
13
  if (oldestArtifactMs === undefined) {
14
14
  return true;
15
15
  }
16
- const crateDirs = await collectCrateDirs('.');
16
+ // Git deps are pinned to a specific tag in Nargo.toml and nargo always fetches an exact tag, so their contents never
17
+ // change without Nargo.toml itself changing — and Nargo.toml is already tracked as a source file. Hence we can
18
+ // safely ignore checking source files of git deps.
19
+ const crateDirs = await collectCrateDirs('.', {
20
+ skipGitDeps: true
21
+ });
17
22
  return hasNewerSourceFile(crateDirs, oldestArtifactMs);
18
23
  }
19
24
  /**
@@ -41,55 +46,6 @@ import { join, resolve } from 'path';
41
46
  }
42
47
  return oldest;
43
48
  }
44
- /**
45
- * Recursively collects crate directories starting from startCrateDir by following path-based dependencies declared in
46
- * Nargo.toml files. Git-based deps are ignored (they only change when Nargo.toml itself is modified since the deps are
47
- * tagged).
48
- */ async function collectCrateDirs(startCrateDir) {
49
- // We have a set of visited dirs we check against when entering a new dir because we could stumble upon a directory
50
- // multiple times in case multiple deps shared a dep (e.g. dep A and dep B both sharing dep C).
51
- const visited = new Set();
52
- async function visit(crateDir) {
53
- const absDir = resolve(crateDir);
54
- if (visited.has(absDir)) {
55
- return;
56
- }
57
- visited.add(absDir);
58
- // Every dep is its own crate and every crate needs to have Nargo.toml defined in the root so we try to load it and
59
- // error out if it's not the case.
60
- const tomlPath = join(absDir, 'Nargo.toml');
61
- const content = await readFile(tomlPath, 'utf-8').catch(()=>{
62
- throw new Error(`Incorrectly defined dependency. Nargo.toml not found in ${absDir}`);
63
- });
64
- const parsed = TOML.parse(content);
65
- const members = parsed.workspace?.members;
66
- // A Nargo.toml is either a workspace root (has workspace.members) or a single crate (has dependencies).
67
- if (Array.isArray(members)) {
68
- // The crate is a workspace root and has members defined so we visit the members
69
- for (const member of members){
70
- const memberPath = resolve(absDir, member);
71
- await visit(memberPath);
72
- }
73
- } else {
74
- // The crate is not a workspace root so we check for dependencies
75
- const deps = parsed.dependencies ?? {};
76
- for (const dep of Object.values(deps)){
77
- if (dep && typeof dep === 'object' && typeof dep.path === 'string') {
78
- const depPath = resolve(absDir, dep.path);
79
- const s = await stat(depPath);
80
- if (!s.isDirectory()) {
81
- throw new Error(`Dependency path "${dep.path}" in ${tomlPath} resolves to ${depPath} which is not a directory`);
82
- }
83
- await visit(depPath);
84
- }
85
- }
86
- }
87
- }
88
- await visit(startCrateDir);
89
- return [
90
- ...visited
91
- ];
92
- }
93
49
  /**
94
50
  * Walks crate dirs looking for .nr and Nargo.toml files newer than thresholdMs. Short-circuits on the first match.
95
51
  */ async function hasNewerSourceFile(crateDirs, thresholdMs) {
@@ -0,0 +1,4 @@
1
+ import type { LogFn } from '@aztec/foundation/log';
2
+ /** Warns if any aztec-nr git dependency in a crate's Nargo.toml has a tag that doesn't match the CLI version. */
3
+ export declare function warnIfAztecVersionMismatch(log: LogFn, cliVersion?: string): Promise<void>;
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2Fybl9pZl9henRlY192ZXJzaW9uX21pc21hdGNoLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvY2xpL2NtZHMvdXRpbHMvd2Fybl9pZl9henRlY192ZXJzaW9uX21pc21hdGNoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLEtBQUssRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBMkJuRCxpSEFBaUg7QUFDakgsd0JBQXNCLDBCQUEwQixDQUFDLEdBQUcsRUFBRSxLQUFLLEVBQUUsVUFBVSxDQUFDLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0ErQy9GIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"warn_if_aztec_version_mismatch.d.ts","sourceRoot":"","sources":["../../../../src/cli/cmds/utils/warn_if_aztec_version_mismatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AA2BnD,iHAAiH;AACjH,wBAAsB,0BAA0B,CAAC,GAAG,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+C/F"}
@@ -0,0 +1,61 @@
1
+ import { DEV_VERSION, getPackageVersion } from '@aztec/stdlib/update-checker';
2
+ import TOML from '@iarna/toml';
3
+ import { readFile } from 'fs/promises';
4
+ import { join } from 'path';
5
+ import { collectCrateDirs } from './collect_crate_dirs.js';
6
+ /** Returns true if the given git URL points to the AztecProtocol/aztec-nr repository. */ function isAztecNrGitUrl(gitUrl) {
7
+ let url;
8
+ try {
9
+ url = new URL(gitUrl);
10
+ } catch {
11
+ return false;
12
+ }
13
+ if (url.hostname !== 'github.com') {
14
+ return false;
15
+ }
16
+ const repoPath = url.pathname.replace(/^\//, '').replace(/\.git$/, '').replace(/\/$/, '');
17
+ return repoPath === 'AztecProtocol/aztec-nr';
18
+ }
19
+ /** Warns if any aztec-nr git dependency in a crate's Nargo.toml has a tag that doesn't match the CLI version. */ export async function warnIfAztecVersionMismatch(log, cliVersion) {
20
+ const version = cliVersion ?? getPackageVersion();
21
+ if (version === DEV_VERSION) {
22
+ return;
23
+ }
24
+ const expectedTag = `v${version}`;
25
+ const mismatches = [];
26
+ const crateDirs = await collectCrateDirs('.', {
27
+ skipGitDeps: true
28
+ });
29
+ for (const dir of crateDirs){
30
+ const tomlPath = join(dir, 'Nargo.toml');
31
+ let content;
32
+ try {
33
+ content = await readFile(tomlPath, 'utf-8');
34
+ } catch {
35
+ continue;
36
+ }
37
+ const parsed = TOML.parse(content);
38
+ const deps = parsed.dependencies ?? {};
39
+ for (const [depName, dep] of Object.entries(deps)){
40
+ // Skip non-object deps (e.g. malformed entries) and anything that isn't a tagged git dep.
41
+ if (!dep || typeof dep !== 'object' || typeof dep.git !== 'string' || typeof dep.tag !== 'string') {
42
+ continue;
43
+ }
44
+ // Only flag deps that are sourced from the aztec-nr repo.
45
+ if (!isAztecNrGitUrl(dep.git)) {
46
+ continue;
47
+ }
48
+ if (dep.tag !== expectedTag) {
49
+ mismatches.push({
50
+ file: tomlPath,
51
+ depName,
52
+ tag: dep.tag
53
+ });
54
+ }
55
+ }
56
+ }
57
+ if (mismatches.length > 0) {
58
+ const details = mismatches.map((m)=>` ${m.file} — ${m.depName} (${m.tag})`).join('\n');
59
+ log(`WARNING: Aztec dependency version mismatch detected.\n` + `The following aztec-nr dependencies do not match the CLI version (${expectedTag}):\n` + `${details}\n\n` + `See https://docs.aztec.network/errors/9 for how to update your dependencies.`);
60
+ }
61
+ }
package/dest/cli/util.js CHANGED
@@ -80,10 +80,12 @@ export const installSignalHandlers = (logFn, cb)=>{
80
80
  accountLogStrings.push(` Address: ${completeAddress.address.toString()}\n`);
81
81
  accountLogStrings.push(` Partial Address: ${completeAddress.partialAddress.toString()}\n`);
82
82
  accountLogStrings.push(` Secret Key: ${account.getSecretKey().toString()}\n`);
83
- accountLogStrings.push(` Master nullifier public key: ${completeAddress.publicKeys.masterNullifierPublicKey.toString()}\n`);
84
- accountLogStrings.push(` Master incoming viewing public key: ${completeAddress.publicKeys.masterIncomingViewingPublicKey.toString()}\n\n`);
85
- accountLogStrings.push(` Master outgoing viewing public key: ${completeAddress.publicKeys.masterOutgoingViewingPublicKey.toString()}\n\n`);
86
- accountLogStrings.push(` Master tagging public key: ${completeAddress.publicKeys.masterTaggingPublicKey.toString()}\n\n`);
83
+ accountLogStrings.push(` Master nullifier public key hash: ${completeAddress.publicKeys.npkMHash.toString()}\n`);
84
+ accountLogStrings.push(` Master incoming viewing public key: ${completeAddress.publicKeys.ivpkM.toString()}\n\n`);
85
+ accountLogStrings.push(` Master outgoing viewing public key hash: ${completeAddress.publicKeys.ovpkMHash.toString()}\n\n`);
86
+ accountLogStrings.push(` Master tagging public key hash: ${completeAddress.publicKeys.tpkMHash.toString()}\n\n`);
87
+ accountLogStrings.push(` Master message-signing public key hash: ${completeAddress.publicKeys.mspkMHash.toString()}\n\n`);
88
+ accountLogStrings.push(` Master fallback public key hash: ${completeAddress.publicKeys.fbpkMHash.toString()}\n\n`);
87
89
  }
88
90
  }
89
91
  return accountLogStrings;
@@ -250,7 +252,7 @@ export async function setupVersionChecker(network, followsCanonicalRollup, publi
250
252
  const checks = [];
251
253
  checks.push({
252
254
  name: 'node',
253
- currentVersion: getPackageVersion() ?? 'unknown',
255
+ currentVersion: getPackageVersion(),
254
256
  getLatestVersion: async ()=>{
255
257
  const cfg = await getNetworkConfig(network, cacheDir);
256
258
  return cfg?.nodeVersion;
@@ -13,10 +13,10 @@ const TRANSFER_AMOUNT = 33n;
13
13
  */ async function main() {
14
14
  logger.info('Running token contract test on HTTP interface.');
15
15
  const wallet = await EmbeddedWallet.create(node);
16
- // During local network setup we deploy a few accounts. Below we add them to our wallet.
16
+ // During local network setup we create a few initializerless accounts. Below we add them to our wallet.
17
17
  const [aliceInitialAccountData, bobInitialAccountData] = await getInitialTestAccountsData();
18
- await wallet.createSchnorrAccount(aliceInitialAccountData.secret, aliceInitialAccountData.salt);
19
- await wallet.createSchnorrAccount(bobInitialAccountData.secret, bobInitialAccountData.salt);
18
+ await wallet.createSchnorrInitializerlessAccount(aliceInitialAccountData.secret, aliceInitialAccountData.salt);
19
+ await wallet.createSchnorrInitializerlessAccount(bobInitialAccountData.secret, bobInitialAccountData.salt);
20
20
  const alice = aliceInitialAccountData.address;
21
21
  const bob = bobInitialAccountData.address;
22
22
  logger.info(`Fetched Alice and Bob accounts: ${alice.toString()}, ${bob.toString()}`);
@@ -0,0 +1,5 @@
1
+ import type { WaitOpts } from '@aztec/aztec.js/contracts';
2
+ import type { Wallet } from '@aztec/aztec.js/wallet';
3
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
+ export declare function publishStandardAuthRegistry(wallet: Wallet, from: AztecAddress, waitOpts?: WaitOpts): Promise<void>;
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aF9yZWdpc3RyeS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsLW5ldHdvcmsvYXV0aF9yZWdpc3RyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUUxRCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVyRCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUVoRSx3QkFBc0IsMkJBQTJCLENBQy9DLE1BQU0sRUFBRSxNQUFNLEVBQ2QsSUFBSSxFQUFFLFlBQVksRUFDbEIsUUFBUSxDQUFDLEVBQUUsUUFBUSxHQUNsQixPQUFPLENBQUMsSUFBSSxDQUFDLENBUWYifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth_registry.d.ts","sourceRoot":"","sources":["../../src/local-network/auth_registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,YAAY,EAClB,QAAQ,CAAC,EAAE,QAAQ,GAClB,OAAO,CAAC,IAAI,CAAC,CAQf"}
@@ -0,0 +1,17 @@
1
+ import { publishContractClass, publishInstance } from '@aztec/aztec.js/deployment';
2
+ import { AuthRegistryArtifact, getStandardAuthRegistry } from '@aztec/standard-contracts/auth-registry';
3
+ export async function publishStandardAuthRegistry(wallet, from, waitOpts) {
4
+ const { instance, contractClass } = await getStandardAuthRegistry();
5
+ if (!(await wallet.getContractClassMetadata(contractClass.id)).isContractClassPubliclyRegistered) {
6
+ await (await publishContractClass(wallet, AuthRegistryArtifact)).send({
7
+ from,
8
+ wait: waitOpts
9
+ });
10
+ }
11
+ if (!(await wallet.getContractMetadata(instance.address)).isContractPublished) {
12
+ await publishInstance(wallet, instance).send({
13
+ from,
14
+ wait: waitOpts
15
+ });
16
+ }
17
+ }
@@ -1,10 +1,11 @@
1
1
  import { type InitialAccountData } from '@aztec/accounts/testing';
2
+ import type { WaitOpts } from '@aztec/aztec.js/contracts';
2
3
  import type { Wallet } from '@aztec/aztec.js/wallet';
3
4
  import type { LogFn } from '@aztec/foundation/log';
4
5
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
6
  export declare function getBananaCoinAddress(initialAccounts: InitialAccountData[]): Promise<AztecAddress>;
6
7
  export declare function getBananaFPCAddress(initialAccounts: InitialAccountData[]): Promise<AztecAddress>;
7
- export declare function setupBananaFPC(initialAccounts: InitialAccountData[], wallet: Wallet, log: LogFn): Promise<void>;
8
+ export declare function setupBananaFPC(initialAccounts: InitialAccountData[], wallet: Wallet, log: LogFn, waitOpts?: WaitOpts): Promise<void>;
8
9
  export declare function registerDeployedBananaCoinInWalletAndGetAddress(wallet: Wallet): Promise<AztecAddress>;
9
10
  export declare function registerDeployedBananaFPCInWalletAndGetAddress(wallet: Wallet): Promise<AztecAddress>;
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFuYW5hX2ZwYy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsLW5ldHdvcmsvYmFuYW5hX2ZwYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxrQkFBa0IsRUFBOEIsTUFBTSx5QkFBeUIsQ0FBQztBQUM5RixPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVyRCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUduRCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUF3QjNELHdCQUFzQixvQkFBb0IsQ0FBQyxlQUFlLEVBQUUsa0JBQWtCLEVBQUUseUJBRS9FO0FBV0Qsd0JBQXNCLG1CQUFtQixDQUFDLGVBQWUsRUFBRSxrQkFBa0IsRUFBRSx5QkFFOUU7QUFFRCx3QkFBc0IsY0FBYyxDQUFDLGVBQWUsRUFBRSxrQkFBa0IsRUFBRSxFQUFFLE1BQU0sRUFBRSxNQUFNLEVBQUUsR0FBRyxFQUFFLEtBQUssaUJBa0JyRztBQUVELHdCQUFzQiwrQ0FBK0MsQ0FBQyxNQUFNLEVBQUUsTUFBTSx5QkFNbkY7QUFFRCx3QkFBc0IsOENBQThDLENBQUMsTUFBTSxFQUFFLE1BQU0seUJBTWxGIn0=
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFuYW5hX2ZwYy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsLW5ldHdvcmsvYmFuYW5hX2ZwYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxrQkFBa0IsRUFBOEIsTUFBTSx5QkFBeUIsQ0FBQztBQUM5RixPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUMxRCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVyRCxPQUFPLEtBQUssRUFBRSxLQUFLLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUduRCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUF3QjNELHdCQUFzQixvQkFBb0IsQ0FBQyxlQUFlLEVBQUUsa0JBQWtCLEVBQUUseUJBRS9FO0FBV0Qsd0JBQXNCLG1CQUFtQixDQUFDLGVBQWUsRUFBRSxrQkFBa0IsRUFBRSx5QkFFOUU7QUFFRCx3QkFBc0IsY0FBYyxDQUNsQyxlQUFlLEVBQUUsa0JBQWtCLEVBQUUsRUFDckMsTUFBTSxFQUFFLE1BQU0sRUFDZCxHQUFHLEVBQUUsS0FBSyxFQUNWLFFBQVEsQ0FBQyxFQUFFLFFBQVEsaUJBaUJwQjtBQUVELHdCQUFzQiwrQ0FBK0MsQ0FBQyxNQUFNLEVBQUUsTUFBTSx5QkFNbkY7QUFFRCx3QkFBc0IsOENBQThDLENBQUMsTUFBTSxFQUFFLE1BQU0seUJBTWxGIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"banana_fpc.d.ts","sourceRoot":"","sources":["../../src/local-network/banana_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAwB3D,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,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,iBAkBrG;AAED,wBAAsB,+CAA+C,CAAC,MAAM,EAAE,MAAM,yBAMnF;AAED,wBAAsB,8CAA8C,CAAC,MAAM,EAAE,MAAM,yBAMlF"}
1
+ {"version":3,"file":"banana_fpc.d.ts","sourceRoot":"","sources":["../../src/local-network/banana_fpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,yBAAyB,CAAC;AAC9F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAwB3D,wBAAsB,oBAAoB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE/E;AAWD,wBAAsB,mBAAmB,CAAC,eAAe,EAAE,kBAAkB,EAAE,yBAE9E;AAED,wBAAsB,cAAc,CAClC,eAAe,EAAE,kBAAkB,EAAE,EACrC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,KAAK,EACV,QAAQ,CAAC,EAAE,QAAQ,iBAiBpB;AAED,wBAAsB,+CAA+C,CAAC,MAAM,EAAE,MAAM,yBAMnF;AAED,wBAAsB,8CAA8C,CAAC,MAAM,EAAE,MAAM,yBAMlF"}
@@ -43,19 +43,23 @@ async function getBananaFPCInstance(initialAccounts) {
43
43
  export async function getBananaFPCAddress(initialAccounts) {
44
44
  return (await getBananaFPCInstance(initialAccounts)).address;
45
45
  }
46
- export async function setupBananaFPC(initialAccounts, wallet, log) {
46
+ export async function setupBananaFPC(initialAccounts, wallet, log, waitOpts) {
47
47
  const bananaCoinAddress = await getBananaCoinAddress(initialAccounts);
48
48
  const admin = getBananaAdmin(initialAccounts);
49
49
  const [{ contract: bananaCoin }, { contract: fpc }] = await Promise.all([
50
- TokenContract.deploy(wallet, admin, bananaCoinArgs.name, bananaCoinArgs.symbol, bananaCoinArgs.decimal).send({
51
- from: admin,
52
- contractAddressSalt: BANANA_COIN_SALT,
50
+ TokenContract.deploy(wallet, admin, bananaCoinArgs.name, bananaCoinArgs.symbol, bananaCoinArgs.decimal, {
51
+ salt: BANANA_COIN_SALT,
53
52
  universalDeploy: true
54
- }),
55
- FPCContract.deploy(wallet, bananaCoinAddress, admin).send({
53
+ }).send({
56
54
  from: admin,
57
- contractAddressSalt: BANANA_FPC_SALT,
55
+ wait: waitOpts
56
+ }),
57
+ FPCContract.deploy(wallet, bananaCoinAddress, admin, {
58
+ salt: BANANA_FPC_SALT,
58
59
  universalDeploy: true
60
+ }).send({
61
+ from: admin,
62
+ wait: waitOpts
59
63
  })
60
64
  ]);
61
65
  log(`BananaCoin: ${bananaCoin.address}`);