core

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 4, 2020 License: GPL-3.0, GPL-3.0 Imports: 29 Imported by: 0

Documentation

Overview

Package core is a generated GoMock package.

Index

Constants

View Source
const (
	MaxRound = 99 // consequence of backlog priority
)

Variables

View Source
var ErrUnauthorizedAddress = errors.New("unauthorized address")

Functions

func Encode

func Encode(val interface{}) ([]byte, error)

func New

func New(backend Backend, config *config.Config) *core

New creates an Tendermint consensus core

func NewRoundMessages added in v0.4.0

func NewRoundMessages() *roundMessages

NewRoundMessages creates a new messages instance with the given view and validatorSet we need to keep a reference of proposal in order to propose locked proposal when there is a lock and itself is the proposer

func PrepareCommittedSeal

func PrepareCommittedSeal(hash common.Hash, round int64, height *big.Int) []byte

PrepareCommittedSeal returns a committed seal for the given hash

Types

type Backend added in v0.1.6

type Backend interface {
	consensus.Engine
	consensus.Handler
	Start(ctx context.Context, chain consensus.ChainReader, currentBlock func() *types.Block, hasBadBlock func(hash common.Hash) bool) error

	// Address returns the owner's address
	Address() common.Address

	// Validators returns the committee set
	Committee(number uint64) (committee.Set, error)

	Subscribe(types ...interface{}) *event.TypeMuxSubscription

	Post(ev interface{})

	// Broadcast sends a message to all validators (include self)
	Broadcast(ctx context.Context, valSet committee.Set, payload []byte) error

	// Gossip sends a message to all validators (exclude self)
	Gossip(ctx context.Context, valSet committee.Set, payload []byte)

	// Commit delivers an approved proposal to backend.
	// The delivered proposal will be put into blockchain.
	Commit(proposalBlock *types.Block, round int64, seals [][]byte) error

	// VerifyProposal verifies the proposal. If a consensus.ErrFutureBlock error is returned,
	// the time difference of the proposal and current time is also returned.
	VerifyProposal(types.Block) (time.Duration, error)

	// Sign signs input data with the backend's private key
	Sign([]byte) ([]byte, error)

	// CheckSignature verifies the signature by checking if it's signed by
	// the given validator
	CheckSignature(data []byte, addr common.Address, sig []byte) error

	// LastCommittedProposal retrieves latest committed proposal and the address of proposer
	LastCommittedProposal() (*types.Block, common.Address)

	// GetProposer returns the proposer of the given block height
	GetProposer(number uint64) common.Address

	// HasBadBlock returns whether the block with the hash is a bad block
	HasBadProposal(hash common.Hash) bool

	// Setter for proposed block hash
	SetProposedBlockHash(hash common.Hash)

	AddSeal(block *types.Block) (*types.Block, error)

	SyncPeer(address common.Address, messages []*Message)

	ResetPeerCache(address common.Address)

	AskSync(set committee.Set)

	HandleUnhandledMsgs(ctx context.Context)

	GetContractAddress() common.Address

	GetContractABI() string

	WhiteList() []string
}

Backend provides application specific functions for Istanbul core

type Changes added in v0.4.0

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

func NewChanges added in v0.4.0

func NewChanges() Changes

type ConsensusMsg added in v0.4.0

type ConsensusMsg interface {
	GetRound() int64
	GetHeight() *big.Int
}

type Message added in v0.1.6

type Message struct {
	Code          uint64
	Msg           []byte
	Address       common.Address
	Signature     []byte
	CommittedSeal []byte
	// contains filtered or unexported fields
}

func (*Message) Decode added in v0.1.6

func (m *Message) Decode(val interface{}) error

func (*Message) DecodeRLP added in v0.1.6

func (m *Message) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream.

func (*Message) EncodeRLP added in v0.1.6

func (m *Message) EncodeRLP(w io.Writer) error

EncodeRLP serializes m into the Ethereum RLP format.

func (*Message) FromPayload added in v0.1.6

func (m *Message) FromPayload(b []byte, valSet committee.Set, validateFn func(committee.Set, []byte, []byte) (common.Address, error)) (*types.CommitteeMember, error)

