import { routes } from "@lodestar/api";
import { ProtoBlock } from "@lodestar/fork-choice";
import { CachedBeaconStateAllForks } from "@lodestar/state-transition";
import { BeaconBlock, Epoch, RootHex, Slot, phase0 } from "@lodestar/types";
import { CheckpointHex } from "../stateCache/types.js";
export declare enum RegenCaller {
    getDuties = "getDuties",
    processBlock = "processBlock",
    produceBlock = "produceBlock",
    validateGossipBlock = "validateGossipBlock",
    validateGossipBlob = "validateGossipBlob",
    validateGossipDataColumn = "validateGossipDataColumn",
    precomputeEpoch = "precomputeEpoch",
    predictProposerHead = "predictProposerHead",
    produceAttestationData = "produceAttestationData",
    processBlocksInEpoch = "processBlocksInEpoch",
    validateGossipAggregateAndProof = "validateGossipAggregateAndProof",
    validateGossipAttestation = "validateGossipAttestation",
    validateGossipVoluntaryExit = "validateGossipVoluntaryExit",
    validateGossipExecutionPayloadBid = "validateGossipExecutionPayloadBid",
    onForkChoiceFinalized = "onForkChoiceFinalized",
    restApi = "restApi"
}
export declare enum RegenFnName {
    getBlockSlotState = "getBlockSlotState",
    getState = "getState",
    getPreState = "getPreState"
}
export type StateRegenerationOpts = {
    dontTransferCache: boolean;
};
export interface IStateRegenerator extends IStateRegeneratorInternal {
    dropCache(): void;
    dumpCacheSummary(): routes.lodestar.StateCacheItem[];
    getStateSync(stateRoot: RootHex): CachedBeaconStateAllForks | null;
    getPreStateSync(block: BeaconBlock): CachedBeaconStateAllForks | null;
    getCheckpointStateOrBytes(cp: CheckpointHex): Promise<CachedBeaconStateAllForks | Uint8Array | null>;
    getCheckpointStateSync(cp: CheckpointHex): CachedBeaconStateAllForks | null;
    getClosestHeadState(head: ProtoBlock): CachedBeaconStateAllForks | null;
    pruneOnCheckpoint(finalizedEpoch: Epoch, justifiedEpoch: Epoch, headStateRoot: RootHex): void;
    pruneOnFinalized(finalizedEpoch: Epoch): void;
    processState(blockRootHex: RootHex, postState: CachedBeaconStateAllForks): void;
    addCheckpointState(cp: phase0.Checkpoint, item: CachedBeaconStateAllForks): void;
    updateHeadState(newHead: ProtoBlock, maybeHeadState: CachedBeaconStateAllForks): void;
    updatePreComputedCheckpoint(rootHex: RootHex, epoch: Epoch): number | null;
}
/**
 * Regenerates states that have already been processed by the fork choice
 */
export interface IStateRegeneratorInternal {
    /**
     * Return a valid pre-state for a beacon block
     * This will always return a state in the latest viable epoch
     */
    getPreState(block: BeaconBlock, opts: StateRegenerationOpts, rCaller: RegenCaller): Promise<CachedBeaconStateAllForks>;
    /**
     * Return the state of `blockRoot` processed to slot `slot`
     */
    getBlockSlotState(block: ProtoBlock, slot: Slot, opts: StateRegenerationOpts, rCaller: RegenCaller): Promise<CachedBeaconStateAllForks>;
    /**
     * Return the exact state with `stateRoot`
     */
    getState(stateRoot: RootHex, rCaller: RegenCaller): Promise<CachedBeaconStateAllForks>;
}
//# sourceMappingURL=interface.d.ts.map