blockv1

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BH_41385450_RECORD = "" /* 128-byte string literal not displayed */
	BH_41385450_MISSED = "" /* 128-byte string literal not displayed */
	BH_41385879_RECORD = "" /* 128-byte string literal not displayed */
	BH_41385879_MISSED = "" /* 128-byte string literal not displayed */
)
View Source
const (
	BH_41385450 = 41385450
	BH_41385879 = 41385879
)

Variables

This section is empty.

Functions

func CheckAndApplyPatch added in v1.2.9

func CheckAndApplyPatch(dbase db.Database) error

func NewHandler added in v0.9.8

func NewHandler(
	chain base.Chain,
) base.BlockHandler

Types

type Block

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

func NewBlockFromHeaderReader added in v0.9.7

func NewBlockFromHeaderReader(database db.Database, r io.Reader) (*Block, error)

func NewBlockFromReader added in v0.9.8

func NewBlockFromReader(dbase db.Database, r io.Reader) (*Block, error)

func NewBlockV11 added in v0.9.10

func NewBlockV11(
	height int64, ts int64, proposer module.Address, prev module.Block,
	logsBloom module.LogsBloom, result []byte,
	patchTransactions module.TransactionList,
	normalTransactions module.TransactionList,
	nextValidators module.ValidatorList,
) *Block

func NewBlockV13 added in v0.9.10

func NewBlockV13(
	height int64, ts int64, proposer module.Address, prev module.Block,
	logsBloom module.LogsBloom, result []byte,
	patchTransactions module.TransactionList,
	normalTransactions module.TransactionList,
	nextValidators module.ValidatorList, blockVote module.CommitVoteSet,
) *Block

func NewFromV0 added in v0.9.7

func NewFromV0(
	blkV0 blockv0.Block,
	dbase db.Database,
	prevHash []byte,
	tr module.Transition,
) (*Block, error)

func (*Block) BTPDigest added in v1.3.0

func (b *Block) BTPDigest() (module.BTPDigest, error)

func (*Block) BTPSection added in v1.3.0

func (b *Block) BTPSection() (module.BTPSection, error)

func (*Block) Copy added in v1.2.14

func (b *Block) Copy() module.Block

func (*Block) FinalizeHeader added in v0.9.10

func (b *Block) FinalizeHeader(dbase db.Database) error

func (*Block) GetVoters added in v0.9.10

func (b *Block) GetVoters(ctx base.BlockHandlerContext) (module.ValidatorList, error)

func (*Block) Hash added in v0.9.7

func (b *Block) Hash() []byte

func (*Block) Height

func (b *Block) Height() int64

func (*Block) ID

func (b *Block) ID() []byte

func (*Block) LogsBloom

func (b *Block) LogsBloom() module.LogsBloom

func (*Block) Marshal

func (b *Block) Marshal(w io.Writer) error

func (*Block) MarshalBody

func (b *Block) MarshalBody(w io.Writer) error

func (*Block) MarshalHeader

func (b *Block) MarshalHeader(w io.Writer) error

func (*Block) NTSHashEntryList added in v1.3.0

func (b *Block) NTSHashEntryList() (module.NTSHashEntryList, error)

func (*Block) NetworkSectionFilter added in v1.3.0

func (b *Block) NetworkSectionFilter() module.BitSetFilter

func (*Block) NextProofContextMap added in v1.3.0

func (b *Block) NextProofContextMap() (module.BTPProofContextMap, error)

func (*Block) NextValidators

func (b *Block) NextValidators() module.ValidatorList

func (*Block) NormalTransactions

func (b *Block) NormalTransactions() module.TransactionList

func (*Block) PatchTransactions

func (b *Block) PatchTransactions() module.TransactionList

func (*Block) PrevHash added in v0.9.7

func (b *Block) PrevHash() []byte

func (*Block) PrevID

func (b *Block) PrevID() []byte

func (*Block) Proposer

func (b *Block) Proposer() module.Address

func (*Block) Result

func (b *Block) Result() []byte

func (*Block) Signature added in v0.9.7

func (b *Block) Signature() common.Signature

func (*Block) Timestamp

func (b *Block) Timestamp() int64

func (*Block) ToJSON

func (b *Block) ToJSON(version module.JSONVersion) (interface{}, error)

func (*Block) TransactionsRoot added in v0.9.7

func (b *Block) TransactionsRoot() []byte

func (*Block) VerifyTimestamp added in v0.9.10

func (b *Block) VerifyTimestamp(prev module.BlockData, prevVoters module.ValidatorList) error

func (*Block) Version

func (b *Block) Version() int

func (*Block) VersionV0 added in v0.9.7

func (b *Block) VersionV0() string

func (*Block) Votes

func (b *Block) Votes() module.CommitVoteSet

func (*Block) WriteHeaderTo added in v0.9.10

func (b *Block) WriteHeaderTo(dbase db.Database) error

func (*Block) WriteTo added in v0.9.7

func (b *Block) WriteTo(dbase db.Database) error

type BodyFormat added in v0.9.10

type BodyFormat struct {
	PatchTransactions  [][]byte
	NormalTransactions [][]byte
	BlockVotes         *blockv0.BlockVoteList
	LeaderVotes        *blockv0.LeaderVoteList
}

type Format added in v0.9.10

type Format struct {
	HeaderFormat
	BodyFormat
}

func (*Format) RLPDecodeSelf added in v0.9.10

func (f *Format) RLPDecodeSelf(d codec.Decoder) error

func (*Format) RLPEncodeSelf added in v0.9.10

func (f *Format) RLPEncodeSelf(e codec.Encoder) error

type HeaderFormat added in v0.9.10

type HeaderFormat struct {
	// V10 and V20 common
	Version                int
	Height                 int64
	Timestamp              int64
	Proposer               []byte
	PrevHash               []byte
	BlockVotesHash         []byte
	NextValidatorsHash     []byte
	PatchTransactionsHash  []byte
	NormalTransactionsHash []byte
	LogsBloom              []byte
	Result                 []byte

	// V1X common
	PrevID    []byte
	VersionV0 string
	Signature common.Signature

	// V13 only, final value (after executing TXes in this block)
	StateHashV0     []byte
	ReceiptRoot     []byte
	RepsRoot        []byte
	NextRepsRoot    []byte
	LogsBloomV0     []byte
	LeaderVotesHash []byte
	NextLeader      []byte
}

Jump to

Keyboard shortcuts

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