Skip to content

Commit fcdc21c

Browse files
author
Nicolás Tallar
authored
[ETCM-121] Refactor configs (#681)
1 parent b8adef4 commit fcdc21c

35 files changed

+595
-495
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Universal / mappings += (resourceDirectory in Compile).value / "logback.xml" ->
126126

127127
val sep = java.io.File.separator
128128
jdkPackagerJVMArgs := Seq(
129-
"-Dconfig.file=." + sep + "conf" + sep + "mantis.conf",
129+
"-Dconfig.file=." + sep + "conf" + sep + "app.conf",
130130
"-Dlogback.configurationFile=." + sep + "conf" + sep + "logback.xml",
131131
"-Xss10M"
132132
)

src/main/resources/application.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,17 +260,17 @@ mantis {
260260
blockchains {
261261
network = "etc"
262262

263-
etc { include "chains/etc.conf" }
263+
etc { include "chains/etc-chain.conf"}
264264

265-
eth { include "chains/eth.conf" }
265+
eth { include "chains/eth-chain.conf"}
266266

267-
mordor { include "chains/mordor.conf"}
267+
mordor { include "chains/mordor-chain.conf"}
268268

269-
ropsten { include "chains/ropsten.conf" }
269+
ropsten { include "chains/ropsten-chain.conf"}
270270

271-
test { include "chains/test.conf" }
271+
test { include "chains/test-chain.conf"}
272272

273-
private { include "chains/private.conf" }
273+
testnet-internal { include "chains/testnet-internal-chain.conf"}
274274
}
275275

276276
sync {

src/main/resources/chains/base.conf renamed to src/main/resources/chains/etc-chain.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
# Ethereum network identifier:
3-
# 1 - mainnet, 7 - mordor
3+
# 1 - mainnet, 3 - ropsten, 7 - mordor
44
network-id = 1
55

66
# Frontier block number

src/main/resources/chains/etc.conf

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/resources/chains/eth.conf renamed to src/main/resources/chains/eth-chain.conf

Lines changed: 92 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,58 @@
11
{
2-
include "etc.conf"
2+
# Ethereum network identifier:
3+
# 1 - mainnet, 3 - ropsten, 7 - mordor
4+
network-id = 1
35

6+
# Frontier block number
7+
frontier-block-number = "0"
8+
9+
# Homestead fork block number
10+
# Doc: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.md
11+
homestead-block-number = "1150000"
12+
13+
# EIP-106 fork block number
14+
# Doc: https://github.com/ethereum/EIPs/issues/106
15+
eip106-block-number = "1000000000000000000"
16+
17+
# EIP-150 fork block number
18+
# Doc: https://github.com/ethereum/EIPs/issues/150
419
eip150-block-number = "2463000"
20+
21+
# EIP-155 fork block number
22+
# Doc: https://github.com/ethereum/eips/issues/155
23+
# 3 000 000 following lead of existing clients implementation to maintain compatibility
24+
# https://github.com/paritytech/parity/blob/b50fb71dd1d29dfde2a6c7e1830447cf30896c31/ethcore/res/ethereum/classic.json#L15
525
eip155-block-number = "2675000"
6-
eip160-block-number = "2675000"
7-
eip161-block-number = "2675000"
826

9-
# Byzantium fork block number (ETH only)
10-
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-609.md
11-
byzantium-block-number = "4370000"
27+
# EIP-160 fork block number
28+
# Doc: https://github.com/ethereum/EIPs/issues/160
29+
eip160-block-number = "2675000"
1230

13-
# Constantinople fork block number (ETH only)
14-
# https://github.com/ethereum/pm/issues/53
15-
constantinople-block-number = "7280000"
31+
# EIP-161 fork block number (ETH Only)
32+
# Doc: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-161.md
33+
eip161-block-number = "2675000"
1634

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

20-
# Setting both values to zero disables difficulty bomb delay
41+
# Difficulty bomb pause block number
42+
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1010.md
2143
difficulty-bomb-pause-block-number = "0"
44+
45+
# Difficulty bomb continuation block number
46+
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1010.md
2247
difficulty-bomb-continue-block-number = "0"
23-
# Disabled for ethereumHF
48+
49+
# Difficulty bomb defusion block number
50+
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1041.md
2451
difficulty-bomb-removal-block-number = "1000000000000000000"
2552

26-
chain-id = "1"
53+
# Byzantium fork block number (ETH only)
54+
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-609.md
55+
byzantium-block-number = "4370000"
2756

2857
# Atlantis fork block number (ETC only)
2958
# https://ecips.ethereumclassic.org/ECIPs/ecip-1054
@@ -37,6 +66,10 @@
3766
# https://ecips.ethereumclassic.org/ECIPs/ecip-1088
3867
phoenix-block-number = "1000000000000000000"
3968

69+
# Constantinople fork block number (ETH only)
70+
# https://github.com/ethereum/pm/issues/53
71+
constantinople-block-number = "7280000"
72+
4073
# Petersburg fork block number (ETH only)
4174
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1716.md
4275
petersburg-block-number = "7280000"
@@ -49,18 +82,6 @@
4982
# https://ecips.ethereumclassic.org/ECIPs/ecip-1098
5083
ecip1098-block-number = "1000000000000000000"
5184

52-
monetary-policy {
53-
54-
# Setting era-duration for eth and ropsten chain to big number is necessery to ensure
55-
# that those chains will always remain in era - 0. Later eras are only relevant for
56-
# etc and morden chain.
57-
# 500000000 blocks will ensure that 0 era will last at least 237 years.
58-
#
59-
era-duration = 500000000
60-
61-
reward-reduction-rate = 0
62-
}
63-
6485
# DAO fork configuration (Ethereum HF/Classic split)
6586
# https://blog.ethereum.org/2016/07/20/hard-fork-completed/
6687
dao {
@@ -201,6 +222,51 @@
201222
]
202223
}
203224

225+
# Starting nonce of an empty account. Some networks (like Morden) use different values.
226+
account-start-nonce = "0"
227+
228+
# The ID of the accepted chain
229+
chain-id = "1"
230+
231+
# Custom genesis JSON file path
232+
# null value indicates using default genesis definition that matches the main network
233+
custom-genesis-file = null
234+
235+
# Monetary policy parameters
236+
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1017.md
237+
monetary-policy {
238+
# Block reward in the first era
239+
first-era-block-reward = "5000000000000000000"
240+
241+
# Reduced block reward after Byzantium fork
242+
first-era-reduced-block-reward = "3000000000000000000"
243+
244+
# Reduced block reward after Constantinople fork
245+
first-era-constantinople-reduced-block-reward = "2000000000000000000"
246+
247+
# Monetary policy era duration in number of blocks
248+
# Setting era-duration for eth and ropsten chain to big number is necessery to ensure
249+
# that those chains will always remain in era - 0. Later eras are only relevant for
250+
# etc and morden chain.
251+
# 500000000 blocks will ensure that 0 era will last at least 237 years.
252+
#
253+
era-duration = 500000000
254+
255+
# Rate at which rewards get reduced in successive eras.
256+
# Value in range [0.0, 1.0]
257+
reward-reduction-rate = 0
258+
}
259+
260+
# if 2 competing blocktree branches are equal in terms of total difficulty and this is set to true, then gas
261+
# consumed in those branches will be used to resolve the tie
262+
# this is currently only used in ETS blockchain tests
263+
gas-tie-breaker = false
264+
265+
# if true, account storage will use Ethereum-specific format for storing keys/value in MPT (32 byte)
266+
# if false, generic storage for arbitrary length integers will be used
267+
eth-compatible-storage = true
268+
269+
# Set of initial nodes
204270
bootstrap-nodes = [
205271
"enode://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303",
206272
"enode://3f1d12044546b76342d59d4a05532c14b85aa669704bfe1f864fe079415aa2c02d743e03218e57a33fb94523adb54032871a6c51b2cc5514cb7c7e35b3ed0a99@13.93.211.84:30303",
@@ -209,5 +275,5 @@
209275
"enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303",
210276
"enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303",
211277
]
212-
213278
}
279+

src/main/resources/chains/mordor.conf renamed to src/main/resources/chains/mordor-chain.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
# Ethereum network identifier:
3-
# 1 - mainnet, 7 - mordor
3+
# 1 - mainnet, 3 - ropsten, 7 - mordor
44
network-id = 7
55

66
# Frontier block number
@@ -94,7 +94,7 @@
9494

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

9999
# Monetary policy parameters
100100
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1017.md

src/main/resources/chains/private.conf

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)