Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Gnosis dencun0 devnet configs #8465

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion common/paths/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ func DataDirForNetwork(datadir string, network string) string {
return networkDataDirCheckingLegacy(datadir, "gnosis")
case networkname.ChiadoChainName:
return networkDataDirCheckingLegacy(datadir, "chiado")

case networkname.GnosisDencun0DevnetName:
return networkDataDirCheckingLegacy(datadir, networkname.GnosisDencun0DevnetName)
default:
return datadir
}
Expand Down
105 changes: 105 additions & 0 deletions core/allocs/gnosis_dencun0_devnet.json

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions core/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ func TestGenesisBlockRoots(t *testing.T) {
if block.Hash() != params.ChiadoGenesisHash {
t.Errorf("wrong Chiado genesis hash, got %v, want %v", block.Hash(), params.ChiadoGenesisHash)
}

block, _, err = core.GenesisToBlock(core.GnosisDencun0DevnetGenesisBlock(), "")
require.NoError(err)
if block.Root() != params.GnosisDencun0DevnetStateRoot {
t.Errorf("wrong Gnosis_Dencun0_Devnet genesis state root, got %v, want %v", block.Root(), params.GnosisDencun0DevnetStateRoot)
}
if block.Hash() != params.GnosisDencun0DevnetGenesisHash {
t.Errorf("wrong Gnosis_Dencun0_Devnet genesis hash, got %v, want %v", block.Hash(), params.GnosisDencun0DevnetGenesisHash)
}
}

func TestCommitGenesisIdempotency(t *testing.T) {
Expand Down
13 changes: 13 additions & 0 deletions core/genesis_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,17 @@ func ChiadoGenesisBlock() *types.Genesis {
}
}

func GnosisDencun0DevnetGenesisBlock() *types.Genesis {
return &types.Genesis{
Config: params.GnosisDencun0DevnetConfig,
AuRaSeal: common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: 0x989680,
Difficulty: big.NewInt(1),
BaseFee: big.NewInt(0x3b9aca00),
Alloc: readPrealloc("allocs/gnosis_dencun0_devnet.json"),
}
}

// Pre-calculated version of:
//
// DevnetSignPrivateKey = crypto.HexToECDSA(sha256.Sum256([]byte("erigon devnet key")))
Expand Down Expand Up @@ -657,6 +668,8 @@ func GenesisBlockByChainName(chain string) *types.Genesis {
return GnosisGenesisBlock()
case networkname.ChiadoChainName:
return ChiadoGenesisBlock()
case networkname.GnosisDencun0DevnetName:
return GnosisDencun0DevnetGenesisBlock()
default:
return nil
}
Expand Down
2 changes: 2 additions & 0 deletions erigon-lib/chain/networkname/network_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const (
GnosisChainName = "gnosis"
BorE2ETestChain2ValName = "bor-e2e-test-2Val"
ChiadoChainName = "chiado"
GnosisDencun0DevnetName = "gno_dencun_0"
)

