Documentation ¶
Index ¶
Constants ¶
const ( InitConsensus int64 = iota NetworkFork CheckBlocks Consensus Wait )
The steps are: 1. Await initial network consensus for N blocks 2. Fork the network, separate node 0 from 1 and 2 3. Await alternative blocks mined on node zero, nodes 1 and 2 will have longer chain with more block difficulty so blocks of node 0 must be replaced 4. Await consensus for N blocks, check alt block hashes now
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReorgConfig ¶ added in v1.1.12
type ReorgConfig struct { FromPodLabel string ToPodLabel string Network client.BlockchainClient Env *environment.Environment BlockConsensusThreshold int Timeout time.Duration }
type ReorgController ¶ added in v1.1.12
type ReorgController struct { ReorgDepth int // contains filtered or unexported fields }
ReorgController reorg stats collecting struct
func NewReorgController ¶ added in v1.1.12
func NewReorgController(cfg *ReorgConfig) (*ReorgController, error)
NewReorgController creates a type that can create reorg chaos and confirm reorg has happened
func (*ReorgController) ReOrg ¶ added in v1.1.12
func (rc *ReorgController) ReOrg(depth int)
ReOrg start re-org
func (*ReorgController) ReceiveBlock ¶ added in v1.1.12
func (rc *ReorgController) ReceiveBlock(blk client.NodeBlock) error
ReceiveBlock receives block marked by node that mined it, forks the network and record all alternative block numbers on node 0
func (*ReorgController) VerifyReorgComplete ¶ added in v1.1.14
func (rc *ReorgController) VerifyReorgComplete() error
VerifyReorgComplete verifies that all blocks are replaced by reorg
func (*ReorgController) Wait ¶ added in v1.1.12
func (rc *ReorgController) Wait() error
Wait wait until reorg is done
func (*ReorgController) WaitDepthReached ¶ added in v1.1.12
func (rc *ReorgController) WaitDepthReached() error
WaitDepthReached wait until N alternative blocks are mined