Documentation
¶
Index ¶
- func Sha256(bytes []byte) []byte
- type ConsensusVerifier
- type GraphVerifier
- type TxFormatVerifier
- func (v *TxFormatVerifier) Independent() bool
- func (v *TxFormatVerifier) Name() string
- func (t *TxFormatVerifier) SignatureValues(sig []byte) (r, s, v *big.Int, err error)
- func (c *TxFormatVerifier) String() string
- func (v *TxFormatVerifier) Verify(t types.Txi) bool
- func (v *TxFormatVerifier) VerifyFrom(t types.Txi) bool
- func (v *TxFormatVerifier) VerifyHash(t types.Txi) bool
- func (v *TxFormatVerifier) VerifySignature(t types.Txi) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsensusVerifier ¶
type ConsensusVerifier struct { VerifyCampaign func(cp *campaign.Campaign) bool VerifyTermChange func(cp *campaign.TermChange) bool VerifySequencer func(cp *types.Sequencer) bool }
consensus related verification
func (*ConsensusVerifier) Independent ¶
func (v *ConsensusVerifier) Independent() bool
func (*ConsensusVerifier) Name ¶
func (c *ConsensusVerifier) Name() string
func (*ConsensusVerifier) String ¶
func (c *ConsensusVerifier) String() string
type GraphVerifier ¶
GraphVerifier verifies if the tx meets the OG hash and graph standards.
func (*GraphVerifier) Independent ¶
func (v *GraphVerifier) Independent() bool
func (*GraphVerifier) Name ¶
func (v *GraphVerifier) Name() string
func (*GraphVerifier) String ¶
func (c *GraphVerifier) String() string
func (*GraphVerifier) Verify ¶
func (v *GraphVerifier) Verify(txi types.Txi) (ok bool)
Verify do the graph validation according to the following rules that are marked as [My job]. Graph standards: A1: [My job] Randomly choose 2 tips. A2: [Not used] Node's parent cannot be its grandparents or ancestors. A3: [My job] Nodes produced by same source must be sequential (tx nonce ++). A4: [------] Double spending once A3 is not followed, whatever there is actual double spending. A5: [Pool's job] If A3 is followed but there is still double spending (tx nonce collision), keep the forked tx with smaller hash A6: [My job] Node cannot reference two un-ordered nodes as its parents B1: [My job] Nodes that are confirmed by at least N (=2) sequencers cannot be referenced. B2: [My job] Two layer hash validation Basically Verify checks whether txs are in their nonce order
type TxFormatVerifier ¶
type TxFormatVerifier struct { MaxTxHash types2.Hash // The difficulty of TxHash MaxMinedHash types2.Hash // The difficulty of MinedHash NoVerifyHash bool NoVerifySignatrue bool // contains filtered or unexported fields }
func (*TxFormatVerifier) Independent ¶
func (v *TxFormatVerifier) Independent() bool
func (*TxFormatVerifier) Name ¶
func (v *TxFormatVerifier) Name() string
func (*TxFormatVerifier) SignatureValues ¶
func (t *TxFormatVerifier) SignatureValues(sig []byte) (r, s, v *big.Int, err error)
SignatureValues returns signature values. This signature needs to be in the [R || S || V] format where V is 0 or 1.
func (*TxFormatVerifier) String ¶
func (c *TxFormatVerifier) String() string
func (*TxFormatVerifier) VerifyFrom ¶
func (v *TxFormatVerifier) VerifyFrom(t types.Txi) bool
func (*TxFormatVerifier) VerifyHash ¶
func (v *TxFormatVerifier) VerifyHash(t types.Txi) bool
func (*TxFormatVerifier) VerifySignature ¶
func (v *TxFormatVerifier) VerifySignature(t types.Txi) bool