Skip to content

Commit

Permalink
[CHORE] Mordor testnet support
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Tallar committed Sep 14, 2020
1 parent 101a363 commit 38de423
Show file tree
Hide file tree
Showing 7 changed files with 168 additions and 62 deletions.
4 changes: 1 addition & 3 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,11 @@ mantis {
blockchains {
network = "etc"

base { include "chains/base.conf" }

etc { include "chains/etc.conf" }

eth { include "chains/eth.conf" }

morden { include "chains/morden.conf" }
mordor { include "chains/mordor.conf"}

ropsten { include "chains/ropsten.conf" }

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/chains/base.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
# Ethereum network identifier:
# 1 - mainnet, 2 - morden
# 1 - mainnet, 7 - mordor
network-id = 1

# Frontier block number
Expand Down
40 changes: 0 additions & 40 deletions src/main/resources/chains/morden.conf

This file was deleted.

17 changes: 0 additions & 17 deletions src/main/resources/chains/morden.json

This file was deleted.

153 changes: 153 additions & 0 deletions src/main/resources/chains/mordor.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
# Ethereum network identifier:
# 1 - mainnet, 7 - mordor
network-id = 7

# Frontier block number
frontier-block-number = "0"

# Homestead fork block number
# Doc: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.md
homestead-block-number = "0"

# EIP-106 fork block number
# Doc: https://github.com/ethereum/EIPs/issues/106
eip106-block-number = "1000000000000000000"

# EIP-150 fork block number
# Doc: https://github.com/ethereum/EIPs/issues/150
eip150-block-number = "0"

# EIP-155 fork block number
# Doc: https://github.com/ethereum/eips/issues/155
# 3 000 000 following lead of existing clients implementation to maintain compatibility
# https://github.com/paritytech/parity/blob/b50fb71dd1d29dfde2a6c7e1830447cf30896c31/ethcore/res/ethereum/classic.json#L15
eip155-block-number = "0"

# EIP-160 fork block number
# Doc: https://github.com/ethereum/EIPs/issues/160
eip160-block-number = "0"

# EIP-161 fork block number (ETH Only)
# Doc: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md
eip161-block-number = "1000000000000000000"

# EIP-170 max code size (Enabled from Atlantis fork block number)
# Doc: https://github.com/ethereum/EIPs/issues/170
# null value indicates there's no max code size for the contract code
# TODO improve this configuration format as currently it is not obvious that this is enabled only from some block number
max-code-size = "24576"

# Difficulty bomb pause block number
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1010.md
difficulty-bomb-pause-block-number = "0"

# Difficulty bomb continuation block number
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1010.md
difficulty-bomb-continue-block-number = "0"

# Difficulty bomb defusion block number
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1041.md
difficulty-bomb-removal-block-number = "0"

# Byzantium fork block number (ETH only)
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-609.md
byzantium-block-number = "1000000000000000000"

# Atlantis fork block number (ETC only)
# https://ecips.ethereumclassic.org/ECIPs/ecip-1054
atlantis-block-number = "0"

# Agharta fork block number (ETC only)
# https://ecips.ethereumclassic.org/ECIPs/ecip-1056
agharta-block-number = "301243"

# Phoenix fork block number (ETC only)
# https://ecips.ethereumclassic.org/ECIPs/ecip-1088
phoenix-block-number = "999983"

# Constantinople fork block number (ETH only)
# https://github.com/ethereum/pm/issues/53
constantinople-block-number = "1000000000000000000"

# Petersburg fork block number (ETH only)
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1716.md
petersburg-block-number = "1000000000000000000"

# Istanbul fork block number (ETH only)
# https://eips.ethereum.org/EIPS/eip-1679
istanbul-block-number = "1000000000000000000"

# DAO fork configuration (Ethereum HF/Classic split)
# https://blog.ethereum.org/2016/07/20/hard-fork-completed/
dao = null


# Starting nonce of an empty account. Some networks (like Morden) use different values.
account-start-nonce = "0"

# The ID of the accepted chain
chain-id = "0x3f"

# Custom genesis JSON file path
# null value indicates using default genesis definition that matches the main network
custom-genesis-file = "chains/mordor.json"

# Monetary policy parameters
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1017.md
monetary-policy {
# Block reward in the first era
first-era-block-reward = "5000000000000000000"

# Reduced block reward after Byzantium fork
first-era-reduced-block-reward = "3000000000000000000"

# Reduced block reward after Constantinople fork
first-era-constantinople-reduced-block-reward = "2000000000000000000"

# Monetary policy era duration in number of blocks
era-duration = 2000000

# Rate at which rewards get reduced in successive eras.
# Value in range [0.0, 1.0]
reward-reduction-rate = 0.2
}

# if 2 competing blocktree branches are equal in terms of total difficulty and this is set to true, then gas
# consumed in those branches will be used to resolve the tie
# this is currently only used in ETS blockchain tests
gas-tie-breaker = false

# if true, account storage will use Ethereum-specific format for storing keys/value in MPT (32 byte)
# if false, generic storage for arbitrary length integers will be used
eth-compatible-storage = true

# Set of initial nodes
bootstrap-nodes = [
"enode://a59e33ccd2b3e52d578f1fbd70c6f9babda2650f0760d6ff3b37742fdcdfdb3defba5d56d315b40c46b70198c7621e63ffa3f987389c7118634b0fefbbdfa7fd@51.158.191.43:38556", // @q9f parity mizar
"enode://651b484b652c07c72adebfaaf8bc2bd95b420b16952ef3de76a9c00ef63f07cca02a20bd2363426f9e6fe372cef96a42b0fec3c747d118f79fd5e02f2a4ebd4e@51.158.190.99:45678", // @q9f core-geth lyrae
"enode://9b1bf9613d859ac2071d88509ab40a111b75c1cfc51f4ad78a1fdbb429ff2405de0dc5ea8ae75e6ac88e03e51a465f0b27b517e78517f7220ae163a2e0692991@51.158.190.99:30426", // @q9f parity lyrae
"enode://111bd28d5b2c1378d748383fd83ff59572967c317c3063a9f475a26ad3f1517642a164338fb5268d4e32ea1cc48e663bd627dec572f1d201c7198518e5a506b1@88.99.216.30:45834",
"enode://2b69a3926f36a7748c9021c34050be5e0b64346225e477fe7377070f6289bd363b2be73a06010fd516e6ea3ee90778dd0399bc007bb1281923a79374f842675a@51.15.116.226:30303",
"enode://06fdbeb591d26f53b2e7250025fe955ca013431ded930920cf1e3cd1f0c920e9a5e727949d209bc25a07288327b525279b11c5551315c50ff0db483e69fc159b@34.218.225.178:32000",
"enode://534d18fd46c5cd5ba48a68250c47cea27a1376869755ed631c94b91386328039eb607cf10dd8d0aa173f5ec21e3fb45c5d7a7aa904f97bc2557e9cb4ccc703f1@51.158.190.99:30303", // @q9f besu lyrae
"enode://617a2009783a09085ed0d5d5e7250e2e3c142f73448bf28200284bf4825c5926a80f3e9fb481edf38b89ade2aa0ad5a2f14cc935f3150e36e648eddda674fd70@35.225.5.185:51320",
"enode://4ca79bbff7491fed82221259e3f27492e27b95b600594e2f8d5f1fa011123ea267e71873a0db3993e5109845d519d8b849ba2c7e4b48b09bedebb99e1c2ce304@35.238.132.8:30303",
"enode://5a1399e6ba3268721dd7656530cd81230dbeb950570c6e3ec2a45effc50c032f66633c5eaaa1a49c51ba1849db37a7bef6e402779ad12dc9943f117e058d7760@35.225.124.17:39306",
"enode://0d70715514674189792de4ad294b658c96d0ec40fe517fbe9cb7949d3792f25f82357ec77d1bd8bed6ec719ca0c1d608bb34cc702bf3d4bb4507f7280f835452@154.5.137.161:61410",
"enode://07fa944c83597d5e935a2abe6194ed40fc7239e86111c971a43537a33d0184d1cd1b3f1291b8dd3bcfaebfbb802de77c843465a00065b39120c338fdd877ca4a@35.238.126.60:30000",
"enode://b45f008ab8ad73966d0c8c0c923c50f47c0ae50c37a9ea05cc28b00cb94802145a4158412a526fdadd7e539db5eaab72f06a9046a34576ecf5a68efc41ba9d01@34.68.40.145:30303",
"enode://03b133f731049e3f7be827339c3759be92778c05e54a1847d178c0fdb56fa168aa1e7e61fc77791a7afdd0328a00318f73c01212eb3f3bbe919f5ce8f5b4a314@192.227.105.4:32000",
"enode://859ed8c19ea04eaea41f1cf17c8d2710e2e0affb97328c8392a79f1764118edf2344f1941299f0d676772fa6054447e6f9b3af96444e350b417442bfd7cc832b@34.68.243.226:30303",
"enode://f840b007500f50c98ea6f9c9e56dabf4690bbbbb7036d43682c531204341aff8315013547e5bee54117eb22bd3603585ae6bf713d9fa710659533fcab65d5b84@35.238.101.58:30303",
"enode://f840b007500f50c98ea6f9c9e56dabf4690bbbbb7036d43682c531204341aff8315013547e5bee54117eb22bd3603585ae6bf713d9fa710659533fcab65d5b84@34.69.50.155:42078",
"enode://5a1399e6ba3268721dd7656530cd81230dbeb950570c6e3ec2a45effc50c032f66633c5eaaa1a49c51ba1849db37a7bef6e402779ad12dc9943f117e058d7760@34.69.121.227:30303",
"enode://642cf9650dd8869d42525dbf6858012e3b4d64f475e733847ab6f7742341a4397414865d953874e8f5ed91b0e4e1c533dee14ad1d6bb276a5459b2471460ff0d@157.230.152.87:30303", // @meowsbits but don't count on it
"enode://1f378945c9b2eeb292d910f461911fd99520a23beda1bc5c8aea12be09e249f8d92615aa3d4d75c938004db5281dabad4a9cf7a0f07ec7c1fc8e7721addc7c85@34.205.41.164:40218",
"enode://15b6ae4e9e18772f297c90d83645b0fbdb56667ce2d747d6d575b21d7b60c2d3cd52b11dec24e418438caf80ddc433232b3685320ed5d0e768e3972596385bfc@51.158.191.43:41235", // @q9f core-geth mizar
"enode://f50f52b5fe18fd281748905bf5dad5439471f32cc02d99fecf960a983c1f4eba701ffca96afd2f2a68dcf6f97c5d02b566bafce1f361b51717e1a03c1dd9a836@157.230.42.102:30303",
"enode://07fa944c83597d5e935a2abe6194ed40fc7239e86111c971a43537a33d0184d1cd1b3f1291b8dd3bcfaebfbb802de77c843465a00065b39120c338fdd877ca4a@35.238.126.60:51240",
"enode://c0afb552bfe932c72598caa245aef82d55c23555622c5ab946d4e49bb0ab694e46086dcff6793a606527f323ef94d0eb499d01ceb26aefb6fa3f8977105d7dd8@157.230.152.87:52138",
"enode://2592745efd35b4be443b8ee25fd2099de132e037951f9f6d3e8805e0a78f213537f71264b973f1a83a57372f57bbe6acac8d6ae678f39393221c045ccbe3b18c@51.15.116.226:30304",
]
}
12 changes: 12 additions & 0 deletions src/main/resources/chains/mordor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"difficulty": "0x20000",
"extraData": "0x70686f656e697820636869636b656e206162737572642062616e616e61",
"gasLimit": "0x2fefd8",
"nonce": "0x0000000000000000",
"ommersHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"timestamp": "0x5d9676db",
"coinbase": "0x0000000000000000000000000000000000000000",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"alloc": {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class GenesisDataLoader(

val header: BlockHeader = prepareHeader(genesisData, stateMptRootHash)

log.debug(s"prepared genesis header: $header")
log.debug(s"prepared genesis header: $header, with hash ${header.hashAsHexString}")

blockchain.getBlockHeaderByNumber(0) match {
case Some(existingGenesisHeader) if existingGenesisHeader.hash == header.hash =>
Expand Down

0 comments on commit 38de423

Please sign in to comment.