pos 命名空间
conflux-rust
从版本2.0.0开始引入了权益证明(PoS)最终性,以加速区块的最终性并防止51%攻击。 PoS finality将引入一个独立的PoS链用于PoS共识和确认PoW块的最终性。 对应地,PoS也有自己的RPC方法,用于从PoS链中获取数据。
Currently, only the archive nodes of conflux-rust can provide PoS RPC service to the public. public_rpc_apis
needs to be configured to open RPC.
You can add the pos
group to the current RPC method group.
public_rpc_apis = "safe,pos"
Or just set public_rpc_apis
to all
to open all RPC methods.
public_rpc_apis = "all"
Basic Concepts
epoch
The concept of epoch is also used in PoS. However, different from the epoch in PoW, an epoch in PoS represents the term of a committee, starting from term 1
. Each epoch is equivalent to half hour
on average. After each epoch, a part of the members of the committee are replaced. The rewards for participating in PoS consensus are also given on an epoch basis.
round
A PoS chain will on average perform one round of consensus 30 seconds
(i.e. try to generate a PoS block). This means that each epoch will have 60
rounds, and with each new epoch
, the round will start from 1
again.
Note: Not every round will generate a block. there may be network or consensus failures preventing a block from generating.
block.number
The block.number is the height
of the block, and is added by one for each new block generated.
After a PoS block is proposed by a committee member, it will be sent to the network for voting. When the block collects enough votes, it is labeled as voted
. However, the block has yet been committed. When three consecutive blocks are created, the block corresponding to the first round will be submitted. Then its state will change from voted
to committed
.
pivotDecision
pivotDecision is the PoS chain's final decision on a block in the PoW chain. Once a block in the PoW is referenced by the PoS, the PoW block is finalized and there will be no further reversion. Blocks in the PoS chain will include PivotDecision attributes, indicating that this PoS block has finalized a block in the PoW chain. The pivotDecision is the block number or hash value of a block in the PoW chain.
PoS Address
Unlike the format of the PoW address, the PoS account address is a 256-bit hash value, e.g:
0x046ca462890f25ed9394ca9f92c979ff48e1738a81822ecab96d83813c1a433c
PoS Model
AccountStatus
After an account registers to participate in PoS consensus, or adds staking to votes, the votes will first go into the inQueue
state and then become locked
after seven days
. When the user makes an unlock command, the votes to be unlocked will first go into the outQueue
state. Then it also takes seven days
to become unlocked
.
availableVotes
:QUANTITY
- the number of votes currently available for the account. Equals tosum inQueue
+locked
forfeited
:QUANTITY
- the number of votes that are locked and cannot be retrieved if the account is identified as malicious.forceRetired
: [QUANTITY
] - the block number when the votes was retiredinQueue
:Array
of VotesInQueue - the number of votes that are currently waiting to be lockedlocked
:QUANTITY
- the number of votes that are currently lockedoutQueue
:Array
of VotesInQueue - the number of votes that are currently waiting to be unlockedunlocked
:QUANTITY
- the number of users total unlocked votes in history
Decision
The PoS chain's decision on the height of the PoW chain. The block of the PoW that is decided by the PoS chain is the Finalized block.
height
:QUANTITY
- the height of the PoW blockblockHash
:HASH
- the hash value of the PoW block
VotesInQueue
The information regarding a user's in-queue votes.
endBlockNumber
:QUANTITY
- block number when the state endspower
:QUANTITY
- number of votes in the current status