types

package
v0.0.0-...-92d349b Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 48 Imported by: 0

Documentation

Overview

Package types contains data types related to Ethereum consensus.

Index

Constants

View Source
const (
	// BloomByteLength represents the number of bytes used in a header log bloom.
	BloomByteLength = 256

	// BloomBitLength represents the number of bits used in a header log bloom.
	BloomBitLength = 8 * BloomByteLength
)
View Source
const (
	// ReceiptStatusFailed is the status code of a transaction if execution failed.
	ReceiptStatusFailed = uint64(0)

	// ReceiptStatusSuccessful is the status code of a transaction if execution succeeded.
	ReceiptStatusSuccessful = uint64(1)
)
View Source
const (
	MAX_CALLDATA_SIZE              = 1 << 24
	MAX_ACCESS_LIST_SIZE           = 1 << 24
	MAX_ACCESS_LIST_STORAGE_KEYS   = 1 << 24
	MAX_VERSIONED_HASHES_LIST_SIZE = 1 << 24
)
View Source
const (
	LegacyTxType = iota
	AccessListTxType
	DynamicFeeTxType
	BlobTxType = 5
)

Transaction types.

View Source
const BorTxKeyPrefix string = "matic-bor-receipt-"

Variables

View Source
var (
	EmptyRootHash  = libcommon.HexToHash("56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")
	EmptyUncleHash = rlpHash([]*Header(nil))
)
View Source
var (
	ErrInvalidSig           = errors.New("invalid transaction v, r, s values")
	ErrUnexpectedProtection = errors.New("transaction type does not supported EIP-155 protected signatures")
	ErrInvalidTxType        = errors.New("transaction type not valid in this context")
	ErrTxTypeNotSupported   = errors.New("transaction type not supported")
)
View Source
var ErrGenesisNoConfig = errors.New("genesis has no chain configuration")
View Source
var ErrInvalidChainId = errors.New("invalid chain id for signer")
View Source
var NanoBlackList = []libcommon.Address{
	libcommon.HexToAddress("0x489A8756C18C0b8B24EC2a2b9FF3D4d447F79BEc"),
	libcommon.HexToAddress("0xFd6042Df3D74ce9959922FeC559d7995F3933c55"),

	libcommon.HexToAddress("0xdb789Eb5BDb4E559beD199B8b82dED94e1d056C9"),
}

This is introduced because of the Tendermint IAVL Merkle Proof verification exploitation.

Functions

func Bloom9

func Bloom9(data []byte) []byte

Bloom9 returns the bloom filter for the given data

func BloomLookup

func BloomLookup(bin Bloom, topic bytesBacked) bool

BloomLookup is a convenience-method to check presence int he bloom filter

func BorReceiptKey

func BorReceiptKey(number uint64) []byte

BorReceiptKey = num (uint64 big endian)

func CalcUncleHash

func CalcUncleHash(uncles []*Header) libcommon.Hash

func ComputeBorTxHash

func ComputeBorTxHash(blockNumber uint64, blockHash libcommon.Hash) libcommon.Hash

ComputeBorTxHash get derived tx hash from block number and hash

func DecodeOnlyTxMetadataFromBody

func DecodeOnlyTxMetadataFromBody(payload []byte) (baseTxId uint64, txAmount uint32, err error)

func DecodeSSZ

func DecodeSSZ(data []byte, dest codec.Deserializable) error

func DeriveChainId

func DeriveChainId(v *uint256.Int) *uint256.Int

deriveChainID derives the chain id from the given v parameter

func DeriveFieldsForBorLogs

func DeriveFieldsForBorLogs(logs []*Log, blockHash libcommon.Hash, blockNumber uint64, txIndex uint, logIndex uint)

DeriveFieldsForBorLogs fills the receipts with their computed fields based on consensus data and contextual infos like containing block and transactions.

func DeriveFieldsForBorReceipt

func DeriveFieldsForBorReceipt(receipt *Receipt, blockHash libcommon.Hash, blockNumber uint64, receipts Receipts) error

DeriveFieldsForBorReceipt fills the receipts with their computed fields based on consensus data and contextual infos like containing block and transactions.

func DeriveSha

func DeriveSha(list DerivableList) libcommon.Hash

func EncodeSSZ

func EncodeSSZ(w io.Writer, obj codec.Serializable) error

func EncodeStructSizePrefix

func EncodeStructSizePrefix(size int, w io.Writer, b []byte) error

func LogsBloom

func LogsBloom(logs []*Log) []byte

LogsBloom returns the bloom bytes for the given logs

func MarshalTransactionsBinary

func MarshalTransactionsBinary(txs Transactions) ([][]byte, error)

func RawRlpHash

func RawRlpHash(rawRlpData rlp.RawValue) (h libcommon.Hash)

func ReadHashes

func ReadHashes(dr *codec.DecodingReader, hashes *[]libcommon.Hash, length uint64) error

func ReadHashesLimited

func ReadHashesLimited(dr *codec.DecodingReader, hashes *[]libcommon.Hash, limit uint64) error

func TypedTransactionMarshalledAsRlpString

func TypedTransactionMarshalledAsRlpString(data []byte) bool

func WriteHashes

func WriteHashes(ew *codec.EncodingWriter, hashes []libcommon.Hash) error

Types

type AccessListTx

type AccessListTx struct {
	LegacyTx
	ChainID    *uint256.Int
	AccessList types2.AccessList // EIP-2930 access list
}

AccessListTx is the data of EIP-2930 access list transactions.

func (AccessListTx) AsMessage

func (tx AccessListTx) AsMessage(s Signer, _ *big.Int, rules *chain.Rules) (Message, error)

AsMessage returns the transaction as a core.Message.

func (*AccessListTx) DecodeRLP

func (tx *AccessListTx) DecodeRLP(s *rlp.Stream) error

func (AccessListTx) EncodeRLP

func (tx AccessListTx) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder

func (AccessListTx) EncodingSize

func (tx AccessListTx) EncodingSize() int

EncodingSize returns the RLP encoding size of the whole transaction envelope

func (*AccessListTx) FakeSign

func (tx *AccessListTx) FakeSign(address libcommon.Address) (Transaction, error)

func (AccessListTx) GetAccessList

func (tx AccessListTx) GetAccessList() types2.AccessList

func (AccessListTx) GetChainID

func (tx AccessListTx) GetChainID() *uint256.Int

func (*AccessListTx) Hash

func (tx *AccessListTx) Hash() libcommon.Hash

Hash computes the hash (but not for signatures!)

func (AccessListTx) MarshalBinary

func (tx AccessListTx) MarshalBinary(w io.Writer) error

MarshalBinary returns the canonical encoding of the transaction. For legacy transactions, it returns the RLP encoding. For EIP-2718 typed transactions, it returns the type and payload.

func (AccessListTx) MarshalJSON

func (tx AccessListTx) MarshalJSON() ([]byte, error)

func (AccessListTx) Protected

func (tx AccessListTx) Protected() bool

func (AccessListTx) RawSignatureValues

func (tx AccessListTx) RawSignatureValues() (*uint256.Int, *uint256.Int, *uint256.Int)

func (*AccessListTx) Sender

func (tx *AccessListTx) Sender(signer Signer) (libcommon.Address, error)

func (AccessListTx) SigningHash

func (tx AccessListTx) SigningHash(chainID *big.Int) libcommon.Hash

func (AccessListTx) Type

func (tx AccessListTx) Type() byte

func (*AccessListTx) UnmarshalJSON

func (tx *AccessListTx) UnmarshalJSON(input []byte) error

func (*AccessListTx) WithSignature

func (tx *AccessListTx) WithSignature(signer Signer, sig []byte) (Transaction, error)

type AccessListView

type AccessListView types2.AccessList

func (AccessListView) ByteLength

func (alv AccessListView) ByteLength() (out uint64)

func (*AccessListView) Deserialize

func (alv *AccessListView) Deserialize(dr *codec.DecodingReader) error

func (*AccessListView) FixedLength

func (alv *AccessListView) FixedLength() uint64

func (AccessListView) Serialize

func (alv AccessListView) Serialize(w *codec.EncodingWriter) error

type AccessTupleView

type AccessTupleView types2.AccessTuple

func (*AccessTupleView) ByteLength

func (atv *AccessTupleView) ByteLength() uint64

func (*AccessTupleView) Deserialize

func (atv *AccessTupleView) Deserialize(dr *codec.DecodingReader) error

func (*AccessTupleView) FixedLength

func (atv *AccessTupleView) FixedLength() uint64

func (*AccessTupleView) Serialize

func (atv *AccessTupleView) Serialize(w *codec.EncodingWriter) error

type AddressOptionalSSZ

type AddressOptionalSSZ struct {
	Address *AddressSSZ
}

AddressOptionalSSZ implements Union[None, Address]

func (*AddressOptionalSSZ) ByteLength

func (ao *AddressOptionalSSZ) ByteLength() uint64

func (*AddressOptionalSSZ) Deserialize

func (ao *AddressOptionalSSZ) Deserialize(dr *codec.DecodingReader) error

func (*AddressOptionalSSZ) FixedLength

func (*AddressOptionalSSZ) FixedLength() uint64

func (*AddressOptionalSSZ) Serialize

func (ao *AddressOptionalSSZ) Serialize(w *codec.EncodingWriter) error

type AddressSSZ

