v3

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Header is the V3 block header. V3 block header is exactly the same we copy the code instead of embedded v2 header into v3 when we do type checking in NewBodyForMatchingHeader the embedded structure will return v2 header type instead of v3 type

func NewHeader

func NewHeader() *Header

NewHeader creates a new header object.

func (*Header) Bloom

func (h *Header) Bloom() ethtypes.Bloom

Bloom is the Bloom filter that indexes accounts and topics logged by smart contract transactions (executions) in this block.

func (*Header) Coinbase

func (h *Header) Coinbase() common.Address

Coinbase is now the first 20 bytes of the SHA256 hash of the leader's public BLS key. This is required for EVM compatibility.

func (*Header) Copy

func (h *Header) Copy() blockif.Header

Copy returns a copy of the given header.

func (h *Header) CrossLinks() []byte

CrossLinks is the RLP-encoded form of non-beacon block headers chosen to be canonical by the beacon committee. This field is present only on beacon chain block headers.

The returned slice is a copy; the caller may do anything with it.

func (*Header) DecodeRLP

func (h *Header) DecodeRLP(s *rlp.Stream) error

DecodeRLP decodes the given RLP decode stream into the header fields.

func (*Header) EncodeRLP

func (h *Header) EncodeRLP(w io.Writer) error

EncodeRLP encodes the header fields into RLP format.

func (*Header) Epoch

func (h *Header) Epoch() *big.Int

Epoch is the epoch number of this block.

The returned instance is a copy; the caller may do anything with it.

func (*Header) Extra

func (h *Header) Extra() []byte

Extra is the extra data field of this block.

The returned slice is a copy; the caller may do anything with it.

func (*Header) GasLimit

func (h *Header) GasLimit() uint64

GasLimit is the gas limit for transactions in this block.

func (*Header) GasUsed

func (h *Header) GasUsed() uint64

GasUsed is the amount of gas used by transactions in this block.

func (*Header) GetShardState

func (h *Header) GetShardState() (shard.State, error)

GetShardState returns the deserialized shard state object.

func (*Header) Hash

func (h *Header) Hash() common.Hash

Hash returns the block hash of the header, which is simply the keccak256 hash of its RLP encoding.

func (*Header) IncomingReceiptHash

func (h *Header) IncomingReceiptHash() common.Hash

IncomingReceiptHash is the ingress transaction receipt trie hash.

func (*Header) LastCommitBitmap

func (h *Header) LastCommitBitmap() []byte

LastCommitBitmap is the signatory bitmap of the previous block. Bit positions index into committee member array.

The returned slice is a copy; the caller may do anything with it.

func (*Header) LastCommitSignature

func (h *Header) LastCommitSignature() [96]byte

LastCommitSignature is the FBFT commit group signature for the last block.

func (*Header) Logger

func (h *Header) Logger(logger *zerolog.Logger) *zerolog.Logger

Logger returns a sub-logger with block contexts added.

func (*Header) MixDigest

func (h *Header) MixDigest() common.Hash

MixDigest is the mixhash.

This field is a remnant from Ethereum, and Harmony does not use it and always zeroes it out.

func (*Header) Number

func (h *Header) Number() *big.Int

Number is the block number.

The returned instance is a copy; the caller may do anything with it.

func (*Header) OutgoingReceiptHash

func (h *Header) OutgoingReceiptHash() common.Hash

OutgoingReceiptHash is the egress transaction receipt trie hash.

func (*Header) ParentHash

func (h *Header) ParentHash() common.Hash

ParentHash is the header hash of the parent block. For the genesis block which has no parent by definition, this field is zeroed out.

func (*Header) ReceiptHash

func (h *Header) ReceiptHash() common.Hash

ReceiptHash is the same-shard transaction receipt trie hash.

func (*Header) Root

func (h *Header) Root() common.Hash

Root is the state (account) trie root hash.

func (*Header) SetBloom

func (h *Header) SetBloom(newBloom ethtypes.Bloom)

SetBloom sets the smart contract log Bloom filter for this block.

func (*Header) SetCoinbase

func (h *Header) SetCoinbase(newCoinbase common.Address)

SetCoinbase sets the coinbase address field.

func (h *Header) SetCrossLinks(newCrossLinks []byte)

SetCrossLinks sets the RLP-encoded form of non-beacon block headers chosen to be canonical by the beacon committee.

It stores a copy; the caller may freely modify the original.

func (*Header) SetEpoch

func (h *Header) SetEpoch(newEpoch *big.Int)

SetEpoch sets the epoch number of this block.

It stores a copy; the caller may freely modify the original.

func (*Header) SetExtra

func (h *Header) SetExtra(newExtra []byte)

SetExtra sets the extra data field of this block.

It stores a copy; the caller may freely modify the original.

func (*Header) SetGasLimit

func (h *Header) SetGasLimit(newGasLimit uint64)

SetGasLimit sets the gas limit for transactions in this block.

func (*Header) SetGasUsed

