PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@celo/contractkit/lib/wrappers

Просмотр файла: DowntimeSlasher.d.ts

import { Address } from '@celo/connect';
import BigNumber from 'bignumber.js';
import { DowntimeSlasher } from '../generated/DowntimeSlasher';
import { BaseSlasher } from './BaseSlasher';
export interface DowntimeSlasherConfig {
    slashableDowntime: number;
    slashingIncentives: {
        reward: BigNumber;
        penalty: BigNumber;
    };
}
export interface Interval {
    start: number;
    end: number;
}
/**
 * Contract handling slashing for Validator downtime using intervals.
 */
export declare class DowntimeSlasherWrapper extends BaseSlasher<DowntimeSlasher> {
    /**
     * Returns slashable downtime in blocks.
     * @return The number of consecutive blocks before a Validator missing from IBFT consensus
     * can be slashed.
     */
    slashableDowntime: () => Promise<number>;
    /**
     * Returns current configuration parameters.
     */
    getConfig(): Promise<DowntimeSlasherConfig>;
    /**
     * @dev Returns human readable configuration of the downtime slasher contract
     * @return DowntimeSlasherConfig object
     */
    getHumanReadableConfig(): Promise<{
        slashableDowntime: string;
        slashingIncentives: {
            reward: BigNumber;
            penalty: BigNumber;
        };
    }>;
    /**
     * Calculates and returns the signature bitmap for the specified interval.
     * Similar to the parentSealBitmap of every block (where you have which validators were
     * able to sign the previous block), this bitmap shows for that specific interval which
     * validators signed at least one block
     * @param interval First and last block of the interval.
     * @return (string) The signature uptime bitmap for the specified interval.
     * @dev startBlock and endBlock must be in the same epoch.
     * @dev The getParentSealBitmap precompile requires that startBlock must be within 4 epochs of
     * the current block.
     */
    getBitmapForInterval: (interval: Interval) => Promise<string>;
    /**
     * Calculates and sets the signature bitmap for the specified interval.
     * @param interval First and last block of the interval.
     * @dev interval.start and interval.end must be in the same epoch.
     * @return The signature bitmap for the specified interval.
     */
    setBitmapForInterval: (interval: Interval) => import("@celo/connect").CeloTransactionObject<string>;
    /**
     * Calculates intervals which span `slashableDowntime` before provided block.
     * @param block Block number to build intervals before.
     * @param maximumLength Maximum length for any interval (limited by gas limit).
     * @dev if block is undefined, latest will be used
     * @return The signature bitmap for the specified interval.
     */
    slashableDowntimeIntervalsBefore(block?: number, maximumLength?: number): Promise<Interval[]>;
    /**
     * Shows if the user already called the `setBitmapForInterval` for
     * the specific interval.
     * @param interval First and last block of the interval.
     * @return True if the user already called the `setBitmapForInterval` for
     * the specific interval.
     */
    isBitmapSetForInterval: (interval: Interval) => Promise<boolean>;
    /**
     * Shows if the user already called the `setBitmapForInterval` for intervals.
     * @param intervals First and last block of the interval.
     * @return True if the user already called the `setBitmapForInterval` for intervals.
     */
    isBitmapSetForIntervals(intervals: Interval[]): Promise<boolean>;
    lastSlashedBlock: (arg0: string) => Promise<number>;
    /**
     * Tests if the given validator or signer did not sign any blocks in the interval.
     * @param address Address of the validator account or signer.
     * @param interval First and last block of the interval.
     */
    wasValidatorDownForInterval(address: Address, interval: Interval): Promise<boolean>;
    /**
     * Returns true if the validator did not sign any blocks for the specified overlapping or adjacent
     * intervals.
     * @param address Address of the validator account or signer.
     * @param intervals
     * @return True if the validator signature does not appear in any block within the window.
     */
    wasValidatorDownForIntervals(address: Address, intervals: Interval[]): Promise<boolean>;
    /**
     * Returns true if the validator did not sign any blocks for the specified overlapping or adjacent
     * intervals.
     * @param address Address of the validator account or signer.
     * @param intervals A list of ordered intervals for which signature bitmaps have already been set.
     */
    slashValidator(address: Address, intervals: Interval[]): Promise<import("@celo/connect").CeloTransactionObject<void>>;
    /**
     * Calculate the slashable downtime window with respect to a provided start/end block numbers and length.
     * @param startBlock First block of the downtime. Determined from endBlock if not provided.
     * @param endBlock Last block of the downtime. Determined from startBlock or grandparent of latest block if not provided.
     * @param length Length of downtime. Determined from minimum slashable downtime if not provided.
     */
    private getSlashableDowntimeWindow;
}
export declare type DowntimeSlasherWrapperType = DowntimeSlasherWrapper;

Выполнить команду


Для локальной разработки. Не используйте в интернете!