import { ChainForkConfig } from "@lodestar/config"; import { Epoch, Root, TimeSeconds } from "@lodestar/types"; import { BeaconStateAllForks, CachedBeaconStateAllForks } from "../types.js"; import { StateBytesMetadata } from "./sszBytes.js"; export declare const ETH_TO_GWEI: number; /** * Returns the epoch of the latest weak subjectivity checkpoint for the given `state` and `safetyDecay`. The default `safetyDecay` used should be 10% (= 0.1) */ export declare function getLatestWeakSubjectivityCheckpointEpoch(config: ChainForkConfig, state: CachedBeaconStateAllForks): Epoch; /** Returns the weak subjectivity period for the current `state`. This computation takes into account the effect of: - validator set churn (bounded by `get_validator_churn_limit()` per epoch), and - validator balance top-ups (bounded by `MAX_DEPOSITS * SLOTS_PER_EPOCH` per epoch). A detailed calculation can be found at: https://github.com/runtimeverification/beacon-chain-verification/blob/master/weak-subjectivity/weak-subjectivity-analysis.pdf */ export declare function computeWeakSubjectivityPeriodCachedState(config: ChainForkConfig, state: CachedBeaconStateAllForks): number; /** * Same to computeWeakSubjectivityPeriodCachedState but for normal state */ export declare function computeWeakSubjectivityPeriod(config: ChainForkConfig, state: BeaconStateAllForks): number; export declare function computeWeakSubjectivityPeriodFromConstituentsPhase0(activeValidatorCount: number, totalBalanceByIncrement: number, churnLimit: number, minWithdrawabilityDelay: number): number; export declare function computeWeakSubjectivityPeriodFromConstituentsElectra(totalBalanceByIncrement: number, balanceChurnLimit: number, minWithdrawabilityDelay: number): number; export declare function computeWeakSubjectivityPeriodFromConstituentsGloas(totalBalanceByIncrement: number, exitChurnLimit: number, activationChurnLimit: number, consolidationChurnLimit: number, minWithdrawabilityDelay: number): number; export declare function getLatestBlockRoot(state: BeaconStateAllForks): Root; export type WeakSubjectivitySummary = { checkpointEpoch: Epoch; genesisTime: number; period: number; }; /** The metadata must describe the supplied state bytes. */ export declare function computeWeakSubjectivitySummaryFromStateBytes(config: ChainForkConfig, bytes: Uint8Array, metadata: StateBytesMetadata): WeakSubjectivitySummary | null; export declare function isWithinWeakSubjectivityPeriodFromSummary(config: ChainForkConfig, summary: WeakSubjectivitySummary, now?: TimeSeconds): boolean; //# sourceMappingURL=weakSubjectivity.d.ts.map