func (h *Header) SetGasUsed(newGasUsed uint64)

SetGasUsed sets the amount of gas used by transactions in this block.

func (*Header) SetIncomingReceiptHash

func (h *Header) SetIncomingReceiptHash(newIncomingReceiptHash common.Hash)

SetIncomingReceiptHash sets the ingress transaction receipt trie hash.

func (*Header) SetLastCommitBitmap

func (h *Header) SetLastCommitBitmap(newLastCommitBitmap []byte)

SetLastCommitBitmap sets the signatory bitmap of the previous block.

It stores a copy; the caller may freely modify the original.

func (*Header) SetLastCommitSignature

func (h *Header) SetLastCommitSignature(newLastCommitSignature [96]byte)

SetLastCommitSignature sets the FBFT commit group signature for the last block.

func (*Header) SetMixDigest

func (h *Header) SetMixDigest(newMixDigest common.Hash)

SetMixDigest sets the mixhash of this block.

func (*Header) SetNumber

func (h *Header) SetNumber(newNumber *big.Int)

SetNumber sets the block number.

It stores a copy; the caller may freely modify the original.

func (*Header) SetOutgoingReceiptHash

func (h *Header) SetOutgoingReceiptHash(newOutgoingReceiptHash common.Hash)

SetOutgoingReceiptHash sets the egress transaction receipt trie hash.

func (*Header) SetParentHash

func (h *Header) SetParentHash(newParentHash common.Hash)

SetParentHash sets the parent hash field.

func (*Header) SetReceiptHash

func (h *Header) SetReceiptHash(newReceiptHash common.Hash)

SetReceiptHash sets the same-shard transaction receipt trie hash.

func (*Header) SetRoot

func (h *Header) SetRoot(newRoot common.Hash)

SetRoot sets the state trie root hash field.

func (*Header) SetShardID

func (h *Header) SetShardID(newShardID uint32)

SetShardID sets the shard ID to which this block belongs.

func (*Header) SetShardState

func (h *Header) SetShardState(newShardState []byte)

SetShardState sets the RLP-encoded form of shard state

It stores a copy; the caller may freely modify the original.

func (*Header) SetShardStateHash

func (h *Header) SetShardStateHash(newShardStateHash common.Hash)

SetShardStateHash sets the shard state hash.

func (*Header) SetSlashes

func (h *Header) SetSlashes(newSlashes []byte)

SetSlashes ..

func (*Header) SetTime

func (h *Header) SetTime(newTime *big.Int)

SetTime sets the UNIX timestamp of this block.

It stores a copy; the caller may freely modify the original.

func (*Header) SetTxHash

func (h *Header) SetTxHash(newTxHash common.Hash)

SetTxHash sets the transaction trie root hash field.

func (*Header) SetVdf

func (h *Header) SetVdf(newVdf []byte)

SetVdf sets the output of the VDF for the epoch.

It stores a copy; the caller may freely modify the original.

func (*Header) SetViewID

func (h *Header) SetViewID(newViewID *big.Int)

SetViewID sets the view ID in which the block was originally proposed.

It stores a copy; the caller may freely modify the original.

func (*Header) SetVrf

func (h *Header) SetVrf(newVrf []byte)

SetVrf sets the output of the VRF for the epoch.

It stores a copy; the caller may freely modify the original.

func (*Header) ShardID

func (h *Header) ShardID() uint32

ShardID is the shard ID to which this block belongs.

func (*Header) ShardState

func (h *Header) ShardState() []byte

ShardState is the RLP-encoded form of shard state (list of committees) for the next epoch.

The returned slice is a copy; the caller may do anything with it.

func (*Header) ShardStateHash

func (h *Header) ShardStateHash() common.Hash

ShardStateHash is the shard state hash.

func (*Header) Size

func (h *Header) Size() common.StorageSize

Size returns the approximate memory used by all internal contents. It is used to approximate and limit the memory consumption of various caches.

func (*Header) Slashes

func (h *Header) Slashes() []byte

Slashes ..

func (*Header) Time

func (h *Header) Time() *big.Int

Time is the UNIX timestamp of this block.

The returned instance is a copy; the caller may do anything with it.

func (*Header) TxHash

func (h *Header) TxHash() common.Hash

TxHash is the transaction trie root hash.

func (*Header) Vdf

func (h *Header) Vdf() []byte

Vdf is the output of the VDF for the epoch.

The returned slice is a copy; the caller may do anything with it.

func (*Header) ViewID

func (h *Header) ViewID() *big.Int

ViewID is the ID of the view in which this block was originally proposed.

It normally increases by one for each subsequent block, or by more than one if one or more PBFT/FBFT view changes have occurred.

The returned instance is a copy; the caller may do anything with it.

func (*Header) Vrf

func (h *Header) Vrf() []byte

Vrf is the output of the VRF for the epoch.

The returned slice is a copy; the caller may do anything with it.

Jump to

Keyboard shortcuts

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