Block Consensus Contract
blkendt.xsat
This contract processes votes from validators on the hash of each Bitcoin block. When more than two-thirds of the validators submit the same hash for a block, and it matches the hash of the block data submitted by the Synchronizer, the block is considered to have reached consensus.
Actions
Endorse a block
QuickStart
Table Information
STRUCT requested_validator_info
requested_validator_info
{name} account
- validator account{uint64_t} staking
- the validator's staking amount
STRUCT provider_validator_info
provider_validator_info
{name} account
- validator account{uint64_t} staking
- the validator's staking amount{time_point_sec} created_at
- created at time
example
TABLE config
config
scope
blkendt.xsat
params
{uint64_t} limit_endorse_height
- limit the endorsement height. If it is 0, there will be no limit. If it is greater than this height, endorsement will not be allowed.{uint16_t} limit_num_endorsed_blocks
- limit the endorsement height to no more than the number of blocks of the parsed height. If it is 0, there will be no limit.{uint16_t} min_validators
- the minimum number of validators, which limits the number of validators that pledge more than 100 BTC at the time of first endorsement.{uint16_t} consensus_interval_seconds
- the interval in seconds between consensus rounds.{uint64_t} xsat_stake_activation_height
- block height at which XSAT staking feature is activated{asset} min_xsat_qualification
- minimum XSAT amount required for qualification{asset} min_btc_qualification
- minimum BTC amount required for qualification{uint64_t} xsat_reward_height
- block height at which XSAT rewards are activated{uint64_t} validator_active_vote_count
- count of active validator votes
example
TABLE endorsements
endorsements
scope
height
params
{uint64_t} id
- primary key{checksum256} hash
- endorsement block hash{std::vector<requested_validator_info>} requested_validators
- list of unendorsed validators{std::vector<provider_validator_info>} provider_validators
- list of endorsed validators
example
TABLE revote_record
revote_record
scope
blkendt.xsat
params
{uint64_t} id
- primary key{uint64_t} height
- height{std::vector<name>} synchronizers
- synchronizers{uint8_t} status
- status{time_point_sec} created_at
- created at time{time_point_sec} updated_at
- updated at time
example
ACTION config
config
authority: blkendt.xsat
Configure endorsement status
params
{uint64_t} limit_endorse_height
- limit the endorsement height. If it is 0, there will be no limit. If it is greater than this height, endorsement will not be allowed.{uint16_t} limit_num_endorsed_blocks
- limit the endorsement height to no more than the number of blocks of the parsed height. If it is 0, there will be no limit.{uint16_t} min_validators
- the minimum number of validators, which limits the number of validators that pledge more than 100 BTC at the time of first endorsement.{uint64_t} xsat_stake_activation_height
- block height at which XSAT staking feature is activated{uint16_t} consensus_interval_seconds
- the interval in seconds between consensus rounds.
example
ACTION endorse
endorse
authority:
validator
Endorsement block
params
{name} validator
- validator account{uint64_t} height
- to endorse the height of the block{checksum256} hash
- to endorse the hash of the block
example
ACTION erase
erase
authority:
utxomng.xsat
To erase high endorsements
params
{uint64_t} height
- to endorse the height of the block
example
ACTION revote
revote
authority:
synchronizer
To initiate a revote for a specific height
params
{name} synchronizer
- synchronizer account{uint64_t} height
- height
example
ACTION setqualify
setqualify
authority:
endrmng.xsat
orblkendt.sat
Set the minimum pledge amount of xast to become a validator
params
{asset} min_xsat_qualification
- the minimum pledge amount of xast to become a validator{asset} min_btc_qualification
- the minimum pledge amount of btc to become a validator
example
ACTION setconheight
setconheight
authority:
blkendt.sat
Set the XSAT stake activation height and XSAT reward height
params
{uint64_t} xsat_stake_activation_height
- block height at which XSAT staking feature is activated{uint64_t} xsat_reward_height
- block height at which XSAT reward feature is activated
example
Last updated