query

package
v6.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PopulateVariableLengthInfo

func PopulateVariableLengthInfo(sszInfo *SszInfo, value reflect.Value) error

PopulateVariableLengthInfo populates runtime information for SSZ fields of variable-sized types. This function updates the SszInfo structure with actual lengths and offsets that can only be determined at runtime for variable-sized items like Lists and variable-sized Container fields.

Types

type PathElement

type PathElement struct {
	Name string
	// [Optional] Index for List/Vector elements
	Index *uint64
}

PathElement represents a single element in a path.

func ParsePath

func ParsePath(rawPath string) ([]PathElement, error)

type SSZDimension

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

SSZDimension holds parsed SSZ tag information for current dimension. Mutually exclusive fields indicate whether the dimension is a vector or a list.

func ParseSSZTag

func ParseSSZTag(tag *reflect.StructTag) (*SSZDimension, *reflect.StructTag, error)

ParseSSZTag parses SSZ-specific tags (like `ssz-max` and `ssz-size`) and returns the first dimension and the remaining SSZ tags. This function validates the tags and returns an error if they are malformed.

func (*SSZDimension) GetListLimit

func (d *SSZDimension) GetListLimit() (uint64, error)

GetListLimit returns the limit for a list in current dimension

func (*SSZDimension) GetVectorLength

func (d *SSZDimension) GetVectorLength() (uint64, error)

GetVectorLength returns the length for a vector in current dimension

func (*SSZDimension) IsList

func (d *SSZDimension) IsList() bool

IsList returns true if this dimension represents a list.

func (*SSZDimension) IsVector

func (d *SSZDimension) IsVector() bool

IsVector returns true if this dimension represents a vector.

type SSZObject added in v6.1.3

type SSZObject interface {
	HashTreeRoot() ([32]byte, error)
	SizeSSZ() int
}

type SSZType

type SSZType int

SSZType represents the type supported by SSZ. https://github.com/ethereum/consensus-specs/blob/master/ssz/simple-serialize.md#typing

const (
	// Basic types
	Uint8 SSZType = iota
	Uint16
	Uint32
	Uint64
	Boolean

	// Composite types
	Container
	Vector
	List
	Bitvector
	Bitlist

	// Added in EIP-7916
	ProgressiveList
	Union
)

SSZ type constants.

func (SSZType) String

func (t SSZType) String() string

type SszInfo added in v6.1.4

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

SszInfo holds the all necessary data for analyzing SSZ data types.

func AnalyzeObject

func AnalyzeObject(obj SSZObject) (*SszInfo, error)

AnalyzeObject analyzes given object and returns its SSZ information.

func CalculateOffsetAndLength

func CalculateOffsetAndLength(sszInfo *SszInfo, path []PathElement) (*SszInfo, uint64, uint64, error)

CalculateOffsetAndLength calculates the offset and length of a given path within the SSZ object. By walking the given path, it accumulates the offsets based on SszInfo.

func (*SszInfo) BitlistInfo added in v6.1.4

func (info *SszInfo) BitlistInfo() (*bitlistInfo, error)

func (*SszInfo) BitvectorInfo added in v6.1.4

func (info *SszInfo) BitvectorInfo() (*bitvectorInfo, error)

func (*SszInfo) ContainerInfo added in v6.1.4

func (info *SszInfo) ContainerInfo() (*containerInfo, error)

func (*SszInfo) HashTreeRoot added in v6.1.4

func (info *SszInfo) HashTreeRoot() ([32]byte, error)

HashTreeRoot calls the HashTreeRoot method on the stored interface if it implements SSZObject. Returns the 32-byte hash tree root or an error if the interface doesn't support hashing.

func (*SszInfo) ListInfo added in v6.1.4

func (info *SszInfo) ListInfo() (*listInfo, error)

func (*SszInfo) Print added in v6.1.4

func (info *SszInfo) Print() string

Print returns a string representation of the SszInfo, which is useful for debugging.

func (*SszInfo) Size added in v6.1.4

func (info *SszInfo) Size() uint64

func (*SszInfo) String added in v6.1.4

func (info *SszInfo) String() string

String implements the Stringer interface for SszInfo. This follows the notation used in the consensus specs.

func (*SszInfo) VectorInfo added in v6.1.4

func (info *SszInfo) VectorInfo() (*vectorInfo, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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