import { BeaconConfig } from "@lodestar/config"; import { BuilderIndex, Epoch, ValidatorIndex, gloas } from "@lodestar/types"; import { AttestationData } from "@lodestar/types/phase0"; import { CachedBeaconStateFulu, CachedBeaconStateGloas } from "../types.js"; import { RootCache } from "./rootCache.js"; export declare function isBuilderWithdrawalCredential(withdrawalCredentials: Uint8Array): boolean; export declare function getBuilderPaymentQuorumThreshold(state: CachedBeaconStateGloas): number; /** * Check if a validator index represents a builder (has the builder flag set). * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/beacon-chain.md#new-is_builder_index */ export declare function isBuilderIndex(validatorIndex: number): boolean; /** * Convert a builder index to a flagged validator index for use in Withdrawal containers. * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/beacon-chain.md#new-convert_builder_index_to_validator_index */ export declare function convertBuilderIndexToValidatorIndex(builderIndex: BuilderIndex): ValidatorIndex; /** * Convert a flagged validator index back to a builder index. * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/beacon-chain.md#new-convert_validator_index_to_builder_index */ export declare function convertValidatorIndexToBuilderIndex(validatorIndex: ValidatorIndex): BuilderIndex; /** * Check if a builder is active (deposited and not yet withdrawable). * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/beacon-chain.md#isactivebuilder */ export declare function isActiveBuilder(builder: gloas.Builder, finalizedEpoch: Epoch): boolean; /** * Compute the gas limit that satisfies the EIP-1559 adjustment rule from `parentGasLimit`, * clamping `targetGasLimit` into the allowed window of `±max(parentGasLimit / 1024, 1) - 1`. * * From https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md */ export declare function getExpectedGasLimit(parentGasLimit: number, targetGasLimit: number): number; export declare function getExpectedGasLimitBigint(parentGasLimit: bigint, targetGasLimit: bigint): bigint; /** * Check if `gasLimit` is compatible with `targetGasLimit` under the EIP-1559 transition rule * from `parentGasLimit`. The bid must hit `targetGasLimit` when the target is within one * adjustment step of the parent, otherwise it must hit the clamped boundary. * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.8/specs/gloas/builder.md#new-is_gas_limit_target_compatible */ export declare function isGasLimitTargetCompatible(parentGasLimit: bigint, gasLimit: bigint, targetGasLimit: bigint): boolean; /** * Get the total pending balance to withdraw for a builder (from withdrawals + payments). * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/beacon-chain.md#new-get_pending_balance_to_withdraw_for_builder */ export declare function getPendingBalanceToWithdrawForBuilder(state: CachedBeaconStateGloas, builderIndex: BuilderIndex): number; /** * Check if a builder has sufficient balance to cover a bid amount. * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/beacon-chain.md#new-can_builder_cover_bid */ export declare function canBuilderCoverBid(state: CachedBeaconStateGloas, builderIndex: BuilderIndex, bidAmount: number): boolean; /** * Initiate a builder exit by setting their withdrawable epoch. * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.1/specs/gloas/beacon-chain.md#new-initiate_builder_exit */ export declare function initiateBuilderExit(state: CachedBeaconStateGloas, builderIndex: BuilderIndex): void; /** * Find the index of a builder by their public key. * Returns null if not found. * * May consider builder pubkey cache if performance becomes an issue. */ export declare function findBuilderIndexByPubkey(state: CachedBeaconStateGloas, pubkey: Uint8Array): BuilderIndex | null; /** * Use cached block roots to avoid repeated state root lookups while matching the spec's is_attestation_same_slot behavior. */ export declare function isAttestationSameSlotRootCache(rootCache: RootCache, data: AttestationData): boolean; export declare function initializePtcWindow(state: CachedBeaconStateFulu): Uint32Array[]; export declare function getPtcWindowEpochCacheData(state: CachedBeaconStateGloas): { previousPayloadTimelinessCommittees: Uint32Array[]; payloadTimelinessCommittees: Uint32Array[]; nextPayloadTimelinessCommittees: Uint32Array[]; }; /** * Add a new builder to the builders registry. Reuses slots from exited and fully withdrawn * builders when available, otherwise appends. * * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.11/specs/gloas/beacon-chain.md#new-add_builder_to_registry */ export declare function addBuilderToRegistry(state: CachedBeaconStateGloas, pubkey: Uint8Array, version: number, executionAddress: Uint8Array, amount: number, slot: number): void; /** * Append a new builder to the registry without scanning for a reusable slot. * * This is only safe to be used at the gloas fork transition. */ export declare function appendBuilderToRegistry(state: CachedBeaconStateGloas, pubkey: Uint8Array, version: number, executionAddress: Uint8Array, amount: number, slot: number): void; /** * Verify the proof of possession on a builder deposit request. * * The dedicated `DOMAIN_BUILDER_DEPOSIT` (vs the validator `DOMAIN_DEPOSIT`) prevents replay * of validator deposit signatures against the builder deposit contract and vice versa. * * Spec: https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.11/specs/gloas/beacon-chain.md#new-is_valid_builder_deposit_signature */ export declare function isValidBuilderDepositSignature(config: BeaconConfig, pubkey: Uint8Array, withdrawalCredentials: Uint8Array, amount: number, signature: Uint8Array): boolean; //# sourceMappingURL=gloas.d.ts.map