Compare commits

...

14 Commits

Author SHA1 Message Date
Preston Van Loon
765e7f86f1 Update CHANGELOG.md 2024-08-26 09:32:44 -05:00
Md Amaan
181c53ec0b removed root 2024-08-24 13:40:32 +05:30
Md Amaan
1a838f6fa9 removed root from minimal and testnet 2024-08-24 13:37:25 +05:30
Preston Van Loon
19e545adf8 Add test for genesis validator root mainnet value 2024-08-24 13:27:20 +05:30
Md Amaan
15247d5fa6 removed fn and added bytes output directly 2024-08-24 13:27:20 +05:30
Md Amaan
7523057a3f minor fix 2024-08-24 13:27:20 +05:30
Md Amaan
6976474e1c fixed test 2024-08-24 13:27:20 +05:30
Md Amaan
39e73b783e added in e2e testnet_config 2024-08-24 13:27:20 +05:30
Md Amaan
1359c247d9 added roots instead of empty and fn to compute byte32 from hex 2024-08-24 13:27:20 +05:30
Md Amaan
a93a0e6110 minor change 2024-08-24 13:27:20 +05:30
Md Amaan
a0b91d0d90 added it in all testnets 2024-08-24 13:27:20 +05:30
Md Amaan
3f359e851b updated desc 2024-08-24 13:27:20 +05:30
Md Amaan
f7dc1740ff added in mainnet.config 2024-08-24 13:27:20 +05:30
Md Amaan
894f9cc8c3 hardcoded GenesisValidatorsRoot 2024-08-24 13:27:20 +05:30
8 changed files with 23 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- Electra: Add electra objects to beacon API.
- Electra: Updated block publishing beacon APIs to support Electra.
- "Submitted builder validator registration settings for custom builders" log message moved to debug level.
- config: Genesis validator root is now hardcoded in params.BeaconConfig()
### Deprecated

View File

@@ -8,7 +8,10 @@ go_library(
],
embedsrcs = ["mainnet.ssz.snappy"],
importpath = "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/genesis",
visibility = ["//beacon-chain/db:__subpackages__"],
visibility = [
"//beacon-chain/db:__subpackages__",
"//config/params:go_default_test",
],
deps = [
"//beacon-chain/state:go_default_library",
"//beacon-chain/state/state-native:go_default_library",

View File

@@ -62,6 +62,7 @@ go_test(
gotags = ["develop"],
tags = ["CI_race_detection"],
deps = [
"//beacon-chain/state/genesis:go_default_library",
"//consensus-types/primitives:go_default_library",
"//encoding/bytesutil:go_default_library",
"//io/file:go_default_library",

View File

@@ -128,6 +128,7 @@ type BeaconChainConfig struct {
DomainConsolidation [4]byte `yaml:"DOMAIN_CONSOLIDATION" spec:"true"`
// Prysm constants.
GenesisValidatorsRoot [32]byte // GenesisValidatorsRoot is the root hash of the genesis validators.
GweiPerEth uint64 // GweiPerEth is the amount of gwei corresponding to 1 eth.
BLSSecretKeyLength int // BLSSecretKeyLength defines the expected length of BLS secret keys in bytes.
BLSPubkeyLength int // BLSPubkeyLength defines the expected length of BLS public keys in bytes.

View File

@@ -1,9 +1,11 @@
package params_test
import (
"bytes"
"sync"
"testing"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state/genesis"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/testing/require"
@@ -92,3 +94,14 @@ func TestConfig_WithinDAPeriod(t *testing.T) {
})
}
}
func TestConfigGenesisValidatorRoot(t *testing.T) {
g, err := genesis.State(params.MainnetName)
require.NoError(t, err)
gvr := g.GenesisValidatorsRoot()
if !bytes.Equal(gvr, params.BeaconConfig().GenesisValidatorsRoot[:]) {
t.Fatal("mainnet params genesis validator root does not match the mainnet genesis state value")
}
}

View File

@@ -174,6 +174,7 @@ var mainnetBeaconConfig = &BeaconChainConfig{
DomainConsolidation: bytesutil.Uint32ToBytes4(0x0B000000),
// Prysm constants.
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,

View File

@@ -26,6 +26,7 @@ func HoleskyConfig() *BeaconChainConfig {
cfg.MinGenesisTime = 1695902100
cfg.GenesisDelay = 300
cfg.ConfigName = HoleskyName
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

View File

@@ -26,6 +26,7 @@ func SepoliaConfig() *BeaconChainConfig {
cfg.MinGenesisTime = 1655647200
cfg.GenesisDelay = 86400
cfg.MinGenesisActiveValidatorCount = 1300
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