Block Synchronization Contract
blksync.xsat
blksync.xsat
This contract processes the submission and verification of block data by the Synchronizer and stores the verified block data.
Actions
Initialize block bucket
Sharding of upload chunks
Delete block shards
Verify the validity of the block
ENUM block_status
block_status
TABLE globalid
globalid
scope
blksync.xsat
params
{uint64_t} bucket_id
- latest bucket_id
example
TABLE blockbuckets
blockbuckets
scope
validator
params
{uint64_t} bucket_id
- primary key, bucket_id is the scope associated with block.bucket{uint64_t} height
- block height{uint32_t} size
-block size{uint32_t} uploaded_size
- the latest release id{uint8_t} num_chunks
- number of chunks{uint8_t} uploaded_num_chunks
- number of chunks that have been uploaded{uint32_t} chunk_size
- the size of each chunk{vector<uint8_t>} chunk_ids
- the uploaded chunk_id{string} reason
- reason for verification failure{block_status} status
- current block status{time_point_sec} updated_at
- updated at time{std::optional<verify_info_data>} verify_info
- @see structverify_info_data
example
TABLE passedindexs
passedindexs
scope
height
params
{uint64_t} id
- primary key{checksum256} hash
- block hash{checksum256} cumulative_work
- the cumulative workload of the block{uint64_t} bucket_id
- bucket_id is used to obtain block data{name} synchronizer
- synchronizer account{name} miner
- miner account{time_point_sec} created_at
- created at time
example
TABLE blockminer
blockminer
scope
height
params
{uint64_t} id
- primary key{checksum256} hash
- block hash{name} miner
- block miner account{uint32_t} block_num
- the block number that passed the first verification
example
TABLE block.chunk
block.chunk
scope
bucket_id
params
{std::vector<char>} data
- the block chunk for block
example
STRUCT verify_info_data
verify_info_data
params
{name} miner
- block miner account{vector<string>} btc_miners
- btc miner account{checksum256} previous_block_hash
- hash in internal byte order of the previous blockβs header{checksum256} work
- block workload{checksum256} witness_reserve_value
- witness reserve value in the block{std::optional<checksum256>}
- witness commitment in the block{bool} has_witness
- whether any of the transactions in the block contains witness{checksum256} header_merkle
- the merkle root of the block{std::vector<checksum256>} relay_header_merkle
- check header merkle relay data{std::vector<checksum256>} relay_witness_merkle
- check witness merkle relay data{uint64_t} num_transactions
- the number of transactions in the block{uint64_t} processed_position
- the location of the block that has been resolved{uint64_t} processed_transactions
- the number of processed transactions{uint32_t} timestamp
- the block time in seconds since epoch (Jan 1 1970 GMT){uint32_t} bits
- the bits
example
STRUCT verify_block_result
verify_block_result
params
{string} status
- verification status (uploading, upload_complete, verify_merkle, verify_parent_hash, waiting_miner_verification, verify_pass, verify_fail){string} reason
- reason for verification failure{checksum256} block_hash
- block hash
example
ACTION consensus
consensus
authority:
utxomng.xsat
Consensus completion processing logic
params
{uint64_t} height
- block height{name} synchronizer
- synchronizer account{uint64_t} bucket_id
- bucket id
ACTION delchunks
delchunks
authority:
utxomng.xsat
Deletion of historical block data after parsing is completed
params
{uint64_t} bucket_id
- bucket_id of block data to be deleted
ACTION initbucket
initbucket
authority:
synchronizer
Initialize the block information to be uploaded
params
{name} synchronizer
- synchronizer account{uint64_t} height
- block height{checksum256} hash
- block hash{uint32_t} size
-block size{uint8_t} num_chunks
- number of chunks{uint32_t} chunk_size
- the size of each chunk
ACTION pushchunk
pushchunk
authority:
synchronizer
Upload block shard data
params
{name} synchronizer
- synchronizer account{uint64_t} height
- block height{checksum256} hash
- block hash{uint8_t} chunk_id
- chunk id{std::vector<char>} data
- block data to be uploaded
ACTION delchunk
delchunk
authority:
synchronizer
Delete block shard data
params
{name} synchronizer
- synchronizer account{uint64_t} height
- block height{checksum256} hash
- block hash{uint8_t} chunk_id
- chunk id
ACTION delbucket
delbucket
authority:
synchronizer
Delete the entire block data
params
{name} synchronizer
- synchronizer account{uint64_t} height
- block height{checksum256} hash
- block hash
ACTION verify
verify
authority:
synchronizer
Verify block data
params
{name} synchronizer
- synchronizer account{uint64_t} height
- block height{checksum256} hash
- block hash{uint64_t} nonce
- unique value for each call to prevent duplicate transactions
Last updated