Remove Ropsten and Rinkeby test networks

This commit is contained in:
Roman Volosovskyi 2022-10-20 12:33:23 +02:00
parent 0ccdec2985
commit a399c04346
No known key found for this signature in database
GPG Key ID: 0238A4B5ECEE70DE
16 changed files with 18 additions and 86 deletions

View File

@ -20,8 +20,7 @@ jobs:
cache: cache:
directories: directories:
- ".ethereumtest/Mainnet" - ".ethereumtest/Mainnet"
- ".ethereumtest/Rinkeby" - ".ethereumtest/Goerli"
- ".ethereumtest/Ropsten"
- ".ethereumtest/StatusChain" - ".ethereumtest/StatusChain"
env: env:
matrix: matrix:

View File

@ -257,7 +257,7 @@ func makeNodeConfig() (*params.NodeConfig, error) {
return nil, err return nil, err
} }
nodeConfig, err := params.NewNodeConfigWithDefaults(path.Join(workDir, ".ethereum"), uint64(params.RopstenNetworkID)) nodeConfig, err := params.NewNodeConfigWithDefaults(path.Join(workDir, ".ethereum"), uint64(params.GoerliNetworkID))
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -52,10 +52,10 @@ var (
dataDir = flag.String("dir", getDefaultDataDir(), "Directory used by node to store data") dataDir = flag.String("dir", getDefaultDataDir(), "Directory used by node to store data")
networkID = flag.Int( networkID = flag.Int(
"network-id", "network-id",
params.RopstenNetworkID, params.GoerliNetworkID,
fmt.Sprintf( fmt.Sprintf(
"A network ID: %d (Mainnet), %d (Ropsten), %d (Rinkeby), %d (Goerli)", "A network ID: %d (Mainnet), %d (Goerli)",
params.MainNetworkID, params.RopstenNetworkID, params.RinkebyNetworkID, params.GoerliNetworkID, params.MainNetworkID, params.GoerliNetworkID,
), ),
) )
listenAddr = flag.String("addr", "", "address to bind listener to") listenAddr = flag.String("addr", "", "address to bind listener to")

View File

@ -64,10 +64,10 @@ var (
dataDir = flag.String("dir", getDefaultDataDir(), "Directory used by node to store data") dataDir = flag.String("dir", getDefaultDataDir(), "Directory used by node to store data")
networkID = flag.Int( networkID = flag.Int(
"network-id", "network-id",
params.RopstenNetworkID, params.GoerliNetworkID,
fmt.Sprintf( fmt.Sprintf(
"A network ID: %d (Mainnet), %d (Ropsten), %d (Rinkeby), %d (Goerli)", "A network ID: %d (Mainnet), %d (Goerli)",
params.MainNetworkID, params.RopstenNetworkID, params.RinkebyNetworkID, params.GoerliNetworkID, params.MainNetworkID, params.GoerliNetworkID,
), ),
) )
listenAddr = flag.String("addr", "", "address to bind listener to") listenAddr = flag.String("addr", "", "address to bind listener to")

View File

@ -55,10 +55,10 @@ var (
mailserver = flag.Bool("mailserver", false, "Enable Mail Server with default configuration") mailserver = flag.Bool("mailserver", false, "Enable Mail Server with default configuration")
networkID = flag.Int( networkID = flag.Int(
"network-id", "network-id",
params.RopstenNetworkID, params.GoerliNetworkID,
fmt.Sprintf( fmt.Sprintf(
"A network ID: %d (Mainnet), %d (Ropsten), %d (Rinkeby), %d (Goerli)", "A network ID: %d (Mainnet), %d (Goerli)",
params.MainNetworkID, params.RopstenNetworkID, params.RinkebyNetworkID, params.GoerliNetworkID, params.MainNetworkID, params.GoerliNetworkID,
), ),
) )
fleet = flag.String( fleet = flag.String(

View File

@ -10,8 +10,6 @@ var errorNotAvailableOnChainID = errors.New("not available for chainID")
var contractAddressByChainID = map[uint64]common.Address{ var contractAddressByChainID = map[uint64]common.Address{
1: common.HexToAddress("0x08A8fDBddc160A7d5b957256b903dCAb1aE512C5"), // mainnet 1: common.HexToAddress("0x08A8fDBddc160A7d5b957256b903dCAb1aE512C5"), // mainnet
3: common.HexToAddress("0x08A8fDBddc160A7d5b957256b903dCAb1aE512C5"), // ropsten
4: common.HexToAddress("0x08A8fDBddc160A7d5b957256b903dCAb1aE512C5"), // rinkeby
5: common.HexToAddress("0x08A8fDBddc160A7d5b957256b903dCAb1aE512C5"), // goerli 5: common.HexToAddress("0x08A8fDBddc160A7d5b957256b903dCAb1aE512C5"), // goerli
} }

View File

@ -10,7 +10,6 @@ var errorNotAvailableOnChainID = errors.New("not available for chainID")
var contractAddressByChainID = map[uint64]common.Address{ var contractAddressByChainID = map[uint64]common.Address{
1: common.HexToAddress("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"), // mainnet 1: common.HexToAddress("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"), // mainnet
3: common.HexToAddress("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"), // ropsten
5: common.HexToAddress("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"), // goerli 5: common.HexToAddress("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"), // goerli
} }

View File

@ -10,7 +10,6 @@ var errorNotAvailableOnChainID = errors.New("not available for chainID")
var contractAddressByChainID = map[uint64]common.Address{ var contractAddressByChainID = map[uint64]common.Address{
1: common.HexToAddress("0x744d70fdbe2ba4cf95131626614a1763df805b9e"), // mainnet 1: common.HexToAddress("0x744d70fdbe2ba4cf95131626614a1763df805b9e"), // mainnet
3: common.HexToAddress("0xc55cf4b03948d7ebc8b9e8bad92643703811d162"), // ropsten
5: common.HexToAddress("0x3d6afaa395c31fcd391fe3d562e75fe9e8ec7e6a"), // goerli 5: common.HexToAddress("0x3d6afaa395c31fcd391fe3d562e75fe9e8ec7e6a"), // goerli
} }

View File

@ -10,19 +10,16 @@ var errorNotAvailableOnChainID = errors.New("not available for chainID")
var stickerTypeByChainID = map[uint64]common.Address{ var stickerTypeByChainID = map[uint64]common.Address{
1: common.HexToAddress("0x0577215622f43a39f4bc9640806dfea9b10d2a36"), // mainnet 1: common.HexToAddress("0x0577215622f43a39f4bc9640806dfea9b10d2a36"), // mainnet
3: common.HexToAddress("0x8cc272396be7583c65bee82cd7b743c69a87287d"), // ropsten
5: common.HexToAddress("0x07f7CB0C0a4ab3e0999AfE8b3997Da34880f05d0"), // goerli testnet 5: common.HexToAddress("0x07f7CB0C0a4ab3e0999AfE8b3997Da34880f05d0"), // goerli testnet
} }
var stickerMarketByChainID = map[uint64]common.Address{ var stickerMarketByChainID = map[uint64]common.Address{
1: common.HexToAddress("0x12824271339304d3a9f7e096e62a2a7e73b4a7e7"), // mainnet 1: common.HexToAddress("0x12824271339304d3a9f7e096e62a2a7e73b4a7e7"), // mainnet
3: common.HexToAddress("0x6CC7274aF9cE9572d22DFD8545Fb8c9C9Bcb48AD"), // ropsten
5: common.HexToAddress("0xf1E149A7DF70D5Ff1E265daAa738d785D3274717"), // goerli testnet 5: common.HexToAddress("0xf1E149A7DF70D5Ff1E265daAa738d785D3274717"), // goerli testnet
} }
var stickerPackByChainID = map[uint64]common.Address{ var stickerPackByChainID = map[uint64]common.Address{
1: common.HexToAddress("0x110101156e8F0743948B2A61aFcf3994A8Fb172e"), // mainnet 1: common.HexToAddress("0x110101156e8F0743948B2A61aFcf3994A8Fb172e"), // mainnet
3: common.HexToAddress("0xf852198d0385c4b871e0b91804ecd47c6ba97351"), // ropsten
5: common.HexToAddress("0x8D3fD2EA24bD53a8Bd2b1026727db8bbe9A8C8Af"), // goerli testnet 5: common.HexToAddress("0x8D3fD2EA24bD53a8Bd2b1026727db8bbe9A8C8Af"), // goerli testnet
} }

View File

@ -41,7 +41,7 @@ func TestParseNodesToNodeID(t *testing.T) {
} }
func TestNewGethNodeConfig(t *testing.T) { func TestNewGethNodeConfig(t *testing.T) {
config, err := params.NewNodeConfig("", params.RopstenNetworkID) config, err := params.NewNodeConfig("", params.GoerliNetworkID)
require.NoError(t, err) require.NoError(t, err)
config.HTTPEnabled = true config.HTTPEnabled = true
config.HTTPVirtualHosts = []string{"my.domain.com"} config.HTTPVirtualHosts = []string{"my.domain.com"}

View File

@ -1106,10 +1106,6 @@ func getUpstreamURL(networkID uint64) string {
switch networkID { switch networkID {
case MainNetworkID: case MainNetworkID:
return MainnetEthereumNetworkURL return MainnetEthereumNetworkURL
case RopstenNetworkID:
return RopstenEthereumNetworkURL
case RinkebyNetworkID:
return RinkebyEthereumNetworkURL
case GoerliNetworkID: case GoerliNetworkID:
return GoerliEthereumNetworkURL return GoerliEthereumNetworkURL
} }
@ -1158,14 +1154,12 @@ func (c *NodeConfig) AddAPIModule(m string) {
} }
// LesTopic returns discovery v5 topic derived from genesis of the provided network. // LesTopic returns discovery v5 topic derived from genesis of the provided network.
// 1 - mainnet, 3 - ropsten, 4 - rinkeby // 1 - mainnet, 5 - goerli
func LesTopic(netid int) string { func LesTopic(netid int) string {
switch netid { switch netid {
case 1: case 1:
return LESDiscoveryIdentifier + types.Bytes2Hex(params.MainnetGenesisHash.Bytes()[:8]) return LESDiscoveryIdentifier + types.Bytes2Hex(params.MainnetGenesisHash.Bytes()[:8])
case 3: case 5:
return LESDiscoveryIdentifier + types.Bytes2Hex(params.RopstenGenesisHash.Bytes()[:8])
case 4:
return LESDiscoveryIdentifier + types.Bytes2Hex(params.RinkebyGenesisHash.Bytes()[:8]) return LESDiscoveryIdentifier + types.Bytes2Hex(params.RinkebyGenesisHash.Bytes()[:8])
default: default:
return "" return ""

View File

@ -19,7 +19,7 @@ import (
func TestNewNodeConfigWithDefaults(t *testing.T) { func TestNewNodeConfigWithDefaults(t *testing.T) {
c, err := params.NewNodeConfigWithDefaults( c, err := params.NewNodeConfigWithDefaults(
"/some/data/path", "/some/data/path",
params.RopstenNetworkID, params.GoerliNetworkID,
params.WithFleet(params.FleetProd), params.WithFleet(params.FleetProd),
params.WithLES(), params.WithLES(),
params.WithMailserver(), params.WithMailserver(),
@ -88,7 +88,7 @@ func TestConfigWriteRead(t *testing.T) {
require.Nil(t, err) require.Nil(t, err)
defer os.RemoveAll(tmpDir) // nolint: errcheck defer os.RemoveAll(tmpDir) // nolint: errcheck
nodeConfig, err := utils.MakeTestNodeConfigWithDataDir("", tmpDir, params.RopstenNetworkID) nodeConfig, err := utils.MakeTestNodeConfigWithDataDir("", tmpDir, params.GoerliNetworkID)
require.Nil(t, err, "cannot create new config object") require.Nil(t, err, "cannot create new config object")
err = nodeConfig.Save() err = nodeConfig.Save()
@ -97,7 +97,7 @@ func TestConfigWriteRead(t *testing.T) {
loadedConfigData, err := ioutil.ReadFile(filepath.Join(nodeConfig.DataDir, "config.json")) loadedConfigData, err := ioutil.ReadFile(filepath.Join(nodeConfig.DataDir, "config.json"))
require.Nil(t, err, "cannot read configuration from disk") require.Nil(t, err, "cannot read configuration from disk")
loadedConfig := string(loadedConfigData) loadedConfig := string(loadedConfigData)
require.Contains(t, loadedConfig, fmt.Sprintf(`"NetworkId": %d`, params.RopstenNetworkID)) require.Contains(t, loadedConfig, fmt.Sprintf(`"NetworkId": %d`, params.GoerliNetworkID))
require.Contains(t, loadedConfig, fmt.Sprintf(`"DataDir": "%s"`, tmpDir)) require.Contains(t, loadedConfig, fmt.Sprintf(`"DataDir": "%s"`, tmpDir))
require.Contains(t, loadedConfig, fmt.Sprintf(`"BackupDisabledDataDir": "%s"`, tmpDir)) require.Contains(t, loadedConfig, fmt.Sprintf(`"BackupDisabledDataDir": "%s"`, tmpDir))
} }

View File

@ -39,14 +39,6 @@ const (
// allow us avoid syncing node. // allow us avoid syncing node.
MainnetEthereumNetworkURL = "https://mainnet.infura.io/nKmXgiFgc2KqtoQ8BCGJ" MainnetEthereumNetworkURL = "https://mainnet.infura.io/nKmXgiFgc2KqtoQ8BCGJ"
// RopstenEthereumNetworkURL is URL where the upstream ethereum network is loaded to
// allow us avoid syncing node.
RopstenEthereumNetworkURL = "https://ropsten.infura.io/nKmXgiFgc2KqtoQ8BCGJ"
// RinkebyEthereumNetworkURL is URL where the upstream ethereum network is loaded to
// allow us avoid syncing node.
RinkebyEthereumNetworkURL = "https://rinkeby.infura.io/nKmXgiFgc2KqtoQ8BCGJ"
// GoerliEthereumNetworkURL is an open RPC endpoint to Goerli network // GoerliEthereumNetworkURL is an open RPC endpoint to Goerli network
// Other RPC endpoints are available here: http://goerli.blockscout.com/ // Other RPC endpoints are available here: http://goerli.blockscout.com/
GoerliEthereumNetworkURL = "http://goerli.blockscout.com/" GoerliEthereumNetworkURL = "http://goerli.blockscout.com/"
@ -54,12 +46,6 @@ const (
// MainNetworkID is id of the main network // MainNetworkID is id of the main network
MainNetworkID = 1 MainNetworkID = 1
// RopstenNetworkID is id of a test network (on PoW)
RopstenNetworkID = 3
// RinkebyNetworkID is id of a test network (on PoA)
RinkebyNetworkID = 4
// GoerliNetworkID is id of goerli test network (PoA) // GoerliNetworkID is id of goerli test network (PoA)
GoerliNetworkID = 5 GoerliNetworkID = 5

View File

@ -27,32 +27,6 @@ var initNetworks = []params.Network{
Layer: 1, Layer: 1,
Enabled: true, Enabled: true,
}, },
{
ChainID: 3,
ChainName: "Ropsten",
RPCURL: "https://ropsten.infura.io/nKmXgiFgc2KqtoQ8BCGJ",
BlockExplorerURL: "https://ropsten.etherscan.io/",
IconURL: "",
NativeCurrencyName: "Ether",
NativeCurrencySymbol: "ETH",
NativeCurrencyDecimals: 18,
IsTest: true,
Layer: 1,
Enabled: false,
},
{
ChainID: 4,
ChainName: "Rinkeby",
RPCURL: "https://rinkeby.infura.io/nKmXgiFgc2KqtoQ8BCGJ",
BlockExplorerURL: "https://rinkeby.etherscan.io/",
IconURL: "",
NativeCurrencyName: "Ether",
NativeCurrencySymbol: "ETH",
NativeCurrencyDecimals: 18,
IsTest: true,
Layer: 1,
Enabled: false,
},
{ {
ChainID: 5, ChainID: 5,
ChainName: "Goerli", ChainName: "Goerli",

View File

@ -1,5 +1,5 @@
// Package t and its sub-packages are intended to support the testing // Package t and its sub-packages are intended to support the testing
// of status-go. It supports Ropsten, Rinkeby, and StatusChain for tests. // of status-go. It supports Goerli and StatusChain for tests.
package t package t
//go:generate go-bindata -pkg t -o ./bindata.go ./config //go:generate go-bindata -pkg t -o ./bindata.go ./config

View File

@ -50,8 +50,6 @@ var (
// TestNetworkNames network ID to name mapping // TestNetworkNames network ID to name mapping
TestNetworkNames = map[int]string{ TestNetworkNames = map[int]string{
params.MainNetworkID: "Mainnet", params.MainNetworkID: "Mainnet",
params.RopstenNetworkID: "Ropsten",
params.RinkebyNetworkID: "Rinkeby",
params.StatusChainNetworkID: "StatusChain", params.StatusChainNetworkID: "StatusChain",
params.GoerliNetworkID: "Goerli", params.GoerliNetworkID: "Goerli",
} }
@ -128,10 +126,6 @@ func GetRemoteURLFromNetworkID(id int) (url string, err error) {
switch id { switch id {
case params.MainNetworkID: case params.MainNetworkID:
url = params.MainnetEthereumNetworkURL url = params.MainnetEthereumNetworkURL
case params.RinkebyNetworkID:
url = params.RinkebyEthereumNetworkURL
case params.RopstenNetworkID:
url = params.RopstenEthereumNetworkURL
case params.GoerliNetworkID: case params.GoerliNetworkID:
url = params.GoerliEthereumNetworkURL url = params.GoerliEthereumNetworkURL
default: default:
@ -146,10 +140,6 @@ func GetHeadHashFromNetworkID(id int) string {
switch id { switch id {
case params.MainNetworkID: case params.MainNetworkID:
return "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3" return "0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3"
case params.RinkebyNetworkID:
return "0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177"
case params.RopstenNetworkID:
return "0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"
case params.StatusChainNetworkID: case params.StatusChainNetworkID:
return "0xe9d8920a99dc66a9557a87d51f9d14a34ec50aae04298e0f142187427d3c832e" return "0xe9d8920a99dc66a9557a87d51f9d14a34ec50aae04298e0f142187427d3c832e"
case params.GoerliNetworkID: case params.GoerliNetworkID:
@ -175,10 +165,6 @@ func GetNetworkID() int {
switch strings.ToLower(*networkSelected) { switch strings.ToLower(*networkSelected) {
case fmt.Sprintf("%d", params.MainNetworkID), "mainnet": case fmt.Sprintf("%d", params.MainNetworkID), "mainnet":
return params.MainNetworkID return params.MainNetworkID
case fmt.Sprintf("%d", params.RinkebyNetworkID), "rinkeby":
return params.RinkebyNetworkID
case fmt.Sprintf("%d", params.RopstenNetworkID), "ropsten", "testnet":
return params.RopstenNetworkID
case fmt.Sprintf("%d", params.StatusChainNetworkID), "statuschain": case fmt.Sprintf("%d", params.StatusChainNetworkID), "statuschain":
return params.StatusChainNetworkID return params.StatusChainNetworkID
case fmt.Sprintf("%d", params.GoerliNetworkID), "goerli": case fmt.Sprintf("%d", params.GoerliNetworkID), "goerli":