func (*Message) GetCode added in v0.1.6

func (m *Message) GetCode() uint64

func (*Message) GetPower added in v0.4.0

func (m *Message) GetPower() uint64

func (*Message) GetSignature added in v0.1.6

func (m *Message) GetSignature() []byte

func (*Message) Height added in v0.4.0

func (m *Message) Height() (*big.Int, error)

func (*Message) Payload added in v0.1.6

func (m *Message) Payload() ([]byte, error)

func (*Message) PayloadNoSig added in v0.1.6

func (m *Message) PayloadNoSig() ([]byte, error)

func (*Message) Round added in v0.4.0

func (m *Message) Round() (int64, error)

func (*Message) String added in v0.1.6

func (m *Message) String() string

type MockBackend added in v0.1.6

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

MockBackend is a mock of Backend interface

func NewMockBackend added in v0.1.6

func NewMockBackend(ctrl *gomock.Controller) *MockBackend

NewMockBackend creates a new mock instance

func (*MockBackend) APIs added in v0.1.6

func (m *MockBackend) APIs(chain consensus.ChainReader) []rpc.API

APIs mocks base method

func (*MockBackend) AddSeal added in v0.4.0

func (m *MockBackend) AddSeal(block *types.Block) (*types.Block, error)

AddSeal mocks base method

func (*MockBackend) Address added in v0.1.6

func (m *MockBackend) Address() common.Address

Address mocks base method

func (*MockBackend) AskSync added in v0.3.0

func (m *MockBackend) AskSync(set committee.Set)

AskSync mocks base method

func (*MockBackend) Author added in v0.1.6

func (m *MockBackend) Author(header *types.Header) (common.Address, error)

Author mocks base method

func (*MockBackend) Broadcast added in v0.1.6

func (m *MockBackend) Broadcast(ctx context.Context, valSet committee.Set, payload []byte) error

Broadcast mocks base method

func (*MockBackend) CalcDifficulty added in v0.1.6

func (m *MockBackend) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int

CalcDifficulty mocks base method

func (*MockBackend) CheckSignature added in v0.1.6

func (m *MockBackend) CheckSignature(data []byte, addr common.Address, sig []byte) error

CheckSignature mocks base method

func (*MockBackend) Close added in v0.1.6

func (m *MockBackend) Close() error

Close mocks base method

func (*MockBackend) Commit added in v0.1.6

func (m *MockBackend) Commit(proposalBlock *types.Block, round int64, seals [][]byte) error

Commit mocks base method

func (*MockBackend) Committee added in v0.4.0

func (m *MockBackend) Committee(number uint64) (committee.Set, error)

Committee mocks base method

func (*MockBackend) EXPECT added in v0.1.6

func (m *MockBackend) EXPECT() *MockBackendMockRecorder

EXPECT returns an object that allows the caller to indicate expected use

func (*MockBackend) Finalize added in v0.1.6

func (m *MockBackend) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts []*types.Receipt) (types.Committee, *types.Receipt, error)

Finalize mocks base method

func (*MockBackend) FinalizeAndAssemble added in v0.1.6

func (m *MockBackend) FinalizeAndAssemble(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts *[]*types.Receipt) (*types.Block, error)

FinalizeAndAssemble mocks base method

func (*MockBackend) GetContractABI added in v0.3.0

func (m *MockBackend) GetContractABI() string

GetContractABI mocks base method

func (*MockBackend) GetContractAddress added in v0.3.0

func (m *MockBackend) GetContractAddress() common.Address

GetContractAddress mocks base method

func (*MockBackend) GetProposer added in v0.1.6

func (m *MockBackend) GetProposer(number uint64) common.Address

GetProposer mocks base method

func (*MockBackend) Gossip added in v0.1.6

func (m *MockBackend) Gossip(ctx context.Context, valSet committee.Set, payload []byte)

Gossip mocks base method

func (*MockBackend) HandleMsg added in v0.1.6

func (m *MockBackend) HandleMsg(address common.Address, data p2p.Msg) (bool, error)

HandleMsg mocks base method

func (*MockBackend) HandleUnhandledMsgs added in v0.3.0

func (m *MockBackend) HandleUnhandledMsgs(ctx context.Context)

