Skip to content
Closed
2 changes: 2 additions & 0 deletions common/paths/paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ func DataDirForNetwork(datadir string, network string) string {
return networkDataDirCheckingLegacy(datadir, "gnosis")
case networkname.ChiadoChainName:
return networkDataDirCheckingLegacy(datadir, "chiado")
case networkname.GnosisWithdrawalsDevnet2Name:
return networkDataDirCheckingLegacy(datadir, "gnosis_withdrawals_devnet_2")

default:
return datadir
Expand Down
5 changes: 5 additions & 0 deletions consensus/aura/consensusconfig/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ var Gnosis []byte
//go:embed poachiado.json
var Chiado []byte

//go:embed gnosis_withdrawals_devnet_2.json
var GnosisWithdrawalsDevnet2 []byte

//go:embed test.json
var Test []byte

Expand All @@ -26,6 +29,8 @@ func GetConfigByChain(chainName string) []byte {
return Gnosis
case networkname.ChiadoChainName:
return Chiado
case networkname.GnosisWithdrawalsDevnet2Name:
return GnosisWithdrawalsDevnet2
default:
return Test
}
Expand Down
26 changes: 26 additions & 0 deletions consensus/aura/consensusconfig/gnosis_withdrawals_devnet_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"stepDuration": 5,
"blockReward": "0x0",
"maximumUncleCountTransition": 0,
"maximumUncleCount": 0,
"validators": {
"multi": {
"0": {
"list": [
"0x14747a698Ec1227e6753026C08B29b4d5D3bC484"
]
}
}
},
"blockRewardContractAddress": "0x2000000000000000000000000000000000000001",
"blockRewardContractTransition": 0,
"randomnessContractAddress": {
"0": "0x3000000000000000000000000000000000000001"
},
"posdaoTransition": 0,
"blockGasLimitContractTransitions": {
"0": "0x4000000000000000000000000000000000000001"
},
"registrar": "0x6000000000000000000000000000000000000000",
"withdrawalContractAddress": "0xbabe2bed00000000000000000000000000000003"
}
9 changes: 0 additions & 9 deletions consensus/ethash/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,6 @@ func VerifyHeaderBasics(chain consensus.ChainHeaderReader, header, parent *types
if header.BaseFee != nil {
return fmt.Errorf("invalid baseFee before fork: have %d, expected 'nil'", header.BaseFee)
}
// Verify that the gas limit remains within allowed bounds
diff := int64(parent.GasLimit) - int64(header.GasLimit)
if diff < 0 {
diff *= -1
}
limit := parent.GasLimit / params.GasLimitBoundDivisor
if uint64(diff) >= limit || header.GasLimit < params.MinGasLimit {
return fmt.Errorf("invalid gas limit: have %d, want %d += %d", header.GasLimit, parent.GasLimit, limit)
}
} else if err := misc.VerifyEip1559Header(chain.Config(), parent, header); err != nil {
// Verify the header's EIP-1559 attributes.
return err
Expand Down
10 changes: 0 additions & 10 deletions consensus/misc/gaslimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,13 @@ package misc

import (
"errors"
"fmt"

"github.com/ledgerwatch/erigon/params"
)

// VerifyGaslimit verifies the header gas limit according increase/decrease
// in relation to the parent gas limit.
func VerifyGaslimit(parentGasLimit, headerGasLimit uint64) error {
// Verify that the gas limit remains within allowed bounds
diff := int64(parentGasLimit) - int64(headerGasLimit)
if diff < 0 {
diff *= -1
}
limit := parentGasLimit / params.GasLimitBoundDivisor
if uint64(diff) >= limit {
return fmt.Errorf("invalid gas limit: have %d, want %d +-= %d", headerGasLimit, parentGasLimit, limit-1)
}
if headerGasLimit < params.MinGasLimit {
return errors.New("invalid gas limit below 5000")
}
Expand Down
112 changes: 112 additions & 0 deletions core/allocs/gnosis_withdrawals_devnet_2.json

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,17 @@ func ChiadoGenesisBlock() *Genesis {
}
}

func GnosisWithdrawalsDevnet2GenesisBlock() *Genesis {
return &Genesis{
Config: params.GnosisWithdrawalsDevnet2ChainConfig,
Timestamp: 0,
AuRaSeal: common.FromHex("0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: 0x989680,
Difficulty: big.NewInt(0x20000),
Alloc: readPrealloc("allocs/gnosis_withdrawals_devnet_2.json"),
}
}

// Pre-calculated version of:
//
// DevnetSignPrivateKey = crypto.HexToECDSA(sha256.Sum256([]byte("erigon devnet key")))
Expand Down Expand Up @@ -829,6 +840,8 @@ func GenesisBlockByChainName(chain string) *Genesis {
return GnosisGenesisBlock()
case networkname.ChiadoChainName:
return ChiadoGenesisBlock()
case networkname.GnosisWithdrawalsDevnet2Name:
return GnosisWithdrawalsDevnet2GenesisBlock()
default:
return nil
}
Expand Down
9 changes: 9 additions & 0 deletions core/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,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.GnosisWithdrawalsDevnet2GenesisBlock().ToBlock("")
require.NoError(err)
if block.Root() != params.GnosisWithdrawalsDevnet2GenesisStateRoot {
t.Errorf("wrong gnosis_withdrawals_devnet_2 genesis state root, got %v, want %v", block.Root(), params.GnosisWithdrawalsDevnet2GenesisStateRoot)
}
if block.Hash() != params.GnosisWithdrawalsDevnet2GenesisHash {
t.Errorf("wrong gnosis_withdrawals_devnet_2 genesis hash, got %v, want %v", block.Hash(), params.GnosisWithdrawalsDevnet2GenesisHash)
}
}

func TestCommitGenesisIdempotency(t *testing.T) {
Expand Down
10 changes: 10 additions & 0 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,14 @@ var ChiadoBootnodes = []string{
"enode://595160631241ea41b187b85716f9f9572a266daa940d74edbe3b83477264ce284d69208e61cf50e91641b1b4f9a03fa8e60eb73d435a84cf4616b1c969bc2512@3.69.35.13:30303",
}

var GnosisWithdrawalsDevnet2Bootnodes = []string{
"enode://f641df32e0e847e9d2125647a090fe4a1e72c42fd4ed291b2e89eafb8bd554193ed9d6f73858a5d0ba885244aa3f6615ffeabb80298d12a30a723650531b457c@45.79.220.126:30303",
"enode://e6675d7b271f646cd2dbd721168f2c1a7a9cc7ea5967b4ebee784fb86affcd28f41206de09d9a93c0447da22658e34a982dbd309bbf158ac44756f0ce21c99d9@45.79.220.38:30303",
"enode://f36b22dfa36be48b2bbf7a2c04c36002af2b85fe73883b2bc64e90097f3314fdf934203908f75cfbfbf3beafafd6ffd4e2dc5d10d30361314f0d5372d12828da@194.195.210.229:30303",
"enode://2d54a05541680ccf152c07e4b0127a860fd8ef0f07ef8f5c24956e88b0ad844ab1595a4617c2db63eb53334bac0524479e2645988e3aec1e07870a3ce1e82a03@194.195.215.98:30303",
"enode://f1ee6f765010cb85c900cab637d8ba1b3889087e33bc275b882f469d381dbfef7c8a9be008e408759b0e66ae9405333ae8f0373bf19b6be59e7161ceeae08653@194.195.215.144:30303",
}

const dnsPrefix = "enrtree://AKA3AM6LPBYEUDMVNU3BSVQJ5AD45Y7YPOHJLEF6W26QOE4VTUDPE@"

// KnownDNSNetwork returns the address of a public DNS-based node list for the given
Expand Down Expand Up @@ -284,6 +292,8 @@ func BootnodeURLsOfChain(chain string) []string {
return GnosisBootnodes
case networkname.ChiadoChainName:
return ChiadoBootnodes
case networkname.GnosisWithdrawalsDevnet2Name:
return GnosisWithdrawalsDevnet2Bootnodes
default:
return []string{}
}
Expand Down
24 changes: 24 additions & 0 deletions params/chainspecs/gnosis_withdrawals_devnet_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"ChainName": "gnosis_withdrawals_devnet_2",
"chainId": 10203,
"consensus": "aura",
"homesteadBlock": 0,
"eip150Block": 0,
"eip155Block": 0,
"byzantiumBlock": 0,
"constantinopleBlock": 0,
"petersburgBlock": 0,
"istanbulBlock": 0,
"posdaoBlock": 0,
"berlinBlock": 0,
"londonBlock": 0,
"eip1559FeeCollectorTransition": 0,
"eip1559FeeCollector": "0x1559000000000000000000000000000000000000",
"terminalTotalDifficulty": 17365630031076252605926396341065427135234048,
"shanghaiTime": 1679483000,
"aura": {
"DBPath": "",
"InMemory": false,
"Etherbase": "0x0000000000000000000000000000000000000000"
}
}
42 changes: 26 additions & 16 deletions params/config.go

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions params/networkname/network_name.go
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
package networkname

const (
MainnetChainName = "mainnet"
SepoliaChainName = "sepolia"
RinkebyChainName = "rinkeby"
GoerliChainName = "goerli"
DevChainName = "dev"
SokolChainName = "sokol"
BSCChainName = "bsc"
ChapelChainName = "chapel"
RialtoChainName = "rialto"
MumbaiChainName = "mumbai"
BorMainnetChainName = "bor-mainnet"
BorDevnetChainName = "bor-devnet"
GnosisChainName = "gnosis"
ChiadoChainName = "chiado"
MainnetChainName = "mainnet"
SepoliaChainName = "sepolia"
RinkebyChainName = "rinkeby"
GoerliChainName = "goerli"
DevChainName = "dev"
SokolChainName = "sokol"
BSCChainName = "bsc"
ChapelChainName = "chapel"
RialtoChainName = "rialto"
MumbaiChainName = "mumbai"
BorMainnetChainName = "bor-mainnet"
BorDevnetChainName = "bor-devnet"
GnosisChainName = "gnosis"
ChiadoChainName = "chiado"
GnosisWithdrawalsDevnet2Name = "gnosis_withdrawals_devnet_2"
)

var All = []string{
Expand All @@ -31,4 +32,5 @@ var All = []string{
BorDevnetChainName,
GnosisChainName,
ChiadoChainName,
GnosisWithdrawalsDevnet2Name,
}