Skip to content

Commit

Permalink
removed fn and added bytes output directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Redidacove committed Aug 22, 2024
1 parent 4290812 commit efa5e0c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 26 deletions.
12 changes: 1 addition & 11 deletions config/params/mainnet_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ func MainnetConfig() *BeaconChainConfig {
return mainnetBeaconConfig
}

func ComputeGenesisValidatorsRoot(s string) [32]byte {
// Compute the genesis validators root.
rootInByte, err := bytesutil.DecodeHexWithLength(s, 32) // Mainnet
if err != nil {
return [32]byte{}
}
genesisValidatorsRoot := bytesutil.ToBytes32(rootInByte)
return genesisValidatorsRoot
}

const (
// Genesis Fork Epoch for the mainnet config.
genesisForkEpoch = 0
Expand Down Expand Up @@ -184,7 +174,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{
DomainConsolidation: bytesutil.Uint32ToBytes4(0x0B000000),

// Prysm constants.
GenesisValidatorsRoot: ComputeGenesisValidatorsRoot("0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95"),
GenesisValidatorsRoot: [32]byte{75, 54, 61, 185, 78, 40, 97, 32, 215, 110, 185, 5, 52, 15, 221, 78, 84, 191, 233, 240, 107, 243, 63, 246, 207, 90, 210, 127, 81, 27, 254, 149},
GweiPerEth: 1000000000,
BLSSecretKeyLength: 32,
BLSPubkeyLength: 48,
Expand Down
10 changes: 0 additions & 10 deletions config/params/mainnet_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"testing"

"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/testing/require"
)

func TestMaxRequestBlock(t *testing.T) {
Expand Down Expand Up @@ -32,12 +31,3 @@ func TestMaxRequestBlock(t *testing.T) {
})
}
}

func TestComputeGenesisValidatorsRoot(t *testing.T) {
wantRoot := [32]byte{
75, 54, 61, 185, 78, 40, 97, 32, 215, 110, 185, 5, 52, 15, 221, 78,
84, 191, 233, 240, 107, 243, 63, 246, 207, 90, 210, 127, 81, 27, 254, 149,
}
gotRoot := ComputeGenesisValidatorsRoot("0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95")
require.DeepEqual(t, gotRoot, wantRoot)
}
2 changes: 1 addition & 1 deletion config/params/minimal_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func MinimalSpecConfig() *BeaconChainConfig {
minimalConfig := mainnetBeaconConfig.Copy()
// Misc
minimalConfig.GenesisValidatorsRoot = ComputeGenesisValidatorsRoot("0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95")
minimalConfig.GenesisValidatorsRoot = [32]byte{75, 54, 61, 185, 78, 40, 97, 32, 215, 110, 185, 5, 52, 15, 221, 78, 84, 191, 233, 240, 107, 243, 63, 246, 207, 90, 210, 127, 81, 27, 254, 149}
minimalConfig.MaxCommitteesPerSlot = 4
minimalConfig.TargetCommitteeSize = 4
minimalConfig.MaxValidatorsPerCommittee = 2048
Expand Down
4 changes: 2 additions & 2 deletions config/params/testnet_e2e_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func E2ETestConfig() *BeaconChainConfig {

// Prysm constants.
e2eConfig.ConfigName = EndToEndName
e2eConfig.GenesisValidatorsRoot = ComputeGenesisValidatorsRoot("0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95")
e2eConfig.GenesisValidatorsRoot = [32]byte{75, 54, 61, 185, 78, 40, 97, 32, 215, 110, 185, 5, 52, 15, 221, 78, 84, 191, 233, 240, 107, 243, 63, 246, 207, 90, 210, 127, 81, 27, 254, 149}
e2eConfig.GenesisForkVersion = []byte{0, 0, 0, 253}
e2eConfig.AltairForkVersion = []byte{1, 0, 0, 253}
e2eConfig.BellatrixForkVersion = []byte{2, 0, 0, 253}
Expand Down Expand Up @@ -95,7 +95,7 @@ func E2EMainnetTestConfig() *BeaconChainConfig {

// Prysm constants.
e2eConfig.ConfigName = EndToEndMainnetName
e2eConfig.GenesisValidatorsRoot = ComputeGenesisValidatorsRoot("0x4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95")
e2eConfig.GenesisValidatorsRoot = [32]byte{75, 54, 61, 185, 78, 40, 97, 32, 215, 110, 185, 5, 52, 15, 221, 78, 84, 191, 233, 240, 107, 243, 63, 246, 207, 90, 210, 127, 81, 27, 254, 149}
e2eConfig.GenesisForkVersion = []byte{0, 0, 0, 254}
e2eConfig.AltairForkVersion = []byte{1, 0, 0, 254}
e2eConfig.BellatrixForkVersion = []byte{2, 0, 0, 254}
Expand Down
2 changes: 1 addition & 1 deletion config/params/testnet_holesky_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func HoleskyConfig() *BeaconChainConfig {
cfg.MinGenesisTime = 1695902100
cfg.GenesisDelay = 300
cfg.ConfigName = HoleskyName
cfg.GenesisValidatorsRoot = ComputeGenesisValidatorsRoot("0x9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1")
cfg.GenesisValidatorsRoot = [32]byte{145, 67, 170, 124, 97, 90, 127, 113, 21, 226, 182, 170, 195, 25, 192, 53, 41, 223, 130, 66, 174, 112, 95, 186, 157, 243, 155, 121, 197, 159, 168, 177}
cfg.GenesisForkVersion = []byte{0x01, 0x01, 0x70, 0x00}
cfg.SecondsPerETH1Block = 14
cfg.DepositChainID = 17000
Expand Down
2 changes: 1 addition & 1 deletion config/params/testnet_sepolia_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func SepoliaConfig() *BeaconChainConfig {
cfg.MinGenesisTime = 1655647200
cfg.GenesisDelay = 86400
cfg.MinGenesisActiveValidatorCount = 1300
cfg.GenesisValidatorsRoot = ComputeGenesisValidatorsRoot("0xd8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078")
cfg.GenesisValidatorsRoot = [32]byte{216, 234, 23, 31, 60, 148, 174, 162, 30, 188, 66, 161, 237, 97, 5, 42, 207, 63, 146, 9, 192, 14, 78, 251, 170, 221, 172, 9, 237, 155, 128, 120}
cfg.ConfigName = SepoliaName
cfg.GenesisForkVersion = []byte{0x90, 0x00, 0x00, 0x69}
cfg.SecondsPerETH1Block = 14
Expand Down

0 comments on commit efa5e0c

Please sign in to comment.