HandleUnhandledMsgs mocks base method

func (*MockBackend) HasBadProposal added in v0.1.6

func (m *MockBackend) HasBadProposal(hash common.Hash) bool

HasBadProposal mocks base method

func (*MockBackend) LastCommittedProposal added in v0.1.6

func (m *MockBackend) LastCommittedProposal() (*types.Block, common.Address)

LastCommittedProposal mocks base method

func (*MockBackend) NewChainHead added in v0.1.6

func (m *MockBackend) NewChainHead() error

NewChainHead mocks base method

func (*MockBackend) Post added in v0.1.6

func (m *MockBackend) Post(ev interface{})

Post mocks base method

func (*MockBackend) Prepare added in v0.1.6

func (m *MockBackend) Prepare(chain consensus.ChainReader, header *types.Header) error

Prepare mocks base method

func (*MockBackend) Protocol added in v0.1.6

func (m *MockBackend) Protocol() (string, uint64)

Protocol mocks base method

func (*MockBackend) ResetPeerCache added in v0.1.6

func (m *MockBackend) ResetPeerCache(address common.Address)

ResetPeerCache mocks base method

func (*MockBackend) Seal added in v0.1.6

func (m *MockBackend) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error

Seal mocks base method

func (*MockBackend) SealHash added in v0.1.6

func (m *MockBackend) SealHash(header *types.Header) common.Hash

SealHash mocks base method

func (*MockBackend) SetBroadcaster added in v0.1.6

func (m *MockBackend) SetBroadcaster(arg0 consensus.Broadcaster)

SetBroadcaster mocks base method

func (*MockBackend) SetProposedBlockHash added in v0.1.6

func (m *MockBackend) SetProposedBlockHash(hash common.Hash)

SetProposedBlockHash mocks base method

func (*MockBackend) Sign added in v0.1.6

func (m *MockBackend) Sign(arg0 []byte) ([]byte, error)

Sign mocks base method

func (*MockBackend) Start added in v0.1.6

func (m *MockBackend) Start(ctx context.Context, chain consensus.ChainReader, currentBlock func() *types.Block, hasBadBlock func(common.Hash) bool) error

Start mocks base method

func (*MockBackend) Subscribe added in v0.1.6

func (m *MockBackend) Subscribe(types ...interface{}) *event.TypeMuxSubscription

Subscribe mocks base method

func (*MockBackend) SyncPeer added in v0.1.6

func (m *MockBackend) SyncPeer(address common.Address, messages []*Message)

SyncPeer mocks base method

func (*MockBackend) VerifyHeader added in v0.1.6

func (m *MockBackend) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error

VerifyHeader mocks base method

func (*MockBackend) VerifyHeaders added in v0.1.6

func (m *MockBackend) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)

VerifyHeaders mocks base method

func (*MockBackend) VerifyProposal added in v0.1.6

func (m *MockBackend) VerifyProposal(arg0 types.Block) (time.Duration, error)

VerifyProposal mocks base method

func (*MockBackend) VerifySeal added in v0.1.6

func (m *MockBackend) VerifySeal(chain consensus.ChainReader, header *types.Header) error

VerifySeal mocks base method

func (*MockBackend) VerifyUncles added in v0.1.6

func (m *MockBackend) VerifyUncles(chain consensus.ChainReader, block *types.Block) error

VerifyUncles mocks base method

func (*MockBackend) WhiteList added in v0.3.0

func (m *MockBackend) WhiteList() []string

WhiteList mocks base method

type MockBackendMockRecorder added in v0.1.6

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

MockBackendMockRecorder is the mock recorder for MockBackend

func (*MockBackendMockRecorder) APIs added in v0.1.6

func (mr *MockBackendMockRecorder) APIs(chain interface{}) *gomock.Call

APIs indicates an expected call of APIs

func (*MockBackendMockRecorder) AddSeal added in v0.4.0

func (mr *MockBackendMockRecorder) AddSeal(block interface{}) *gomock.Call

AddSeal indicates an expected call of AddSeal

func (*MockBackendMockRecorder) Address added in v0.1.6

func (mr *MockBackendMockRecorder) Address() *gomock.Call

