package
2.0.1+incompatible
Repository: https://github.com/dipperin/dipperin-core.git
Documentation: pkg.go.dev
# README
BlockValidation
- Verify header
CsBFT does not modify data when verifying state roots and registering roots SaveBlock confirms data and save data when verifying status root and registration root
completeness rate | block type | consensus | method |
---|---|---|---|
complete | both | block configuration correct:version ID,chain ID, etc | ValidateBlockVersion |
complete | both | verify continuum of block height | ValidateBlockNumber |
complete | both | verify correctness of block hash | ValidateBlockHash |
complete | both | verify block size smaller than default maximum | ValidateBlockSize |
complete | normal block | verify block difficulty meets the need | ValidateBlockDifficulty |
complete | normal block | verify block hash satisfies the difficulty | ValidHashForDifficulty |
complete | both | verify correctness of block seed | ValidateSeed |
complete | special block | verify the address of the miner of the block is boot node | ValidateBlockCoinBase |
complete | both | verify vote root hash | validVerificationRoot |
complete | both | verify transaction root hash | ValidateBlockTxs |
complete | both | verify state root hash | validStateRoot |
complete | both | verify registration root hash | validBlockVerifier |
incomplete | both | verify interlink root hash | ??? |
- Verify votes
When CsBFT verifies the vote, it only needs to verify the verification in the body. The object is the last block. When SaveBlock verifies the vote, you need to verify the two sets of votes, except for verification, the other group is see commit, and the object is the current block.
completeness rate | block type | consensus | method |
---|---|---|---|
complete | normal block | check at least 2/3 of verifiers vote | validVotesForBlock |
complete | special block | check there is angel node who has voted | validVotesForBlock |
complete | special block | check vote type is correct | HaltedVoteValid |
complete | both | verify there is no repeated vote | sameVote |
complete | both | check the voter is the current verifier | verificationSignerInVerifiers |
complete | both | verify the correctness of signature of verifiers | ver.Valid() |
complete | both | verify the correctness of verifiers | validVotesForBlock |
- Verify Txs
completeness rate | block type | consensus | method |
---|---|---|---|
complete | special block | verify transaction list of the special block is empty | ValidateBlockTxs |
complete | normal block | verify the correctness of signature of transactions | ValidateBlockTxs |
complete | normal block | verify transactions of all types meet the need of safety | txValidators |
complete | normal block | verify the sender's balance is sufficient | ValidTxSender |
complete | normal block | verify the size of each transaction is smaller than the default maximal value | ValidTxSize |
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewValidatorTx create a validator for transactions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
validate_block typical usage:
bc := InitBlockContext(block)
m := &BlockProcessor{bc, chain}
m.Use(ValidateBlockNumber(bc), ValidateBlockDifficulty(bc), ValidateBlockTxs(bc), )
m.Use(VrfCheckCommits(bc), )
m.Use(UpdateState(bc))
m.Use(InsertBlock(bc))
*/.
No description provided by the author
No description provided by the author
No description provided by the author
valid gas limit.
No description provided by the author
SaveBlock use.
BFT use.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
do checking for different types of transactions.
valid sender and amount.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
visit chain, db, state_root through processor
*/.
basic middleware, can be comprised by other middleware.
No description provided by the author
# Interfaces
No description provided by the author
go:generate mockgen -destination=./chain_interface_mock_test.go -package=middleware github.com/dipperin/dipperin-core/core/cs-chain/chain-writer/middleware ChainInterfacego:generate mockgen -destination=../../../../tests/g-mockFile/chainInterface_mock_test.go -package=g_mockFile github.com/dipperin/dipperin-core/core/cs-chain/chain-writer/middleware ChainInterface.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author