-
Notifications
You must be signed in to change notification settings - Fork 272
Expand file tree
/
Copy pathdata.go
More file actions
170 lines (156 loc) · 8.92 KB
/
data.go
File metadata and controls
170 lines (156 loc) · 8.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// SPDX-License-Identifier: BUSL-1.1
//
// Copyright (C) 2025, Berachain Foundation. All rights reserved.
// Use of this software is governed by the Business Source License included
// in the LICENSE file of this repository and at www.mariadb.com/bsl11.
//
// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY
// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER
// VERSIONS OF THE LICENSED WORK.
//
// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF
// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF
// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE).
//
// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
// TITLE.
package chain
import "github.com/berachain/beacon-kit/primitives/common"
// SpecData is the underlying data structure for chain-specific parameters. All fields with a
// `mapstructure` tag are required.
type SpecData struct {
// Gwei value constants.
//
// MaxEffectiveBalance is the maximum effective balance allowed for a validator.
MaxEffectiveBalance uint64 `mapstructure:"max-effective-balance"`
// EffectiveBalanceIncrement is the effective balance increment.
EffectiveBalanceIncrement uint64 `mapstructure:"effective-balance-increment"`
// HysteresisQuotient is the quotient used in effective balance calculations
HysteresisQuotient uint64 `mapstructure:"hysteresis-quotient"`
// HysteresisDownwardMultiplier is the multiplier for downward balance
// adjustments.
HysteresisDownwardMultiplier uint64 `mapstructure:"hysteresis-downward-multiplier"`
// HysteresisUpwardMultiplier is the multiplier for upward balance
// adjustments.
HysteresisUpwardMultiplier uint64 `mapstructure:"hysteresis-upward-multiplier"`
// Time parameters constants.
//
// SlotsPerEpoch is the number of slots per epoch.
SlotsPerEpoch uint64 `mapstructure:"slots-per-epoch"`
// SlotsPerHistoricalRoot is the number of slots per historical root.
SlotsPerHistoricalRoot uint64 `mapstructure:"slots-per-historical-root"`
// MinEpochsToInactivityPenalty is the minimum number of epochs before a
// validator is penalized for inactivity.
MinEpochsToInactivityPenalty uint64 `mapstructure:"min-epochs-to-inactivity-penalty"`
// Signature domains.
//
// DomainDomainTypeProposerProposer is the domain for beacon proposer
// signatures.
DomainTypeProposer common.DomainType `mapstructure:"domain-type-beacon-proposer"`
// DomainTypeAttester is the domain for beacon attester signatures.
DomainTypeAttester common.DomainType `mapstructure:"domain-type-beacon-attester"`
// DomainTypeRandao is the domain for RANDAO reveal signatures.
DomainTypeRandao common.DomainType `mapstructure:"domain-type-randao"`
// DomainTypeDeposit is the domain for deposit contract signatures.
DomainTypeDeposit common.DomainType `mapstructure:"domain-type-deposit"`
// DomainTypeVoluntaryExit is the domain for voluntary exit signatures.
DomainTypeVoluntaryExit common.DomainType `mapstructure:"domain-type-voluntary-exit"`
// DomainTypeSelectionProof is the domain for selection proof signatures.
DomainTypeSelectionProof common.DomainType `mapstructure:"domain-type-selection-proof"`
// DomainTypeAggregateAndProof is the domain for aggregate and proof
// signatures.
DomainTypeAggregateAndProof common.DomainType `mapstructure:"domain-type-aggregate-and-proof"`
// DomainTypeApplicationMask is the domain for the application mask.
DomainTypeApplicationMask common.DomainType `mapstructure:"domain-type-application-mask"`
// Eth1-related values.
//
// DepositContractAddress is the address of the deposit contract.
DepositContractAddress common.ExecutionAddress `mapstructure:"deposit-contract-address"`
// MaxDepositsPerBlock specifies the maximum number of deposit operations
// allowed per block.
MaxDepositsPerBlock uint64 `mapstructure:"max-deposits-per-block"`
// DepositEth1ChainID is the chain ID of the execution client.
DepositEth1ChainID uint64 `mapstructure:"deposit-eth1-chain-id"`
// Eth1FollowDistance is the distance between the eth1 chain and the beacon
// chain with respect to reading deposits.
Eth1FollowDistance uint64 `mapstructure:"eth1-follow-distance"`
// TargetSecondsPerEth1Block is the target time between eth1 blocks.
TargetSecondsPerEth1Block uint64 `mapstructure:"target-seconds-per-eth1-block"`
// Fork-related values.
//
// GenesisTime is the time at which the genesis block was created.
GenesisTime uint64 `mapstructure:"genesis-time"`
// Deneb1ForkTime is the time at which the Deneb1 fork is activated.
Deneb1ForkTime uint64 `mapstructure:"deneb-one-fork-time"`
// ElectraForkTime is the time at which the Electra fork is activated.
ElectraForkTime uint64 `mapstructure:"electra-fork-time"`
// ElectraDisableWithdrawalsForkTime is the time at which withdrawals were first disabled (if disabled).
ElectraDisableWithdrawalsForkTime uint64 `mapstructure:"electra-disable-withdrawals-fork-time"`
// ElectraEnableWithdrawalsForkTime is the time at which withdrawals were enabled after disabling
ElectraEnableWithdrawalsForkTime uint64 `mapstructure:"electra-enable-withdrawals-fork-time"`
// State list lengths
//
// EpochsPerHistoricalVector is the number of epochs in the historical
// vector.
EpochsPerHistoricalVector uint64 `mapstructure:"epochs-per-historical-vector"`
// EpochsPerSlashingsVector is the number of epochs in the slashings vector.
EpochsPerSlashingsVector uint64 `mapstructure:"epochs-per-slashings-vector"`
// HistoricalRootsLimit is the maximum number of historical roots.
HistoricalRootsLimit uint64 `mapstructure:"historical-roots-limit"`
// ValidatorRegistryLimit is the maximum number of validators in the
// registry.
ValidatorRegistryLimit uint64 `mapstructure:"validator-registry-limit"`
// Capella Values
//
// MaxWithdrawalsPerPayload indicates the maximum number of withdrawal
// operations allowed in a single payload.
MaxWithdrawalsPerPayload uint64 `mapstructure:"max-withdrawals-per-payload"`
// MaxValidatorsPerWithdrawalsSweep specifies the maximum number of validator withdrawals
// allowed per sweep. Note that this value should ideally be smaller than the total number
// of validators in the registry.
MaxValidatorsPerWithdrawalsSweep uint64 `mapstructure:"max-validators-per-withdrawals-sweep"`
// Deneb Values
//
// MinEpochsForBlobsSidecarsRequest is the minimum number of epochs the node
// will keep the blobs for.
MinEpochsForBlobsSidecarsRequest uint64 `mapstructure:"min-epochs-for-blobs-sidecars-request"`
// MaxBlobCommitmentsPerBlock specifies the maximum number of blob
// commitments allowed per block.
MaxBlobCommitmentsPerBlock uint64 `mapstructure:"max-blob-commitments-per-block"`
// MaxBlobsPerBlock specifies the maximum number of blobs allowed per block.
MaxBlobsPerBlock uint64 `mapstructure:"max-blobs-per-block"`
// FieldElementsPerBlob specifies the number of field elements per blob.
FieldElementsPerBlob uint64 `mapstructure:"field-elements-per-blob"`
// BytesPerBlob denotes the size of EIP-4844 blobs in bytes.
BytesPerBlob uint64 `mapstructure:"bytes-per-blob"`
// Berachain Values at genesis
//
// ValidatorSetCap is the maximum number of validators that can be active
// for a given epoch
// Note: ValidatorSetCap must be smaller than ValidatorRegistryLimit.
ValidatorSetCap uint64 `mapstructure:"validator-set-cap"`
// EVMInflationAddressGenesis is the address on the EVM which will receive the
// inflation amount of native EVM balance through a withdrawal every block.
EVMInflationAddressGenesis common.ExecutionAddress `mapstructure:"evm-inflation-address"`
// EVMInflationPerBlockGenesis is the amount of native EVM balance (in Gwei) to be
// minted to the EVMInflationAddress via a withdrawal every block.
EVMInflationPerBlockGenesis uint64 `mapstructure:"evm-inflation-per-block"`
// Deneb1 Value Changes
//
// EVMInflationAddressDeneb1 is the address on the EVM which will receive the
// inflation amount of native EVM balance through a withdrawal every block in the Deneb1 fork.
EVMInflationAddressDeneb1 common.ExecutionAddress `mapstructure:"evm-inflation-address-deneb-one"`
// EVMInflationPerBlockDeneb1 is the amount of native EVM balance (in Gwei) to be
// minted to the EVMInflationAddressDeneb1 via a withdrawal every block in the Deneb1 fork.
EVMInflationPerBlockDeneb1 uint64 `mapstructure:"evm-inflation-per-block-deneb-one"`
// Electra Values
//
// MinActivationBalance [New in Electra:EIP7251] Minimum balance for a validator to become active
MinActivationBalance uint64 `mapstructure:"min-activation-balance"`
// MinValidatorWithdrawabilityDelay is defined in the Electra spec and introduces
// withdrawability delays to allow for slashing.
MinValidatorWithdrawabilityDelay uint64 `mapstructure:"min-validator-withdrawability-delay"`
}