import type { Fr } from '@aztec/foundation/curves/bn254'; import type { PublicTreesDB } from '../public_db_sources.js'; /** * A class to manage new nullifier staging and existence checks during a contract call's AVM simulation. * Maintains a siloed nullifier cache, and ensures that existence checks fall back to the correct source. * When a contract call completes, its cached nullifier set can be merged into its parent's. */ export declare class NullifierManager { /** Reference to node storage. Checked on parent cache-miss. */ private readonly hostNullifiers; /** Cache of siloed nullifiers. */ private cache; /** Parent nullifier manager to fall back on */ private readonly parent?; constructor( /** Reference to node storage. Checked on parent cache-miss. */ hostNullifiers: PublicTreesDB, /** Cache of siloed nullifiers. */ cache?: Set, /** Parent nullifier manager to fall back on */ parent?: NullifierManager | undefined); /** * Create a new nullifiers manager forked from this one */ fork(): NullifierManager; /** * Get a nullifier's existence in this' cache or parent's (recursively). * DOES NOT CHECK HOST STORAGE! * @param siloedNullifier - the nullifier to check for * @returns exists: whether the nullifier exists in cache here or in parent's */ private checkExistsHereOrParent; /** * Get a nullifier's existence status. * 1. Check cache. * 2. Check parent cache. * 3. Fall back to the host state. * 4. Not found! Nullifier does not exist. * * @param siloedNullifier - the nullifier to check for * @returns exists: whether the nullifier exists at all, * cacheHit: whether the nullifier was found in a cache, */ checkExists(siloedNullifier: Fr): Promise<{ exists: boolean; cacheHit: boolean; }>; /** * Stage a new nullifier (append it to the cache). * * @param siloedNullifier - the nullifier to stage */ append(siloedNullifier: Fr): Promise; /** * Merges another nullifier cache into this one. * * @param incomingNullifiers - the incoming cached nullifiers to merge into this instance's */ acceptAndMerge(incomingNullifiers: NullifierManager): void; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVsbGlmaWVycy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3B1YmxpYy9zdGF0ZV9tYW5hZ2VyL251bGxpZmllcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQU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