BlockKeeperContractRoot.abi.json

Overview

This file defines the Application Binary Interface (ABI) for the BlockKeeperContractRoot smart contract. The contract primarily manages the root logic of block keepers within a blockchain network, including configuration management, stake handling, block keeper node deployment, reward calculation, and address/code retrieval for various related components.

The ABI version is 2, and the contract version is 2.4. The contract uses a header consisting of public key, time, and expire fields, which are common for transaction validation and security.

The contract encapsulates key functionalities to maintain the block keeper ecosystem, ensuring proper stake management, node registration, slashing mechanisms, and epoch-related operations.


Structure and Components

Fields

The contract maintains a set of persistent fields representing the state of the block keeper root. Key fields include:


Functions

constructor(licenseRoot: address)

closeRoot()

setConfig(epochDuration: uint64, minBlockKeepers: uint128, isNeedNumberOfActiveBlockKeepers: bool, needNumberOfActiveBlockKeepers: uint128, walletTouch: uint8, nlinit: uint128)

setConfigNode(...)

deployAckiNackiBlockKeeperNodeWallet(pubkey: uint256, whiteListLicense: map(uint256,bool))

coolerSlash(seqNoStart: uint64, pubkey: uint256)

decreaseStakes(pubkey: uint256, seqNoStart: uint64, slash_stake: uint128, rep_coef: uint128)

increaseActiveBlockKeeperNumber(pubkey: uint256, seqNoStart: uint64, stake: uint128, rep_coef: uint128, virtualStake: optional(uint128))

receiveBlockKeeperRequestWithStakeFromWallet(pubkey: uint256, bls_pubkey: bytes, signerIndex: uint16, rep_coef: uint128, is_min: bool, ProxyList: map(uint8,string), myIp: string, nodeVersion: optional(string))

isBLSAccepted(wallet: address, pubkey: uint256, bls_pubkey: bytes, stake: uint128, isNotOk: bool, signerIndex: uint16, rep_coef: uint128, virtualStake: optional(uint128), ProxyList: map(uint8,string), myIp: string, nodeVersion: optional(string))

isSignerIndexAccepted(...)

receiveBlockKeeperRequestWithStakeFromWalletContinue(pubkey: uint256, bls_pubkey: bytes, seqNoStartOld: uint64, signerIndex: uint16, is_min: bool, ProxyList: map(uint8,string), seqNoFinish: uint64, sumReputationCoef: uint128, nodeVersion: optional(string))

isBLSAcceptedContinue(...)

isSignerIndexContinue(...)

setNewCode(id: uint8, code: cell)

decreaseActiveBlockKeeper(pubkey: uint256, rep_coef: uint128, seqNoStart: uint64, stake: uint128, virtualStake: optional(uint128), reward_sum: uint128, gparam: uint256, isSlash: bool)

getBlockKeeperCoolerAddress(pubkey: uint256, seqNoStart: uint64) -> address

getAckiNackiBlockKeeperNodeWalletAddress(pubkey: uint256) -> address

getAckiNackiBlockKeeperNodeWalletCode() -> cell

getBlockKeeperEpochCode() -> cell

getBlockKeeperEpochAddress(pubkey: uint256, seqNoStart: uint64) -> address

getBlockKeeperPreEpochAddress(pubkey: uint256, seqNoStart: uint64) -> address

getDetails() -> (minStake: uint128, numberOfActiveBlockKeepers: uint128)

getEpochCodeHash() -> uint256

getPreEpochCodeHash() -> uint256

getRewardOut(reward_sum: uint128, rep_coef: uint128, gparam: uint256, stake: uint128) -> uint128

getProxyListCode() -> cell

getProxyListAddress(pubkey: uint256) -> address

getRewardNow(rep_coef: uint128, stake: uint128) -> uint128

getMinStakeNow() -> uint128

getMaxStakeNow() -> uint128

getConfig() -> (epochDuration: uint64, epochCliff: uint64, waitStep: uint64)

getSignerIndexAddress(index: uint16) -> address

getMinStakeOut(reward_sum: uint128, timeEpochStart: uint128, numberOfActiveBlockKeepersAtBlockStart: uint128, needNumberOfActiveBlockKeepers: uint128) -> uint128

getBLSIndexAddress(bls_key: bytes) -> address

getCodes() -> map(uint8,cell)

getVersion() -> (string, string)

_notion() -> string


Important Implementation Details


Interaction with Other System Components


Visual Diagram: Function Structure Flowchart

flowchart TD
    constructor --> setConfig
    constructor --> setConfigNode

    setConfig --> deployAckiNackiBlockKeeperNodeWallet
    setConfigNode --> deployAckiNackiBlockKeeperNodeWallet

    deployAckiNackiBlockKeeperNodeWallet --> receiveBlockKeeperRequestWithStakeFromWallet
    receiveBlockKeeperRequestWithStakeFromWallet --> isBLSAccepted
    receiveBlockKeeperRequestWithStakeFromWallet --> isSignerIndexAccepted

    receiveBlockKeeperRequestWithStakeFromWallet --> receiveBlockKeeperRequestWithStakeFromWalletContinue
    receiveBlockKeeperRequestWithStakeFromWalletContinue --> isBLSAcceptedContinue
    receiveBlockKeeperRequestWithStakeFromWalletContinue --> isSignerIndexContinue

    coolerSlash --> decreaseStakes
    coolerSlash --> decreaseActiveBlockKeeper

    increaseActiveBlockKeeperNumber --> getDetails
    decreaseActiveBlockKeeper --> getDetails

    getBlockKeeperCoolerAddress --> getAckiNackiBlockKeeperNodeWalletAddress
    getAckiNackiBlockKeeperNodeWalletAddress --> getAckiNackiBlockKeeperNodeWalletCode

    getBlockKeeperEpochCode --> getBlockKeeperEpochAddress
    getBlockKeeperEpochCode --> getBlockKeeperPreEpochAddress

    getRewardOut --> getRewardNow
    getRewardNow --> getMinStake