blockchain

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package blockchain provides two implementations of the fast-sync protocol.

- v0 was the very first implementation. it's battle tested, but does not have a lot of test coverage. - v2 is the newest implementation, with a focus on testability and readability.

Check out ADR-40 for the formal model and requirements.

Termination criteria

1. the maximum peer height is reached 2. termination timeout is triggered, which is set if the peer set is empty or there are no pending requests.

Index

Constants

View Source
const (
	// NOTE: keep up to date with bcproto.BlockResponse
	BlockResponseMessagePrefixSize   = 4
	BlockResponseMessageFieldKeySize = 1
	MaxMsgSize                       = types.MaxBlockSizeBytes +
		BlockResponseMessagePrefixSize +
		BlockResponseMessageFieldKeySize
)

Variables

This section is empty.

Functions

func DecodeMsg added in v0.0.7

func DecodeMsg(bz []byte) (proto.Message, error)

DecodeMsg decodes a Protobuf message.

func EncodeMsg added in v0.0.7

func EncodeMsg(pb proto.Message) ([]byte, error)

EncodeMsg encodes a Protobuf message

func ValidateMsg added in v0.0.7

func ValidateMsg(pb proto.Message) error

ValidateMsg validates a message.

Types

This section is empty.

Directories

Path Synopsis
v2
internal/behavior
Package Behavior provides a mechanism for reactors to report behavior of peers.
Package Behavior provides a mechanism for reactors to report behavior of peers.

Jump to

Keyboard shortcuts

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