Documentation
¶
Index ¶
- Variables
- func AlternateUint256ToUint64(bytes [32]byte) uint64
- func BitAtVector(b []byte, i int) bool
- func BitAtVectorReversed(b []byte, i int) bool
- func CalculatePercentage(value uint64, total uint64) float64
- func ComputeVersionedHash(commitment []byte) common.Hash
- func ConvertPeerIDStringToEnodeID(pidStr string) (enode.ID, error)
- func CustodyColumnSubnets(nodeId enode.ID, custodySubnetCount uint64, ...) (map[uint64]bool, error)
- func CustodyColumnSubnetsSlice(nodeId enode.ID, custodySubnetCount uint64, ...) ([]uint64, error)
- func CustodyColumns(nodeId enode.ID, custodySubnetCount uint64, numberOfColumns uint64, ...) (map[uint64]bool, error)
- func CustodyColumnsSlice(nodeId enode.ID, custodySubnetCount uint64, numberOfColumns uint64, ...) ([]uint64, error)
- func DecodeENR(raw string) (*enr.Record, error)
- func DecodeUint64BitfieldFromQuery(query string, fieldName string) uint64
- func FindMatchingIndices(a, b []uint64) []uint64
- func FormatAddCommas(n uint64) template.HTML
- func FormatAddCommasFormatted(num float64, precision uint) template.HTML
- func FormatAmount(amount *big.Int, unit string, digits int) template.HTML
- func FormatAmountFormatted(amount *big.Int, unit string, digits int, maxPreCommaDigitsBeforeTrim int, ...) template.HTML
- func FormatBaseFee(weiValue uint64) template.HTML
- func FormatBigAmount(amount *hexutil.Big, unit string, digits int) template.HTML
- func FormatBigNumberAddCommasFormatted(val hexutil.Big, precision uint) template.HTML
- func FormatBitlist(b []byte, v []types.NamedValidator) template.HTML
- func FormatBlobFeeDifference(eip7918Value, originalValue uint64) template.HTML
- func FormatByteAmount(bytes uint64) template.HTML
- func FormatBytesAmount(amount []byte, unit string, digits int) template.HTML
- func FormatContractCreationLink(fromAddr []byte, nonce uint64) template.HTML
- func FormatETH(num string) string
- func FormatETHAddCommasFromGwei(gwei uint64) template.HTML
- func FormatETHFromGwei(gwei uint64) string
- func FormatETHFromGweiShort(gwei uint64) string
- func FormatEthAddress(address []byte) template.HTML
- func FormatEthAddressFull(address []byte) string
- func FormatEthAddressFullLink(address []byte) template.HTML
- func FormatEthAddressLink(address []byte) template.HTML
- func FormatEthAddressShort(address []byte, byteCount ...int) template.HTML
- func FormatEthAddressShortLink(address []byte, isContract bool, byteCount ...int) template.HTML
- func FormatEthBlockHashLink(blockHash []byte) template.HTML
- func FormatEthBlockLink(blockNum uint64) template.HTML
- func FormatEthHashShort(hash []byte, byteCount ...int) template.HTML
- func FormatEthTransactionLink(hash []byte, width uint64) template.HTML
- func FormatFloat(num float64, precision int) string
- func FormatFullEthFromGwei(gwei uint64) string
- func FormatGraffiti(graffiti []byte) template.HTML
- func FormatGraffitiString(graffiti string) string
- func FormatGweiValue(val uint64) string
- func FormatHexBytes(data []byte) string
- func FormatHexBytesShort(data []byte, byteCount ...int) template.HTML
- func FormatNFTTokenID(data []byte) string
- func FormatParticipation(v float64) template.HTML
- func FormatRecentTimeShort(ts time.Time) template.HTML
- func FormatRecvDelay(delay int32) template.HTML
- func FormatSlashedValidator(index uint64, name string) template.HTML
- func FormatTokenAmount(amount float64, symbol string) string
- func FormatTransactionFee(ethValue float64) template.HTML
- func FormatTransactionValue(ethValue float64) template.HTML
- func FormatValidator(index uint64, name string) template.HTML
- func FormatValidatorNameWithIndex(index uint64, name string) template.HTML
- func FormatValidatorWithIndex(index uint64, name string) template.HTML
- func FormatWeiAmount(weiStr string) template.HTML
- func FormatWeiDeltaAmount(diffWeiStr string) template.HTML
- func FormatWithdawalCredentials(hash []byte) template.HTML
- func GetBaseFeeAsUint64(baseFee interface{}) uint64
- func GetExplorerVersion() string
- func GetFrontendRPCUrl() string
- func GetKeyValuesFromENR(r *enr.Record) map[string]interface{}
- func GetKeyValuesFromENRFiltered(r *enr.Record) map[string]interface{}
- func GetNodeIDFromENR(r *enr.Record) enode.ID
- func GetRedactedUrl(requrl string) string
- func GetTemplateFuncs() template.FuncMap
- func GraffitiToString(graffiti []byte) string
- func HandleSubroutinePanic(identifier string, restartFn func())
- func IncludeHTML(path string) template.HTML
- func IncludeJSON(obj any, escapeHTML bool) template.HTML
- func LoadGenesisFromPathOrURL(pathOrURL string) (*core.Genesis, error)
- func LogError(err error, errorMsg interface{}, callerSkip int, ...)
- func LogFatal(err error, errorMsg interface{}, callerSkip int, ...)
- func MatchBlobCommitments(versionedHashes []common.Hash, allCommitments []deneb.KZGCommitment) [][]byte
- func MustParseHex(hexString string) []byte
- func ParseSpecMap(data map[string]any) map[string]any
- func ReadConfig(cfg *types.Config, path string) error
- func ShouldSkipSignatureLookup(toAddr []byte, isCreate bool, sysContracts map[common.Address]string) (bool, string)
- func SliceContains(list []string, target string) bool
- func SyncCommitteeParticipation(bits []byte, syncCommitteeSize uint64) float64
- func Uint256ToUint64(bytes [32]byte) uint64
- func WaitForCtrlC()
- type CallTargetResolution
- type DecodedCalldataParam
- func DecodeCalldata(signature string, data []byte) []*DecodedCalldataParam
- func DecodeConsolidationRequestInput(data []byte) []*DecodedCalldataParam
- func DecodePrecompileInput(precompileIndex uint8, data []byte) []*DecodedCalldataParam
- func DecodeWithdrawalRequestInput(data []byte) []*DecodedCalldataParam
- type Dispatcher
- type LogWriter
- type LogWriterHook
- type PrecompileInfo
- type SignatureLookupFunc
- type SignatureLookupResult
- type Subscription
Constants ¶
This section is empty.
Variables ¶
var BuildRelease string
var BuildVersion string
var Buildtime string
var Config *types.Config
Config is the globally accessible configuration
var GWEI *big.Int = big.NewInt(1000000000)
Functions ¶
func AlternateUint256ToUint64 ¶ added in v1.16.0
AlternateUint256ToUint64 converts a [32]byte representation of a uint256 to a uint64 using big.Int
func BitAtVector ¶
func BitAtVectorReversed ¶
func CalculatePercentage ¶ added in v1.16.0
CalculatePercentage calculates the percentage of a value from a total
func ComputeVersionedHash ¶ added in v1.20.3
ComputeVersionedHash computes the versioned hash from a KZG commitment. Per EIP-4844: versioned_hash = 0x01 || SHA256(commitment)[1:]
func ConvertPeerIDStringToEnodeID ¶ added in v1.12.1
ConvertPeerIDStringToEnodeID converts a libp2p peer ID string to an enode.ID.
func CustodyColumnSubnets ¶ added in v1.12.1
func CustodyColumnSubnetsSlice ¶ added in v1.12.1
func CustodyColumns ¶ added in v1.12.1
func CustodyColumns(nodeId enode.ID, custodySubnetCount uint64, numberOfColumns uint64, dataColumnSidecarSubnetCount uint64) (map[uint64]bool, error)
CustodyColumns computes the columns the node should custody. https://github.com/ethereum/consensus-specs/blob/dev/specs/fulu/das-core.md#helper-functions
func CustodyColumnsSlice ¶ added in v1.12.1
func DecodeUint64BitfieldFromQuery ¶ added in v1.19.6
func FindMatchingIndices ¶ added in v1.15.0
FindMatchingIndices returns indices that appear in both slices assumes both slices contain uint64 values
func FormatAddCommas ¶
func FormatAddCommasFormatted ¶ added in v1.14.0
func FormatAmountFormatted ¶
func FormatBaseFee ¶ added in v1.17.0
func FormatBigAmount ¶
func FormatBigNumberAddCommasFormatted ¶ added in v1.14.0
func FormatBitlist ¶
func FormatBitlist(b []byte, v []types.NamedValidator) template.HTML
func FormatBlobFeeDifference ¶ added in v1.19.4
func FormatByteAmount ¶ added in v1.16.0
FormatByteAmount converts a byte count to a human-readable string with appropriate unit (B, kB, MB, GB)
func FormatBytesAmount ¶
func FormatContractCreationLink ¶ added in v1.19.9
FormatContractCreationLink formats a link for a contract creation transaction Shows "New Contract" badge linking to the created contract address
func FormatETHFromGwei ¶
func FormatETHFromGweiShort ¶
func FormatEthAddress ¶
func FormatEthAddressFull ¶ added in v1.19.9
FormatEthAddressFull returns the full 0x-prefixed Ethereum address from bytes
func FormatEthAddressFullLink ¶ added in v1.19.9
FormatEthAddressFullLink returns the full Ethereum address with a link
func FormatEthAddressLink ¶
func FormatEthAddressShort ¶ added in v1.19.9
FormatEthAddressShort formats an Ethereum address in short form: 0xcBA360df…60ebC2d32 The bytes parameter specifies how many bytes (hex char pairs) to show on each side (default 4)
func FormatEthAddressShortLink ¶ added in v1.19.9
FormatEthAddressShortLink formats an Ethereum address as a short link with optional contract icon isContract: whether to show the contract icon prefix byteCount: how many bytes (hex char pairs) to show on each side (default 4)
func FormatEthBlockHashLink ¶
func FormatEthBlockLink ¶
func FormatEthHashShort ¶ added in v1.19.9
FormatEthHashShort formats an Ethereum hash (tx hash, block hash) in short form
func FormatFloat ¶
func FormatFullEthFromGwei ¶ added in v1.16.0
func FormatGraffiti ¶
func FormatGraffitiString ¶
FormatGraffitiString formats (and escapes) the graffiti
func FormatGweiValue ¶ added in v1.16.0
FormatGweiValue formats a gas value in Gwei
func FormatHexBytes ¶ added in v1.19.9
FormatHexBytes formats a byte slice as a 0x-prefixed hex string
func FormatHexBytesShort ¶ added in v1.20.3
FormatHexBytesShort formats bytes as a 0x-prefixed hex string truncated in the middle: e.g. 0x1234abcd…c0ffee. The bytes parameter specifies how many bytes (hex pairs) to show on each side (default 4).
func FormatNFTTokenID ¶ added in v1.19.9
FormatNFTTokenID formats a byte slice as a decimal NFT token ID
func FormatParticipation ¶
func FormatRecvDelay ¶ added in v1.17.0
func FormatTokenAmount ¶ added in v1.19.9
FormatTokenAmount formats a token amount with full precision, trimming trailing zeros
func FormatTransactionFee ¶ added in v1.20.0
FormatTransactionFee formats a transaction fee in ETH with intelligent rounding. Cuts off decimals after 3 non-zero decimals, with min 6 decimals. Examples: 0.123456789 => 0.123456, 0.000023456244 => 0.0000234 Does not include the unit (designed for table columns where space is limited).
func FormatTransactionValue ¶ added in v1.19.4
func FormatValidatorNameWithIndex ¶ added in v1.13.0
func FormatWeiAmount ¶ added in v1.20.3
FormatWeiAmount formats a wei amount (passed as a base-10 string) into wei/gwei/ETH depending on magnitude, keeping precision (no float rounding).
Heuristics mirror FormatBaseFee: - < 100000 wei -> show in wei - < 100000 gwei -> show in gwei (6 decimals, trimmed) - otherwise -> show in ETH (6 decimals, trimmed)
func FormatWeiDeltaAmount ¶ added in v1.20.3
FormatWeiDeltaAmount formats a signed wei delta (base-10 string) into wei/gwei/ETH with a + or - prefix (no float rounding).
func GetBaseFeeAsUint64 ¶ added in v1.16.0
func GetBaseFeeAsUint64(baseFee interface{}) uint64
GetBaseFeeAsUint64 is a generic function that converts any BaseFeePerGas type to uint64 It handles both [32]byte and objects with Uint64() method
func GetExplorerVersion ¶
func GetExplorerVersion() string
func GetFrontendRPCUrl ¶ added in v1.19.1
func GetFrontendRPCUrl() string
GetFrontendRPCUrl returns the appropriate RPC URL for the frontend. If RPC proxy is enabled, it returns the local proxy endpoint. Otherwise, it returns the configured public RPC URL.
func GetKeyValuesFromENR ¶ added in v1.11.2
func GetKeyValuesFromENRFiltered ¶ added in v1.18.2
func GetRedactedUrl ¶
func GetTemplateFuncs ¶
GetTemplateFuncs will get the template functions
func GraffitiToString ¶
func HandleSubroutinePanic ¶
func HandleSubroutinePanic(identifier string, restartFn func())
func IncludeJSON ¶ added in v1.12.1
IncludeJSON adds json to the page
func LoadGenesisFromPathOrURL ¶ added in v1.19.0
LoadGenesisFromPathOrURL loads a genesis config from either a local file path or HTTP/HTTPS URL
func LogError ¶
func LogError(err error, errorMsg interface{}, callerSkip int, additionalInfos ...map[string]interface{})
LogError logs an error with callstack info that skips callerSkip many levels with arbitrarily many additional infos. callerSkip equal to 0 gives you info directly where LogError is called.
func LogFatal ¶
func LogFatal(err error, errorMsg interface{}, callerSkip int, additionalInfos ...map[string]interface{})
LogFatal logs a fatal error with callstack info that skips callerSkip many levels with arbitrarily many additional infos. callerSkip equal to 0 gives you info directly where LogFatal is called.
func MatchBlobCommitments ¶ added in v1.20.3
func MatchBlobCommitments(versionedHashes []common.Hash, allCommitments []deneb.KZGCommitment) [][]byte
MatchBlobCommitments finds the KZG commitments from the block that match the given versioned hashes from a transaction. Since blob commitments in the block are ordered across all transactions, we need to find the ones belonging to this transaction by matching versioned hashes.
func MustParseHex ¶
MustParseHex will parse a string into hex
func ReadConfig ¶
ReadConfig will process a configuration
func ShouldSkipSignatureLookup ¶ added in v1.20.3
func ShouldSkipSignatureLookup(toAddr []byte, isCreate bool, sysContracts map[common.Address]string) (bool, string)
ShouldSkipSignatureLookup checks if a function signature lookup should be skipped for the given target address. Returns (shouldSkip, alternativeName). The sysContracts map should be obtained from ChainService.GetSystemContractAddresses().
func SliceContains ¶
sliceContains reports whether the provided string is present in the given slice of strings.
func Uint256ToUint64 ¶ added in v1.16.0
Uint256ToUint64 converts a [32]byte representation of a uint256 to a uint64
Types ¶
type CallTargetResolution ¶ added in v1.20.3
type CallTargetResolution struct {
CallType string // "call", "deploy", "precompile", "system"
CallName string // Precompile or system contract name
MethodName string // Resolved method name
MethodID []byte // 4-byte method selector (if applicable)
MethodSignature string // Full function signature (if resolved)
DecodedCalldata []*DecodedCalldataParam // Decoded calldata params (if available)
}
CallTargetResolution holds the result of resolving a call target type and method information for a transaction.
func ResolveCallTargetAndMethod ¶ added in v1.20.3
func ResolveCallTargetAndMethod( toAddr []byte, isCreate bool, inputData []byte, methodID []byte, sysContracts map[common.Address]string, lookupSignature SignatureLookupFunc, ) *CallTargetResolution
ResolveCallTargetAndMethod determines the call target type and resolves the method name. For deployments, precompiles, and non-deposit system contracts, the function signature lookup is skipped. For normal contract calls, the signature is looked up via the provided callback and calldata is optionally ABI-decoded.
type DecodedCalldataParam ¶ added in v1.20.3
type DecodedCalldataParam struct {
Name string `json:"name"`
Type string `json:"type"`
Value string `json:"value"`
}
DecodedCalldataParam represents a single decoded parameter from calldata.
func DecodeCalldata ¶ added in v1.20.3
func DecodeCalldata(signature string, data []byte) []*DecodedCalldataParam
DecodeCalldata decodes calldata using a full function signature (e.g., "transfer(address,uint256)"). Returns nil if decoding fails.
func DecodeConsolidationRequestInput ¶ added in v1.20.3
func DecodeConsolidationRequestInput(data []byte) []*DecodedCalldataParam
DecodeConsolidationRequestInput decodes EIP-7251 consolidation request calldata. Format: 48 bytes source pubkey + 48 bytes target pubkey.
func DecodePrecompileInput ¶ added in v1.20.3
func DecodePrecompileInput(precompileIndex uint8, data []byte) []*DecodedCalldataParam
DecodePrecompileInput decodes known precompile input data.
func DecodeWithdrawalRequestInput ¶ added in v1.20.3
func DecodeWithdrawalRequestInput(data []byte) []*DecodedCalldataParam
DecodeWithdrawalRequestInput decodes EIP-7002 withdrawal request calldata. Format: 48 bytes validator pubkey + 8 bytes amount (big-endian).
type Dispatcher ¶ added in v1.17.0
type Dispatcher[T any] struct { // contains filtered or unexported fields }
func (*Dispatcher[T]) Fire ¶ added in v1.17.0
func (d *Dispatcher[T]) Fire(data T)
func (*Dispatcher[T]) Subscribe ¶ added in v1.17.0
func (d *Dispatcher[T]) Subscribe(capacity int, blocking bool) *Subscription[T]
func (*Dispatcher[T]) Unsubscribe ¶ added in v1.17.0
func (d *Dispatcher[T]) Unsubscribe(subscription *Subscription[T])
type LogWriter ¶
type LogWriter struct {
// contains filtered or unexported fields
}
func InitLogger ¶
func InitLogger() (*LogWriter, logrus.FieldLogger)
type LogWriterHook ¶
WriterHook is a hook that writes logs of specified LogLevels to specified Writer
func (*LogWriterHook) Fire ¶
func (hook *LogWriterHook) Fire(entry *logrus.Entry) error
Fire will be called when some logging function is called with current hook It will format log entry to string and write it to appropriate writer
func (*LogWriterHook) Levels ¶
func (hook *LogWriterHook) Levels() []logrus.Level
type PrecompileInfo ¶ added in v1.20.3
PrecompileInfo describes a known precompile contract.
func GetPrecompileInfo ¶ added in v1.20.3
func GetPrecompileInfo(addr []byte) *PrecompileInfo
GetPrecompileInfo checks if the given 20-byte address is a precompile. A precompile address has all-zero bytes except the last byte, which is in range [0x01, maxPrecompileIndex].
type SignatureLookupFunc ¶ added in v1.20.3
type SignatureLookupFunc func(methodID [4]byte) *SignatureLookupResult
SignatureLookupFunc is a callback for looking up function signatures by their 4-byte selector. Implementations typically query a signature database.
type SignatureLookupResult ¶ added in v1.20.3
SignatureLookupResult holds the result of a function signature lookup.
type Subscription ¶ added in v1.17.0
type Subscription[T any] struct { // contains filtered or unexported fields }
func (*Subscription[T]) Channel ¶ added in v1.17.0
func (s *Subscription[T]) Channel() <-chan T
func (*Subscription[T]) Unsubscribe ¶ added in v1.17.0
func (s *Subscription[T]) Unsubscribe()