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 RegisterEvidenceMessages Uses

func RegisterEvidenceMessages(cdc *amino.Codec)

func RegisterMockEvidences Uses

func RegisterMockEvidences()

For testing purposes only

type EvidenceInfo Uses

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

type EvidenceListMessage Uses

type EvidenceListMessage struct {
    Evidence []types.Evidence
}

EvidenceListMessage contains a list of evidence.

func (*EvidenceListMessage) String Uses

func (m *EvidenceListMessage) String() string

String returns a string representation of the EvidenceListMessage.

func (*EvidenceListMessage) ValidateBasic Uses

func (m *EvidenceListMessage) ValidateBasic() error

ValidateBasic performs basic validation.

type EvidenceMessage Uses

type EvidenceMessage interface {
    ValidateBasic() error
}

EvidenceMessage is a message sent or received by the EvidenceReactor.

type EvidencePool Uses

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

EvidencePool maintains a pool of valid evidence in an EvidenceStore.

func NewEvidencePool Uses

func NewEvidencePool(stateDB, evidenceDB dbm.DB) *EvidencePool

func (*EvidencePool) AddEvidence Uses

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

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

func (*EvidencePool) EvidenceFront Uses

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

func (*EvidencePool) EvidenceWaitChan Uses

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

func (*EvidencePool) IsCommitted Uses

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

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

func (*EvidencePool) MarkEvidenceAsCommitted Uses

func (evpool *EvidencePool) MarkEvidenceAsCommitted(height int64, evidence []types.Evidence)

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

func (*EvidencePool) PendingEvidence Uses

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

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

func (*EvidencePool) PriorityEvidence Uses

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

PriorityEvidence returns the priority evidence.

func (*EvidencePool) SetLogger Uses

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

SetLogger sets the Logger.

func (*EvidencePool) State Uses

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

State returns the current state of the evpool.

func (*EvidencePool) Update Uses

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

Update loads the latest

type EvidenceReactor Uses

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

EvidenceReactor handles evpool evidence broadcasting amongst peers.

func NewEvidenceReactor Uses

func NewEvidenceReactor(evpool *EvidencePool) *EvidenceReactor

NewEvidenceReactor returns a new EvidenceReactor with the given config and evpool.

func (*EvidenceReactor) AddPeer Uses

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

AddPeer implements Reactor.

func (*EvidenceReactor) GetChannels Uses

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

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

func (*EvidenceReactor) Receive Uses

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

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

func (*EvidenceReactor) SetEventBus Uses

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

SetEventSwitch implements events.Eventable.

func (*EvidenceReactor) SetLogger Uses

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

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

type EvidenceStore Uses

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

EvidenceStore 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 NewEvidenceStore Uses

func NewEvidenceStore(db dbm.DB) *EvidenceStore

func (*EvidenceStore) AddNewEvidence Uses

func (store *EvidenceStore) 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 (*EvidenceStore) GetEvidenceInfo Uses

func (store *EvidenceStore) GetEvidenceInfo(height int64, hash []byte) EvidenceInfo

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

func (*EvidenceStore) MarkEvidenceAsBroadcasted Uses

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

MarkEvidenceAsBroadcasted removes evidence from Outqueue.

func (*EvidenceStore) MarkEvidenceAsCommitted Uses

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

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

func (*EvidenceStore) PendingEvidence Uses

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

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

func (*EvidenceStore) PriorityEvidence Uses

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

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

type PeerState Uses

type PeerState interface {
    GetHeight() int64
}

PeerState describes the state of a peer.

Package evidence imports 12 packages (graph) and is imported by 4 packages. Updated 2019-09-14. Refresh now. Tools for package owners.