2020-06-26 17:20:24 -07:00
|
|
|
package params
|
|
|
|
|
2021-07-18 09:18:43 -07:00
|
|
|
import (
|
|
|
|
"math"
|
|
|
|
|
2022-08-16 12:20:13 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v3/encoding/bytesutil"
|
2021-07-18 09:18:43 -07:00
|
|
|
)
|
2020-06-26 17:20:24 -07:00
|
|
|
|
|
|
|
// MinimalSpecConfig retrieves the minimal config used in spec tests.
|
|
|
|
func MinimalSpecConfig() *BeaconChainConfig {
|
|
|
|
minimalConfig := mainnetBeaconConfig.Copy()
|
|
|
|
// Misc
|
|
|
|
minimalConfig.MaxCommitteesPerSlot = 4
|
|
|
|
minimalConfig.TargetCommitteeSize = 4
|
|
|
|
minimalConfig.MaxValidatorsPerCommittee = 2048
|
|
|
|
minimalConfig.MinPerEpochChurnLimit = 4
|
2021-09-10 18:33:31 -07:00
|
|
|
minimalConfig.ChurnLimitQuotient = 32
|
2020-06-26 17:20:24 -07:00
|
|
|
minimalConfig.ShuffleRoundCount = 10
|
|
|
|
minimalConfig.MinGenesisActiveValidatorCount = 64
|
2020-12-18 14:22:48 -08:00
|
|
|
minimalConfig.MinGenesisTime = 1578009600
|
2020-06-26 17:20:24 -07:00
|
|
|
minimalConfig.GenesisDelay = 300 // 5 minutes
|
2020-12-18 14:22:48 -08:00
|
|
|
minimalConfig.TargetAggregatorsPerCommittee = 16
|
2020-06-26 17:20:24 -07:00
|
|
|
|
|
|
|
// Gwei values
|
|
|
|
minimalConfig.MinDepositAmount = 1e9
|
|
|
|
minimalConfig.MaxEffectiveBalance = 32e9
|
|
|
|
minimalConfig.EjectionBalance = 16e9
|
|
|
|
minimalConfig.EffectiveBalanceIncrement = 1e9
|
|
|
|
|
|
|
|
// Initial values
|
|
|
|
minimalConfig.BLSWithdrawalPrefixByte = byte(0)
|
2022-07-25 11:10:18 -03:00
|
|
|
minimalConfig.ETH1AddressWithdrawalPrefixByte = byte(1)
|
2020-06-26 17:20:24 -07:00
|
|
|
|
|
|
|
// Time parameters
|
|
|
|
minimalConfig.SecondsPerSlot = 6
|
|
|
|
minimalConfig.MinAttestationInclusionDelay = 1
|
|
|
|
minimalConfig.SlotsPerEpoch = 8
|
2021-08-09 09:35:46 -07:00
|
|
|
minimalConfig.SqrRootSlotsPerEpoch = 2
|
2020-06-26 17:20:24 -07:00
|
|
|
minimalConfig.MinSeedLookahead = 1
|
|
|
|
minimalConfig.MaxSeedLookahead = 4
|
|
|
|
minimalConfig.EpochsPerEth1VotingPeriod = 4
|
|
|
|
minimalConfig.SlotsPerHistoricalRoot = 64
|
|
|
|
minimalConfig.MinValidatorWithdrawabilityDelay = 256
|
|
|
|
minimalConfig.ShardCommitteePeriod = 64
|
|
|
|
minimalConfig.MinEpochsToInactivityPenalty = 4
|
|
|
|
minimalConfig.Eth1FollowDistance = 16
|
|
|
|
minimalConfig.SafeSlotsToUpdateJustified = 2
|
|
|
|
minimalConfig.SecondsPerETH1Block = 14
|
|
|
|
|
|
|
|
// State vector lengths
|
|
|
|
minimalConfig.EpochsPerHistoricalVector = 64
|
|
|
|
minimalConfig.EpochsPerSlashingsVector = 64
|
|
|
|
minimalConfig.HistoricalRootsLimit = 16777216
|
|
|
|
minimalConfig.ValidatorRegistryLimit = 1099511627776
|
|
|
|
|
|
|
|
// Reward and penalty quotients
|
|
|
|
minimalConfig.BaseRewardFactor = 64
|
|
|
|
minimalConfig.WhistleBlowerRewardQuotient = 512
|
|
|
|
minimalConfig.ProposerRewardQuotient = 8
|
2020-11-12 17:00:05 -08:00
|
|
|
minimalConfig.InactivityPenaltyQuotient = 33554432
|
|
|
|
minimalConfig.MinSlashingPenaltyQuotient = 64
|
|
|
|
minimalConfig.ProportionalSlashingMultiplier = 2
|
2020-06-26 17:20:24 -07:00
|
|
|
|
|
|
|
// Max operations per block
|
|
|
|
minimalConfig.MaxProposerSlashings = 16
|
|
|
|
minimalConfig.MaxAttesterSlashings = 2
|
|
|
|
minimalConfig.MaxAttestations = 128
|
|
|
|
minimalConfig.MaxDeposits = 16
|
|
|
|
minimalConfig.MaxVoluntaryExits = 16
|
2022-11-07 11:11:16 -03:00
|
|
|
minimalConfig.MaxWithdrawalsPerPayload = 4
|
2022-12-16 03:45:26 -03:00
|
|
|
minimalConfig.MaxValidatorsPerWithdrawalsSweep = 16
|
2020-06-26 17:20:24 -07:00
|
|
|
|
|
|
|
// Signature domains
|
|
|
|
minimalConfig.DomainBeaconProposer = bytesutil.ToBytes4(bytesutil.Bytes4(0))
|
|
|
|
minimalConfig.DomainBeaconAttester = bytesutil.ToBytes4(bytesutil.Bytes4(1))
|
|
|
|
minimalConfig.DomainRandao = bytesutil.ToBytes4(bytesutil.Bytes4(2))
|
|
|
|
minimalConfig.DomainDeposit = bytesutil.ToBytes4(bytesutil.Bytes4(3))
|
|
|
|
minimalConfig.DomainVoluntaryExit = bytesutil.ToBytes4(bytesutil.Bytes4(4))
|
|
|
|
minimalConfig.GenesisForkVersion = []byte{0, 0, 0, 1}
|
|
|
|
|
|
|
|
minimalConfig.DepositContractTreeDepth = 32
|
2021-11-04 11:48:09 -07:00
|
|
|
minimalConfig.FarFutureEpoch = math.MaxUint64
|
|
|
|
minimalConfig.FarFutureSlot = math.MaxUint64
|
2020-07-28 22:29:12 +02:00
|
|
|
|
2021-07-18 09:18:43 -07:00
|
|
|
// New Altair params
|
|
|
|
minimalConfig.AltairForkVersion = []byte{1, 0, 0, 1} // Highest byte set to 0x01 to avoid collisions with mainnet versioning
|
|
|
|
minimalConfig.AltairForkEpoch = math.MaxUint64
|
2021-12-26 15:18:28 -08:00
|
|
|
minimalConfig.BellatrixForkVersion = []byte{2, 0, 0, 1}
|
|
|
|
minimalConfig.BellatrixForkEpoch = math.MaxUint64
|
2022-07-08 10:40:01 -07:00
|
|
|
minimalConfig.CapellaForkVersion = []byte{3, 0, 0, 1}
|
|
|
|
minimalConfig.CapellaForkEpoch = math.MaxUint64
|
2022-03-21 14:43:41 -05:00
|
|
|
|
2021-07-18 09:18:43 -07:00
|
|
|
minimalConfig.SyncCommitteeSize = 32
|
|
|
|
minimalConfig.InactivityScoreBias = 4
|
|
|
|
minimalConfig.EpochsPerSyncCommitteePeriod = 8
|
|
|
|
|
2021-08-09 13:40:06 -05:00
|
|
|
// Ethereum PoW parameters.
|
|
|
|
minimalConfig.DepositChainID = 5 // Chain ID of eth1 goerli.
|
|
|
|
minimalConfig.DepositNetworkID = 5 // Network ID of eth1 goerli.
|
|
|
|
minimalConfig.DepositContractAddress = "0x1234567890123456789012345678901234567890"
|
2022-08-17 08:18:43 -07:00
|
|
|
// 2**256-2**10 for fake minimal network
|
|
|
|
minimalConfig.TerminalTotalDifficulty = "115792089237316195423570985008687907853269984665640564039457584007913129638912"
|
2021-08-09 13:40:06 -05:00
|
|
|
|
2022-05-06 16:42:27 -05:00
|
|
|
minimalConfig.ConfigName = MinimalName
|
2021-08-13 13:11:11 +08:00
|
|
|
minimalConfig.PresetBase = "minimal"
|
2021-08-09 13:40:06 -05:00
|
|
|
|
2022-03-21 14:43:41 -05:00
|
|
|
minimalConfig.InitializeForkSchedule()
|
2020-06-26 17:20:24 -07:00
|
|
|
return minimalConfig
|
|
|
|
}
|