type AddressSSZ libcommon.Address

func (*AddressSSZ) ByteLength

func (*AddressSSZ) ByteLength() uint64

func (*AddressSSZ) Deserialize

func (addr *AddressSSZ) Deserialize(dr *codec.DecodingReader) error

func (*AddressSSZ) FixedLength

func (*AddressSSZ) FixedLength() uint64

func (*AddressSSZ) Serialize

func (addr *AddressSSZ) Serialize(w *codec.EncodingWriter) error

type AuthorityRoundSeal

type AuthorityRoundSeal struct {
	/// Seal step.
	Step uint64 `json:"step"`
	/// Seal signature.
	Signature common.Hash `json:"signature"`
}

type BLSFieldElement

type BLSFieldElement [32]byte

BLSFieldElement is the raw bytes representation of a field element

func (BLSFieldElement) MarshalText

func (p BLSFieldElement) MarshalText() ([]byte, error)

func (BLSFieldElement) String

func (p BLSFieldElement) String() string

func (*BLSFieldElement) UnmarshalText

func (p *BLSFieldElement) UnmarshalText(text []byte) error

type BinaryTransactions

type BinaryTransactions [][]byte

RLP-marshalled legacy transactions and binary-marshalled (not wrapped into an RLP string) typed (EIP-2718) transactions

func (BinaryTransactions) EncodeIndex

func (t BinaryTransactions) EncodeIndex(i int, w *bytes.Buffer)

func (BinaryTransactions) Len

func (t BinaryTransactions) Len() int

type Blob

type Blob [params.FieldElementsPerBlob * 32]byte

Blob data

func (*Blob) ByteLength

func (blob *Blob) ByteLength() (out uint64)

func (*Blob) Deserialize

func (blob *Blob) Deserialize(dr *codec.DecodingReader) error

func (*Blob) FixedLength

func (blob *Blob) FixedLength() uint64

func (*Blob) MarshalText

func (blob *Blob) MarshalText() ([]byte, error)

func (*Blob) Serialize

func (blob *Blob) Serialize(w *codec.EncodingWriter) error

func (*Blob) String

func (blob *Blob) String() string

func (*Blob) UnmarshalText

func (blob *Blob) UnmarshalText(text []byte) error

type BlobKzgs

type BlobKzgs []KZGCommitment

func (BlobKzgs) ByteLength

func (li BlobKzgs) ByteLength() uint64

func (*BlobKzgs) Deserialize

func (li *BlobKzgs) Deserialize(dr *codec.DecodingReader) error

func (BlobKzgs) FixedLength

func (li BlobKzgs) FixedLength() uint64

func (BlobKzgs) Serialize

func (li BlobKzgs) Serialize(w *codec.EncodingWriter) error

type BlobTxMessage

type BlobTxMessage struct {
	ChainID          Uint256View
	Nonce            Uint64View
	GasTipCap        Uint256View // a.k.a. maxPriorityFeePerGas
	GasFeeCap        Uint256View // a.k.a. maxFeePerGas
	Gas              Uint64View
	To               AddressOptionalSSZ // nil means contract creation
	Value            Uint256View
	Data             TxDataView
	AccessList       AccessListView
	MaxFeePerDataGas Uint256View

	BlobVersionedHashes VersionedHashesView
}

func (*BlobTxMessage) ByteLength

func (tx *BlobTxMessage) ByteLength() uint64

func (*BlobTxMessage) Deserialize

func (tx *BlobTxMessage) Deserialize(dr *codec.DecodingReader) error

func (*BlobTxMessage) FixedLength

func (tx *BlobTxMessage) FixedLength() uint64

func (*BlobTxMessage) Serialize

func (tx *BlobTxMessage) Serialize(w *codec.EncodingWriter) error

type BlobTxWrapper

type BlobTxWrapper struct {
	Tx                 SignedBlobTx
	BlobKzgs           BlobKzgs
	Blobs              Blobs
	KzgAggregatedProof KZGProofs
}

BlobTxWrapper is the "network representation" of a Blob transaction, that is it includes not only the SignedBlobTx but also all the associated blob data.

func (*BlobTxWrapper) AsMessage

func (txw *BlobTxWrapper) AsMessage(s Signer, baseFee *big.Int, rules *chain.Rules) (Message, error)

func (*BlobTxWrapper) ByteLength

func (txw *BlobTxWrapper) ByteLength() uint64

func (*BlobTxWrapper) Cost

func (txw *BlobTxWrapper) Cost() *uint256.Int

func (*BlobTxWrapper) Deserialize

func (txw *BlobTxWrapper) Deserialize(dr *codec.DecodingReader) error

func (BlobTxWrapper) EncodeRLP

func (txw BlobTxWrapper) EncodeRLP(w io.Writer) error

func (BlobTxWrapper) EncodingSize

func (txw BlobTxWrapper) EncodingSize() int

func (*BlobTxWrapper) FakeSign

func (txw *BlobTxWrapper) FakeSign(address libcommon.Address) (Transaction, error)

func (*BlobTxWrapper) FixedLength

func (txw *BlobTxWrapper) FixedLength() uint64

func (*BlobTxWrapper) GetAccessList

func (txw *BlobTxWrapper) GetAccessList() types2.AccessList

func (*BlobTxWrapper) GetChainID

func (txw *BlobTxWrapper) GetChainID() *uint256.Int

func (*BlobTxWrapper) GetData

func (txw *BlobTxWrapper) GetData() []byte

func (*BlobTxWrapper) GetDataGas

func (txw *BlobTxWrapper) GetDataGas() uint64

func (*BlobTxWrapper) GetDataHashes

func (txw *BlobTxWrapper) GetDataHashes() []libcommon.Hash

func (*BlobTxWrapper) GetEffectiveGasTip

func (txw *BlobTxWrapper) GetEffectiveGasTip(baseFee *uint256.Int) *uint256.Int

func (*BlobTxWrapper) GetFeeCap

func (txw *BlobTxWrapper) GetFeeCap() *uint256.Int

func (*BlobTxWrapper) GetGas

func (txw *BlobTxWrapper) GetGas() uint64

func (*BlobTxWrapper) GetNonce

func (txw *BlobTxWrapper) GetNonce() uint64

func (*BlobTxWrapper) GetPrice

func (txw *BlobTxWrapper) GetPrice() *uint256.Int

func (*BlobTxWrapper) GetSender

func (txw *BlobTxWrapper) GetSender() (libcommon.Address, bool)

func (*BlobTxWrapper) GetTip

func (txw *BlobTxWrapper) GetTip() *uint256.Int

func (*BlobTxWrapper) GetTo

func (txw *BlobTxWrapper) GetTo() *libcommon.Address

func (*BlobTxWrapper) GetValue

func (txw *BlobTxWrapper) GetValue() *uint256.Int

func (*BlobTxWrapper) Hash

func (txw *BlobTxWrapper) Hash() libcommon.Hash

func (*BlobTxWrapper) IsContractDeploy

func (txw *BlobTxWrapper) IsContractDeploy() bool

func (*BlobTxWrapper) MarshalBinary

func (txw *BlobTxWrapper) MarshalBinary(w io.Writer) error

func (*BlobTxWrapper) Protected

func (txw *BlobTxWrapper) Protected() bool

func (*BlobTxWrapper) RawSignatureValues

func (txw *BlobTxWrapper) RawSignatureValues() (*uint256.Int, *uint256.Int, *uint256.Int)

func (*BlobTxWrapper) Sender

func (txw *BlobTxWrapper) Sender(s Signer) (libcommon.Address, error)

func (*BlobTxWrapper) Serialize

func (txw *BlobTxWrapper) Serialize(w *codec.EncodingWriter) error

func (*BlobTxWrapper) SetSender

func (txw *BlobTxWrapper) SetSender(address libcommon.Address)

func (*BlobTxWrapper) SigningHash

func (txw *BlobTxWrapper) SigningHash(chainID *big.Int) libcommon.Hash

func (*BlobTxWrapper) Time

func (txw *BlobTxWrapper) Time() time.Time

func (*BlobTxWrapper) Type

func (txw *BlobTxWrapper) Type() byte

Implement transaction interface

func (*BlobTxWrapper) Unwrap

func (txw *BlobTxWrapper) Unwrap() Transaction

func (*BlobTxWrapper) ValidateBlobTransactionWrapper

func (txw *BlobTxWrapper) ValidateBlobTransactionWrapper() error

validateBlobTransactionWrapper implements validate_blob_transaction_wrapper from EIP-4844

func (*BlobTxWrapper) WithSignature

func (txw *BlobTxWrapper) WithSignature(signer Signer, sig []byte) (Transaction, error)

type Blobs

type Blobs []Blob

func (Blobs) ByteLength

func (a Blobs) ByteLength() (out uint64)

func (Blobs) ComputeCommitmentsAndProofs

func (blobs Blobs) ComputeCommitmentsAndProofs() (commitments []KZGCommitment, versionedHashes []libcommon.Hash, proofs []KZGProof, err error)

Return KZG commitments, versioned hashes and the proofs that correspond to these blobs

func (*Blobs) Deserialize

func (a *Blobs) Deserialize(dr *codec.DecodingReader) error

func (*Blobs) FixedLength

func (a *Blobs) FixedLength() uint64

func (Blobs) Serialize

func (a Blobs) Serialize(w *codec.EncodingWriter) error

