Remove unused testnet configuration

This commit is contained in:
jangko 2023-10-24 11:44:15 +07:00
parent 0a01ab1fe0
commit 63ff17efbf
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
7 changed files with 3 additions and 133 deletions

View File

@ -77,10 +77,7 @@ const
# these are public network id
MainNet* = 1.NetworkId
# No longer used: MordenNet = 2
RopstenNet* = 3.NetworkId
RinkebyNet* = 4.NetworkId
GoerliNet* = 5.NetworkId
KovanNet* = 42.NetworkId
SepoliaNet* = 11155111.NetworkId
# ------------------------------------------------------------------------------
@ -411,45 +408,6 @@ proc chainConfigForNetwork*(id: NetworkId): ChainConfig =
terminalTotalDifficulty: some(mainNetTTD),
shanghaiTime: some(1_681_338_455.EthTime)
)
of RopstenNet:
ChainConfig(
consensusType: ConsensusType.POW,
chainId: RopstenNet.ChainId,
# Genesis: # 2016-11-20 11:48:50 UTC
homesteadBlock: some(0.toBlockNumber), # Included in genesis
daoForkSupport: false,
eip150Block: some(0.toBlockNumber), # Included in genesis
eip150Hash: toDigest("41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"),
eip155Block: some(10.toBlockNumber), # Same as EIP-158
eip158Block: some(10.toBlockNumber), # 2016-11-20 11:50:44 UTC
byzantiumBlock: some(1_700_000.toBlockNumber), # 2017-09-19 01:08:28 UTC
constantinopleBlock: some(4_230_000.toBlockNumber), # 2018-10-13 17:19:06 UTC
petersburgBlock: some(4_939_394.toBlockNumber), # 2019-02-02 07:39:08 UTC
istanbulBlock: some(6_485_846.toBlockNumber), # 2019-09-30 03:38:06 UTC
muirGlacierBlock: some(7_117_117.toBlockNumber), # 2020-01-13 06:37:37 UTC
berlinBlock: some(9_812_189.toBlockNumber), # 2021-03-10 13:32:08 UTC
londonBlock: some(10_499_401.toBlockNumber), # 2021-06-24 02:03:37 UTC
)
of RinkebyNet:
ChainConfig(
clique: CliqueOptions(period: some(15), epoch: some(30000)),
consensusType: ConsensusType.POA,
chainId: RinkebyNet.ChainId,
# Genesis: # 2017-04-12 15:20:50 UTC
homesteadBlock: some(1.toBlockNumber), # 2017-04-12 15:20:58 UTC
daoForkSupport: false,
eip150Block: some(2.toBlockNumber), # 2017-04-12 15:21:14 UTC
eip150Hash: toDigest("9b095b36c15eaf13044373aef8ee0bd3a382a5abb92e402afa44b8249c3a90e9"),
eip155Block: some(3.toBlockNumber), # Same as EIP-158
eip158Block: some(3.toBlockNumber), # 2017-04-12 15:21:29 UTC
byzantiumBlock: some(1_035_301.toBlockNumber), # 2017-10-09 12:08:23 UTC
constantinopleBlock: some(3_660_663.toBlockNumber), # 2019-01-09 13:00:55 UTC
petersburgBlock: some(4_321_234.toBlockNumber), # 2019-05-04 05:32:45 UTC
istanbulBlock: some(5_435_345.toBlockNumber), # 2019-11-13 18:21:53 UTC
muirGlacierBlock: some(8_290_928.toBlockNumber), # Skipped on Rinkeby
berlinBlock: some(8_290_928.toBlockNumber), # 2021-03-24 14:48:36 UTC
londonBlock: some(8_897_988.toBlockNumber), # 2021-07-08 01:27:32 UTC
)
of GoerliNet:
ChainConfig(
clique: CliqueOptions(period: some(15), epoch: some(30000)),
@ -507,23 +465,6 @@ proc genesisBlockForNetwork*(id: NetworkId): Genesis
difficulty: 17179869184.u256,
alloc: decodePrealloc(mainnetAllocData)
)
of RopstenNet:
Genesis(
nonce: 66.toBlockNonce,
extraData: hexToSeqByte("0x3535353535353535353535353535353535353535353535353535353535353535"),
gasLimit: 16777216,
difficulty: 1048576.u256,
alloc: decodePrealloc(testnetAllocData)
)
of RinkebyNet:
Genesis(
nonce: 0.toBlockNonce,
timestamp: EthTime(0x58ee40ba),
extraData: hexToSeqByte("0x52657370656374206d7920617574686f7269746168207e452e436172746d616e42eb768f2244c8811c63729a21a3569731535f067ffc57839b00206d1ad20c69a1981b489f772031b279182d99e65703f0076e4812653aab85fca0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
gasLimit: 4700000,
difficulty: 1.u256,
alloc: decodePrealloc(rinkebyAllocData)
)
of GoerliNet:
Genesis(
nonce: 0.toBlockNonce,

View File

@ -451,7 +451,7 @@ func pruneTrie*(com: CommonRef): bool =
# because some client do not make distinction
# between them.
# And popular networks such as MainNet
# Goerli, Rinkeby add more confusion to this
# Goerli add more confusion to this
# by not make distinction too in their value.
func chainId*(com: CommonRef): ChainId =
com.config.chainId

File diff suppressed because one or more lines are too long

View File

@ -213,13 +213,10 @@ type
network {.
separator: "\pETHEREUM NETWORK OPTIONS:"
desc: "Name or id number of Ethereum network(mainnet(1), ropsten(3), rinkeby(4), goerli(5), kovan(42), sepolia(11155111), other=custom)"
desc: "Name or id number of Ethereum network(mainnet(1), goerli(5), sepolia(11155111), other=custom)"
longDesc:
"- mainnet: Ethereum main network\n" &
"- ropsten: Test network (proof-of-work, the one most like Ethereum mainnet)\n" &
"- rinkeby: Test network (proof-of-authority, for those running Geth clients)\n" &
"- goerli: Test network (proof-of-authority, works across all clients)\n" &
"- kovan: Test network (proof-of-authority, for those running OpenEthereum clients)\n" &
"- sepolia: Test network (proof-of-work)"
defaultValue: "" # the default value is set in makeConfig
defaultValueDesc: "mainnet(1)"
@ -655,10 +652,7 @@ proc getNetworkId(conf: NimbusConf): Option[NetworkId] =
let network = toLowerAscii(conf.network)
case network
of "mainnet": return some MainNet
of "ropsten": return some RopstenNet
of "rinkeby": return some RinkebyNet
of "goerli" : return some GoerliNet
of "kovan" : return some KovanNet
of "sepolia": return some SepoliaNet
else:
try:
@ -734,14 +728,8 @@ proc getBootNodes*(conf: NimbusConf): seq[ENode] =
case conf.networkId
of MainNet:
bootstrapNodes.setBootnodes(MainnetBootnodes)
of RopstenNet:
bootstrapNodes.setBootnodes(RopstenBootnodes)
of RinkebyNet:
bootstrapNodes.setBootnodes(RinkebyBootnodes)
of GoerliNet:
bootstrapNodes.setBootnodes(GoerliBootnodes)
of KovanNet:
bootstrapNodes.setBootnodes(KovanBootnodes)
of SepoliaNet:
bootstrapNodes.setBootnodes(SepoliaBootnodes)
else:

View File

@ -4,10 +4,7 @@ import
from ../nimbus/common/chain_config import
MainNet,
RopstenNet,
RinkebyNet,
GoerliNet,
KovanNet
GoerliNet
type
ConfigStatus* = enum
@ -64,10 +61,7 @@ proc processU256(val: string, o: var UInt256): ConfigStatus =
proc processNetId(val: string, o: var NetworkId): ConfigStatus =
case val.toLowerAscii()
of "main": o = MainNet
of "ropsten": o = RopstenNet
of "rinkeby": o = RinkebyNet
of "goerli": o = GoerliNet
of "kovan": o = KovanNet
template checkArgument(fun, o, value: untyped) =
## Checks if arguments got processed successfully

View File

@ -33,47 +33,6 @@ const
(blockNumber: 20000000'u64, id: (crc: 0xf0afd0e3'u32, nextFork: 0'u64)), # Future Gray Glacier block
]
RopstenNetIDs = [
(blockNumber: 0'u64, id: (crc: 0x30c7ddbc'u32, nextFork: 10'u64)), # Unsynced, last Frontier, Homestead and first Tangerine block
(blockNumber: 9'u64, id: (crc: 0x30c7ddbc'u32, nextFork: 10'u64)), # Last Tangerine block
(blockNumber: 10'u64, id: (crc: 0x63760190'u32, nextFork: 1700000'u64)), # First Spurious block
(blockNumber: 1699999'u64, id: (crc: 0x63760190'u32, nextFork: 1700000'u64)), # Last Spurious block
(blockNumber: 1700000'u64, id: (crc: 0x3ea159c7'u32, nextFork: 4230000'u64)), # First Byzantium block
(blockNumber: 4229999'u64, id: (crc: 0x3ea159c7'u32, nextFork: 4230000'u64)), # Last Byzantium block
(blockNumber: 4230000'u64, id: (crc: 0x97b544f3'u32, nextFork: 4939394'u64)), # First Constantinople block
(blockNumber: 4939393'u64, id: (crc: 0x97b544f3'u32, nextFork: 4939394'u64)), # Last Constantinople block
(blockNumber: 4939394'u64, id: (crc: 0xd6e2149b'u32, nextFork: 6485846'u64)), # First Petersburg block
(blockNumber: 6485845'u64, id: (crc: 0xd6e2149b'u32, nextFork: 6485846'u64)), # Last Petersburg block
(blockNumber: 6485846'u64, id: (crc: 0x4bc66396'u32, nextFork: 7117117'u64)), # First Istanbul block
(blockNumber: 7117116'u64, id: (crc: 0x4bc66396'u32, nextFork: 7117117'u64)), # Last Istanbul block
(blockNumber: 7117117'u64, id: (crc: 0x6727EF90'u32, nextFork: 9812189'u64)), # First MuirGlacier block
(blockNumber: 9812188'u64, id: (crc: 0x6727EF90'u32, nextFork: 9812189'u64)), # Last MuirGlacier block
(blockNumber: 9812189'u64, id: (crc: 0xa157d377'u32, nextFork: 10499401'u64)), # First Berlin block
(blockNumber: 10499400'u64, id: (crc: 0xa157d377'u32, nextFork: 10499401'u64)), # Last Berlin block
(blockNumber: 10499401'u64, id: (crc: 0x7119b6b3'u32, nextFork: 0'u64)), # First London block
(blockNumber: 20000000'u64, id: (crc: 0x7119b6b3'u32, nextFork: 0'u64)), # Future London block
]
RinkebyNetIDs = [
(blockNumber: 0'u64, id: (crc: 0x3b8e0691'u32, nextFork: 1'u64)), # Unsynced, last Frontier block
(blockNumber: 1'u64, id: (crc: 0x60949295'u32, nextFork: 2'u64)), # First and last Homestead block
(blockNumber: 2'u64, id: (crc: 0x8bde40dd'u32, nextFork: 3'u64)), # First and last Tangerine block
(blockNumber: 3'u64, id: (crc: 0xcb3a64bb'u32, nextFork: 1035301'u64)), # First Spurious block
(blockNumber: 1035300'u64, id: (crc: 0xcb3a64bb'u32, nextFork: 1035301'u64)), # Last Spurious block
(blockNumber: 1035301'u64, id: (crc: 0x8d748b57'u32, nextFork: 3660663'u64)), # First Byzantium block
(blockNumber: 3660662'u64, id: (crc: 0x8d748b57'u32, nextFork: 3660663'u64)), # Last Byzantium block
(blockNumber: 3660663'u64, id: (crc: 0xe49cab14'u32, nextFork: 4321234'u64)), # First Constantinople block
(blockNumber: 4321233'u64, id: (crc: 0xe49cab14'u32, nextFork: 4321234'u64)), # Last Constantinople block
(blockNumber: 4321234'u64, id: (crc: 0xafec6b27'u32, nextFork: 5435345'u64)), # First Petersburg block
(blockNumber: 5435344'u64, id: (crc: 0xafec6b27'u32, nextFork: 5435345'u64)), # Last Petersburg block
(blockNumber: 5435345'u64, id: (crc: 0xcbdb8838'u32, nextFork: 8290928'u64)), # First Istanbul block
(blockNumber: 8290927'u64, id: (crc: 0xcbdb8838'u32, nextFork: 8290928'u64)), # Last Istanbul block
(blockNumber: 8290928'u64, id: (crc: 0x6910c8bd'u32, nextFork: 8897988'u64)), # First Berlin block
(blockNumber: 8897987'u64, id: (crc: 0x6910c8bd'u32, nextFork: 8897988'u64)), # Last Berlin block
(blockNumber: 8897988'u64, id: (crc: 0x8e29f2f3'u32, nextFork: 0'u64)), # First London block
(blockNumber: 10000000'u64, id: (crc: 0x8e29f2f3'u32, nextFork: 0'u64)), # Future London block
]
GoerliNetIDs = [
(blockNumber: 0'u64, id: (crc: 0xa3f5ab08'u32, nextFork: 1561651'u64)), # Unsynced, last Frontier, Homestead, Tangerine, Spurious, Byzantium, Constantinople and first Petersburg block
(blockNumber: 1561650'u64, id: (crc: 0xa3f5ab08'u32, nextFork: 1561651'u64)), # Last Petersburg block
@ -99,8 +58,6 @@ template runTest(network: untyped, name: string) =
proc forkIdMain*() =
suite "Fork ID tests":
runTest(MainNet, "MainNet")
runTest(RopstenNet, "RopstenNet")
runTest(RinkebyNet, "RinkebyNet")
runTest(GoerliNet, "GoerliNet")
when isMainModule:

View File

@ -26,14 +26,6 @@ proc genesisTest() =
let b = makeGenesis(MainNet)
check(b.blockHash == "D4E56740F876AEF8C010B86A40D5F56745A118D0906A34E69AEC8C0DB1CB8FA3".toDigest)
test "Correct ropstennet hash":
let b = makeGenesis(RopstenNet)
check(b.blockHash == "41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d".toDigest)
test "Correct rinkebynet hash":
let b = makeGenesis(RinkebyNet)
check(b.blockHash == "6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177".toDigest)
test "Correct goerlinet hash":
let b = makeGenesis(GoerliNet)
check(b.blockHash == "bf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a".toDigest)