tendermint: github.com/tendermint/tendermint/evidence Index | Files

package evidence

import "github.com/tendermint/tendermint/evidence"

Index

Package Files

codec.go pool.go reactor.go store.go

Constants

const (
    EvidenceChannel = byte(0x38)
)

func RegisterMessages Uses

func RegisterMessages(cdc *amino.Codec)

func RegisterMockEvidences Uses

func RegisterMockEvidences()

For testing purposes only

type Info Uses

type Info struct {
    Committed bool
    Priority  int64
    Evidence  types.Evidence
}

type ListMessage Uses

type ListMessage struct {
    Evidence []types.Evidence
}

ListMessage contains a list of evidence.

func (*ListMessage) String Uses

func (m *ListMessage) String() string

String returns a string representation of the ListMessage.

func (*ListMessage) ValidateBasic Uses

func (m *ListMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type Message Uses

type Message interface {
    ValidateBasic() error
}

Message is a message sent or received by the Reactor.

type PeerState Uses

type PeerState interface {
    GetHeight() int64
}

PeerState describes the state of a peer.

type Pool Uses

type Pool struct {
    // contains filtered or unexported fields
}

Pool maintains a pool of valid evidence in an Store.

func NewPool Uses

func NewPool(stateDB, evidenceDB dbm.DB) *Pool

func (*Pool) AddEvidence Uses

func (evpool *Pool) AddEvidence(evidence types.Evidence) (err error)

AddEvidence checks the evidence is valid and adds it to the pool.

func (*Pool) EvidenceFront Uses

func (evpool *Pool) EvidenceFront() *clist.CElement

func (*Pool) EvidenceWaitChan Uses

func (evpool *Pool) EvidenceWaitChan() <-chan struct{}

func (*Pool) IsCommitted Uses

func (evpool *Pool) IsCommitted(evidence types.Evidence) bool

IsCommitted returns true if we have already seen this exact evidence and it is already marked as committed.

func (*Pool) MarkEvidenceAsCommitted Uses

func (evpool *Pool) MarkEvidenceAsCommitted(height int64, lastBlockTime time.Time, evidence []types.Evidence)

MarkEvidenceAsCommitted marks all the evidence as committed and removes it from the queue.

func (*Pool) PendingEvidence Uses

func (evpool *Pool) PendingEvidence(maxNum int64) []types.Evidence

PendingEvidence returns up to maxNum uncommitted evidence. If maxNum is -1, all evidence is returned.

func (*Pool) PriorityEvidence Uses

func (evpool *Pool) PriorityEvidence() []types.Evidence

PriorityEvidence returns the priority evidence.

func (*Pool) SetLogger Uses

func (evpool *Pool) SetLogger(l log.Logger)

SetLogger sets the Logger.

func (*Pool) State Uses

func (evpool *Pool) State() sm.State

State returns the current state of the evpool.

func (*Pool) Update Uses

func (evpool *Pool) Update(block *types.Block, state sm.State)

Update loads the latest

type Reactor Uses

type Reactor struct {
    p2p.BaseReactor
    // contains filtered or unexported fields
}

Reactor handles evpool evidence broadcasting amongst peers.

func NewReactor Uses

func NewReactor(evpool *Pool) *Reactor

NewReactor returns a new Reactor with the given config and evpool.

func (*Reactor) AddPeer Uses

func (evR *Reactor) AddPeer(peer p2p.Peer)

AddPeer implements Reactor.

func (*Reactor) GetChannels Uses

func (evR *Reactor) GetChannels() []*p2p.ChannelDescriptor

GetChannels implements Reactor. It returns the list of channels for this reactor.

func (*Reactor) Receive Uses

func (evR *Reactor) Receive(chID byte, src p2p.Peer, msgBytes []byte)

Receive implements Reactor. It adds any received evidence to the evpool.

func (*Reactor) SetEventBus Uses

func (evR *Reactor) SetEventBus(b *types.EventBus)

SetEventBus implements events.Eventable.

func (*Reactor) SetLogger Uses

func (evR *Reactor) SetLogger(l log.Logger)

SetLogger sets the Logger on the reactor and the underlying Evidence.

type Store Uses

type Store struct {
    // contains filtered or unexported fields
}

Store is a store of all the evidence we've seen, including evidence that has been committed, evidence that has been verified but not broadcast, and evidence that has been broadcast but not yet committed.

func NewStore Uses

func NewStore(db dbm.DB) *Store

func (*Store) AddNewEvidence Uses

func (store *Store) AddNewEvidence(evidence types.Evidence, priority int64) bool

AddNewEvidence adds the given evidence to the database. It returns false if the evidence is already stored.

func (*Store) GetInfo Uses

func (store *Store) GetInfo(height int64, hash []byte) Info

GetInfo fetches the Info with the given height and hash. If not found, ei.Evidence is nil.

func (*Store) MarkEvidenceAsBroadcasted Uses

func (store *Store) MarkEvidenceAsBroadcasted(evidence types.Evidence)

MarkEvidenceAsBroadcasted removes evidence from Outqueue.

func (*Store) MarkEvidenceAsCommitted Uses

func (store *Store) MarkEvidenceAsCommitted(evidence types.Evidence)

MarkEvidenceAsCommitted removes evidence from pending and outqueue and sets the state to committed.

func (*Store) PendingEvidence Uses

func (store *Store) PendingEvidence(maxNum int64) (evidence []types.Evidence)

PendingEvidence returns up to maxNum known, uncommitted evidence. If maxNum is -1, all evidence is returned.

func (*Store) PriorityEvidence Uses

func (store *Store) PriorityEvidence() (evidence []types.Evidence)

PriorityEvidence returns the evidence from the outqueue, sorted by highest priority.

Package evidence imports 12 packages (graph) and is imported by 8 packages. Updated 2020-01-14. Refresh now. Tools for package owners.