@aztec/txe 3.0.0-canary.a9708bd → 3.0.0-devnet.20251212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/dest/bin/index.d.ts +1 -1
  2. package/dest/bin/index.js +1 -1
  3. package/dest/index.d.ts +1 -1
  4. package/dest/index.d.ts.map +1 -1
  5. package/dest/index.js +5 -2
  6. package/dest/oracle/interfaces.d.ts +55 -0
  7. package/dest/oracle/interfaces.d.ts.map +1 -0
  8. package/dest/oracle/interfaces.js +3 -0
  9. package/dest/oracle/txe_oracle_public_context.d.ts +11 -11
  10. package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
  11. package/dest/oracle/txe_oracle_public_context.js +30 -32
  12. package/dest/oracle/txe_oracle_top_level_context.d.ts +57 -0
  13. package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -0
  14. package/dest/oracle/txe_oracle_top_level_context.js +432 -0
  15. package/dest/{txe_service/txe_service.d.ts → rpc_translator.d.ts} +40 -31
  16. package/dest/rpc_translator.d.ts.map +1 -0
  17. package/dest/{txe_service/txe_service.js → rpc_translator.js} +172 -125
  18. package/dest/state_machine/archiver.d.ts +18 -9
  19. package/dest/state_machine/archiver.d.ts.map +1 -1
  20. package/dest/state_machine/archiver.js +21 -4
  21. package/dest/state_machine/dummy_p2p_client.d.ts +5 -2
  22. package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
  23. package/dest/state_machine/dummy_p2p_client.js +6 -0
  24. package/dest/state_machine/global_variable_builder.d.ts +3 -15
  25. package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
  26. package/dest/state_machine/global_variable_builder.js +3 -22
  27. package/dest/state_machine/index.d.ts +2 -2
  28. package/dest/state_machine/index.d.ts.map +1 -1
  29. package/dest/state_machine/index.js +8 -6
  30. package/dest/state_machine/mock_epoch_cache.d.ts +6 -5
  31. package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
  32. package/dest/state_machine/mock_epoch_cache.js +8 -7
  33. package/dest/state_machine/synchronizer.d.ts +5 -4
  34. package/dest/state_machine/synchronizer.d.ts.map +1 -1
  35. package/dest/state_machine/synchronizer.js +5 -4
  36. package/dest/txe_session.d.ts +36 -46
  37. package/dest/txe_session.d.ts.map +1 -1
  38. package/dest/txe_session.js +200 -82
  39. package/dest/util/encoding.d.ts +24 -24
  40. package/dest/util/encoding.d.ts.map +1 -1
  41. package/dest/util/encoding.js +1 -1
  42. package/dest/util/expected_failure_error.d.ts +1 -1
  43. package/dest/util/expected_failure_error.d.ts.map +1 -1
  44. package/dest/util/txe_account_data_provider.d.ts +1 -1
  45. package/dest/util/txe_account_data_provider.d.ts.map +1 -1
  46. package/dest/util/txe_contract_data_provider.d.ts +3 -2
  47. package/dest/util/txe_contract_data_provider.d.ts.map +1 -1
  48. package/dest/util/txe_contract_data_provider.js +1 -1
  49. package/dest/util/txe_public_contract_data_source.d.ts +8 -6
  50. package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
  51. package/dest/util/txe_public_contract_data_source.js +14 -12
  52. package/dest/utils/block_creation.d.ts +14 -0
  53. package/dest/utils/block_creation.d.ts.map +1 -0
  54. package/dest/utils/block_creation.js +24 -0
  55. package/dest/utils/tx_effect_creation.d.ts +6 -0
  56. package/dest/utils/tx_effect_creation.d.ts.map +1 -0
  57. package/dest/utils/tx_effect_creation.js +16 -0
  58. package/package.json +18 -17
  59. package/src/bin/index.ts +1 -1
  60. package/src/index.ts +5 -8
  61. package/src/oracle/interfaces.ts +84 -0
  62. package/src/oracle/txe_oracle_public_context.ts +38 -71
  63. package/src/oracle/txe_oracle_top_level_context.ts +667 -0
  64. package/src/{txe_service/txe_service.ts → rpc_translator.ts} +222 -128
  65. package/src/state_machine/archiver.ts +33 -13
  66. package/src/state_machine/dummy_p2p_client.ts +10 -1
  67. package/src/state_machine/global_variable_builder.ts +7 -41
  68. package/src/state_machine/index.ts +10 -8
  69. package/src/state_machine/mock_epoch_cache.ts +12 -11
  70. package/src/state_machine/synchronizer.ts +8 -7
  71. package/src/txe_session.ts +305 -92
  72. package/src/util/encoding.ts +1 -1
  73. package/src/util/txe_contract_data_provider.ts +2 -1
  74. package/src/util/txe_public_contract_data_source.ts +16 -13
  75. package/src/utils/block_creation.ts +64 -0
  76. package/src/utils/tx_effect_creation.ts +38 -0
  77. package/dest/oracle/txe_oracle.d.ts +0 -124
  78. package/dest/oracle/txe_oracle.d.ts.map +0 -1
  79. package/dest/oracle/txe_oracle.js +0 -770
  80. package/dest/oracle/txe_typed_oracle.d.ts +0 -42
  81. package/dest/oracle/txe_typed_oracle.d.ts.map +0 -1
  82. package/dest/oracle/txe_typed_oracle.js +0 -83
  83. package/dest/txe_constants.d.ts +0 -2
  84. package/dest/txe_constants.d.ts.map +0 -1
  85. package/dest/txe_constants.js +0 -7
  86. package/dest/txe_service/txe_service.d.ts.map +0 -1
  87. package/src/oracle/txe_oracle.ts +0 -1287
  88. package/src/oracle/txe_typed_oracle.ts +0 -142
  89. package/src/txe_constants.ts +0 -9
@@ -1,39 +1,18 @@
1
- import { AztecAddress } from '@aztec/aztec.js';
1
+ import { BlockNumber } from '@aztec/foundation/branded-types';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
3
  import { type Logger } from '@aztec/foundation/log';
