primitives

package
v0.1.0-experimental.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxTxsPerPayloadLength defines the maximum number of transactions that
	// can
	// be included in a payload.
	MaxTxsPerPayloadLength = 1048576
	// MaxBytesPerTxLength defines the maximum number of bytes that can be
	// included
	// in a transaction.
	MaxBytesPerTxLength = 1073741824
	// MaxWithdrawalsPerPayloadLength defines the
	// maximum number of withdrawals that can be included in a payload.
	MaxWithdrawalsPerPayload = 16
)
View Source
const (
	HashRootLength = 32
)

Variables

View Source
var ErrInvalidBufferSize = errors.New("invalid buffer size")

ErrInvalidBufferSize indicates that the provided buffer size is invalid.

Functions

This section is empty.

Types

type Epoch

type Epoch = uint64

Epoch represents a single epoch. We don't really use epochs in BeaconKit. But we keep them around for compatibility with the Ethereum 2.0 spec.

type ExecutionAddress

type ExecutionAddress = common.Address

ExecutionAddress represents an address on the execution layer which is derived via secp256k1 w/recovery bit.

Related: https://eips.ethereum.org/EIPS/eip-55

type ExecutionHash

type ExecutionHash = common.Hash

ExecutionHash represents a hash on the execution layer which is currently a Keccak256 hash.

type HashRoot

type HashRoot [HashRootLength]byte

HashRoot is a 32-byte root of a hash tree structure.

type SSZEpoch

type SSZEpoch Epoch

func (SSZEpoch) HashTreeRoot

func (e SSZEpoch) HashTreeRoot() (HashRoot, error)

HashTreeRoot return the merklized epoch, represented as bytes in little endian, padded on the right side with zeroed bytes to a total of 32 bytes.

type SSZUInt256

type SSZUInt256 []byte

SSZUInt256 represents a ssz-able uint64.

func (*SSZUInt256) Big

func (s *SSZUInt256) Big() *big.Int

Big converts an SSZUInt256 to a big.Int.

func (SSZUInt256) MarshalJSON

func (s SSZUInt256) MarshalJSON() ([]byte, error)

MarshalJSON marshals a SSZUInt256 to JSON, it flips the endianness before encoding it to hex.

func (*SSZUInt256) UInt256

func (s *SSZUInt256) UInt256() *uint256.Int

UInt256 converts an SSZUInt256 to a uint256.Int.

func (*SSZUInt256) UnmarshalJSON

func (s *SSZUInt256) UnmarshalJSON(input []byte) error

UnmarshalJSON unmarshals a SSZUInt256 from JSON by decoding the hex string and flipping the endianness.

type Slot

type Slot = uint64

Slot is just a nice alias for a uint64.

type ValidatorIndex

type ValidatorIndex = uint64

ValidatorIndex represents a validator index in the beacon chain.

Jump to

Keyboard shortcuts

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