import { ChainForkConfig } from "@lodestar/config";
import { IForkChoice, ProtoBlock } from "@lodestar/fork-choice";
import { CachedBeaconStateAllForks } from "@lodestar/state-transition";
import { BeaconBlock, RootHex, Slot } from "@lodestar/types";
import { Logger } from "@lodestar/utils";
import { IBeaconDb } from "../../db/index.js";
import { Metrics } from "../../metrics/index.js";
import { ChainEventEmitter } from "../emitter.js";
import { SeenBlockInput } from "../seenCache/seenGossipBlockInput.js";
import { BlockStateCache, CheckpointStateCache } from "../stateCache/types.js";
import { ValidatorMonitor } from "../validatorMonitor.js";
import { IStateRegeneratorInternal, RegenCaller, StateRegenerationOpts } from "./interface.js";
export type RegenModules = {
    db: IBeaconDb;
    forkChoice: IForkChoice;
    blockStateCache: BlockStateCache;
    checkpointStateCache: CheckpointStateCache;
    seenBlockInputCache: SeenBlockInput;
    config: ChainForkConfig;
    emitter: ChainEventEmitter;
    logger: Logger;
    metrics: Metrics | null;
    validatorMonitor: ValidatorMonitor | null;
};
/**
 * Regenerates states that have already been processed by the fork choice
 * Since Feb 2024, we support reloading checkpoint state from disk via allowDiskReload flag. Due to its performance impact
 * this flag is only set to true in this case:
 *    - getPreState: this is for block processing, it's important to reload state in unfinality time
 *    - updateHeadState: rarely happen, but it's important to make sure we always can regen head state
 */
export declare class StateRegenerator implements IStateRegeneratorInternal {
    private readonly modules;
    constructor(modules: RegenModules);
    /**
     * Get the state to run with `block`. May be:
     * - If parent is in same epoch -> Exact state at `block.parentRoot`
     * - If parent is in prev epoch -> State after `block.parentRoot` dialed forward through epoch transition
     * - reload state if needed in this flow
     */
    getPreState(block: BeaconBlock, opts: StateRegenerationOpts, regenCaller: RegenCaller): Promise<CachedBeaconStateAllForks>;
    /**
     * Get state after block `blockRoot` dialed forward to `slot`
     *   - allowDiskReload should be used with care, as it will cause the state to be reloaded from disk
     */
    getBlockSlotState(block: ProtoBlock, slot: Slot, opts: StateRegenerationOpts, regenCaller: RegenCaller, allowDiskReload?: boolean): Promise<CachedBeaconStateAllForks>;
    /**
     * Get state by exact root. If not in cache directly, requires finding the block that references the state from the
     * forkchoice and replaying blocks to get to it.
     *   - allowDiskReload should be used with care, as it will cause the state to be reloaded from disk
     */
    getState(stateRoot: RootHex, caller: RegenCaller, allowDiskReload?: boolean): Promise<CachedBeaconStateAllForks>;
    private findFirstStateBlock;
}
/**
 * Starting at `state.slot`,
 * process slots forward towards `slot`,
 * emitting "checkpoint" events after every epoch processed.
 *
 * Stops processing after no more full epochs can be processed.
 */
export declare function processSlotsToNearestCheckpoint(modules: {
    checkpointStateCache: CheckpointStateCache;
    metrics: Metrics | null;
    validatorMonitor: ValidatorMonitor | null;
    emitter: ChainEventEmitter | null;
    logger: Logger | null;
}, preState: CachedBeaconStateAllForks, slot: Slot, regenCaller: RegenCaller, opts: StateRegenerationOpts): Promise<CachedBeaconStateAllForks>;
//# sourceMappingURL=regen.d.ts.map