type Block

type Block struct {
	ReceivedAt time.Time
	// contains filtered or unexported fields
}

Block represents an entire block in the Ethereum blockchain.

func NewBlock

func NewBlock(header *Header, txs []Transaction, uncles []*Header, receipts []*Receipt, withdrawals []*Withdrawal) *Block

NewBlock creates a new block. The input data is copied, changes to header and to the field values will not affect the block.

The values of TxHash, UncleHash, ReceiptHash, Bloom, and WithdrawalHash in the header are ignored and set to the values derived from the given txs, uncles, receipts, and withdrawals.

func NewBlockFromStorage

func NewBlockFromStorage(hash libcommon.Hash, header *Header, txs []Transaction, uncles []*Header, withdrawals []*Withdrawal) *Block

NewBlockFromStorage like NewBlock but used to create Block object when read it from DB in this case no reason to copy parts, or re-calculate headers fields - they are all stored in DB

func NewBlockWithHeader

func NewBlockWithHeader(header *Header) *Block

NewBlockWithHeader creates a block with the given header data. The header data is copied, changes to header and to the field values will not affect the block.

func (*Block) BaseFee

func (b *Block) BaseFee() *big.Int

func (*Block) Bloom

func (b *Block) Bloom() Bloom

func (*Block) Body

func (b *Block) Body() *Body

Body returns the non-header content of the block.

func (*Block) Coinbase

func (b *Block) Coinbase() libcommon.Address

func (*Block) Copy

func (b *Block) Copy() *Block

Copy creates a deep copy of the Block.

func (*Block) DecodeRLP

func (bb *Block) DecodeRLP(s *rlp.Stream) error

DecodeRLP decodes the Ethereum

func (*Block) Difficulty

func (b *Block) Difficulty() *big.Int

func (Block) EncodeRLP

func (bb Block) EncodeRLP(w io.Writer) error

EncodeRLP serializes b into the Ethereum RLP block format.

func (Block) EncodingSize

func (bb Block) EncodingSize() int

func (*Block) ExcessDataGas

func (b *Block) ExcessDataGas() *big.Int

func (*Block) Extra

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

func (*Block) GasLimit

func (b *Block) GasLimit() uint64

func (*Block) GasUsed

func (b *Block) GasUsed() uint64

func (*Block) Hash

func (b *Block) Hash() libcommon.Hash

Hash returns the keccak256 hash of b's header. The hash is computed on the first call and cached thereafter.

func (*Block) HashCheck

func (b *Block) HashCheck() error

HashCheck checks that uncle, transaction, and withdrawals hashes are correct.

func (*Block) Header

func (b *Block) Header() *Header

Header returns a deep-copy of the entire block header using CopyHeader()

func (*Block) HeaderNoCopy

func (b *Block) HeaderNoCopy() *Header

func (*Block) MixDigest

func (b *Block) MixDigest() libcommon.Hash

func (*Block) Nonce

func (b *Block) Nonce() BlockNonce

func (*Block) NonceU64

func (b *Block) NonceU64() uint64

func (*Block) Number

func (b *Block) Number() *big.Int

func (*Block) NumberU64

func (b *Block) NumberU64() uint64

func (*Block) ParentHash

func (b *Block) ParentHash() libcommon.Hash

func (*Block) RawBody

func (b *Block) RawBody() *RawBody

RawBody creates a RawBody based on the block. It is not very efficient, so will probably be removed in favour of RawBlock. Also it panics

func (*Block) ReceiptHash

func (b *Block) ReceiptHash() libcommon.Hash

func (*Block) Root

func (b *Block) Root() libcommon.Hash

func (*Block) SanityCheck

func (b *Block) SanityCheck() error

SanityCheck can be used to prevent that unbounded fields are stuffed with junk data to add processing overhead

func (*Block) SendersToTxs

func (b *Block) SendersToTxs(senders []libcommon.Address)

func (*Block) Size

func (b *Block) Size() common.StorageSize

Size returns the true RLP encoded storage size of the block, either by encoding and returning it, or returning a previously cached value.

func (*Block) Time

func (b *Block) Time() uint64

func (*Block) Transaction

func (b *Block) Transaction(hash libcommon.Hash) Transaction

func (*Block) Transactions

func (b *Block) Transactions() Transactions

func (*Block) TxHash

func (b *Block) TxHash() libcommon.Hash

func (*Block) UncleHash

func (b *Block) UncleHash() libcommon.Hash

func (*Block) Uncles

func (b *Block) Uncles() []*Header

func (*Block) WithBody

func (b *Block) WithBody(transactions []Transaction, uncles []*Header) *Block

WithBody returns a new block with the given transaction and uncle contents.

func (*Block) WithSeal

func (b *Block) WithSeal(header *Header) *Block

WithSeal returns a new block with the data from b but the header replaced with the sealed one.

func (*Block) WithWithdrawals

func (b *Block) WithWithdrawals(withdrawals []*Withdrawal) *Block

WithWithdrawals sets the withdrawal contents of a block, does not return a new block.

func (*Block) Withdrawals

func (b *Block) Withdrawals() Withdrawals

func (*Block) WithdrawalsHash

func (b *Block) WithdrawalsHash() *libcommon.Hash

type BlockNonce

type BlockNonce [8]byte

A BlockNonce is a 64-bit hash which proves (combined with the mix-hash) that a sufficient amount of computation has been carried out on a block.

func EncodeNonce

func EncodeNonce(i uint64) BlockNonce

EncodeNonce converts the given integer to a block nonce.

func (BlockNonce) MarshalText

func (n BlockNonce) MarshalText() ([]byte, error)

MarshalText encodes n as a hex string with 0x prefix.

func (BlockNonce) Uint64

func (n BlockNonce) Uint64() uint64

Uint64 returns the integer value of a block nonce.

func (*BlockNonce) UnmarshalText

func (n *BlockNonce) UnmarshalText(input []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

type BlockWithReceipts

type BlockWithReceipts struct {
	Block    *Block
	Receipts Receipts
}

type Blocks

type Blocks []*Block

type Bloom

type Bloom [BloomByteLength]byte

Bloom represents a 2048 bit bloom filter.

func BytesToBloom

func BytesToBloom(b []byte) Bloom

BytesToBloom converts a byte slice to a bloom filter. It panics if b is not of suitable size.

func CreateBloom

func CreateBloom(receipts Receipts) Bloom

func (*Bloom) Add

func (b *Bloom) Add(d []byte)

Add adds d to the filter. Future calls of Test(d) will return true.

func (Bloom) Big

func (b Bloom) Big() *big.Int

Big converts b to a big integer. Note: Converting a bloom filter to a big.Int and then calling GetBytes does not return the same bytes, since big.Int will trim leading zeroes

func (Bloom) Bytes

func (b Bloom) Bytes() []byte

Bytes returns the backing byte slice of the bloom

func (Bloom) MarshalText

func (b Bloom) MarshalText() ([]byte, error)

MarshalText encodes b as a hex string with 0x prefix.

func (*Bloom) SetBytes

func (b *Bloom) SetBytes(d []byte)

SetBytes sets the content of b to the given bytes. It panics if d is not of suitable size.

func (Bloom) Test

func (b Bloom) Test(topic []byte) bool

Test checks if the given topic is present in the bloom filter

func (*Bloom) UnmarshalText

func (b *Bloom) UnmarshalText(input []byte) error

UnmarshalText b as a hex string with 0x prefix.

type Body

type Body struct {
	Transactions []Transaction
	Uncles       []*Header
	Withdrawals  []*Withdrawal
}

Body is a simple (mutable, non-safe) data container for storing and moving a block's data contents (transactions and uncles) together.

func (*Body) DecodeRLP

func (bb *Body) DecodeRLP(s *rlp.Stream) error

func (Body) EncodeRLP

func (bb Body) EncodeRLP(w io.Writer) error

func (Body) EncodingSize

func (bb Body) EncodingSize() int

func (*Body) RawBody

func (b *Body) RawBody() *RawBody

RawBody creates a RawBody based on the body.

func (*Body) SendersFromTxs

func (b *Body) SendersFromTxs() []libcommon.Address

Copy transaction senders from transactions to the body

func (*Body) SendersToTxs

func (b *Body) SendersToTxs(senders []libcommon.Address)

Copy transaction senders from body into the transactions

type BodyForStorage

type BodyForStorage struct {
	BaseTxId    uint64
	TxAmount    uint32
	Uncles      []*Header
	Withdrawals []*Withdrawal
}

func (*BodyForStorage) DecodeRLP

func (bfs *BodyForStorage) DecodeRLP(s *rlp.Stream) error

func (BodyForStorage) EncodeRLP

func (bfs BodyForStorage) EncodeRLP(w io.Writer) error

type CommonTx

type CommonTx struct {
	TransactionMisc

	ChainID *uint256.Int
	Nonce   uint64             // nonce of sender account
	Gas     uint64             // gas limit
	To      *libcommon.Address `rlp:"nil"` // nil means contract creation
	Value   *uint256.Int       // wei amount
	Data    []byte             // contract invocation input data
	V, R, S uint256.Int        // signature values
}

func (CommonTx) GetChainID

func (ct CommonTx) GetChainID() *uint256.Int

func (CommonTx) GetData

func (ct CommonTx) GetData() []byte

func (*CommonTx) GetDataHashes

func (ct *CommonTx) GetDataHashes() []libcommon.Hash

func (CommonTx) GetGas

func (ct CommonTx) GetGas() uint64

func (CommonTx) GetNonce

func (ct CommonTx) GetNonce() uint64

func (CommonTx) GetSender

func (ct CommonTx) GetSender() (libcommon.Address, bool)

func (CommonTx) GetTo

func (ct CommonTx) GetTo() *libcommon.Address

func (CommonTx) GetValue

func (ct CommonTx) GetValue() *uint256.Int

func (CommonTx) IsContractDeploy

func (ct CommonTx) IsContractDeploy() bool

func (CommonTx) Protected

func (ct CommonTx) Protected() bool

func (*CommonTx) SetSender

func (ct *CommonTx) SetSender(addr libcommon.Address)

type DerivableList

type DerivableList interface {
	Len() int
	EncodeIndex(i int, w *bytes.Buffer)
}

type DynamicFeeTransaction

type DynamicFeeTransaction struct {
	CommonTx
	Tip        *uint256.Int
	FeeCap     *uint256.Int
	AccessList types2.AccessList
}

func NewEIP1559Transaction

func NewEIP1559Transaction(chainID uint256.Int, nonce uint64, to libcommon.Address, amount *uint256.Int, gasLimit uint64, gasPrice *uint256.Int, gasTip *uint256.Int, gasFeeCap *uint256.Int, data []byte) *DynamicFeeTransaction

NewEIP1559Transaction creates an unsigned eip1559 transaction.

func (DynamicFeeTransaction) AsMessage

func (tx DynamicFeeTransaction) AsMessage(s Signer, baseFee *big.Int, rules *chain.Rules) (Message, error)

AsMessage returns the transaction as a core.Message.

func (DynamicFeeTransaction) Cost

func (tx DynamicFeeTransaction) Cost() *uint256.Int

func (*DynamicFeeTransaction) DecodeRLP

func (tx *DynamicFeeTransaction) DecodeRLP(s *rlp.Stream) error

func (DynamicFeeTransaction) EncodeRLP

func (tx DynamicFeeTransaction) EncodeRLP(w io.Writer) error

func (DynamicFeeTransaction) EncodingSize

func (tx DynamicFeeTransaction) EncodingSize() int

func (*DynamicFeeTransaction) FakeSign

func (tx *DynamicFeeTransaction) FakeSign(address libcommon.Address) (Transaction, error)

func (DynamicFeeTransaction) GetAccessList

func (tx DynamicFeeTransaction) GetAccessList() types2.AccessList

func (DynamicFeeTransaction) GetEffectiveGasTip

func (tx DynamicFeeTransaction) GetEffectiveGasTip(baseFee *uint256.Int) *uint256.Int

func (*DynamicFeeTransaction) GetFeeCap

func (tx *DynamicFeeTransaction) GetFeeCap() *uint256.Int

func (DynamicFeeTransaction) GetPrice

func (tx DynamicFeeTransaction) GetPrice() *uint256.Int

func (*DynamicFeeTransaction) GetTip

func (tx *DynamicFeeTransaction) GetTip() *uint256.Int

func (*DynamicFeeTransaction) Hash

Hash computes the hash (but not for signatures!)

func (DynamicFeeTransaction) MarshalBinary

func (tx DynamicFeeTransaction) MarshalBinary(w io.Writer) error

MarshalBinary returns the canonical encoding of the transaction. For legacy transactions, it returns the RLP encoding. For EIP-2718 typed transactions, it returns the type and payload.

func (DynamicFeeTransaction) MarshalJSON

func (tx DynamicFeeTransaction) MarshalJSON() ([]byte, error)

func (DynamicFeeTransaction) RawSignatureValues

func (tx DynamicFeeTransaction) RawSignatureValues() (*uint256.Int, *uint256.Int, *uint256.Int)

func (*DynamicFeeTransaction) Sender

func (tx *DynamicFeeTransaction) Sender(signer Signer) (libcommon.Address, error)

func (DynamicFeeTransaction) SigningHash

func (tx DynamicFeeTransaction) SigningHash(chainID *big.Int) libcommon.Hash

func (DynamicFeeTransaction) Type

func (tx DynamicFeeTransaction) Type() byte

accessors for innerTx.

func (*DynamicFeeTransaction) UnmarshalJSON

func (tx *DynamicFeeTransaction) UnmarshalJSON(input []byte) error

func (*DynamicFeeTransaction) WithSignature

func (tx *DynamicFeeTransaction) WithSignature(signer Signer, sig []byte) (Transaction, error)

type ECDSASignature

type ECDSASignature struct {
	V Uint8View
	R Uint256View
	S Uint256View
}

func (*ECDSASignature) ByteLength

func (*ECDSASignature) ByteLength() uint64

func (*ECDSASignature) Deserialize

func (sig *ECDSASignature) Deserialize(dr *codec.DecodingReader) error

func (*ECDSASignature) FixedLength

func (*ECDSASignature) FixedLength() uint64

func (*ECDSASignature) GetR

func (sig *ECDSASignature) GetR() *uint256.Int

func (*ECDSASignature) GetS

func (sig *ECDSASignature) GetS() *uint256.Int

func (*ECDSASignature) GetV

func (sig *ECDSASignature) GetV() *uint256.Int

func (*ECDSASignature) Serialize

func (sig *ECDSASignature) Serialize(w *codec.EncodingWriter) error

type ErigonLog

type ErigonLog struct {
	Address     libcommon.Address `json:"address" gencodec:"required" codec:"1"`
	Topics      []libcommon.Hash  `json:"topics" gencodec:"required" codec:"2"`
	Data        []byte            `json:"data" gencodec:"required" codec:"3"`
	BlockNumber uint64            `json:"blockNumber" codec:"-"`
	TxHash      libcommon.Hash    `json:"transactionHash" gencodec:"required" codec:"-"`
	TxIndex     uint              `json:"transactionIndex" codec:"-"`
	BlockHash   libcommon.Hash    `json:"blockHash" codec:"-"`
	Index       uint              `json:"logIndex" codec:"-"`
	Removed     bool              `json:"removed" codec:"-"`
	Timestamp   uint64            `json:"timestamp" codec:"-"`
}

func (ErigonLog) MarshalJSON

func (l ErigonLog) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*ErigonLog) UnmarshalJSON

func (l *ErigonLog) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type ErigonLogs

type ErigonLogs []*ErigonLog

type Genesis

type Genesis struct {
	Config     *chain.Config  `json:"config"`
	Nonce      uint64         `json:"nonce"`
	Timestamp  uint64         `json:"timestamp"`
	ExtraData  []byte         `json:"extraData"`
	GasLimit   uint64         `json:"gasLimit"   gencodec:"required"`
	Difficulty *big.Int       `json:"difficulty" gencodec:"required"`
	Mixhash    common.Hash    `json:"mixHash"`
	Coinbase   common.Address `json:"coinbase"`
	Alloc      GenesisAlloc   `json:"alloc"      gencodec:"required"`
	AuRaStep   uint64         `json:"auRaStep"`
	AuRaSeal   []byte         `json:"auRaSeal"`

	// These fields are used for consensus tests. Please don't use them
	// in actual genesis blocks.
	Number        uint64      `json:"number"`
	GasUsed       uint64      `json:"gasUsed"`
	ParentHash    common.Hash `json:"parentHash"`
	BaseFee       *big.Int    `json:"baseFeePerGas"`
	ExcessDataGas *big.Int    `json:"excessDataGas"`
}

Genesis specifies the header fields, state of a genesis block. It also defines hard fork switch-over blocks through the chain configuration.

func (*Genesis) ConfigOrDefault

func (g *Genesis) ConfigOrDefault(genesisHash common.Hash) *chain.Config

func (Genesis) MarshalJSON

func (g Genesis) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*Genesis) UnmarshalJSON

func (g *Genesis) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type GenesisAccount

type GenesisAccount struct {
	Constructor []byte                      `json:"constructor,omitempty"` // deployment code
	Code        []byte                      `json:"code,omitempty"`        // final contract code
	Storage     map[common.Hash]common.Hash `json:"storage,omitempty"`
	Balance     *big.Int                    `json:"balance" gencodec:"required"`
	Nonce       uint64                      `json:"nonce,omitempty"`
	PrivateKey  []byte                      `json:"secretKey,omitempty"` // for tests
}

GenesisAccount is an account in the state of the genesis block. Either use "constructor" for deployment code or "code" directly for the final code.

func (GenesisAccount) MarshalJSON

func (g GenesisAccount) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*GenesisAccount) UnmarshalJSON

func (g *GenesisAccount) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type GenesisAlloc

type GenesisAlloc map[common.Address]GenesisAccount

GenesisAlloc specifies the initial state that is part of the genesis block.

func (*GenesisAlloc) UnmarshalJSON

func (ga *GenesisAlloc) UnmarshalJSON(data []byte) error

type GenesisMismatchError

type GenesisMismatchError struct {
	Stored, New common.Hash
}

GenesisMismatchError is raised when trying to overwrite an existing genesis block with an incompatible one.

func (*GenesisMismatchError) Error

func (e *GenesisMismatchError) Error() string
type Header struct {
	ParentHash  libcommon.Hash    `json:"parentHash"       gencodec:"required"`
	UncleHash   libcommon.Hash    `json:"sha3Uncles"       gencodec:"required"`
	Coinbase    libcommon.Address `json:"miner"`
	Root        libcommon.Hash    `json:"stateRoot"        gencodec:"required"`
	TxHash      libcommon.Hash    `json:"transactionsRoot" gencodec:"required"`
	ReceiptHash libcommon.Hash    `json:"receiptsRoot"     gencodec:"required"`
	Bloom       Bloom             `json:"logsBloom"        gencodec:"required"`
	Difficulty  *big.Int          `json:"difficulty"       gencodec:"required"`
	Number      *big.Int          `json:"number"           gencodec:"required"`
	GasLimit    uint64            `json:"gasLimit"         gencodec:"required"`
	GasUsed     uint64            `json:"gasUsed"          gencodec:"required"`
	Time        uint64            `json:"timestamp"        gencodec:"required"`
	Extra       []byte            `json:"extraData"        gencodec:"required"`
	MixDigest   libcommon.Hash    `json:"mixHash"` // prevRandao after EIP-4399
	Nonce       BlockNonce        `json:"nonce"`
	// AuRa extensions (alternative to MixDigest & Nonce)
	AuRaStep uint64
	AuRaSeal []byte

	BaseFee         *big.Int        `json:"baseFeePerGas"`   // EIP-1559
	WithdrawalsHash *libcommon.Hash `json:"withdrawalsRoot"` // EIP-4895
	// ExcessDataGas was added by EIP-4844 and is ignored in legacy headers.
	ExcessDataGas *big.Int `json:"excessDataGas"`

	// The verkle proof is ignored in legacy headers
	Verkle        bool
	VerkleProof   []byte
	VerkleKeyVals []verkle.KeyValuePair
}

Header represents a block header in the Ethereum blockchain. DESCRIBED: docs/programmers_guide/guide.md#organising-ethereum-state-into-a-merkle-tree

func CopyHeader

func CopyHeader(h *Header) *Header

CopyHeader creates a deep copy of a block header to prevent side effects from modifying a header variable.

func (*Header) DecodeRLP

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

func (*Header) EncodeRLP

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

func (*Header) EncodingSize

func (h *Header) EncodingSize() int

func (*Header) Hash

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

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

func (Header) MarshalJSON

func (h Header) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*Header) ParentExcessDataGas

func (h *Header) ParentExcessDataGas(getHeader func(hash libcommon.Hash, number uint64) *Header) *big.Int

ParentExcessDataGas is a helper that returns the excess data gas value of the parent block. It returns nil if the parent header could not be fetched, or if the parent block's excess data gas is nil.

func (*Header) SanityCheck

func (h *Header) SanityCheck() error

SanityCheck checks a few basic things -- these checks are way beyond what any 'sane' production values should hold, and can mainly be used to prevent that the unbounded fields are stuffed with junk data to add processing overhead

func (*Header) SetExcessDataGas

func (h *Header) SetExcessDataGas(v *big.Int)

SetExcessDataGas sets the excess_data_gas field in the header

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) UnmarshalJSON

func (h *Header) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

func (*Header) ZkHash

func (h *Header) ZkHash() libcommon.Hash

type KZGCommitment

type KZGCommitment [48]byte

Compressed BLS12-381 G1 element

func (KZGCommitment) ByteLength

func (KZGCommitment) ByteLength() uint64

func (KZGCommitment) ComputeVersionedHash

func (c KZGCommitment) ComputeVersionedHash() libcommon.Hash

func (*KZGCommitment) Deserialize

func (p *KZGCommitment) Deserialize(dr *codec.DecodingReader) error

func (KZGCommitment) FixedLength

func (KZGCommitment) FixedLength() uint64

func (KZGCommitment) MarshalText

func (p KZGCommitment) MarshalText() ([]byte, error)

func (*KZGCommitment) Serialize

func (p *KZGCommitment) Serialize(w *codec.EncodingWriter) error

func (KZGCommitment) String

func (p KZGCommitment) String() string

func (*KZGCommitment) UnmarshalText

func (p *KZGCommitment) UnmarshalText(text []byte) error

type KZGProof

type KZGProof [48]byte

Compressed BLS12-381 G1 element

func (KZGProof) ByteLength

func (KZGProof) ByteLength() uint64

func (*KZGProof) Deserialize

func (p *KZGProof) Deserialize(dr *codec.DecodingReader) error

func (KZGProof) FixedLength

func (KZGProof) FixedLength() uint64

func (KZGProof) MarshalText

func (p KZGProof) MarshalText() ([]byte, error)

func (*KZGProof) Serialize

func (p *KZGProof) Serialize(w *codec.EncodingWriter) error

func (KZGProof) String

func (p KZGProof) String() string

func (*KZGProof) UnmarshalText

func (p *KZGProof) UnmarshalText(text []byte) error

type KZGProofs

type KZGProofs []KZGProof

func (KZGProofs) ByteLength

func (li KZGProofs) ByteLength() uint64

func (*KZGProofs) Deserialize

func (li *KZGProofs) Deserialize(dr *codec.DecodingReader) error

func (KZGProofs) FixedLength

func (li KZGProofs) FixedLength() uint64

func (KZGProofs) Serialize

func (li KZGProofs) Serialize(w *codec.EncodingWriter) error

type LegacyTx

type LegacyTx struct {
	CommonTx
	GasPrice *uint256.Int // wei per gas
}

LegacyTx is the transaction data of regular Ethereum transactions.

func NewBorTransaction

func NewBorTransaction() *LegacyTx

NewBorTransaction create new bor transaction for bor receipt

func NewContractCreation

func NewContractCreation(nonce uint64, amount *uint256.Int, gasLimit uint64, gasPrice *uint256.Int, data []byte) *LegacyTx

NewContractCreation creates an unsigned legacy transaction. Deprecated: use NewTx instead.

func NewTransaction

func NewTransaction(nonce uint64, to libcommon.Address, amount *uint256.Int, gasLimit uint64, gasPrice *uint256.Int, data []byte) *LegacyTx

NewTransaction creates an unsigned legacy transaction. Deprecated: use NewTx instead.

func (LegacyTx) AsMessage

func (tx LegacyTx) AsMessage(s Signer, _ *big.Int, _ *chain.Rules) (Message, error)

AsMessage returns the transaction as a core.Message.

func (LegacyTx) Cost

func (tx LegacyTx) Cost() *uint256.Int

func (*LegacyTx) DecodeRLP

func (tx *LegacyTx) DecodeRLP(s *rlp.Stream, encodingSize uint64) error

DecodeRLP decodes LegacyTx but with the list token already consumed and encodingSize being presented

func (LegacyTx) EncodeRLP

func (tx LegacyTx) EncodeRLP(w io.Writer) error

func (LegacyTx) EncodingSize

func (tx LegacyTx) EncodingSize() int

func (*LegacyTx) FakeSign

func (tx *LegacyTx) FakeSign(address libcommon.Address) (Transaction, error)

func (LegacyTx) GetAccessList

func (tx LegacyTx) GetAccessList() types2.AccessList

func (LegacyTx) GetChainID

func (tx LegacyTx) GetChainID() *uint256.Int

func (LegacyTx) GetEffectiveGasTip

func (tx LegacyTx) GetEffectiveGasTip(baseFee *uint256.Int) *uint256.Int

func (LegacyTx) GetFeeCap

func (tx LegacyTx) GetFeeCap() *uint256.Int

func (LegacyTx) GetPrice

func (tx LegacyTx) GetPrice() *uint256.Int

func (LegacyTx) GetTip

func (tx LegacyTx) GetTip() *uint256.Int

func (*LegacyTx) Hash

func (tx *LegacyTx) Hash() libcommon.Hash

Hash computes the hash (but not for signatures!)

func (LegacyTx) MarshalBinary

func (tx LegacyTx) MarshalBinary(w io.Writer) error

func (LegacyTx) MarshalJSON

func (tx LegacyTx) MarshalJSON() ([]byte, error)

func (LegacyTx) Protected

func (tx LegacyTx) Protected() bool

func (LegacyTx) RawSignatureValues

func (tx LegacyTx) RawSignatureValues() (*uint256.Int, *uint256.Int, *uint256.Int)

func (*LegacyTx) Sender

func (tx *LegacyTx) Sender(signer Signer) (libcommon.Address, error)

func (LegacyTx) SigningHash

func (tx LegacyTx) SigningHash(chainID *big.Int) libcommon.Hash

func (LegacyTx) Type

func (tx LegacyTx) Type() byte

func (*LegacyTx) UnmarshalJSON

func (tx *LegacyTx) UnmarshalJSON(input []byte) error

func (*LegacyTx) WithSignature

func (tx *LegacyTx) WithSignature(signer Signer, sig []byte) (Transaction, error)

type Log

type Log struct {
	// Consensus fields:
	// address of the contract that generated the event
	Address libcommon.Address `json:"address" gencodec:"required" codec:"1"`
	// list of topics provided by the contract.
	Topics []libcommon.Hash `json:"topics" gencodec:"required" codec:"2"`
	// supplied by the contract, usually ABI-encoded
	Data []byte `json:"data" gencodec:"required" codec:"3"`

	// Derived fields. These fields are filled in by the node
	// but not secured by consensus.
	// block in which the transaction was included
	BlockNumber uint64 `json:"blockNumber" codec:"-"`

	// hash of the transaction
	TxHash libcommon.Hash `json:"transactionHash" gencodec:"required" codec:"-"`
	// index of the transaction in the block
	TxIndex uint `json:"transactionIndex" codec:"-"`
	// hash of the block in which the transaction was included
	BlockHash libcommon.Hash `json:"blockHash" codec:"-"`
	// index of the log in the block
	Index uint `json:"logIndex" codec:"-"`

	// The Removed field is true if this log was reverted due to a chain reorganisation.
	// You must pay attention to this field if you receive logs through a filter query.
	Removed bool `json:"removed" codec:"-"`
}

Log represents a contract log event. These events are generated by the LOG opcode and stored/indexed by the node.

func MergeBorLogs

func MergeBorLogs(logs []*Log, borLogs []*Log) []*Log

MergeBorLogs merges receipt logs and block receipt logs

func (*Log) CodecDecodeSelf

func (x *Log) CodecDecodeSelf(d *codec1978.Decoder)

func (*Log) CodecEncodeSelf

func (x *Log) CodecEncodeSelf(e *codec1978.Encoder)

func (*Log) Copy

func (l *Log) Copy() *Log

Copy creates a deep copy of the Log.

func (*Log) DecodeRLP

func (l *Log) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder.

func (*Log) EncodeRLP

func (l *Log) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder.

func (*Log) IsCodecEmpty

func (x *Log) IsCodecEmpty() bool

func (Log) MarshalJSON

func (l Log) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*Log) UnmarshalJSON

func (l *Log) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type LogForStorage

type LogForStorage Log

LogForStorage is a wrapper around a Log that flattens and parses the entire content of a log including non-consensus fields.

func (*LogForStorage) DecodeRLP

func (l *LogForStorage) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder.

Note some redundant fields(e.g. block number, tx hash etc) will be assembled later.

func (*LogForStorage) EncodeRLP

func (l *LogForStorage) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder.

type Logs

type Logs []*Log

func (*Logs) CodecDecodeSelf

func (x *Logs) CodecDecodeSelf(d *codec1978.Decoder)

func (Logs) CodecEncodeSelf

func (x Logs) CodecEncodeSelf(e *codec1978.Encoder)

func (Logs) CointainTopics

func (logs Logs) CointainTopics(addrMap map[libcommon.Address]struct{}, topicsMap map[libcommon.Hash]struct{}) Logs

func (Logs) Filter

func (logs Logs) Filter(addrMap map[libcommon.Address]struct{}, topics [][]libcommon.Hash) Logs

func (Logs) FilterOld

func (logs Logs) FilterOld(addresses map[libcommon.Address]struct{}, topics [][]libcommon.Hash) Logs

type Message

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

Message is a fully derived transaction and implements core.Message

func NewMessage

func NewMessage(from libcommon.Address, to *libcommon.Address, nonce uint64, amount *uint256.Int, gasLimit uint64, gasPrice *uint256.Int, feeCap, tip *uint256.Int, data []byte, accessList types2.AccessList, checkNonce bool, isFree bool) Message

func (Message) AccessList

func (m Message) AccessList() types2.AccessList

func (*Message) ChangeGas

func (m *Message) ChangeGas(globalGasCap, desiredGas uint64)

func (Message) CheckNonce

func (m Message) CheckNonce() bool

func (Message) Data

func (m Message) Data() []byte

func (Message) DataHashes

func (m Message) DataHashes() []libcommon.Hash

func (Message) EffectiveGasPricePercentage

func (m Message) EffectiveGasPricePercentage() uint8

func (Message) FeeCap

func (m Message) FeeCap() *uint256.Int

func (Message) From

func (m Message) From() libcommon.Address

func (Message) Gas

func (m Message) Gas() uint64

func (Message) GasPrice

func (m Message) GasPrice() *uint256.Int

func (Message) IsFree

func (m Message) IsFree() bool

func (Message) Nonce

func (m Message) Nonce() uint64

func (*Message) SetCheckNonce

func (m *Message) SetCheckNonce(checkNonce bool)

func (*Message) SetEffectiveGasPricePercentage

func (m *Message) SetEffectiveGasPricePercentage(effectiveGasPricePercentage uint8)

func (*Message) SetIsFree

func (m *Message) SetIsFree(isFree bool)

func (Message) Tip

func (m Message) Tip() *uint256.Int

func (Message) To

func (m Message) To() *libcommon.Address

func (Message) Value

func (m Message) Value() *uint256.Int

type RawBlock

type RawBlock struct {
	Header *Header
	Body   *RawBody
}

Alternative representation of the Block.

type RawBody

type RawBody struct {
	Transactions [][]byte
	Uncles       []*Header
	Withdrawals  []*Withdrawal
}

RawBody is semi-parsed variant of Body, where transactions are still unparsed RLP strings It is useful in the situations when actual transaction context is not important, for example when downloading Block bodies from other peers or serving them to other peers

func (*RawBody) DecodeRLP

func (rb *RawBody) DecodeRLP(s *rlp.Stream) error

func (RawBody) EncodeRLP

func (rb RawBody) EncodeRLP(w io.Writer) error

func (RawBody) EncodingSize

func (rb RawBody) EncodingSize() int

type Receipt

type Receipt struct {
	// Consensus fields: These fields are defined by the Yellow Paper
	Type              uint8  `json:"type,omitempty"`
	PostState         []byte `json:"root" codec:"1"`
	Status            uint64 `json:"status" codec:"2"`
	CumulativeGasUsed uint64 `json:"cumulativeGasUsed" gencodec:"required" codec:"3"`
	Bloom             Bloom  `json:"logsBloom"         gencodec:"required" codec:"-"`
	Logs              Logs   `json:"logs"              gencodec:"required" codec:"-"`

	// Implementation fields: These fields are added by geth when processing a transaction.
	// They are stored in the chain database.
	TxHash          libcommon.Hash    `json:"transactionHash" gencodec:"required" codec:"-"`
	ContractAddress libcommon.Address `json:"contractAddress" codec:"-"`
	GasUsed         uint64            `json:"gasUsed" gencodec:"required" codec:"-"`

	// Inclusion information: These fields provide information about the inclusion of the
	// transaction corresponding to this receipt.
	BlockHash        libcommon.Hash `json:"blockHash,omitempty" codec:"-"`
	BlockNumber      *big.Int       `json:"blockNumber,omitempty" codec:"-"`
	TransactionIndex uint           `json:"transactionIndex" codec:"-"`
}

Receipt represents the results of a transaction. DESCRIBED: docs/programmers_guide/guide.md#organising-ethereum-state-into-a-merkle-tree

func NewReceipt

func NewReceipt(failed bool, cumulativeGasUsed uint64) *Receipt

NewReceipt creates a barebone transaction receipt, copying the init fields. Deprecated: create receipts using a struct literal instead.

func (*Receipt) CodecDecodeSelf

func (x *Receipt) CodecDecodeSelf(d *codec1978.Decoder)

func (*Receipt) CodecEncodeSelf

func (x *Receipt) CodecEncodeSelf(e *codec1978.Encoder)

func (*Receipt) Copy

func (r *Receipt) Copy() *Receipt

Copy creates a deep copy of the Receipt.

func (*Receipt) DecodeRLP

func (r *Receipt) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and loads the consensus fields of a receipt from an RLP stream.

func (Receipt) EncodeRLP

func (r Receipt) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder, and flattens the consensus fields of a receipt into an RLP stream. If no post state is present, byzantium fork is assumed.

func (*Receipt) IsCodecEmpty

func (x *Receipt) IsCodecEmpty() bool

func (Receipt) MarshalJSON

func (r Receipt) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*Receipt) UnmarshalJSON

func (r *Receipt) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type ReceiptForStorage

type ReceiptForStorage Receipt

ReceiptForStorage is a wrapper around a Receipt that flattens and parses the entire content of a receipt, as opposed to only the consensus fields originally.

func (*ReceiptForStorage) DecodeRLP

func (r *ReceiptForStorage) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder, and loads both consensus and implementation fields of a receipt from an RLP stream.

func (*ReceiptForStorage) EncodeRLP

func (r *ReceiptForStorage) EncodeRLP(w io.Writer) error

EncodeRLP implements rlp.Encoder, and flattens all content fields of a receipt into an RLP stream.

type Receipts

type Receipts []*Receipt

Receipts implements DerivableList for receipts.

func (*Receipts) CodecDecodeSelf

func (x *Receipts) CodecDecodeSelf(d *codec1978.Decoder)

func (Receipts) CodecEncodeSelf

func (x Receipts) CodecEncodeSelf(e *codec1978.Encoder)

func (Receipts) DeriveFields

func (r Receipts) DeriveFields(hash libcommon.Hash, number uint64, txs Transactions, senders []libcommon.Address) error

DeriveFields fills the receipts with their computed fields based on consensus data and contextual infos like containing block and transactions.

func (Receipts) EncodeIndex

func (rs Receipts) EncodeIndex(i int, w *bytes.Buffer)

EncodeIndex encodes the i'th receipt to w.

func (Receipts) Len

func (rs Receipts) Len() int

Len returns the number of receipts in this list.

type ReceiptsForStorage

type ReceiptsForStorage []*ReceiptForStorage

type SignedBlobTx

type SignedBlobTx struct {
	TransactionMisc

	Message   BlobTxMessage
	Signature ECDSASignature
}

func (SignedBlobTx) AsMessage

func (stx SignedBlobTx) AsMessage(s Signer, baseFee *big.Int, rules *chain.Rules) (Message, error)

func (*SignedBlobTx) ByteLength

func (stx *SignedBlobTx) ByteLength() uint64

func (*SignedBlobTx) Cost

func (stx *SignedBlobTx) Cost() *uint256.Int

func (*SignedBlobTx) Deserialize

func (stx *SignedBlobTx) Deserialize(dr *codec.DecodingReader) error

func (SignedBlobTx) EncodeRLP

func (stx SignedBlobTx) EncodeRLP(w io.Writer) error

func (SignedBlobTx) EncodingSize

func (tx SignedBlobTx) EncodingSize() int

func (*SignedBlobTx) FakeSign

func (tx *SignedBlobTx) FakeSign(address libcommon.Address) (Transaction, error)

func (*SignedBlobTx) FixedLength

func (stx *SignedBlobTx) FixedLength() uint64

func (*SignedBlobTx) GetAccessList

func (tx *SignedBlobTx) GetAccessList() types2.AccessList

func (SignedBlobTx) GetAmount

func (stx SignedBlobTx) GetAmount() uint256.Int

func (SignedBlobTx) GetChainID

func (stx SignedBlobTx) GetChainID() *uint256.Int

func (SignedBlobTx) GetData

func (stx SignedBlobTx) GetData() []byte

func (SignedBlobTx) GetDataGas

func (stx SignedBlobTx) GetDataGas() uint64

func (*SignedBlobTx) GetDataHashes

func (stx *SignedBlobTx) GetDataHashes() []libcommon.Hash

func (*SignedBlobTx) GetEffectiveGasTip

func (stx *SignedBlobTx) GetEffectiveGasTip(baseFee *uint256.Int) *uint256.Int

func (SignedBlobTx) GetFeeCap

func (stx SignedBlobTx) GetFeeCap() *uint256.Int

func (SignedBlobTx) GetGas

func (stx SignedBlobTx) GetGas() uint64

func (*SignedBlobTx) GetMaxFeePerDataGas

func (stx *SignedBlobTx) GetMaxFeePerDataGas() *uint256.Int

func (SignedBlobTx) GetNonce

func (stx SignedBlobTx) GetNonce() uint64

func (SignedBlobTx) GetPrice

func (stx SignedBlobTx) GetPrice() *uint256.Int

func (*SignedBlobTx) GetSender

func (stx *SignedBlobTx) GetSender() (libcommon.Address, bool)

func (*SignedBlobTx) GetTip

func (stx *SignedBlobTx) GetTip() *uint256.Int

func (SignedBlobTx) GetTo

func (stx SignedBlobTx) GetTo() *libcommon.Address

func (SignedBlobTx) GetValue

func (stx SignedBlobTx) GetValue() *uint256.Int

func (*SignedBlobTx) Hash

func (stx *SignedBlobTx) Hash() libcommon.Hash

Hash computes the hash (but not for signatures!)

func (*SignedBlobTx) IsContractDeploy

func (stx *SignedBlobTx) IsContractDeploy() bool

func (SignedBlobTx) MarshalBinary

func (tx SignedBlobTx) MarshalBinary(w io.Writer) error

MarshalBinary returns the canonical encoding of the transaction. For legacy transactions, it returns the RLP encoding. For EIP-2718 typed transactions, it returns the type and payload.

func (SignedBlobTx) Protected

func (stx SignedBlobTx) Protected() bool

func (SignedBlobTx) RawSignatureValues

func (tx SignedBlobTx) RawSignatureValues() (v *uint256.Int, r *uint256.Int, s *uint256.Int)

func (*SignedBlobTx) Sender

func (stx *SignedBlobTx) Sender(signer Signer) (libcommon.Address, error)

TODO

func (*SignedBlobTx) Serialize

func (stx *SignedBlobTx) Serialize(w *codec.EncodingWriter) error

func (*SignedBlobTx) SetSender

func (stx *SignedBlobTx) SetSender(addr libcommon.Address)

func (SignedBlobTx) SigningHash

func (stx SignedBlobTx) SigningHash(chainID *big.Int) libcommon.Hash

func (SignedBlobTx) Type

func (stx SignedBlobTx) Type() byte

func (*SignedBlobTx) Unwrap

func (stx *SignedBlobTx) Unwrap() Transaction

func (*SignedBlobTx) WithSignature

func (stx *SignedBlobTx) WithSignature(signer Signer, sig []byte) (Transaction, error)

type Signer

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

Signer encapsulates transaction signature handling. The name of this type is slightly misleading because Signers don't actually sign, they're just for validating and processing of signatures.

Note that this interface is not a stable API and may change at any time to accommodate new protocol rules.

func LatestSigner

func LatestSigner(config *chain.Config) *Signer

LatestSigner returns the 'most permissive' Signer available for the given chain configuration. Specifically, this enables support of EIP-155 replay protection and EIP-2930 access list transactions when their respective forks are scheduled to occur at any block number in the chain config.

Use this in transaction-handling code where the current block number is unknown. If you have the current block number available, use MakeSigner instead.

func LatestSignerForChainID

func LatestSignerForChainID(chainID *big.Int) *Signer

LatestSignerForChainID returns the 'most permissive' Signer available. Specifically, this marks support for EIP-155 replay protection, EIP-2718 typed transactions and EIP-1559 dynamic fee transaction types if chainID is non-nil.

Use this in transaction-handling code where the current block number and fork configuration are unknown. If you have a ChainConfig, use LatestSigner instead. If you have a ChainConfig and know the current block number, use MakeSigner instead.

func MakeFrontierSigner

func MakeFrontierSigner() *Signer

func MakeSigner

func MakeSigner(config *chain.Config, blockNumber uint64) *Signer

MakeSigner returns a Signer based on the given chain config and block number.

func (Signer) ChainID

func (sg Signer) ChainID() *uint256.Int

func (Signer) Equal

func (sg Signer) Equal(other Signer) bool

Equal returns true if the given signer is the same as the receiver.

func (Signer) Sender

func (sg Signer) Sender(tx Transaction) (libcommon.Address, error)

Sender returns the sender address of the transaction.

func (Signer) SenderWithContext

func (sg Signer) SenderWithContext(context *secp256k1.Context, tx Transaction) (libcommon.Address, error)

SenderWithContext returns the sender address of the transaction.

func (Signer) SignatureValues

func (sg Signer) SignatureValues(tx Transaction, sig []byte) (R, S, V *uint256.Int, err error)

SignatureValues returns the raw R, S, V values corresponding to the given signature.

func (Signer) String

func (sg Signer) String() string

type StateSyncData

type StateSyncData struct {
	ID       uint64
	Contract libcommon.Address
	Data     string
	TxHash   libcommon.Hash
}

StateSyncData represents state received from Ethereum Blockchain

type StorageKeysView

type StorageKeysView []libcommon.Hash

func (StorageKeysView) ByteLength

func (skv StorageKeysView) ByteLength() (out uint64)

func (*StorageKeysView) Deserialize

func (skv *StorageKeysView) Deserialize(dr *codec.DecodingReader) error

func (*StorageKeysView) FixedLength

func (skv *StorageKeysView) FixedLength() uint64

func (StorageKeysView) Serialize

func (skv StorageKeysView) Serialize(w *codec.EncodingWriter) error

type Transaction

type Transaction interface {
	Type() byte
	GetChainID() *uint256.Int
	GetNonce() uint64
	GetPrice() *uint256.Int
	GetTip() *uint256.Int
	GetEffectiveGasTip(baseFee *uint256.Int) *uint256.Int
	GetFeeCap() *uint256.Int
	Cost() *uint256.Int
	GetDataHashes() []libcommon.Hash
	GetGas() uint64
	GetValue() *uint256.Int
	Time() time.Time
	GetTo() *libcommon.Address
	AsMessage(s Signer, baseFee *big.Int, rules *chain.Rules) (Message, error)
	WithSignature(signer Signer, sig []byte) (Transaction, error)
	FakeSign(address libcommon.Address) (Transaction, error)
	Hash() libcommon.Hash
	SigningHash(chainID *big.Int) libcommon.Hash
	GetData() []byte
	GetAccessList() types2.AccessList
	Protected() bool
	RawSignatureValues() (*uint256.Int, *uint256.Int, *uint256.Int)
	EncodingSize() int
	EncodeRLP(w io.Writer) error
	MarshalBinary(w io.Writer) error
	// Sender returns the address derived from the signature (V, R, S) using secp256k1
	// elliptic curve and an error if it failed deriving or upon an incorrect
	// signature.
	//
	// Sender may cache the address, allowing it to be used regardless of
	// signing method. The cache is invalidated if the cached signer does
	// not match the signer used in the current call.
	Sender(Signer) (libcommon.Address, error)
	GetSender() (libcommon.Address, bool)
	SetSender(libcommon.Address)
	IsContractDeploy() bool
}

Transaction is an Ethereum transaction.

func DecodeTransaction

func DecodeTransaction(s *rlp.Stream) (Transaction, error)

func DecodeTransactions

func DecodeTransactions(txs [][]byte) ([]Transaction, error)

func MustSignNewTx

func MustSignNewTx(prv *ecdsa.PrivateKey, s Signer, tx Transaction) Transaction

MustSignNewTx creates a transaction and signs it. This panics if the transaction cannot be signed.

func SignNewTx

func SignNewTx(prv *ecdsa.PrivateKey, s Signer, tx Transaction) (Transaction, error)

SignNewTx creates a transaction and signs it.

func SignTx

func SignTx(tx Transaction, s Signer, prv *ecdsa.PrivateKey) (Transaction, error)

SignTx signs the transaction using the given signer and private key.

func UnmarshalTransactionFromBinary

func UnmarshalTransactionFromBinary(data []byte) (Transaction, error)

func UnmarshalTransactionFromJSON

func UnmarshalTransactionFromJSON(input []byte) (Transaction, error)

type TransactionMisc

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

TransactionMisc is collection of miscelaneous fields for transaction that is supposed to be embedded into concrete implementations of different transaction types

func (TransactionMisc) From

func (tm TransactionMisc) From() *atomic.Value

func (TransactionMisc) Time

func (tm TransactionMisc) Time() time.Time

type Transactions

type Transactions []Transaction

Transactions implements DerivableList for transactions.

func CopyTxs

func CopyTxs(in Transactions) Transactions

func TxDifference

func TxDifference(a, b Transactions) Transactions

TxDifference returns a new set which is the difference between a and b.

func (Transactions) EncodeIndex

func (s Transactions) EncodeIndex(i int, w *bytes.Buffer)

EncodeIndex encodes the i'th transaction to w. Note that this does not check for errors because we assume that *Transaction will only ever contain valid txs that were either constructed by decoding or via public API in this package.

func (Transactions) Len

func (s Transactions) Len() int

Len returns the length of s.

type TransactionsByPriceAndNonce

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

TransactionsByPriceAndNonce represents a set of transactions that can return transactions in a profit-maximizing sorted order, while supporting removing entire batches of transactions for non-executable accounts.

func NewTransactionsByPriceAndNonce

func NewTransactionsByPriceAndNonce(signer Signer, txs TransactionsGroupedBySender) *TransactionsByPriceAndNonce

NewTransactionsByPriceAndNonce creates a transaction set that can retrieve price sorted transactions in a nonce-honouring way.

Note, the input map is reowned so the caller should not interact any more with if after providing it to the constructor.

func (*TransactionsByPriceAndNonce) Empty

func (t *TransactionsByPriceAndNonce) Empty() bool

func (*TransactionsByPriceAndNonce) Peek

Peek returns the next transaction by price.

func (*TransactionsByPriceAndNonce) Pop

func (t *TransactionsByPriceAndNonce) Pop()

Pop removes the best transaction, *not* replacing it with the next one from the same account. This should be used when a transaction cannot be executed and hence all subsequent ones should be discarded from the same account.

func (*TransactionsByPriceAndNonce) Shift

func (t *TransactionsByPriceAndNonce) Shift()

Shift replaces the current best head with the next one from the same account.

type TransactionsFixedOrder

type TransactionsFixedOrder struct {
	Transactions
}

TransactionsFixedOrder represents a set of transactions that can return transactions in a profit-maximizing sorted order, while supporting removing entire batches of transactions for non-executable accounts.

func NewTransactionsFixedOrder

func NewTransactionsFixedOrder(txs Transactions) *TransactionsFixedOrder

NewTransactionsFixedOrder creates a transaction set that can retrieve price sorted transactions in a nonce-honouring way.

Note, the input map is reowned so the caller should not interact any more with if after providing it to the constructor.

func (*TransactionsFixedOrder) Empty

func (t *TransactionsFixedOrder) Empty() bool

func (*TransactionsFixedOrder) Peek

Peek returns the next transaction by price.

func (*TransactionsFixedOrder) Pop

func (t *TransactionsFixedOrder) Pop()

Pop removes the best transaction, *not* replacing it with the next one from the same account. This should be used when a transaction cannot be executed and hence all subsequent ones should be discarded from the same account.

func (*TransactionsFixedOrder) Shift

func (t *TransactionsFixedOrder) Shift()

Shift replaces the current best head with the next one from the same account.

type TransactionsGroupedBySender

type TransactionsGroupedBySender []Transactions

TransactionsGroupedBySender - lists of transactions grouped by sender

type TransactionsStream

type TransactionsStream interface {
	Empty() bool
	Peek() Transaction
	Shift()
	Pop()
}

type TxByNonce

type TxByNonce Transactions

TxByNonce implements the sort interface to allow sorting a list of transactions by their nonces. This is usually only useful for sorting transactions from a single account, otherwise a nonce comparison doesn't make much sense.

func (TxByNonce) Len

func (s TxByNonce) Len() int

func (TxByNonce) Less

func (s TxByNonce) Less(i, j int) bool

func (TxByNonce) Swap

func (s TxByNonce) Swap(i, j int)

type TxByPriceAndTime

type TxByPriceAndTime Transactions

TxByPriceAndTime implements both the sort and the heap interface, making it useful for all at once sorting as well as individually adding and removing elements.

func (TxByPriceAndTime) Len

func (s TxByPriceAndTime) Len() int

func (TxByPriceAndTime) Less

func (s TxByPriceAndTime) Less(i, j int) bool

func (*TxByPriceAndTime) Pop

func (s *TxByPriceAndTime) Pop() interface{}

func (*TxByPriceAndTime) Push

func (s *TxByPriceAndTime) Push(x interface{})

func (TxByPriceAndTime) Swap

func (s TxByPriceAndTime) Swap(i, j int)

type TxDataView

type TxDataView []byte

func (TxDataView) ByteLength

func (tdv TxDataView) ByteLength() (out uint64)

func (*TxDataView) Deserialize

func (tdv *TxDataView) Deserialize(dr *codec.DecodingReader) error

func (*TxDataView) FixedLength

func (tdv *TxDataView) FixedLength() uint64

func (TxDataView) MarshalText

func (tdv TxDataView) MarshalText() ([]byte, error)

func (TxDataView) Serialize

func (tdv TxDataView) Serialize(w *codec.EncodingWriter) error

func (TxDataView) String

func (tdv TxDataView) String() string

func (*TxDataView) UnmarshalText

func (tdv *TxDataView) UnmarshalText(text []byte) error

type VersionedHashesView

type VersionedHashesView []libcommon.Hash

func (VersionedHashesView) ByteLength

func (vhv VersionedHashesView) ByteLength() (out uint64)

func (*VersionedHashesView) Deserialize

func (vhv *VersionedHashesView) Deserialize(dr *codec.DecodingReader) error

func (*VersionedHashesView) FixedLength

func (vhv *VersionedHashesView) FixedLength() uint64

func (VersionedHashesView) Serialize

func (vhv VersionedHashesView) Serialize(w *codec.EncodingWriter) error

type Withdrawal

type Withdrawal struct {
	Index     uint64            `json:"index"`          // monotonically increasing identifier issued by consensus layer
	Validator uint64            `json:"validatorIndex"` // index of validator associated with withdrawal
	Address   libcommon.Address `json:"address"`        // target address for withdrawn ether
	Amount    uint64            `json:"amount"`         // value of withdrawal in GWei
}

Withdrawal represents a validator withdrawal from the consensus layer. See EIP-4895: Beacon chain push withdrawals as operations.

func (*Withdrawal) Clone

func (*Withdrawal) Clone() clonable.Clonable

func (*Withdrawal) DecodeRLP

func (obj *Withdrawal) DecodeRLP(s *rlp.Stream) error

func (*Withdrawal) DecodeSSZ

func (obj *Withdrawal) DecodeSSZ(buf []byte) error

func (*Withdrawal) DecodeSSZWithVersion

func (obj *Withdrawal) DecodeSSZWithVersion(buf []byte, _ int) error

func (*Withdrawal) EncodeRLP

func (obj *Withdrawal) EncodeRLP(w io.Writer) error

func (*Withdrawal) EncodeSSZ

func (obj *Withdrawal) EncodeSSZ() []byte

func (*Withdrawal) EncodingSize

func (obj *Withdrawal) EncodingSize() int

func (*Withdrawal) EncodingSizeSSZ

func (obj *Withdrawal) EncodingSizeSSZ() int

func (*Withdrawal) Equal

func (obj *Withdrawal) Equal(other *Withdrawal) bool

func (*Withdrawal) HashSSZ

func (obj *Withdrawal) HashSSZ() ([32]byte, error)

func (Withdrawal) MarshalJSON

func (w Withdrawal) MarshalJSON() ([]byte, error)

MarshalJSON marshals as JSON.

func (*Withdrawal) UnmarshalJSON

func (w *Withdrawal) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals from JSON.

type Withdrawals

type Withdrawals []*Withdrawal

Withdrawals implements DerivableList for withdrawals.

func (Withdrawals) EncodeIndex

func (s Withdrawals) EncodeIndex(i int, w *bytes.Buffer)

EncodeIndex encodes the i'th withdrawal to w. Note that this does not check for errors because we assume that *Withdrawal will only ever contain valid withdrawals that were either constructed by decoding or via public API in this package.

func (Withdrawals) HashSSZ

func (obj Withdrawals) HashSSZ(limit uint64) ([32]byte, error)

HashSSZ hash a serie of withdrawals together given certain limit (16 for ETH1).

func (Withdrawals) Len

func (s Withdrawals) Len() int

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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