Address indicates an expected call of Address

func (*MockBackendMockRecorder) AskSync added in v0.3.0

func (mr *MockBackendMockRecorder) AskSync(set interface{}) *gomock.Call

AskSync indicates an expected call of AskSync

func (*MockBackendMockRecorder) Author added in v0.1.6

func (mr *MockBackendMockRecorder) Author(header interface{}) *gomock.Call

Author indicates an expected call of Author

func (*MockBackendMockRecorder) Broadcast added in v0.1.6

func (mr *MockBackendMockRecorder) Broadcast(ctx, valSet, payload interface{}) *gomock.Call

Broadcast indicates an expected call of Broadcast

func (*MockBackendMockRecorder) CalcDifficulty added in v0.1.6

func (mr *MockBackendMockRecorder) CalcDifficulty(chain, time, parent interface{}) *gomock.Call

CalcDifficulty indicates an expected call of CalcDifficulty

func (*MockBackendMockRecorder) CheckSignature added in v0.1.6

func (mr *MockBackendMockRecorder) CheckSignature(data, addr, sig interface{}) *gomock.Call

CheckSignature indicates an expected call of CheckSignature

func (*MockBackendMockRecorder) Close added in v0.1.6

func (mr *MockBackendMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close

func (*MockBackendMockRecorder) Commit added in v0.1.6

func (mr *MockBackendMockRecorder) Commit(proposalBlock, round, seals interface{}) *gomock.Call

Commit indicates an expected call of Commit

func (*MockBackendMockRecorder) Committee added in v0.4.0

func (mr *MockBackendMockRecorder) Committee(number interface{}) *gomock.Call

Committee indicates an expected call of Committee

func (*MockBackendMockRecorder) Finalize added in v0.1.6

func (mr *MockBackendMockRecorder) Finalize(chain, header, state, txs, uncles, receipts interface{}) *gomock.Call

Finalize indicates an expected call of Finalize

func (*MockBackendMockRecorder) FinalizeAndAssemble added in v0.1.6

func (mr *MockBackendMockRecorder) FinalizeAndAssemble(chain, header, state, txs, uncles, receipts interface{}) *gomock.Call

FinalizeAndAssemble indicates an expected call of FinalizeAndAssemble

func (*MockBackendMockRecorder) GetContractABI added in v0.3.0

func (mr *MockBackendMockRecorder) GetContractABI() *gomock.Call

GetContractABI indicates an expected call of GetContractABI

func (*MockBackendMockRecorder) GetContractAddress added in v0.3.0

func (mr *MockBackendMockRecorder) GetContractAddress() *gomock.Call

GetContractAddress indicates an expected call of GetContractAddress

func (*MockBackendMockRecorder) GetProposer added in v0.1.6

func (mr *MockBackendMockRecorder) GetProposer(number interface{}) *gomock.Call

GetProposer indicates an expected call of GetProposer

func (*MockBackendMockRecorder) Gossip added in v0.1.6

func (mr *MockBackendMockRecorder) Gossip(ctx, valSet, payload interface{}) *gomock.Call

Gossip indicates an expected call of Gossip

func (*MockBackendMockRecorder) HandleMsg added in v0.1.6

func (mr *MockBackendMockRecorder) HandleMsg(address, data interface{}) *gomock.Call

HandleMsg indicates an expected call of HandleMsg

func (*MockBackendMockRecorder) HandleUnhandledMsgs added in v0.3.0

func (mr *MockBackendMockRecorder) HandleUnhandledMsgs(ctx interface{}) *gomock.Call

HandleUnhandledMsgs indicates an expected call of HandleUnhandledMsgs

func (*MockBackendMockRecorder) HasBadProposal added in v0.1.6

func (mr *MockBackendMockRecorder) HasBadProposal(hash interface{}) *gomock.Call

HasBadProposal indicates an expected call of HasBadProposal

func (*MockBackendMockRecorder) LastCommittedProposal added in v0.1.6

func (mr *MockBackendMockRecorder) LastCommittedProposal() *gomock.Call

LastCommittedProposal indicates an expected call of LastCommittedProposal

func (*MockBackendMockRecorder) NewChainHead added in v0.1.6

func (mr *MockBackendMockRecorder) NewChainHead() *gomock.Call

NewChainHead indicates an expected call of NewChainHead

func (*MockBackendMockRecorder) Post added in v0.1.6

func (mr *MockBackendMockRecorder) Post(ev interface{}) *gomock.Call

Post indicates an expected call of Post

func (*MockBackendMockRecorder) Prepare added in v0.1.6

func (mr *MockBackendMockRecorder) Prepare(chain, header interface{}) *gomock.Call

Prepare indicates an expected call of Prepare

func (*MockBackendMockRecorder) Protocol added in v0.1.6

func (mr *MockBackendMockRecorder) Protocol() *gomock.Call

Protocol indicates an expected call of Protocol

func (*MockBackendMockRecorder) ResetPeerCache added in v0.1.6

func (mr *MockBackendMockRecorder) ResetPeerCache(address interface{}) *gomock.Call

ResetPeerCache indicates an expected call of ResetPeerCache

func (*MockBackendMockRecorder) Seal added in v0.1.6

func (mr *MockBackendMockRecorder) Seal(chain, block, results, stop interface{}) *gomock.Call

Seal indicates an expected call of Seal

func (*MockBackendMockRecorder) SealHash added in v0.1.6

func (mr *MockBackendMockRecorder) SealHash(header interface{}) *gomock.Call

SealHash indicates an expected call of SealHash

func (*MockBackendMockRecorder) SetBroadcaster added in v0.1.6

func (mr *MockBackendMockRecorder) SetBroadcaster(arg0 interface{}) *gomock.Call

SetBroadcaster indicates an expected call of SetBroadcaster

func (*MockBackendMockRecorder) SetProposedBlockHash added in v0.1.6

func (mr *MockBackendMockRecorder) SetProposedBlockHash(hash interface{}) *gomock.Call

SetProposedBlockHash indicates an expected call of SetProposedBlockHash

func (*MockBackendMockRecorder) Sign added in v0.1.6

func (mr *MockBackendMockRecorder) Sign(arg0 interface{}) *gomock.Call

Sign indicates an expected call of Sign

func (*MockBackendMockRecorder) Start added in v0.1.6

func (mr *MockBackendMockRecorder) Start(ctx, chain, currentBlock, hasBadBlock interface{}) *gomock.Call

Start indicates an expected call of Start

func (*MockBackendMockRecorder) Subscribe added in v0.1.6

func (mr *MockBackendMockRecorder) Subscribe(types ...interface{}) *gomock.Call

Subscribe indicates an expected call of Subscribe

func (*MockBackendMockRecorder) SyncPeer added in v0.1.6

func (mr *MockBackendMockRecorder) SyncPeer(address, messages interface{}) *gomock.Call

SyncPeer indicates an expected call of SyncPeer

func (*MockBackendMockRecorder) VerifyHeader added in v0.1.6

func (mr *MockBackendMockRecorder) VerifyHeader(chain, header, seal interface{}) *gomock.Call

VerifyHeader indicates an expected call of VerifyHeader

func (*MockBackendMockRecorder) VerifyHeaders added in v0.1.6

func (mr *MockBackendMockRecorder) VerifyHeaders(chain, headers, seals interface{}) *gomock.Call

VerifyHeaders indicates an expected call of VerifyHeaders

func (*MockBackendMockRecorder) VerifyProposal added in v0.1.6

func (mr *MockBackendMockRecorder) VerifyProposal(arg0 interface{}) *gomock.Call

VerifyProposal indicates an expected call of VerifyProposal

func (*MockBackendMockRecorder) VerifySeal added in v0.1.6

func (mr *MockBackendMockRecorder) VerifySeal(chain, header interface{}) *gomock.Call

VerifySeal indicates an expected call of VerifySeal

func (*MockBackendMockRecorder) VerifyUncles added in v0.1.6

func (mr *MockBackendMockRecorder) VerifyUncles(chain, block interface{}) *gomock.Call

VerifyUncles indicates an expected call of VerifyUncles

func (*MockBackendMockRecorder) WhiteList added in v0.3.0

func (mr *MockBackendMockRecorder) WhiteList() *gomock.Call

WhiteList indicates an expected call of WhiteList

type Modifier added in v0.4.0

type Modifier interface {
	ModifyHeader(header *types.Header) *types.Header
}

type ModifyCommitteeEngine added in v0.4.0

type ModifyCommitteeEngine struct {
	*testing.T

	Modifier
	// contains filtered or unexported fields
}

func NewAddValidatorCore added in v0.4.0

func NewAddValidatorCore(c consensus.Engine, changedValidators Changes) *ModifyCommitteeEngine

func NewRemoveValidatorCore added in v0.4.0

func NewRemoveValidatorCore(c consensus.Engine, changedValidators Changes) *ModifyCommitteeEngine

func NewReplaceValidatorCore added in v0.4.0

func NewReplaceValidatorCore(c consensus.Engine, changedValidators Changes) *ModifyCommitteeEngine

func (ModifyCommitteeEngine) APIs added in v0.4.0

func (c ModifyCommitteeEngine) APIs(chain consensus.ChainReader) []rpc.API

func (ModifyCommitteeEngine) Author added in v0.4.0

func (c ModifyCommitteeEngine) Author(header *types.Header) (common.Address, error)

func (ModifyCommitteeEngine) CalcDifficulty added in v0.4.0

func (c ModifyCommitteeEngine) CalcDifficulty(chain consensus.ChainReader, time uint64, parent *types.Header) *big.Int

func (ModifyCommitteeEngine) Close added in v0.4.0

func (c ModifyCommitteeEngine) Close() error

func (ModifyCommitteeEngine) CommitteeSet added in v0.4.0

func (c ModifyCommitteeEngine) CommitteeSet() committee.Set

func (ModifyCommitteeEngine) Finalize added in v0.4.0

func (c ModifyCommitteeEngine) Finalize(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction,
	uncles []*types.Header, receipts []*types.Receipt) (types.Committee, *types.Receipt, error)

func (*ModifyCommitteeEngine) FinalizeAndAssemble added in v0.4.0

func (c *ModifyCommitteeEngine) FinalizeAndAssemble(chain consensus.ChainReader, header *types.Header, state *state.StateDB, txs []*types.Transaction, uncles []*types.Header, receipts *[]*types.Receipt) (*types.Block, error)

func (ModifyCommitteeEngine) GetCurrentHeightMessages added in v0.4.0

func (c ModifyCommitteeEngine) GetCurrentHeightMessages() []*Message

func (ModifyCommitteeEngine) HandleMsg added in v0.4.0

func (c ModifyCommitteeEngine) HandleMsg(address common.Address, data p2p.Msg) (bool, error)

func (ModifyCommitteeEngine) Height added in v0.4.0

func (c ModifyCommitteeEngine) Height() *big.Int

func (ModifyCommitteeEngine) IsMember added in v0.4.0

func (c ModifyCommitteeEngine) IsMember(address common.Address) bool

func (ModifyCommitteeEngine) NewChainHead added in v0.4.0

func (c ModifyCommitteeEngine) NewChainHead() error

func (ModifyCommitteeEngine) Prepare added in v0.4.0

func (c ModifyCommitteeEngine) Prepare(chain consensus.ChainReader, header *types.Header) error

func (ModifyCommitteeEngine) Protocol added in v0.4.0

func (c ModifyCommitteeEngine) Protocol() (protocolName string, extraMsgCodes uint64)

func (ModifyCommitteeEngine) ResetPeerCache added in v0.4.0

func (c ModifyCommitteeEngine) ResetPeerCache(address common.Address)

func (ModifyCommitteeEngine) Round added in v0.4.0

func (c ModifyCommitteeEngine) Round() int64

func (ModifyCommitteeEngine) Seal added in v0.4.0

func (c ModifyCommitteeEngine) Seal(chain consensus.ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error

func (ModifyCommitteeEngine) SealHash added in v0.4.0

func (c ModifyCommitteeEngine) SealHash(header *types.Header) common.Hash

func (ModifyCommitteeEngine) SetBroadcaster added in v0.4.0

func (c ModifyCommitteeEngine) SetBroadcaster(b consensus.Broadcaster)

func (ModifyCommitteeEngine) Start added in v0.4.0

func (c ModifyCommitteeEngine) Start(ctx context.Context, chain consensus.ChainReader, currentBlock func() *types.Block, hasBadBlock func(hash common.Hash) bool) error

Start implements core.Engine.Start

func (ModifyCommitteeEngine) Stop added in v0.4.0

func (c ModifyCommitteeEngine) Stop() error

Stop implements core.Engine.Stop

func (ModifyCommitteeEngine) SyncPeer added in v0.4.0

func (c ModifyCommitteeEngine) SyncPeer(address common.Address)

Synchronize new connected peer with current height state

func (*ModifyCommitteeEngine) VerifyHeader added in v0.4.0

func (ModifyCommitteeEngine) VerifyHeaders added in v0.4.0

func (c ModifyCommitteeEngine) VerifyHeaders(chain consensus.ChainReader, headers []*types.Header, seals []bool) (chan<- struct{}, <-chan error)

func (ModifyCommitteeEngine) VerifySeal added in v0.4.0

func (c ModifyCommitteeEngine) VerifySeal(chain consensus.ChainReader, header *types.Header) error

func (ModifyCommitteeEngine) VerifyUncles added in v0.4.0

func (c ModifyCommitteeEngine) VerifyUncles(chain consensus.ChainReader, block *types.Block) error

type Proposal added in v0.1.6

type Proposal struct {
	Round         int64
	Height        *big.Int
	ValidRound    int64
	ProposalBlock *types.Block
}

func NewProposal added in v0.1.6

func NewProposal(r int64, h *big.Int, vr int64, p *types.Block) *Proposal

func (*Proposal) DecodeRLP added in v0.1.6

func (p *Proposal) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream.

func (*Proposal) EncodeRLP added in v0.1.6

func (p *Proposal) EncodeRLP(w io.Writer) error

RLP encoding doesn't support negative big.Int, so we have to pass one additionnal field to represents validRound = -1. Note that we could have as well indexed rounds starting by 1, but we want to stay close as possible to the spec.

func (*Proposal) GetHeight added in v0.4.0

func (p *Proposal) GetHeight() *big.Int

func (*Proposal) GetRound added in v0.4.0

func (p *Proposal) GetRound() int64

type Step

type Step uint64

func (Step) Cmp

func (s Step) Cmp(y Step) int

func (Step) String

func (s Step) String() string

type TimeoutEvent added in v0.1.6

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

type VerifySelfProposalAlwaysTrueBackend added in v0.4.0

type VerifySelfProposalAlwaysTrueBackend struct {
	*testing.T
	Backend
	// contains filtered or unexported fields
}

func NewChangeValidatorBackend added in v0.4.0

func NewChangeValidatorBackend(t *testing.T, basicCore Backend, brokenValidators Changes, blocksFromRemoved, blocksFromAdded map[common.Hash]uint64) *VerifySelfProposalAlwaysTrueBackend

func (*VerifySelfProposalAlwaysTrueBackend) GetOriginal added in v0.4.0

func (*VerifySelfProposalAlwaysTrueBackend) VerifyHeader added in v0.4.0

func (b *VerifySelfProposalAlwaysTrueBackend) VerifyHeader(chain consensus.ChainReader, header *types.Header, seal bool) error

func (*VerifySelfProposalAlwaysTrueBackend) VerifyProposal added in v0.4.0

func (b *VerifySelfProposalAlwaysTrueBackend) VerifyProposal(block types.Block) (time.Duration, error)

type Vote added in v0.1.6

type Vote struct {
	Round             int64
	Height            *big.Int
	ProposedBlockHash common.Hash
}

func (*Vote) DecodeRLP added in v0.1.6

func (sub *Vote) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and load the consensus fields from a RLP stream.

func (*Vote) EncodeRLP added in v0.1.6

func (sub *Vote) EncodeRLP(w io.Writer) error

EncodeRLP serializes b into the Ethereum RLP format.

func (*Vote) GetHeight added in v0.4.0

func (sub *Vote) GetHeight() *big.Int

func (*Vote) GetRound added in v0.4.0

func (sub *Vote) GetRound() int64

func (*Vote) String added in v0.1.6

func (sub *Vote) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL