types

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attestation

type Attestation struct {
	AggregationBits []byte
	Attesters       []uint64
	Data            *AttestationData
	Signature       []byte
}

Attestation is a struct to hold attestation header data

type AttestationData

type AttestationData struct {
	Slot            uint64
	CommitteeIndex  uint64
	BeaconBlockRoot []byte
	Source          *Checkpoint
	Target          *Checkpoint
}

AttestationData to hold attestation detail data

type AttesterSlashing

type AttesterSlashing struct {
	Attestation1 *IndexedAttestation
	Attestation2 *IndexedAttestation
}

AttesterSlashing is a struct to hold attester slashing

type BLSToExecutionChange

type BLSToExecutionChange struct {
	Validatorindex uint64
	BlsPubkey      []byte
	Address        []byte
}

type Block

type Block struct {
	Status                     uint64
	Proposer                   uint64
	BlockRoot                  []byte
	Slot                       uint64
	ParentRoot                 []byte
	StateRoot                  []byte
	Signature                  []byte
	RandaoReveal               []byte
	Graffiti                   []byte
	Eth1Data                   *Eth1Data
	BodyRoot                   []byte
	ProposerSlashings          []*ProposerSlashing
	AttesterSlashings          []*AttesterSlashing
	Attestations               []*Attestation
	Deposits                   []*Deposit
	VoluntaryExits             []*VoluntaryExit
	SyncAggregate              *SyncAggregate    // warning: sync aggregate may be nil, for phase0 blocks
	ExecutionPayload           *ExecutionPayload // warning: payload may be nil, for phase0/altair blocks
	Canonical                  bool
	SignedBLSToExecutionChange []*SignedBLSToExecutionChange
}

Block is a struct to hold block data

type ChainConfig

type ChainConfig struct {
	PresetBase                       string `yaml:"PRESET_BASE"`
	ConfigName                       string `yaml:"CONFIG_NAME"`
	TerminalTotalDifficulty          string `yaml:"TERMINAL_TOTAL_DIFFICULTY"`
	TerminalBlockHash                string `yaml:"TERMINAL_BLOCK_HASH"`
	TerminalBlockHashActivationEpoch uint64 `yaml:"TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH"`
	MinGenesisActiveValidatorCount   uint64 `yaml:"MIN_GENESIS_ACTIVE_VALIDATOR_COUNT"`
	MinGenesisTime                   int64  `yaml:"MIN_GENESIS_TIME"`
	GenesisForkVersion               string `yaml:"GENESIS_FORK_VERSION"`
	GenesisDelay                     uint64 `yaml:"GENESIS_DELAY"`
	AltairForkVersion                string `yaml:"ALTAIR_FORK_VERSION"`
	AltairForkEpoch                  uint64 `yaml:"ALTAIR_FORK_EPOCH"`
	BellatrixForkVersion             string `yaml:"BELLATRIX_FORK_VERSION"`
	BellatrixForkEpoch               uint64 `yaml:"BELLATRIX_FORK_EPOCH"`
	CappellaForkVersion              string `yaml:"CAPELLA_FORK_VERSION"`
	CappellaForkEpoch                uint64 `yaml:"CAPELLA_FORK_EPOCH"`
	DenebForkVersion                 string `yaml:"DENEB_FORK_VERSION"`
	DenebForkEpoch                   uint64 `yaml:"DENEB_FORK_EPOCH"`
	ShardingForkVersion              string `yaml:"SHARDING_FORK_VERSION"`
	ShardingForkEpoch                uint64 `yaml:"SHARDING_FORK_EPOCH"`
	SecondsPerSlot                   uint64 `yaml:"SECONDS_PER_SLOT"`
	SecondsPerEth1Block              uint64 `yaml:"SECONDS_PER_ETH1_BLOCK"`
	MinValidatorWithdrawabilityDelay uint64 `yaml:"MIN_VALIDATOR_WITHDRAWABILITY_DELAY"`
	ShardCommitteePeriod             uint64 `yaml:"SHARD_COMMITTEE_PERIOD"`
	Eth1FollowDistance               uint64 `yaml:"ETH1_FOLLOW_DISTANCE"`
	InactivityScoreBias              uint64 `yaml:"INACTIVITY_SCORE_BIAS"`
	InactivityScoreRecoveryRate      uint64 `yaml:"INACTIVITY_SCORE_RECOVERY_RATE"`
	EjectionBalance                  uint64 `yaml:"EJECTION_BALANCE"`
	MinPerEpochChurnLimit            uint64 `yaml:"MIN_PER_EPOCH_CHURN_LIMIT"`
	ChurnLimitQuotient               uint64 `yaml:"CHURN_LIMIT_QUOTIENT"`
	ProposerScoreBoost               uint64 `yaml:"PROPOSER_SCORE_BOOST"`
	DepositChainID                   uint64 `yaml:"DEPOSIT_CHAIN_ID"`
	DepositNetworkID                 uint64 `yaml:"DEPOSIT_NETWORK_ID"`
	DepositContractAddress           string `yaml:"DEPOSIT_CONTRACT_ADDRESS"`

	// phase0
	// https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/phase0.yaml
	MaxCommitteesPerSlot           uint64 `yaml:"MAX_COMMITTEES_PER_SLOT"`
	TargetCommitteeSize            uint64 `yaml:"TARGET_COMMITTEE_SIZE"`
	MaxValidatorsPerCommittee      uint64 `yaml:"MAX_VALIDATORS_PER_COMMITTEE"`
	ShuffleRoundCount              uint64 `yaml:"SHUFFLE_ROUND_COUNT"`
	HysteresisQuotient             uint64 `yaml:"HYSTERESIS_QUOTIENT"`
	HysteresisDownwardMultiplier   uint64 `yaml:"HYSTERESIS_DOWNWARD_MULTIPLIER"`
	HysteresisUpwardMultiplier     uint64 `yaml:"HYSTERESIS_UPWARD_MULTIPLIER"`
	SafeSlotsToUpdateJustified     uint64 `yaml:"SAFE_SLOTS_TO_UPDATE_JUSTIFIED"`
	MinDepositAmount               uint64 `yaml:"MIN_DEPOSIT_AMOUNT"`
	MaxEffectiveBalance            uint64 `yaml:"MAX_EFFECTIVE_BALANCE"`
	EffectiveBalanceIncrement      uint64 `yaml:"EFFECTIVE_BALANCE_INCREMENT"`
	MinAttestationInclusionDelay   uint64 `yaml:"MIN_ATTESTATION_INCLUSION_DELAY"`
	SlotsPerEpoch                  uint64 `yaml:"SLOTS_PER_EPOCH"`
	MinSeedLookahead               uint64 `yaml:"MIN_SEED_LOOKAHEAD"`
	MaxSeedLookahead               uint64 `yaml:"MAX_SEED_LOOKAHEAD"`
	EpochsPerEth1VotingPeriod      uint64 `yaml:"EPOCHS_PER_ETH1_VOTING_PERIOD"`
	SlotsPerHistoricalRoot         uint64 `yaml:"SLOTS_PER_HISTORICAL_ROOT"`
	MinEpochsToInactivityPenalty   uint64 `yaml:"MIN_EPOCHS_TO_INACTIVITY_PENALTY"`
	EpochsPerHistoricalVector      uint64 `yaml:"EPOCHS_PER_HISTORICAL_VECTOR"`
	EpochsPerSlashingsVector       uint64 `yaml:"EPOCHS_PER_SLASHINGS_VECTOR"`
	HistoricalRootsLimit           uint64 `yaml:"HISTORICAL_ROOTS_LIMIT"`
	ValidatorRegistryLimit         uint64 `yaml:"VALIDATOR_REGISTRY_LIMIT"`
	BaseRewardFactor               uint64 `yaml:"BASE_REWARD_FACTOR"`
	WhistleblowerRewardQuotient    uint64 `yaml:"WHISTLEBLOWER_REWARD_QUOTIENT"`
	ProposerRewardQuotient         uint64 `yaml:"PROPOSER_REWARD_QUOTIENT"`
	InactivityPenaltyQuotient      uint64 `yaml:"INACTIVITY_PENALTY_QUOTIENT"`
	MinSlashingPenaltyQuotient     uint64 `yaml:"MIN_SLASHING_PENALTY_QUOTIENT"`
	ProportionalSlashingMultiplier uint64 `yaml:"PROPORTIONAL_SLASHING_MULTIPLIER"`
	MaxProposerSlashings           uint64 `yaml:"MAX_PROPOSER_SLASHINGS"`
	MaxAttesterSlashings           uint64 `yaml:"MAX_ATTESTER_SLASHINGS"`
	MaxAttestations                uint64 `yaml:"MAX_ATTESTATIONS"`
	MaxDeposits                    uint64 `yaml:"MAX_DEPOSITS"`
	MaxVoluntaryExits              uint64 `yaml:"MAX_VOLUNTARY_EXITS"`

	// altair
	// https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/altair.yaml
	InvactivityPenaltyQuotientAltair     uint64 `yaml:"INACTIVITY_PENALTY_QUOTIENT_ALTAIR"`
	MinSlashingPenaltyQuotientAltair     uint64 `yaml:"MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR"`
	ProportionalSlashingMultiplierAltair uint64 `yaml:"PROPORTIONAL_SLASHING_MULTIPLIER_ALTAIR"`
	SyncCommitteeSize                    uint64 `yaml:"SYNC_COMMITTEE_SIZE"`
	EpochsPerSyncCommitteePeriod         uint64 `yaml:"EPOCHS_PER_SYNC_COMMITTEE_PERIOD"`
	MinSyncCommitteeParticipants         uint64 `yaml:"MIN_SYNC_COMMITTEE_PARTICIPANTS"`

	// bellatrix
	// https://github.com/ethereum/consensus-specs/blob/dev/presets/mainnet/bellatrix.yaml
	InvactivityPenaltyQuotientBellatrix     uint64 `yaml:"INACTIVITY_PENALTY_QUOTIENT_BELLATRIX"`
	MinSlashingPenaltyQuotientBellatrix     uint64 `yaml:"MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX"`
	ProportionalSlashingMultiplierBellatrix uint64 `yaml:"PROPORTIONAL_SLASHING_MULTIPLIER_BELLATRIX"`
	MaxBytesPerTransaction                  uint64 `yaml:"MAX_BYTES_PER_TRANSACTION"`
	MaxTransactionsPerPayload               uint64 `yaml:"MAX_TRANSACTIONS_PER_PAYLOAD"`
	BytesPerLogsBloom                       uint64 `yaml:"BYTES_PER_LOGS_BLOOM"`
	MaxExtraDataBytes                       uint64 `yaml:"MAX_EXTRA_DATA_BYTES"`

	// capella
	// https://github.com/ethereum/consensus-specs/blob/dev/presets/minimal/capella.yaml
	MaxWithdrawalsPerPayload        uint64 `yaml:"MAX_WITHDRAWALS_PER_PAYLOAD"`
	MaxValidatorsPerWithdrawalSweep uint64 `yaml:"MAX_VALIDATORS_PER_WITHDRAWALS_SWEEP"`
	MaxBlsToExecutionChange         uint64 `yaml:"MAX_BLS_TO_EXECUTION_CHANGES"`
}

https://github.com/ethereum/consensus-specs/blob/dev/configs/mainnet.yaml

type Checkpoint

type Checkpoint struct {
	Epoch uint64
	Root  []byte
}

Checkpoint is a struct to hold checkpoint data

type Config

type Config struct {
	Logging struct {
		OutputLevel  string `yaml:"outputLevel" envconfig:"LOGGING_OUTPUT_LEVEL"`
		OutputStderr bool   `yaml:"outputStderr" envconfig:"LOGGING_OUTPUT_STDERR"`

		FilePath  string `yaml:"filePath" envconfig:"LOGGING_FILE_PATH"`
		FileLevel string `yaml:"fileLevel" envconfig:"LOGGING_FILE_LEVEL"`
	} `yaml:"logging"`

	Server struct {
		Port string `yaml:"port" envconfig:"FRONTEND_SERVER_PORT"`
		Host string `yaml:"host" envconfig:"FRONTEND_SERVER_HOST"`
	} `yaml:"server"`

	Chain struct {
		Name             string `yaml:"name" envconfig:"CHAIN_NAME"`
		DisplayName      string `yaml:"displayName" envconfig:"CHAIN_DISPLAY_NAME"`
		GenesisTimestamp uint64 `yaml:"genesisTimestamp" envconfig:"CHAIN_GENESIS_TIMESTAMP"`
		ConfigPath       string `yaml:"configPath" envconfig:"CHAIN_CONFIG_PATH"`
		Config           ChainConfig

		// optional features
		WhiskForkEpoch *uint64 `yaml:"whiskForkEpoch" envconfig:"WHISK_FORK_EPOCH"`
	} `yaml:"chain"`

	Frontend struct {
		Enabled bool `yaml:"enabled" envconfig:"FRONTEND_ENABLED"`
		Debug   bool `yaml:"debug" envconfig:"FRONTEND_DEBUG"`
		Minify  bool `yaml:"minify" envconfig:"FRONTEND_MINIFY"`

		SiteDomain   string `yaml:"siteDomain" envconfig:"FRONTEND_SITE_DOMAIN"`
		SiteName     string `yaml:"siteName" envconfig:"FRONTEND_SITE_NAME"`
		SiteSubtitle string `yaml:"siteSubtitle" envconfig:"FRONTEND_SITE_SUBTITLE"`

		EthExplorerLink         string `yaml:"ethExplorerLink" envconfig:"FRONTEND_ETH_EXPLORER_LINK"`
		ValidatorNamesYaml      string `yaml:"validatorNamesYaml" envconfig:"FRONTEND_VALIDATOR_NAMES_YAML"`
		ValidatorNamesInventory string `yaml:"validatorNamesInventory" envconfig:"FRONTEND_VALIDATOR_NAMES_INVENTORY"`

		HttpReadTimeout  time.Duration `yaml:"httpReadTimeout" envconfig:"FRONTEND_HTTP_READ_TIMEOUT"`
		HttpWriteTimeout time.Duration `yaml:"httpWriteTimeout" envconfig:"FRONTEND_HTTP_WRITE_TIMEOUT"`
		HttpIdleTimeout  time.Duration `yaml:"httpIdleTimeout" envconfig:"FRONTEND_HTTP_IDLE_TIMEOUT"`
	} `yaml:"frontend"`

	BeaconApi struct {
		Endpoint  string           `yaml:"endpoint" envconfig:"BEACONAPI_ENDPOINT"`
		Endpoints []EndpointConfig `yaml:"endpoints"`

		LocalCacheSize       int    `yaml:"localCacheSize" envconfig:"BEACONAPI_LOCAL_CACHE_SIZE"`
		AssignmentsCacheSize int    `yaml:"assignmentsCacheSize" envconfig:"BEACONAPI_ASSIGNMENTS_CACHE_SIZE"`
		RedisCacheAddr       string `yaml:"redisCacheAddr" envconfig:"BEACONAPI_REDIS_CACHE_ADDR"`
		RedisCachePrefix     string `yaml:"redisCachePrefix" envconfig:"BEACONAPI_REDIS_CACHE_PREFIX"`
	} `yaml:"beaconapi"`

	Indexer struct {
		InMemoryEpochs     uint16 `yaml:"inMemoryEpochs" envconfig:"INDEXER_IN_MEMORY_EPOCHS"`
		DisableIndexWriter bool   `yaml:"disableIndexWriter" envconfig:"INDEXER_DISABLE_INDEX_WRITER"`
		SyncEpochCooldown  uint   `yaml:"syncEpochCooldown" envconfig:"INDEXER_SYNC_EPOCH_COOLDOWN"`
	} `yaml:"indexer"`

	Database struct {
		Engine string `yaml:"engine" envconfig:"DATABASE_ENGINE"`
		Sqlite struct {
			File         string `yaml:"file" envconfig:"DATABASE_SQLITE_FILE"`
			MaxOpenConns int    `yaml:"maxOpenConns" envconfig:"DATABASE_SQLITE_MAX_OPEN_CONNS"`
			MaxIdleConns int    `yaml:"maxIdleConns" envconfig:"DATABASE_SQLITE_MAX_IDLE_CONNS"`
		} `yaml:"sqlite"`
		Pgsql struct {
			Username     string `yaml:"user" envconfig:"DATABASE_PGSQL_USERNAME"`
			Password     string `yaml:"password" envconfig:"DATABASE_PGSQL_PASSWORD"`
			Name         string `yaml:"name" envconfig:"DATABASE_PGSQL_NAME"`
			Host         string `yaml:"host" envconfig:"DATABASE_PGSQL_HOST"`
			Port         string `yaml:"port" envconfig:"DATABASE_PGSQL_PORT"`
			MaxOpenConns int    `yaml:"maxOpenConns" envconfig:"DATABASE_PGSQL_MAX_OPEN_CONNS"`
			MaxIdleConns int    `yaml:"maxIdleConns" envconfig:"DATABASE_PGSQL_MAX_IDLE_CONNS"`
		} `yaml:"pgsql"`
		PgsqlWriter struct {
			Username     string `yaml:"user" envconfig:"DATABASE_PGSQL_WRITER_USERNAME"`
			Password     string `yaml:"password" envconfig:"DATABASE_PGSQL_WRITER_PASSWORD"`
			Name         string `yaml:"name" envconfig:"DATABASE_PGSQL_WRITER_NAME"`
			Host         string `yaml:"host" envconfig:"DATABASE_PGSQL_WRITER_HOST"`
			Port         string `yaml:"port" envconfig:"DATABASE_PGSQL_WRITER_PORT"`
			MaxOpenConns int    `yaml:"maxOpenConns" envconfig:"DATABASE_PGSQL_WRITER_MAX_OPEN_CONNS"`
			MaxIdleConns int    `yaml:"maxIdleConns" envconfig:"DATABASE_PGSQL_WRITER_MAX_IDLE_CONNS"`
		} `yaml:"pgsqlWriter"`
	} `yaml:"database"`
}

Config is a struct to hold the configuration data

type Deposit

type Deposit struct {
	Proof                 [][]byte
	PublicKey             []byte
	WithdrawalCredentials []byte
	Amount                uint64
	Signature             []byte
}

Deposit is a struct to hold deposit data

type Empty

type Empty struct {
}

type EndpointConfig added in v1.3.0

type EndpointConfig struct {
	Url      string            `yaml:"url"`
	Name     string            `yaml:"name"`
	Archive  bool              `yaml:"archive"`
	Priority int               `yaml:"priority"`
	Headers  map[string]string `yaml:"headers"`
}

type Eth1Data

type Eth1Data struct {
	DepositRoot  []byte
	DepositCount uint64
	BlockHash    []byte
}

Eth1Data is a struct to hold the ETH1 data

type ExecutionPayload

type ExecutionPayload struct {
	ParentHash    []byte
	FeeRecipient  []byte
	StateRoot     []byte
	ReceiptsRoot  []byte
	LogsBloom     []byte
	Random        []byte
	BlockNumber   uint64
	GasLimit      uint64
	GasUsed       uint64
	Timestamp     uint64
	ExtraData     []byte
	BaseFeePerGas uint64
	BlockHash     []byte
	Transactions  []*Transaction
	Withdrawals   []*Withdrawals
}

type ForkVersion

type ForkVersion struct {
	Epoch           uint64
	CurrentVersion  []byte
	PreviousVersion []byte
}

type IndexedAttestation

type IndexedAttestation struct {
	Data             *AttestationData
	AttestingIndices []uint64
	Signature        []byte
}

IndexedAttestation is a struct to hold indexed attestation data

type MainMenuItem struct {
	Label        string
	Path         string
	IsActive     bool
	HasBigGroups bool // if HasBigGroups is set to true then the NavigationGroups will be ordered horizontally and their Label will be shown
	Groups       []NavigationGroup
}

type Meta

type Meta struct {
	Title       string
	Description string
	Domain      string
	Path        string
	Tlabel1     string
	Tdata1      string
	Tlabel2     string
	Tdata2      string
	Templates   string
}

Meta is a struct to hold metadata about the page

type NamedValidator added in v1.1.0

type NamedValidator struct {
	Index uint64 `json:"index"`
	Name  string `json:"name"`
}
type NavigationGroup struct {
	Label string // only used for "BigGroups"
	Links []NavigationLink
}
type NavigationLink struct {
	Label         string
	Path          string
	CustomIcon    string
	Icon          string
	IsHidden      bool
	IsHighlighted bool
}

type PageData

type PageData struct {
	Active                string
	Meta                  *Meta
	Data                  interface{}
	Version               string
	Year                  int
	ExplorerTitle         string
	ExplorerSubtitle      string
	ChainSlotsPerEpoch    uint64
	ChainSecondsPerSlot   uint64
	ChainGenesisTimestamp uint64
	CurrentEpoch          uint64
	LatestFinalizedEpoch  uint64
	CurrentSlot           uint64
	FinalizationDelay     uint64
	Mainnet               bool
	DepositContract       string
	InfoBanner            *template.HTML
	ClientsUpdated        bool
	// IsUserClientUpdated   func(uint64) bool
	ChainConfig    ChainConfig
	Lang           string
	NoAds          bool
	Debug          bool
	DebugTemplates []string
	MainMenuItems  []MainMenuItem
}