4
+ import { KeyStore } from '@aztec/key-store';
3
5
  import type { ProtocolContract } from '@aztec/protocol-contracts';
4
- import type { PrivateContextInputs } from '@aztec/stdlib/kernel';
5
- import type { UInt32 } from '@aztec/stdlib/types';
6
- import { TXE } from './oracle/txe_oracle.js';
7
- import type { TXETypedOracle } from './oracle/txe_typed_oracle.js';
6
+ import { AddressDataProvider, PXEOracleInterface } from '@aztec/pxe/server';
7
+ import { type IPrivateExecutionOracle, type IUtilityExecutionOracle } from '@aztec/pxe/simulator';
8
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
9
+ import { PrivateContextInputs } from '@aztec/stdlib/kernel';
10
+ import type { IAvmExecutionOracle, ITxeExecutionOracle } from './oracle/interfaces.js';
11
+ import { RPCTranslator } from './rpc_translator.js';
8
12
  import { TXEStateMachine } from './state_machine/index.js';
9
- import { TXEService } from './txe_service/txe_service.js';
10
13
  import type { ForeignCallArgs, ForeignCallResult } from './util/encoding.js';
11
- /**
12
- * A TXE Session can be ine one of four states, which change as the test progresses and different oracles are called.
13
- * The current state determines which oracles are available.
14
- */
15
- declare enum SessionState {
16
- /**
17
- * The top-level state is the default state, before any other state has been entered. This is where contracts can be
18
- * deployed, accounts created, blocks mined, etc.
19
- */
20
- TOP_LEVEL = 0,
21
- /**
22
- * The private state is entered via the `private_context` function. In this state the PXE oracles that `#[private]`
23
- * functions use are available, such as those related to note retrieval, notification of side-effects, capsule access,
24
- * etc. */
25
- PRIVATE = 1,
26
- /**
27
- * The public state is entered via the `public_context` function. In this state the AVM opcodes that `#[public]`
28
- * functions execute are resolved as oracles by TXE, since Noir tests are not transpiled. */
29
- PUBLIC = 2,
30
- /**
31
- * The utility state is entered via the `utility_context` function. In this state the PXE oracles that `#[utility]`
32
- * functions use are available, such as those related to (unconstrained) note retrieval, capsule access, public
33
- * storage reads, etc.
34
- */
35
- UTILITY = 3
36
- }
14
+ import { TXEAccountDataProvider } from './util/txe_account_data_provider.js';
15
+ import { TXEContractDataProvider } from './util/txe_contract_data_provider.js';
37
16
  type MethodNames<T> = {
38
17
  [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
39
18
  }[keyof T];
@@ -41,12 +20,12 @@ type MethodNames<T> = {
41
20
  * The name of an oracle function that TXE supports, which are a combination of PXE oracles, non-transpiled AVM opcodes,
42
21
  * and custom TXE oracles.
43
22
  */
44
- export type TXEOracleFunctionName = MethodNames<TXEService>;
23
+ export type TXEOracleFunctionName = Exclude<MethodNames<RPCTranslator>, 'constructor' | 'handlerAsMisc' | 'handlerAsUtility' | 'handlerAsPrivate' | 'handlerAsAvm' | 'handlerAsTxe'>;
45
24
  export interface TXESessionStateHandler {
46
- setTopLevelContext(): Promise<void>;
47
- setPublicContext(contractAddress?: AztecAddress): Promise<void>;
48
- setPrivateContext(contractAddress?: AztecAddress, historicalBlockNumber?: UInt32): Promise<PrivateContextInputs>;
49
- setUtilityContext(contractAddress?: AztecAddress): Promise<void>;
25
+ enterTopLevelState(): Promise<void>;
26
+ enterPublicState(contractAddress?: AztecAddress): Promise<void>;
27
+ enterPrivateState(contractAddress?: AztecAddress, anchorBlockNumber?: BlockNumber): Promise<PrivateContextInputs>;
28
+ enterUtilityState(contractAddress?: AztecAddress): Promise<void>;
50
29
  }
51
30
  /**
52
31
  * A `TXESession` corresponds to a Noir `#[test]` function, and handles all of its oracle calls, stores test-specific
@@ -56,9 +35,17 @@ export declare class TXESession implements TXESessionStateHandler {
56
35
  private logger;
57
36
  private stateMachine;
58
37
  private oracleHandler;
59
- private legacyTXEOracle;
60
- state: SessionState;
61
- constructor(logger: Logger, stateMachine: TXEStateMachine, oracleHandler: TXETypedOracle, legacyTXEOracle: TXE);
38
+ private contractDataProvider;
39
+ private keyStore;
40
+ private addressDataProvider;
41
+ private accountDataProvider;
42
+ private chainId;
43
+ private version;
44
+ private nextBlockTimestamp;
45
+ private pxeOracleInterface;
46
+ private state;
47
+ private authwits;
48
+ constructor(logger: Logger, stateMachine: TXEStateMachine, oracleHandler: IUtilityExecutionOracle | IPrivateExecutionOracle | IAvmExecutionOracle | ITxeExecutionOracle, contractDataProvider: TXEContractDataProvider, keyStore: KeyStore, addressDataProvider: AddressDataProvider, accountDataProvider: TXEAccountDataProvider, chainId: Fr, version: Fr, nextBlockTimestamp: bigint, pxeOracleInterface: PXEOracleInterface);
62
49
  static init(protocolContracts: ProtocolContract[]): Promise<TXESession>;
63
50
  /**
64
51
  * Processes an oracle function invoked by the Noir test associated to this session.
@@ -67,11 +54,14 @@ export declare class TXESession implements TXESessionStateHandler {
67
54
  * @returns The oracle return values.
68
55
  */
69
56
  processFunction(functionName: TXEOracleFunctionName, inputs: ForeignCallArgs): Promise<ForeignCallResult>;
70
- setTopLevelContext(): Promise<void>;
71
- setPublicContext(contractAddress?: AztecAddress): Promise<void>;
72
- setPrivateContext(contractAddress?: AztecAddress, historicalBlockNumber?: UInt32): Promise<PrivateContextInputs>;
73
- setUtilityContext(contractAddress?: AztecAddress): Promise<void>;
74
- private assertInTopLevelState;
57
+ enterTopLevelState(): Promise<void>;
58
+ enterPrivateState(contractAddress?: AztecAddress, anchorBlockNumber?: BlockNumber): Promise<PrivateContextInputs>;
59
+ enterPublicState(contractAddress?: AztecAddress): Promise<void>;
60
+ enterUtilityState(contractAddress?: AztecAddress): Promise<void>;
61
+ private exitTopLevelState;
62
+ private exitPrivateState;
63
+ private exitPublicState;
64
+ private exitUtilityContext;
75
65
  }
76
66
  export {};
77
- //# sourceMappingURL=txe_session.d.ts.map
67
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3Nlc3Npb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy90eGVfc2Vzc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDOUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUNsRSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFNUMsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNsRSxPQUFPLEVBQ0wsbUJBQW1CLEVBR25CLGtCQUFrQixFQUduQixNQUFNLG1CQUFtQixDQUFDO0FBQzNCLE9BQU8sRUFJTCxLQUFLLHVCQUF1QixFQUM1QixLQUFLLHVCQUF1QixFQUc3QixNQUFNLHNCQUFzQixDQ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O,CAAC,mBAAmB;IAC3B,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,kBAAkB;IAlB5B,OAAO,CAAC,KAAK,CAAuC;IACpD,OAAO,CAAC,QAAQ,CAAuC;IAEvD,YACU,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,eAAe,EAC7B,aAAa,EACjB,uBAAuB,GACvB,uBAAuB,GACvB,mBAAmB,GACnB,mBAAmB,EACf,oBAAoB,EAAE,uBAAuB,EAC7C,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,sBAAsB,EAC3C,OAAO,EAAE,EAAE,EACX,OAAO,EAAE,EAAE,EACX,kBAAkB,EAAE,MAAM,EAC1B,kBAAkB,EAAE,kBAAkB,EAC5C;IAEJ,OAAa,IAAI,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,uBA+DtD;IAED;;;;;OAKG;IACH,eAAe,CAAC,YAAY,EAAE,qBAAqB,EAAE,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAuBxG;IAEK,kBAAkB,kBAqCvB;IAEK,iBAAiB,CACrB,eAAe,GAAE,YAA8B,EAC/C,iBAAiB,CAAC,EAAE,WAAW,GAC9B,OAAO,CAAC,oBAAoB,CAAC,CAkD/B;IAEK,gBAAgB,CAAC,eAAe,CAAC,EAAE,YAAY,iBAsBpD;IAEK,iBAAiB,CAAC,eAAe,GAAE,YAA8B,iBActE;IAED,OAAO,CAAC,iBAAiB;YAiBX,gBAAgB;YAoChB,eAAe;IAS7B,OAAO,CAAC,kBAAkB;CAK3B"}
@@ -1,37 +1,26 @@
1
- import { AztecAddress, Fr } from '@aztec/aztec.js';
1
+ import { BlockNumber } from '@aztec/foundation/branded-types';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
3
  import { createLogger } from '@aztec/foundation/log';
3
4
  import { KeyStore } from '@aztec/key-store';
4
5
  import { openTmpStore } from '@aztec/kv-store/lmdb-v2';
5
- import { AddressDataProvider, CapsuleDataProvider, NoteDataProvider, PrivateEventDataProvider, TaggingDataProvider } from '@aztec/pxe/server';
6
- import { makeGlobalVariables } from '@aztec/stdlib/testing';
7
- import { TXE } from './oracle/txe_oracle.js';
6
+ import { AddressDataProvider, CapsuleDataProvider, NoteDataProvider, PXEOracleInterface, PrivateEventDataProvider, TaggingDataProvider } from '@aztec/pxe/server';
7
+ import { ExecutionNoteCache, ExecutionTaggingIndexCache, HashedValuesCache, PrivateExecutionOracle, UtilityExecutionOracle } from '@aztec/pxe/simulator';
8
+ import { FunctionSelector } from '@aztec/stdlib/abi';
9
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
10
+ import { Body, L2Block } from '@aztec/stdlib/block';
11
+ import { GasSettings } from '@aztec/stdlib/gas';
12
+ import { computeProtocolNullifier } from '@aztec/stdlib/hash';
13
+ import { makeAppendOnlyTreeSnapshot, makeGlobalVariables } from '@aztec/stdlib/testing';
14
+ import { CallContext, TxContext } from '@aztec/stdlib/tx';
15
+ import { z } from 'zod';
8
16
  import { TXEOraclePublicContext } from './oracle/txe_oracle_public_context.js';
17
+ import { TXEOracleTopLevelContext } from './oracle/txe_oracle_top_level_context.js';
18
+ import { RPCTranslator } from './rpc_translator.js';
9
19
  import { TXEStateMachine } from './state_machine/index.js';
10
- import { TXEService } from './txe_service/txe_service.js';
11
20
  import { TXEAccountDataProvider } from './util/txe_account_data_provider.js';
12
21
  import { TXEContractDataProvider } from './util/txe_contract_data_provider.js';
13
- /**
14
- * A TXE Session can be ine one of four states, which change as the test progresses and different oracles are called.
15
- * The current state determines which oracles are available.
16
- */ var SessionState = /*#__PURE__*/ function(SessionState) {
17
- /**
18
- * The top-level state is the default state, before any other state has been entered. This is where contracts can be
19
- * deployed, accounts created, blocks mined, etc.
20
- */ SessionState[SessionState["TOP_LEVEL"] = 0] = "TOP_LEVEL";
21
- /**
22
- * The private state is entered via the `private_context` function. In this state the PXE oracles that `#[private]`
23
- * functions use are available, such as those related to note retrieval, notification of side-effects, capsule access,
24
- * etc. */ SessionState[SessionState["PRIVATE"] = 1] = "PRIVATE";
25
- /**
26
- * The public state is entered via the `public_context` function. In this state the AVM opcodes that `#[public]`
27
- * functions execute are resolved as oracles by TXE, since Noir tests are not transpiled. */ SessionState[SessionState["PUBLIC"] = 2] = "PUBLIC";
28
- /**
29
- * The utility state is entered via the `utility_context` function. In this state the PXE oracles that `#[utility]`
30
- * functions use are available, such as those related to (unconstrained) note retrieval, capsule access, public
31
- * storage reads, etc.
32
- */ SessionState[SessionState["UTILITY"] = 3] = "UTILITY";
33
- return SessionState;
34
- }(SessionState || {});
22
+ import { getSingleTxBlockRequestHash, insertTxEffectIntoWorldTrees, makeTXEBlockHeader } from './utils/block_creation.js';
23
+ import { makeTxEffect } from './utils/tx_effect_creation.js';
35
24
  const DEFAULT_ADDRESS = AztecAddress.fromNumber(42);
36
25
  /**
37
26
  * A `TXESession` corresponds to a Noir `#[test]` function, and handles all of its oracle calls, stores test-specific
@@ -40,14 +29,32 @@ const DEFAULT_ADDRESS = AztecAddress.fromNumber(42);
40
29
  logger;
41
30
  stateMachine;
42
31
  oracleHandler;
43
- legacyTXEOracle;
32
+ contractDataProvider;
33
+ keyStore;
34
+ addressDataProvider;
35
+ accountDataProvider;
36
+ chainId;
37
+ version;
38
+ nextBlockTimestamp;
39
+ pxeOracleInterface;
44
40
  state;
45
- constructor(logger, stateMachine, oracleHandler, legacyTXEOracle){
41
+ authwits;
42
+ constructor(logger, stateMachine, oracleHandler, contractDataProvider, keyStore, addressDataProvider, accountDataProvider, chainId, version, nextBlockTimestamp, pxeOracleInterface){
46
43
  this.logger = logger;
47
44
  this.stateMachine = stateMachine;
48
45
  this.oracleHandler = oracleHandler;
49
- this.legacyTXEOracle = legacyTXEOracle;
50
- this.state = 0;
46
+ this.contractDataProvider = contractDataProvider;
47
+ this.keyStore = keyStore;
48
+ this.addressDataProvider = addressDataProvider;
49
+ this.accountDataProvider = accountDataProvider;
50
+ this.chainId = chainId;
51
+ this.version = version;
52
+ this.nextBlockTimestamp = nextBlockTimestamp;
53
+ this.pxeOracleInterface = pxeOracleInterface;
54
+ this.state = {
55
+ name: 'TOP_LEVEL'
56
+ };
57
+ this.authwits = new Map();
51
58
  }
52
59
  static async init(protocolContracts) {
53
60
  const store = await openTmpStore('txe-session');
@@ -65,9 +72,13 @@ const DEFAULT_ADDRESS = AztecAddress.fromNumber(42);
65
72
  await contractDataProvider.addContractInstance(instance);
66
73
  }
67
74
  const stateMachine = await TXEStateMachine.create(store);
68
- const txeOracle = new TXE(keyStore, contractDataProvider, noteDataProvider, capsuleDataProvider, taggingDataProvider, addressDataProvider, privateEventDataProvider, accountDataProvider, DEFAULT_ADDRESS, await stateMachine.synchronizer.nativeWorldStateService.fork(), stateMachine);
69
- await txeOracle.txeAdvanceBlocksBy(1);
70
- return new TXESession(createLogger('txe:session'), stateMachine, txeOracle, txeOracle);
75
+ const nextBlockTimestamp = BigInt(Math.floor(new Date().getTime() / 1000));
76
+ const version = new Fr(await stateMachine.node.getVersion());
77
+ const chainId = new Fr(await stateMachine.node.getChainId());
78
+ const pxeOracleInterface = new PXEOracleInterface(stateMachine.node, keyStore, contractDataProvider, noteDataProvider, capsuleDataProvider, stateMachine.syncDataProvider, taggingDataProvider, addressDataProvider, privateEventDataProvider);
79
+ const topLevelOracleHandler = new TXEOracleTopLevelContext(stateMachine, contractDataProvider, keyStore, addressDataProvider, accountDataProvider, pxeOracleInterface, nextBlockTimestamp, version, chainId, new Map());
80
+ await topLevelOracleHandler.txeAdvanceBlocksBy(1);
81
+ return new TXESession(createLogger('txe:session'), stateMachine, topLevelOracleHandler, contractDataProvider, keyStore, addressDataProvider, accountDataProvider, version, chainId, nextBlockTimestamp, pxeOracleInterface);
71
82
  }
72
83
  /**
73
84
  * Processes an oracle function invoked by the Noir test associated to this session.
@@ -75,64 +86,171 @@ const DEFAULT_ADDRESS = AztecAddress.fromNumber(42);
75
86
  * @param inputs The inputs of the oracle.
76
87
  * @returns The oracle return values.
77
88
  */ processFunction(functionName, inputs) {
78
- return new TXEService(this, this.oracleHandler)[functionName](...inputs);
89
+ try {
90
+ const translator = new RPCTranslator(this, this.oracleHandler);
91
+ // We perform a runtime validation to check that the function name corresponds to a real oracle handler.
92
+ const validatedFunctionName = z.string().refine((fn)=>typeof translator[fn] === 'function' && !fn.startsWith('handlerAs') && fn !== 'constructor').parse(functionName);
93
+ return translator[validatedFunctionName](...inputs);
94
+ } catch (error) {
95
+ if (error instanceof z.ZodError) {
96
+ throw new Error(`${functionName} does not correspond to any oracle handler available on RPCTranslator`);
97
+ } else if (error instanceof Error) {
98
+ throw new Error(`Execution error while processing function ${functionName} in state ${this.state.name}: ${error.message}`);
99
+ } else {
100
+ throw new Error(`Unknown execution error while processing function ${functionName} in state ${this.state.name}`);
101
+ }
102
+ }
79
103
  }
80
- async setTopLevelContext() {
81
- if (this.state == 1) {
82
- await this.oracleHandler.txeAdvanceBlocksBy(1);
83
- this.oracleHandler.txeSetContractAddress(DEFAULT_ADDRESS);
84
- } else if (this.state == 2) {
85
- const block = await this.oracleHandler.close();
86
- await this.stateMachine.handleL2Block(block);
87
- this.legacyTXEOracle.baseFork = await this.stateMachine.synchronizer.nativeWorldStateService.fork();
88
- this.legacyTXEOracle.txeSetContractAddress(DEFAULT_ADDRESS);
89
- this.legacyTXEOracle.setBlockNumber(block.number + 1);
90
- this.oracleHandler = this.legacyTXEOracle;
91
- } else if (this.state == 3) {
92
- this.oracleHandler.txeSetContractAddress(DEFAULT_ADDRESS);
93
- } else if (this.state == 0) {
94
- throw new Error(`Expected to be in state other than ${SessionState[0]}`);
95
- } else {
96
- throw new Error(`Unexpected state '${this.state}'`);
104
+ async enterTopLevelState() {
105
+ switch(this.state.name){
106
+ case 'PRIVATE':
107
+ {
108
+ await this.exitPrivateState();
109
+ break;
110
+ }
111
+ case 'PUBLIC':
112
+ {
113
+ await this.exitPublicState();
114
+ break;
115
+ }
116
+ case 'UTILITY':
117
+ {
118
+ this.exitUtilityContext();
119
+ break;
120
+ }
121
+ case 'TOP_LEVEL':
122
+ {
123
+ throw new Error(`Expected to be in state other than TOP_LEVEL`);
124
+ }
125
+ default:
126
+ {
127
+ this.state;
128
+ }
97
129
  }
98
- this.state = 0;
99
- this.logger.debug(`Entered state ${SessionState[this.state]}`);
130
+ this.oracleHandler = new TXEOracleTopLevelContext(this.stateMachine, this.contractDataProvider, this.keyStore, this.addressDataProvider, this.accountDataProvider, this.pxeOracleInterface, this.nextBlockTimestamp, this.version, this.chainId, this.authwits);
131
+ this.state = {
132
+ name: 'TOP_LEVEL'
133
+ };
134
+ this.logger.debug(`Entered state ${this.state.name}`);
100
135
  }
101
- async setPublicContext(contractAddress) {
102
- this.assertInTopLevelState();
136
+ async enterPrivateState(contractAddress = DEFAULT_ADDRESS, anchorBlockNumber) {
137
+ this.exitTopLevelState();
138
+ // There is no automatic message discovery and contract-driven syncing process in inlined private or utility
139
+ // contexts, which means that known nullifiers are also not searched for, since it is during the tagging sync that
140
+ // we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
141
+ // be removed from the database.
142
+ // TODO(#12553): make the synchronizer sync here instead and remove this
143
+ await this.pxeOracleInterface.syncNoteNullifiers(contractAddress);
144
+ // Private execution has two associated block numbers: the anchor block (i.e. the historical block that is used to
145
+ // build the proof), and the *next* block, i.e. the one we'll create once the execution ends, and which will contain
146
+ // a single transaction with the effects of what was done in the test.
147
+ const anchorBlock = await this.stateMachine.node.getBlockHeader(anchorBlockNumber ?? 'latest');
148
+ const latestBlock = await this.stateMachine.node.getBlockHeader('latest');
149
+ const nextBlockGlobalVariables = makeGlobalVariables(undefined, {
150
+ blockNumber: BlockNumber(latestBlock.globalVariables.blockNumber + 1),
151
+ timestamp: this.nextBlockTimestamp,
152
+ version: this.version,
153
+ chainId: this.chainId
154
+ });
155
+ const txRequestHash = getSingleTxBlockRequestHash(nextBlockGlobalVariables.blockNumber);
156
+ const protocolNullifier = await computeProtocolNullifier(txRequestHash);
157
+ const noteCache = new ExecutionNoteCache(protocolNullifier);
158
+ const taggingIndexCache = new ExecutionTaggingIndexCache();
159
+ this.oracleHandler = new PrivateExecutionOracle(Fr.ZERO, new TxContext(this.chainId, this.version, GasSettings.empty()), new CallContext(AztecAddress.ZERO, contractAddress, FunctionSelector.empty(), false), anchorBlock, [], [], new HashedValuesCache(), noteCache, taggingIndexCache, this.pxeOracleInterface);
160
+ // We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
161
+ // data) in order to refer to it later, mimicking the way this object is used by the ContractFunctionSimulator. The
162
+ // difference resides in that the simulator has all information needed in order to run the simulation, while ours
163
+ // will be ongoing as the different oracles will be invoked from the Noir test, until eventually the private
164
+ // execution finishes.
165
+ this.state = {
166
+ name: 'PRIVATE',
167
+ nextBlockGlobalVariables,
168
+ protocolNullifier,
169
+ noteCache,
170
+ taggingIndexCache
171
+ };
172
+ this.logger.debug(`Entered state ${this.state.name}`);
173
+ return this.oracleHandler.getPrivateContextInputs();
174
+ }
175
+ async enterPublicState(contractAddress) {
176
+ this.exitTopLevelState();
177
+ // The PublicContext will create a block with a single transaction in it, containing the effects of what was done in
178
+ // the test. The block therefore gets the *next* block number and timestamp.
179
+ const latestBlockNumber = (await this.stateMachine.node.getBlockHeader('latest')).globalVariables.blockNumber;
103
180
  const globalVariables = makeGlobalVariables(undefined, {
104
- blockNumber: await this.legacyTXEOracle.utilityGetBlockNumber(),
105
- timestamp: await this.legacyTXEOracle.utilityGetTimestamp(),
106
- version: await this.legacyTXEOracle.utilityGetVersion(),
107
- chainId: await this.legacyTXEOracle.utilityGetChainId()
181
+ blockNumber: BlockNumber(latestBlockNumber + 1),
182
+ timestamp: this.nextBlockTimestamp,
183
+ version: this.version,
184
+ chainId: this.chainId
108
185
  });
109
- const txRequestHash = new Fr(globalVariables.blockNumber + 6969);
110
- this.oracleHandler = new TXEOraclePublicContext(contractAddress ?? DEFAULT_ADDRESS, await this.stateMachine.synchronizer.nativeWorldStateService.fork(), txRequestHash, globalVariables);
111
- this.state = 2;
112
- this.logger.debug(`Entered state ${SessionState[this.state]}`);
186
+ this.oracleHandler = new TXEOraclePublicContext(contractAddress ?? DEFAULT_ADDRESS, await this.stateMachine.synchronizer.nativeWorldStateService.fork(), getSingleTxBlockRequestHash(globalVariables.blockNumber), globalVariables);
187
+ this.state = {
188
+ name: 'PUBLIC'
189
+ };
190
+ this.logger.debug(`Entered state ${this.state.name}`);
191
+ }
192
+ async enterUtilityState(contractAddress = DEFAULT_ADDRESS) {
193
+ this.exitTopLevelState();
194
+ // There is no automatic message discovery and contract-driven syncing process in inlined private or utility
195
+ // contexts, which means that known nullifiers are also not searched for, since it is during the tagging sync that
196
+ // we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
197
+ // be removed from the database.
198
+ // TODO(#12553): make the synchronizer sync here instead and remove this
199
+ await this.pxeOracleInterface.syncNoteNullifiers(contractAddress);
200
+ this.oracleHandler = new UtilityExecutionOracle(contractAddress, [], [], this.pxeOracleInterface);
201
+ this.state = {
202
+ name: 'UTILITY'
203
+ };
204
+ this.logger.debug(`Entered state ${this.state.name}`);
205
+ }
206
+ exitTopLevelState() {
207
+ if (this.state.name != 'TOP_LEVEL') {
208
+ throw new Error(`Expected to be in state 'TOP_LEVEL', but got '${this.state.name}' instead`);
209
+ }
210
+ // Note that while all public and private contexts do is build a single block that we then process when exiting
211
+ // those, the top level context performs a large number of actions not captured in the following 'close' call. Among
212
+ // others, it will create empty blocks (via `txeAdvanceBlocksBy` and `deploy`), create blocks with transactions via
213
+ // `txePrivateCallNewFlow` and `txePublicCallNewFlow`, add accounts to PXE via `txeAddAccount`, etc. This is a
214
+ // slight inconsistency in the working model of this class, but is not too bad.
215
+ // TODO: it's quite unfortunate that we need to capture the authwits created to later pass them again when the top
216
+ // level context is re-created. This is because authwits create a temporary utility context that'd otherwise reset
217
+ // the authwits if not persisted, so we'd not be able to pass more than one per execution.
218
+ // Ideally authwits would be passed alongside a contract call instead of pre-seeded.
219
+ [this.nextBlockTimestamp, this.authwits] = this.oracleHandler.close();
113
220
  }
114
- async setPrivateContext(contractAddress, historicalBlockNumber) {
115
- this.assertInTopLevelState();
116
- if (contractAddress) {
117
- this.oracleHandler.txeSetContractAddress(contractAddress);
221
+ async exitPrivateState() {
222
+ if (this.state.name != 'PRIVATE') {
223
+ throw new Error(`Expected to be in state 'PRIVATE', but got '${this.state.name}' instead`);
118
224
  }
119
- const privateContextInputs = await this.oracleHandler.txeGetPrivateContextInputs(historicalBlockNumber);
120
- this.state = 1;
121
- this.logger.debug(`Entered state ${SessionState[this.state]}`);
122
- return privateContextInputs;
225
+ this.logger.debug('Exiting Private state, building block with collected side effects', {
226
+ blockNumber: this.state.nextBlockGlobalVariables.blockNumber
227
+ });
228
+ // We rely on the note cache to determine the effects of the transaction. This is incomplete as it doesn't private
229
+ // logs (other effects like enqueued public calls don't need to be considered since those are not allowed).
230
+ const txEffect = await makeTxEffect(this.state.noteCache, this.state.protocolNullifier, this.state.nextBlockGlobalVariables.blockNumber);
231
+ // We build a block holding just this transaction
232
+ const forkedWorldTrees = await this.stateMachine.synchronizer.nativeWorldStateService.fork();
233
+ await insertTxEffectIntoWorldTrees(txEffect, forkedWorldTrees);
234
+ const block = new L2Block(makeAppendOnlyTreeSnapshot(), await makeTXEBlockHeader(forkedWorldTrees, this.state.nextBlockGlobalVariables), new Body([
235
+ txEffect
236
+ ]));
237
+ await this.stateMachine.handleL2Block(block);
238
+ await forkedWorldTrees.close();
239
+ this.logger.debug('Exited PublicContext with built block', {
240
+ blockNumber: block.number,
241
+ txEffects: block.body.txEffects
242
+ });
123
243
  }
124
- setUtilityContext(contractAddress) {
125
- this.assertInTopLevelState();
126
- if (contractAddress) {
127
- this.oracleHandler.txeSetContractAddress(contractAddress);
244
+ async exitPublicState() {
245
+ if (this.state.name != 'PUBLIC') {
246
+ throw new Error(`Expected to be in state 'PUBLIC', but got '${this.state.name}' instead`);
128
247
  }
129
- this.state = 3;
130
- this.logger.debug(`Entered state ${SessionState[this.state]}`);
131
- return Promise.resolve();
248
+ const block = await this.oracleHandler.close();
249
+ await this.stateMachine.handleL2Block(block);
132
250
  }
133
- assertInTopLevelState() {
134
- if (this.state != 0) {
135
- throw new Error(`Expected to be in state ${SessionState[0]}, but got '${SessionState[this.state]}' instead`);
251
+ exitUtilityContext() {
252
+ if (this.state.name != 'UTILITY') {
253
+ throw new Error(`Expected to be in state 'UTILITY', but got '${this.state.name}' instead`);
136
254
  }
137
255
  }
138
256
  }
@@ -1,5 +1,5 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
1
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
- import { Fr } from '@aztec/foundation/fields';
3
3
  import { type ContractArtifact } from '@aztec/stdlib/abi';
4
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
5
  import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
@@ -55,29 +55,29 @@ export declare function toForeignCallResult(obj: (ForeignCallSingle | ForeignCal
55
55
  };
56
56
  export declare const ForeignCallSingleSchema: z.ZodString;
57
57
  export declare const ForeignCallArraySchema: z.ZodArray<z.ZodString, "many">;
58
- export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, import("@aztec/foundation/schemas").ZodFor<ContractArtifact>, z.ZodIntersection<z.ZodObject<{
58
+ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">, import("../../../foundation/dest/schemas/types.js").ZodFor<ContractArtifact>, z.ZodIntersection<z.ZodObject<{
59
59
  version: z.ZodLiteral<1>;
60
- salt: import("@aztec/foundation/schemas").ZodFor<Fr>;
61
- deployer: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
62
- currentContractClassId: import("@aztec/foundation/schemas").ZodFor<Fr>;
63
- originalContractClassId: import("@aztec/foundation/schemas").ZodFor<Fr>;
64
- initializationHash: import("@aztec/foundation/schemas").ZodFor<Fr>;
60
+ salt: import("../../../foundation/dest/schemas/types.js").ZodFor<Fr>;
61
+ deployer: import("../../../foundation/dest/schemas/types.js").ZodFor<AztecAddress>;
62
+ currentContractClassId: import("../../../foundation/dest/schemas/types.js").ZodFor<Fr>;
63
+ originalContractClassId: import("../../../foundation/dest/schemas/types.js").ZodFor<Fr>;
64
+ initializationHash: import("../../../foundation/dest/schemas/types.js").ZodFor<Fr>;
65
65
  publicKeys: z.ZodEffects<z.ZodObject<{
66
- masterNullifierPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
67
- masterIncomingViewingPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
68
- masterOutgoingViewingPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
69
- masterTaggingPublicKey: z.ZodType<import("@aztec/foundation/fields").Point, any, string>;
66
+ masterNullifierPublicKey: z.ZodType<import("../../../foundation/dest/schemas/schemas.js").Point, any, string>;
67
+ masterIncomingViewingPublicKey: z.ZodType<import("../../../foundation/dest/schemas/schemas.js").Point, any, string>;
68
+ masterOutgoingViewingPublicKey: z.ZodType<import("../../../foundation/dest/schemas/schemas.js").Point, any, string>;
69
+ masterTaggingPublicKey: z.ZodType<import("../../../foundation/dest/schemas/schemas.js").Point, any, string>;
70
70
  }, "strip", z.ZodTypeAny, {
71
- masterNullifierPublicKey: import("@aztec/foundation/fields").Point;
72
- masterIncomingViewingPublicKey: import("@aztec/foundation/fields").Point;
73
- masterOutgoingViewingPublicKey: import("@aztec/foundation/fields").Point;
74
- masterTaggingPublicKey: import("@aztec/foundation/fields").Point;
71
+ masterNullifierPublicKey: import("../../../foundation/dest/schemas/schemas.js").Point;
72
+ masterIncomingViewingPublicKey: import("../../../foundation/dest/schemas/schemas.js").Point;
73
+ masterOutgoingViewingPublicKey: import("../../../foundation/dest/schemas/schemas.js").Point;
74
+ masterTaggingPublicKey: import("../../../foundation/dest/schemas/schemas.js").Point;
75
75
  }, {
76
76
  masterNullifierPublicKey: string;
77
77
  masterIncomingViewingPublicKey: string;
78
78
  masterOutgoingViewingPublicKey: string;
79
79
  masterTaggingPublicKey: string;
80
- }>, import("@aztec/stdlib/keys").PublicKeys, {
80
+ }>, import("../../../stdlib/dest/keys/public_keys.js").PublicKeys, {
81
81
  masterNullifierPublicKey: string;
82
82
  masterIncomingViewingPublicKey: string;
83
83
  masterOutgoingViewingPublicKey: string;
@@ -86,26 +86,26 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
86
86
  }, "strip", z.ZodTypeAny, {
87
87
  version: 1;
88
88
  salt: Fr;
89
- publicKeys: import("@aztec/stdlib/keys").PublicKeys;
90
89
  deployer: AztecAddress;
91
90
  currentContractClassId: Fr;
92
91
  originalContractClassId: Fr;
93
92
  initializationHash: Fr;
93
+ publicKeys: import("../../../stdlib/dest/keys/public_keys.js").PublicKeys;
94
94
  }, {
95
95
  version: 1;
96
+ salt?: any;
97
+ deployer?: any;
98
+ currentContractClassId?: any;
99
+ originalContractClassId?: any;
100
+ initializationHash?: any;
96
101
  publicKeys: {
97
102
  masterNullifierPublicKey: string;
98
103
  masterIncomingViewingPublicKey: string;
99
104
  masterOutgoingViewingPublicKey: string;
100
105
  masterTaggingPublicKey: string;
101
106
  };
102
- salt?: any;
103
- deployer?: any;
104
- currentContractClassId?: any;
105
- originalContractClassId?: any;
106
- initializationHash?: any;
107
107
  }>, z.ZodObject<{
108
- address: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
108
+ address: import("../../../foundation/dest/schemas/types.js").ZodFor<AztecAddress>;
109
109
  }, "strip", z.ZodTypeAny, {
110
110
  address: AztecAddress;
111
111
  }, {
@@ -118,4 +118,4 @@ export declare const ForeignCallResultSchema: z.ZodObject<{
118
118
  }, {
119
119
  values: (string | string[])[];
120
120
  }>;
121
- //# sourceMappingURL=encoding.d.ts.map
121
+ //# sourceMappingURL=data:application/json;base64,eyJ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B,KAAK,EAAE,YAAY,GAAG,UAAU,GAAG,EAAE,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GACzE,iBAAiB,CAYnB;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,gBAAgB,CAEpD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,qBAE/C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAEhE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,gBAAgB,EAC7B,MAAM,EAAE,MAAM,GACb,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAYvC;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,gBAAgB,EAAE,EAC/B,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,MAAM,GACxB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAqBvC;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,EAAE;;EAEhF;AAED,eAAO,MAAM,uBAAuB,aAAa,CAAC;AAElD,eAAO,MAAM,sBAAsB,iCAAsB,CAAC;AAE1D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Fr } from '@aztec/foundation/fields';
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
2
2
  import { hexToBuffer } from '@aztec/foundation/string';
3
3
  import { ContractArtifactSchema } from '@aztec/stdlib/abi';
4
4
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
@@ -1,4 +1,4 @@
1
1
  export declare class ExpectedFailureError extends Error {
2
2
  constructor(message: string);
3
3
  }
4
- //# sourceMappingURL=expected_failure_error.d.ts.map
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhwZWN0ZWRfZmFpbHVyZV9lcnJvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWwvZXhwZWN0ZWRfZmFpbHVyZV9lcnJvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxxQkFBYSxvQkFBcUIsU0FBUSxLQUFLO0lBQzdDLFlBQVksT0FBTyxFQUFFLE1BQU0sRUFFMUI7Q0FDRiJ9
@@ -1 +1 @@
1
- {"version":3,"file":"expected_failure_error.d.ts","sourceRoot":"","sources":["../../src/util/expected_failure_error.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAG5B"}
1
+ {"version":3,"file":"expected_failure_error.d.ts","sourceRoot":"","sources":["../../src/util/expected_failure_error.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO,EAAE,MAAM,EAE1B;CACF"}
@@ -7,4 +7,4 @@ export declare class TXEAccountDataProvider {
7
7
  getAccount(key: AztecAddress): Promise<CompleteAddress>;
8
8
  setAccount(key: AztecAddress, value: CompleteAddress): Promise<void>;
9
9
  }
10
- //# sourceMappingURL=txe_account_data_provider.d.ts.map
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX2FjY291bnRfZGF0YV9wcm92aWRlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWwvdHhlX2FjY291bnRfZGF0YV9wcm92aWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBaUIsTUFBTSxpQkFBaUIsQ0FBQztBQUN4RSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFekQscUJBQWEsc0JBQXNCOztJQUdqQyxZQUFZLEtBQUssRUFBRSxpQkFBaUIsRUFFbkM7SUFFSyxVQUFVLENBQUMsR0FBRyxFQUFFLFlBQVksNEJBTWpDO0lBRUssVUFBVSxDQUFDLEdBQUcsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLGVBQWUsaUJBRXpEO0NBQ0YifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"txe_account_data_provider.d.ts","sourceRoot":"","sources":["../../src/util/txe_account_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBAAa,sBAAsB;;gBAGrB,KAAK,EAAE,iBAAiB;IAI9B,UAAU,CAAC,GAAG,EAAE,YAAY;IAQ5B,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe;CAG3D"}
1
+ {"version":3,"file":"txe_account_data_provider.d.ts","sourceRoot":"","sources":["../../src/util/txe_account_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBAAa,sBAAsB;;IAGjC,YAAY,KAAK,EAAE,iBAAiB,EAEnC;IAEK,UAAU,CAAC,GAAG,EAAE,YAAY,4BAMjC;IAEK,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,iBAEzD;CACF"}
@@ -1,4 +1,5 @@
1
- import { type ContractArtifact, Fr } from '@aztec/aztec.js';
1
+ import type { ContractArtifact } from '@aztec/aztec.js/abi';
2
+ import { Fr } from '@aztec/aztec.js/fields';
2
3
  import { ContractDataProvider } from '@aztec/pxe/server';
3
4
  export type ContractArtifactWithHash = ContractArtifact & {
4
5
  artifactHash: Fr;
@@ -8,4 +9,4 @@ export declare class TXEContractDataProvider extends ContractDataProvider {
8
9
  addContractArtifact(id: Fr, artifact: ContractArtifact | ContractArtifactWithHash): Promise<void>;
9
10
  getContractArtifact(contractClassId: Fr): Promise<ContractArtifact | ContractArtifactWithHash | undefined>;
10
11
  }
11
- //# sourceMappingURL=txe_contract_data_provider.d.ts.map
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX2NvbnRyYWN0X2RhdGFfcHJvdmlkZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3R4ZV9jb250cmFjdF9kYXRhX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDNUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQzVDLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBRXpELE1BQU0sTUFBTSx3QkFBd0IsR0FBRyxnQkFBZ0IsR0FBRztJQUFFLFlBQVksRUFBRSxFQUFFLENBQUE7Q0FBRSxDQUFDO0FBTy9FLHFCQUFhLHVCQUF3QixTQUFRLG9CQUFvQjs7SUFHekMsbUJBQW1CLENBQ3ZDLEVBQUUsRUFBRSxFQUFFLEVBQ04sUUFBUSxFQUFFLGdCQUFnQixHQUFHLHdCQUF3QixHQUNwRCxPQUFPLENBQUMsSUFBSSxDQUFDLENBS2Y7SUFFcUIsbUJBQW1CLENBQ3ZDLGVBQWUsRUFBRSxFQUFFLEdBQ2xCLE9BQU8sQ0FBQyxnQkFBZ0IsR0FBRyx3QkFBd0IsR0FBRyxTQUFTLENBQUMsQ0FRbEU7Q0FDRiJ9