extcommit

package
v0.0.0-...-4ef5390 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NOTE: keep up to date with bcproto.BlockResponse
	BlockResponseMessagePrefixSize   = 4
	BlockResponseMessageFieldKeySize = 1
	MaxMsgSize                       = types.MaxBlockSizeBytes +
		BlockResponseMessagePrefixSize +
		BlockResponseMessageFieldKeySize
)
View Source
const (
	// BlocksyncChannel is a channel for blocks and status updates (`BlockStore` height)
	BlocksyncChannel = byte(0x40)
)

Variables

View Source
var (
	// ErrNilMessage is returned when provided message is empty
	ErrNilMessage = errors.New("message cannot be nil")
)

Functions

func ValidateMsg

func ValidateMsg(pb proto.Message) error

ValidateMsg validates a message.

Types

type ErrInvalidBase

type ErrInvalidBase struct {
	Base   int64
	Reason string
}

ErrInvalidBase is returned when peer informs of a status with invalid base

func (ErrInvalidBase) Error

func (e ErrInvalidBase) Error() string

type ErrInvalidHeight

type ErrInvalidHeight struct {
	Height int64
	Reason string
}

ErrInvalidBase is returned when peer informs of a status with invalid height

func (ErrInvalidHeight) Error

func (e ErrInvalidHeight) Error() string

type ErrReactorValidation

type ErrReactorValidation struct {
	Err error
}

func (ErrReactorValidation) Error

func (e ErrReactorValidation) Error() string

func (ErrReactorValidation) Unwrap

func (e ErrReactorValidation) Unwrap() error

type ErrUnknownMessageType

type ErrUnknownMessageType struct {
	Msg proto.Message
}

func (ErrUnknownMessageType) Error

func (e ErrUnknownMessageType) Error() string

type Reactor

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

Reactor handles long-term catchup syncing.

func NewReactor

func NewReactor(state sm.State, logger log.Logger, blockStoreDB dbm.DB, height int64) *Reactor

NewReactor returns new reactor instance.

func (*Reactor) AddPeer

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

AddPeer implements Reactor by sending our request to peer.

func (*Reactor) FoundStatus

func (ecR *Reactor) FoundStatus() bool

func (*Reactor) GetChannels

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

GetChannels implements Reactor

func (*Reactor) Receive

func (ecR *Reactor) Receive(e p2p.Envelope)

Receive implements Reactor by handling 4 types of messages (look below).

func (*Reactor) RemovePeer

func (ecR *Reactor) RemovePeer(peer p2p.Peer, _ interface{})

RemovePeer implements Reactor by removing peer from the pool.

Jump to

Keyboard shortcuts

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