PageData is a struct to hold web page data

type PgsqlDatabaseConfig added in v1.2.0

type PgsqlDatabaseConfig struct {
	Username     string
	Password     string
	Name         string
	Host         string
	Port         string
	MaxOpenConns int
	MaxIdleConns int
}

type ProposerSlashing

type ProposerSlashing struct {
	ProposerIndex uint64
	Header1       *Block
	Header2       *Block
}

ProposerSlashing is a struct to hold proposer slashing data

type SignedBLSToExecutionChange

type SignedBLSToExecutionChange struct {
	Message   BLSToExecutionChange
	Signature []byte
}

type SqliteDatabaseConfig added in v1.2.0

type SqliteDatabaseConfig struct {
	File         string
	MaxOpenConns int
	MaxIdleConns int
}

type SyncAggregate

type SyncAggregate struct {
	SyncCommitteeValidators    []uint64
	SyncCommitteeBits          []byte
	SyncCommitteeSignature     []byte
	SyncAggregateParticipation float64
}

type Transaction

type Transaction struct {
	Raw []byte
	// Note: below values may be nil/0 if Raw fails to decode into a valid transaction
	TxHash       []byte
	AccountNonce uint64
	// big endian
	Price     []byte
	GasLimit  uint64
	Sender    []byte
	Recipient []byte
	// big endian
	Amount  []byte
	Payload []byte

	MaxPriorityFeePerGas uint64
	MaxFeePerGas         uint64
}

type VoluntaryExit

type VoluntaryExit struct {
	Epoch          uint64
	ValidatorIndex uint64
	Signature      []byte
}

VoluntaryExit is a struct to hold voluntary exit data

type Withdrawals

type Withdrawals struct {
	Slot           uint64
	BlockRoot      []byte
	Index          uint64
	ValidatorIndex uint64
	Address        []byte
	Amount         uint64
}

type WithdrawalsByEpoch

type WithdrawalsByEpoch struct {
	Epoch          uint64
	ValidatorIndex uint64
	Amount         uint64
}

type WithdrawalsNotification

type WithdrawalsNotification struct {
	Slot           uint64
	Index          uint64
	ValidatorIndex uint64
	Address        []byte
	Amount         uint64
	Pubkey         []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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