Documentation
¶
Index ¶
Constants ¶
const ( TXNodeLabel = "tx-node" MinerNodeLabel = "miner-node" )
Must use that labels for all networks, TXNode is the main node connected to Chainlink
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReorgConfirmer ¶
type ReorgConfirmer struct { NetworkStep ReorgStep // contains filtered or unexported fields }
ReorgConfirmer reorg stats collecting struct
func NewReorgConfirmer ¶
func NewReorgConfirmer( c client.BlockchainClient, env environment.Environment, reorgDepth int, blockConsensusThreshold int, timeout time.Duration, ) (*ReorgConfirmer, error)
NewReorgConfirmer creates a type that can create reorg chaos and confirm reorg has happened
func (*ReorgConfirmer) ReceiveBlock ¶
func (rc *ReorgConfirmer) 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 (*ReorgConfirmer) Verify ¶
func (rc *ReorgConfirmer) Verify() error
Verify verifies that all blocks are replaced by reorg
type ReorgStep ¶
type ReorgStep int
ReorgStep step enum for re-org test
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