var All = []string{
Expand All @@ -24,4 +25,5 @@ var All = []string{
BorDevnetChainName,
GnosisChainName,
ChiadoChainName,
GnosisDencun0DevnetName,
}
12 changes: 12 additions & 0 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@ var ChiadoBootnodes = []string{
"enode://595160631241ea41b187b85716f9f9572a266daa940d74edbe3b83477264ce284d69208e61cf50e91641b1b4f9a03fa8e60eb73d435a84cf4616b1c969bc2512@3.69.35.13:30303",
}

var GnosisDencun0DevnetBootnodes = []string{
"enode://1173ac15e8b67b171b440593d47c0a04ba97f6370e34f70aaedad6a4427f48ded14690ec3ee23737ea38babedb6b41c766f7839a1d02102c1c6556ddaaf3c450@45.56.117.136:30303",
"enode://aea708a6d33a324bac0d739a133ff6880eb7fd36cbea2c090e64cab81d3a8db34617e2a1c5ba36303176b2f66ab9749912009888b5a428910eaadec787913d72@45.79.223.31:30303",
"enode://d04978a2244dfffdad8b93e9f849cfdae22b157953267e9bab79dc7760f3ac8a54ebb49f53cf5f9f4c259c28d8779fb00fa541595600cb42ba02174659131b82@45.56.117.31:30303",
"enode://872c819855a92b4ced93a7c4dbdb8defddec09f623d74a3d18e02bddfacd662c4636d32f0eb4834ab1d3cb4f927d7e9a267a711cf2cb3fbc6119e5c16460aa81@45.79.223.109:30303",
"enode://7fc4bdd2e34be99a7cb1e511a9500494b667446ce86932682ade4071b2d32e5b2d81adec3280ef7b342647121215306132a373eac82e1858580ee1c05ace5811@45.79.253.7:30303",
"enode://02f73780fb4e803113235fbcc78643c6a9673c87681e4b431e2de3967f83a2c8ad4f24f60337555e0e077542212c681c7be102078d9385003d6f19d0bd09bce7@45.79.223.204:30303",
"enode://c8d442c21968c29ae9828dbcd1539bda08dad3413a974c418fb813c1eba6a48cbf09dc8b972ba62c8488ca60fea47b98b497305010fd00eea87ff5b216ee5d0e@45.56.117.192:30303",
}

const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@"

// KnownDNSNetwork returns the address of a public DNS-based node list for the given
Expand Down Expand Up @@ -191,6 +201,8 @@ func BootnodeURLsOfChain(chain string) []string {
return GnosisBootnodes
case networkname.ChiadoChainName:
return ChiadoBootnodes
case networkname.GnosisDencun0DevnetName:
return GnosisDencun0DevnetBootnodes
default:
return []string{}
}
Expand Down
52 changes: 52 additions & 0 deletions params/chainspecs/gnosis_dencun0_devnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

{
"ChainName": "gno_dencun_0",
"chainId": 10209,
"consensus": "aura",
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"berlinBlock": 0,
"londonBlock": 0,
"eip1559FeeCollectorTransition": 0,
"eip1559FeeCollector": "0x1559000000000000000000000000000000000000",
"terminalTotalDifficulty": 0,
"terminalTotalDifficultyPassed": true,
"shanghaiTime": 1696271800,
"cancunTime": 1696272200,
"minBlobGasPrice": 1000000000,
"maxBlobGasPerBlock": 262144,
"targetBlobGasPerBlock": 131072,
"blobGasPriceUpdateFraction": 1112826,
"aura": {
"stepDuration": 5,
"blockReward": 0,
"maximumUncleCountTransition": 0,
"maximumUncleCount": 0,
"validators": {
"multi": {
"0": {
"list": [
"0x14747a698Ec1227e6753026C08B29b4d5D3bC484"
]
}
}
},
"blockRewardContractAddress": "0x2000000000000000000000000000000000000001",
"blockRewardContractTransition": 0,
"randomnessContractAddress": {
"0": "0x3000000000000000000000000000000000000001"
},
"withdrawalContractAddress": "0xbabe2bed00000000000000000000000000000003",
"twoThirdsMajorityTransition": 0,
"posdaoTransition": 0,
"blockGasLimitContractTransitions": {
"0": "0x4000000000000000000000000000000000000001"
},
"registrar": "0x6000000000000000000000000000000000000000"
}
}
33 changes: 22 additions & 11 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,22 @@ func readChainSpec(filename string) *chain.Config {

// Genesis hashes to enforce below configs on.
var (
MainnetGenesisHash = libcommon.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3")
HoleskyGenesisHash = libcommon.HexToHash("0xb5f7f912443c940f21fd611f12828d75b534364ed9e95ca4e307729a4661bde4")
SepoliaGenesisHash = libcommon.HexToHash("0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9")
GoerliGenesisHash = libcommon.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a")
MumbaiGenesisHash = libcommon.HexToHash("0x7b66506a9ebdbf30d32b43c5f15a3b1216269a1ec3a75aa3182b86176a2b1ca7")
BorMainnetGenesisHash = libcommon.HexToHash("0xa9c28ce2141b56c474f1dc504bee9b01eb1bd7d1a507580d5519d4437a97de1b")
BorDevnetGenesisHash = libcommon.HexToHash("0x5a06b25b0c6530708ea0b98a3409290e39dce6be7f558493aeb6e4b99a172a87")
GnosisGenesisHash = libcommon.HexToHash("0x4f1dd23188aab3a76b463e4af801b52b1248ef073c648cbdc4c9333d3da79756")
ChiadoGenesisHash = libcommon.HexToHash("0xada44fd8d2ecab8b08f256af07ad3e777f17fb434f8f8e678b312f576212ba9a")
MainnetGenesisHash = libcommon.HexToHash("0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3")
HoleskyGenesisHash = libcommon.HexToHash("0xb5f7f912443c940f21fd611f12828d75b534364ed9e95ca4e307729a4661bde4")
SepoliaGenesisHash = libcommon.HexToHash("0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9")
GoerliGenesisHash = libcommon.HexToHash("0xbf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a")
MumbaiGenesisHash = libcommon.HexToHash("0x7b66506a9ebdbf30d32b43c5f15a3b1216269a1ec3a75aa3182b86176a2b1ca7")
BorMainnetGenesisHash = libcommon.HexToHash("0xa9c28ce2141b56c474f1dc504bee9b01eb1bd7d1a507580d5519d4437a97de1b")
BorDevnetGenesisHash = libcommon.HexToHash("0x5a06b25b0c6530708ea0b98a3409290e39dce6be7f558493aeb6e4b99a172a87")
GnosisGenesisHash = libcommon.HexToHash("0x4f1dd23188aab3a76b463e4af801b52b1248ef073c648cbdc4c9333d3da79756")
ChiadoGenesisHash = libcommon.HexToHash("0xada44fd8d2ecab8b08f256af07ad3e777f17fb434f8f8e678b312f576212ba9a")
GnosisDencun0DevnetGenesisHash = libcommon.HexToHash("0x59055365d8dba222b2c6c037a064cc9be9fc1726bf0ce779a16e792531c2ffe5")
)

var (
GnosisGenesisStateRoot = libcommon.HexToHash("0x40cf4430ecaa733787d1a65154a3b9efb560c95d9e324a23b97f0609b539133b")
ChiadoGenesisStateRoot = libcommon.HexToHash("0x9ec3eaf4e6188dfbdd6ade76eaa88289b57c63c9a2cde8d35291d5a29e143d31")
GnosisGenesisStateRoot = libcommon.HexToHash("0x40cf4430ecaa733787d1a65154a3b9efb560c95d9e324a23b97f0609b539133b")
ChiadoGenesisStateRoot = libcommon.HexToHash("0x9ec3eaf4e6188dfbdd6ade76eaa88289b57c63c9a2cde8d35291d5a29e143d31")
GnosisDencun0DevnetStateRoot = libcommon.HexToHash("0xfd6db11ed8ad0fac40e5e9b218d2b1304725c7d07c3f3571dad6c60a13e1d858")
)

var (
Expand Down Expand Up @@ -131,6 +133,8 @@ var (

ChiadoChainConfig = readChainSpec("chainspecs/chiado.json")

GnosisDencun0DevnetConfig = readChainSpec("chainspecs/gnosis_dencun0_devnet.json")

CliqueSnapshot = NewSnapshotConfig(10, 1024, 16384, true, "")

TestChainConfig = &chain.Config{
Expand Down Expand Up @@ -211,6 +215,8 @@ func ChainConfigByChainName(chain string) *chain.Config {
return GnosisChainConfig
case networkname.ChiadoChainName:
return ChiadoChainConfig
case networkname.GnosisDencun0DevnetName:
return GnosisDencun0DevnetConfig
default:
return nil
}
Expand All @@ -236,6 +242,8 @@ func GenesisHashByChainName(chain string) *libcommon.Hash {
return &GnosisGenesisHash
case networkname.ChiadoChainName:
return &ChiadoGenesisHash
case networkname.GnosisDencun0DevnetName:
return &GnosisDencun0DevnetGenesisHash
default:
return nil
}
Expand All @@ -261,6 +269,8 @@ func ChainConfigByGenesisHash(genesisHash libcommon.Hash) *chain.Config {
return GnosisChainConfig
case genesisHash == ChiadoGenesisHash:
return ChiadoChainConfig
case genesisHash == GnosisDencun0DevnetGenesisHash:
return GnosisDencun0DevnetConfig
default:
return nil
}
Expand Down Expand Up @@ -291,6 +301,7 @@ func isChainIDPoS(chainID *big.Int) bool {
SepoliaChainConfig.ChainID,
GnosisChainConfig.ChainID,
ChiadoChainConfig.ChainID,
GnosisDencun0DevnetConfig.ChainID,
}
for _, id := range ids {
if id.Cmp(chainID) == 0 {
Expand Down