diff --git a/docs/.gitignore b/docs/.gitignore index 67fcfa892b46..edd3d03a8bae 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -24,4 +24,5 @@ yarn-error.log* /docs/developers/reference/aztecjs /docs/developers/reference/smart_contract_reference/aztec-nr +/docs/docs/protocol-specs/public-vm/gen test-results diff --git a/docs/docs/developers/guides/smart_contracts/writing_contracts/how_to_pop_capsules.md b/docs/docs/developers/guides/smart_contracts/writing_contracts/how_to_pop_capsules.md index 5ba1ba6a226b..6f7f60ae8fcc 100644 --- a/docs/docs/developers/guides/smart_contracts/writing_contracts/how_to_pop_capsules.md +++ b/docs/docs/developers/guides/smart_contracts/writing_contracts/how_to_pop_capsules.md @@ -4,21 +4,15 @@ sidebar_position: 5 tags: [functions, oracles] --- -`popCapsule` is used for passing artbitrary data. We have not yet included this in Aztec.nr, so it is a bit more complex than the other oracles. You can follow this how-to: +`popCapsule` is used for passing arbitrary data. We have not yet included this in Aztec.nr, so it is a bit more complex than the other oracles. You can follow this how-to: -### 1. Define the pop_capsule function - -In a new file on the same level as your `main.nr`, implement an unconstrained function that calls the pop_capsule oracle: - -#include_code pop_capsule noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/capsule.nr rust - -### 2. Import this into your smart contract +### 1. Import capsules into your smart contract If it lies in the same directory as your smart contract, you can import it like this: #include_code import_pop_capsule noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr rust -### 3. Use it as any other oracle +### 2. Use it as any other oracle Now it becomes a regular oracle you can call like this: diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index 900acd5636b9..0fd8bf3400cf 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -121,6 +121,7 @@ library Constants { uint256 internal constant MULTI_CALL_ENTRYPOINT_ADDRESS = 4; uint256 internal constant FEE_JUICE_ADDRESS = 5; uint256 internal constant ROUTER_ADDRESS = 6; + uint256 internal constant REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT = 79025834455612; uint256 internal constant FEE_JUICE_BALANCES_SLOT = 1; uint256 internal constant DEFAULT_NPK_M_X = 582240093077765400562621227108555700500271598878376310175765873770292988861; diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/capsule.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/capsule.nr deleted file mode 100644 index 0e4d3a9c44c1..000000000000 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/capsule.nr +++ /dev/null @@ -1,11 +0,0 @@ -// We should extract this to a shared lib in aztec-nr once we settle on a design for capsules - -// docs:start:pop_capsule -#[oracle(popCapsule)] -unconstrained fn pop_capsule_oracle() -> [Field; N] {} - -// A capsule is a "blob" of data that is passed to the contract through an oracle. -pub unconstrained fn pop_capsule() -> [Field; N] { - pop_capsule_oracle() -} -// docs:end:pop_capsule diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr index e83dd0517a83..9707b3bdbdb2 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr @@ -1,5 +1,4 @@ mod events; -mod capsule; use dep::aztec::macros::aztec; @@ -11,7 +10,7 @@ pub contract ContractClassRegisterer { ARTIFACT_FUNCTION_TREE_MAX_HEIGHT, FUNCTION_TREE_HEIGHT, MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS, - MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, + MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT, }, contract_class_id::ContractClassId, }; @@ -33,8 +32,7 @@ pub contract ContractClassRegisterer { }; // docs:start:import_pop_capsule - use crate::capsule::pop_capsule; - + use dep::aztec::oracle::pxe_db; // docs:end:import_pop_capsule #[private] @@ -47,8 +45,13 @@ pub contract ContractClassRegisterer { // TODO: Validate public_bytecode_commitment is the correct commitment of packed_public_bytecode // TODO: We should be able to remove public_bytecode_commitment from the input if it's calculated in this function // docs:start:pop_capsule - let packed_public_bytecode: [Field; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS] = - unsafe { pop_capsule() }; + let packed_public_bytecode: [Field; MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS] = unsafe { + pxe_db::load( + context.this_address(), + REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT, + ) + .unwrap() + }; // docs:end:pop_capsule // First field element contains the length of the bytecode let bytecode_length_in_bytes: u32 = packed_public_bytecode[0] as u32; @@ -121,8 +124,13 @@ pub contract ContractClassRegisterer { artifact_function_tree_leaf_index: Field, function_data: InnerPrivateFunction, ) { - let private_bytecode: [Field; MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS] = - unsafe { pop_capsule() }; + let private_bytecode: [Field; MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS] = unsafe { + pxe_db::load( + context.this_address(), + REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT, + ) + .unwrap() + }; let event = ClassPrivateFunctionBroadcasted { contract_class_id, @@ -162,8 +170,13 @@ pub contract ContractClassRegisterer { artifact_function_tree_leaf_index: Field, function_data: InnerUnconstrainedFunction, ) { - let unconstrained_bytecode: [Field; MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS] = - unsafe { pop_capsule() }; + let unconstrained_bytecode: [Field; MAX_PACKED_BYTECODE_SIZE_PER_UNCONSTRAINED_FUNCTION_IN_FIELDS] = unsafe { + pxe_db::load( + context.this_address(), + REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT, + ) + .unwrap() + }; let event = ClassUnconstrainedFunctionBroadcasted { contract_class_id, artifact_metadata_hash, diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr index 6799a3334717..d1ee281f3476 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -180,6 +180,9 @@ pub global MULTI_CALL_ENTRYPOINT_ADDRESS: AztecAddress = AztecAddress::from_fiel pub global FEE_JUICE_ADDRESS: AztecAddress = AztecAddress::from_field(5); pub global ROUTER_ADDRESS: AztecAddress = AztecAddress::from_field(6); +// Randomly chosen slot for the bytecode capsule. +pub global REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT: Field = 79025834455612; + // Slot of the balances map to be hashed with an AztecAddress (map key) to get an actual storage slot. pub global FEE_JUICE_BALANCES_SLOT: u32 = 1; diff --git a/yarn-project/aztec.js/src/deployment/broadcast_function.ts b/yarn-project/aztec.js/src/deployment/broadcast_function.ts index 67398836735e..6e13cd3ef301 100644 --- a/yarn-project/aztec.js/src/deployment/broadcast_function.ts +++ b/yarn-project/aztec.js/src/deployment/broadcast_function.ts @@ -1,6 +1,9 @@ import { ARTIFACT_FUNCTION_TREE_MAX_HEIGHT, + AztecAddress, MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, + REGISTERER_CONTRACT_ADDRESS, + REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT, computeVerificationKeyHash, createPrivateFunctionMembershipProof, createUnconstrainedFunctionMembershipProof, @@ -57,7 +60,11 @@ export async function broadcastPrivateFunction( MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, ); - await wallet.addCapsule(bytecode); + await wallet.addCapsule( + AztecAddress.fromNumber(REGISTERER_CONTRACT_ADDRESS), + new Fr(REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT), + bytecode, + ); const registerer = await getRegistererContract(wallet); return Promise.resolve( @@ -115,7 +122,11 @@ export async function broadcastUnconstrainedFunction( MAX_PACKED_BYTECODE_SIZE_PER_PRIVATE_FUNCTION_IN_FIELDS, ); - await wallet.addCapsule(bytecode); + await wallet.addCapsule( + AztecAddress.fromNumber(REGISTERER_CONTRACT_ADDRESS), + new Fr(REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT), + bytecode, + ); const registerer = await getRegistererContract(wallet); return registerer.methods.broadcast_unconstrained_function( diff --git a/yarn-project/aztec.js/src/deployment/register_class.ts b/yarn-project/aztec.js/src/deployment/register_class.ts index ed178b91cd8c..5ee1abbe0062 100644 --- a/yarn-project/aztec.js/src/deployment/register_class.ts +++ b/yarn-project/aztec.js/src/deployment/register_class.ts @@ -1,4 +1,11 @@ -import { MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, getContractClassFromArtifact } from '@aztec/circuits.js'; +import { + AztecAddress, + Fr, + MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS, + REGISTERER_CONTRACT_ADDRESS, + REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT, + getContractClassFromArtifact, +} from '@aztec/circuits.js'; import { type ContractArtifact, bufferAsFields } from '@aztec/foundation/abi'; import { type ContractFunctionInteraction } from '../contract/contract_function_interaction.js'; @@ -21,6 +28,10 @@ export async function registerContractClass( await getContractClassFromArtifact(artifact); const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS); const registerer = await getRegistererContract(wallet); - await wallet.addCapsule(encodedBytecode); + await wallet.addCapsule( + AztecAddress.fromNumber(REGISTERER_CONTRACT_ADDRESS), + new Fr(REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT), + encodedBytecode, + ); return registerer.methods.register(artifactHash, privateFunctionsRoot, publicBytecodeCommitment, emitPublicBytecode); } diff --git a/yarn-project/aztec.js/src/wallet/base_wallet.ts b/yarn-project/aztec.js/src/wallet/base_wallet.ts index c8cdbe034c6a..691c2a2cbe04 100644 --- a/yarn-project/aztec.js/src/wallet/base_wallet.ts +++ b/yarn-project/aztec.js/src/wallet/base_wallet.ts @@ -67,8 +67,8 @@ export abstract class BaseWallet implements Wallet { getAddress() { return this.getCompleteAddress().address; } - addCapsule(capsule: Fr[]): Promise { - return this.pxe.addCapsule(capsule); + addCapsule(contract: AztecAddress, storageSlot: Fr, capsule: Fr[]): Promise { + return this.pxe.addCapsule(contract, storageSlot, capsule); } registerAccount(secretKey: Fr, partialAddress: PartialAddress): Promise { return this.pxe.registerAccount(secretKey, partialAddress); diff --git a/yarn-project/circuit-types/src/interfaces/pxe.test.ts b/yarn-project/circuit-types/src/interfaces/pxe.test.ts index def4889fc4d8..261c41c24fd7 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.test.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.test.ts @@ -112,7 +112,7 @@ describe('PXESchema', () => { }); it('addCapsule', async () => { - await context.client.addCapsule(times(3, Fr.random)); + await context.client.addCapsule(address, Fr.random(), times(3, Fr.random)); }); it('registerAccount', async () => { @@ -344,7 +344,9 @@ class MockPXE implements PXE { expect(messageHash).toBeInstanceOf(Fr); return Promise.resolve([Fr.random()]); } - addCapsule(capsule: Fr[]): Promise { + addCapsule(contract: AztecAddress, storageSlot: Fr, capsule: Fr[]): Promise { + expect(contract).toBeInstanceOf(AztecAddress); + expect(storageSlot).toBeInstanceOf(Fr); expect(capsule.every(c => c instanceof Fr)).toBeTruthy(); return Promise.resolve(); } diff --git a/yarn-project/circuit-types/src/interfaces/pxe.ts b/yarn-project/circuit-types/src/interfaces/pxe.ts index 5fe85fe08435..ac6ac0351bbd 100644 --- a/yarn-project/circuit-types/src/interfaces/pxe.ts +++ b/yarn-project/circuit-types/src/interfaces/pxe.ts @@ -83,11 +83,15 @@ export interface PXE { getAuthWitness(messageHash: Fr): Promise; /** - * Adding a capsule to the capsule dispenser. + * Adds a capsule. + * @param contract - The address of the contract to add the capsule to. + * @param storageSlot - The storage slot to add the capsule to. * @param capsule - An array of field elements representing the capsule. - * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. + * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. It works similarly + * to public contract storage in that it's indexed by the contract address and storage slot but instead of the global + * network state it's backed by local PXE db. */ - addCapsule(capsule: Fr[]): Promise; + addCapsule(contract: AztecAddress, storageSlot: Fr, capsule: Fr[]): Promise; /** * Registers a user account in PXE given its master encryption private key. @@ -464,7 +468,7 @@ export const PXESchema: ApiSchemaFor = { .function() .args(schemas.Fr) .returns(z.union([z.undefined(), z.array(schemas.Fr)])), - addCapsule: z.function().args(z.array(schemas.Fr)).returns(z.void()), + addCapsule: z.function().args(schemas.AztecAddress, schemas.Fr, z.array(schemas.Fr)).returns(z.void()), registerAccount: z.function().args(schemas.Fr, schemas.Fr).returns(CompleteAddress.schema), getRegisteredAccounts: z.function().returns(z.array(CompleteAddress.schema)), registerSender: z.function().args(schemas.AztecAddress).returns(schemas.AztecAddress), diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index ad3ade12cf04..3efdbe8b28f6 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -106,6 +106,7 @@ export const REGISTERER_CONTRACT_ADDRESS = 3; export const MULTI_CALL_ENTRYPOINT_ADDRESS = 4; export const FEE_JUICE_ADDRESS = 5; export const ROUTER_ADDRESS = 6; +export const REGISTERER_CONTRACT_BYTECODE_CAPSULE_SLOT = 79025834455612; export const FEE_JUICE_BALANCES_SLOT = 1; export const DEFAULT_NPK_M_X = 582240093077765400562621227108555700500271598878376310175765873770292988861n; export const DEFAULT_NPK_M_Y = 10422444662424639723529825114205836958711284159673861467999592572974769103684n; diff --git a/yarn-project/pxe/src/database/kv_pxe_database.ts b/yarn-project/pxe/src/database/kv_pxe_database.ts index 05c7faa4b0d7..e205ecb3d812 100644 --- a/yarn-project/pxe/src/database/kv_pxe_database.ts +++ b/yarn-project/pxe/src/database/kv_pxe_database.ts @@ -35,7 +35,6 @@ export class KVPxeDatabase implements PxeDatabase { #completeAddressIndex: AztecAsyncMap; #addressBook: AztecAsyncSet; #authWitnesses: AztecAsyncMap; - #capsules: AztecAsyncArray; #notes: AztecAsyncMap; #nullifiedNotes: AztecAsyncMap; #nullifierToNoteId: AztecAsyncMap; @@ -78,7 +77,6 @@ export class KVPxeDatabase implements PxeDatabase { this.#addressBook = db.openSet('address_book'); this.#authWitnesses = db.openMap('auth_witnesses'); - this.#capsules = db.openArray('capsules'); this.#contractArtifacts = db.openMap('contract_artifacts'); this.#contractInstances = db.openMap('contracts_instances'); @@ -189,15 +187,6 @@ export class KVPxeDatabase implements PxeDatabase { return Promise.resolve(witness?.map(w => Fr.fromBuffer(w))); } - async addCapsule(capsule: Fr[]): Promise { - await this.#capsules.push(capsule.map(c => c.toBuffer())); - } - - async popCapsule(): Promise { - const val = await this.#capsules.pop(); - return val?.map(b => Fr.fromBuffer(b)); - } - async addNote(note: NoteDao, scope?: AztecAddress): Promise { await this.addNotes([note], scope); } @@ -652,7 +641,7 @@ export class KVPxeDatabase implements PxeDatabase { } async dbCopy(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise { - // In order to support overlaping source and destination regions we need to check the relative positions of source + // In order to support overlapping source and destination regions, we need to check the relative positions of source // and destination. If destination is ahead of source, then by the time we overwrite source elements using forward // indexes we'll have already read those. On the contrary, if source is ahead of destination we need to use backward // indexes to avoid reading elements that've been overwritten. diff --git a/yarn-project/pxe/src/database/pxe_database.ts b/yarn-project/pxe/src/database/pxe_database.ts index e508891d1c75..72e7a87bb957 100644 --- a/yarn-project/pxe/src/database/pxe_database.ts +++ b/yarn-project/pxe/src/database/pxe_database.ts @@ -35,20 +35,6 @@ export interface PxeDatabase extends ContractArtifactDatabase, ContractInstanceD */ getAuthWitness(messageHash: Fr): Promise; - /** - * Adding a capsule to the capsule dispenser. - * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. - * @param capsule - An array of field elements representing the capsule. - */ - addCapsule(capsule: Fr[]): Promise; - - /** - * Get the next capsule from the capsule dispenser. - * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. - * @returns A promise that resolves to an array of field elements representing the capsule. - */ - popCapsule(): Promise; - /** * Gets notes based on the provided filter. * @param filter - The filter to apply to the notes. @@ -216,7 +202,7 @@ export interface PxeDatabase extends ContractArtifactDatabase, ContractInstanceD /** * Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `dbLoad`. - * If data was already stored at this slot, it is overwrriten. + * If data was already stored at this slot, it is overwritten. * @param contractAddress - The contract address to scope the data under. * @param slot - The slot in the database in which to store the value. Slots need not be contiguous. * @param values - The data to store. diff --git a/yarn-project/pxe/src/database/pxe_database_test_suite.ts b/yarn-project/pxe/src/database/pxe_database_test_suite.ts index 202c2f6848e3..e6b5c5dee276 100644 --- a/yarn-project/pxe/src/database/pxe_database_test_suite.ts +++ b/yarn-project/pxe/src/database/pxe_database_test_suite.ts @@ -54,29 +54,6 @@ export function describePxeDatabase(getDatabase: () => PxeDatabase) { }); }); - describe('capsules', () => { - it('stores and retrieves capsules', async () => { - const capsule = [Fr.random(), Fr.random()]; - - await database.addCapsule(capsule); - await expect(database.popCapsule()).resolves.toEqual(capsule); - }); - - it("returns undefined if it doesn't have capsules", async () => { - await expect(database.popCapsule()).resolves.toBeUndefined(); - }); - - it('behaves like a stack when storing capsules', async () => { - const capsule1 = [Fr.random(), Fr.random()]; - const capsule2 = [Fr.random(), Fr.random()]; - - await database.addCapsule(capsule1); - await database.addCapsule(capsule2); - await expect(database.popCapsule()).resolves.toEqual(capsule2); - await expect(database.popCapsule()).resolves.toEqual(capsule1); - }); - }); - describe('incoming notes', () => { let owners: CompleteAddress[]; let contractAddresses: AztecAddress[]; diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index b201b976a0dc..48c70c6b81ec 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -137,8 +137,8 @@ export class PXEService implements PXE { return this.db.getAuthWitness(messageHash); } - public addCapsule(capsule: Fr[]) { - return this.db.addCapsule(capsule); + public addCapsule(contract: AztecAddress, storageSlot: Fr, capsule: Fr[]) { + return this.db.dbStore(contract, storageSlot, capsule); } public getContractInstance(address: AztecAddress): Promise { diff --git a/yarn-project/pxe/src/simulator_oracle/index.ts b/yarn-project/pxe/src/simulator_oracle/index.ts index 2220f41fdee7..b2c6d2fb4052 100644 --- a/yarn-project/pxe/src/simulator_oracle/index.ts +++ b/yarn-project/pxe/src/simulator_oracle/index.ts @@ -101,14 +101,6 @@ export class SimulatorOracle implements DBOracle { return witness; } - async popCapsule(): Promise { - const capsule = await this.db.popCapsule(); - if (!capsule) { - throw new Error(`No capsules available`); - } - return capsule; - } - async getNotes(contractAddress: AztecAddress, storageSlot: Fr, status: NoteStatus, scopes?: AztecAddress[]) { const noteDaos = await this.db.getNotes({ contractAddress, diff --git a/yarn-project/simulator/src/acvm/oracle/oracle.ts b/yarn-project/simulator/src/acvm/oracle/oracle.ts index 3d2501a3a2eb..c0129cd3535b 100644 --- a/yarn-project/simulator/src/acvm/oracle/oracle.ts +++ b/yarn-project/simulator/src/acvm/oracle/oracle.ts @@ -142,14 +142,6 @@ export class Oracle { return witness.map(toACVMField); } - async popCapsule(): Promise { - const capsule = await this.typedOracle.popCapsule(); - if (!capsule) { - throw new Error(`No capsules available`); - } - return capsule.map(toACVMField); - } - async getPublicKeysAndPartialAddress([address]: ACVMField[]): Promise { const parsedAddress = AztecAddress.fromField(fromACVMField(address)); const { publicKeys, partialAddress } = await this.typedOracle.getCompleteAddress(parsedAddress); diff --git a/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts b/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts index 6eac05947f37..74ba9884ed4b 100644 --- a/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts +++ b/yarn-project/simulator/src/acvm/oracle/typed_oracle.ts @@ -119,10 +119,6 @@ export abstract class TypedOracle { throw new OracleMethodNotAvailableError('getAuthWitness'); } - popCapsule(): Promise { - throw new OracleMethodNotAvailableError('popCapsule'); - } - getNotes( _storageSlot: Fr, _numSelects: number, diff --git a/yarn-project/simulator/src/client/db_oracle.ts b/yarn-project/simulator/src/client/db_oracle.ts index 594af643bccb..ecbd2828175c 100644 --- a/yarn-project/simulator/src/client/db_oracle.ts +++ b/yarn-project/simulator/src/client/db_oracle.ts @@ -64,13 +64,6 @@ export interface DBOracle extends CommitmentsDB { */ getAuthWitness(messageHash: Fr): Promise; - /** - * Retrieve a capsule from the capsule dispenser. - * @returns A promise that resolves to an array of field elements representing the capsule. - * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. - */ - popCapsule(): Promise; - /** * Retrieve keys associated with a specific master public key and app address. * @param pkMHash - The master public key hash. diff --git a/yarn-project/simulator/src/client/view_data_oracle.ts b/yarn-project/simulator/src/client/view_data_oracle.ts index 0ca67be9f6e4..26fef8e003aa 100644 --- a/yarn-project/simulator/src/client/view_data_oracle.ts +++ b/yarn-project/simulator/src/client/view_data_oracle.ts @@ -162,15 +162,6 @@ export class ViewDataOracle extends TypedOracle { ); } - /** - * Pops a capsule from the capsule dispenser - * @returns The capsule values - * @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. - */ - public override popCapsule(): Promise { - return this.db.popCapsule(); - } - /** * Gets some notes for a contract address and storage slot. * Returns a flattened array containing filtered notes. diff --git a/yarn-project/txe/src/oracle/txe_oracle.ts b/yarn-project/txe/src/oracle/txe_oracle.ts index 2d0a3de8b29e..0ca041aaba1f 100644 --- a/yarn-project/txe/src/oracle/txe_oracle.ts +++ b/yarn-project/txe/src/oracle/txe_oracle.ts @@ -511,10 +511,6 @@ export class TXE implements TypedOracle { return this.txeDatabase.getAuthWitness(messageHash); } - popCapsule(): Promise { - throw new Error('Method not implemented.'); - } - async getNotes( storageSlot: Fr, numSelects: number,