Skip to content

[ETCM-121] Refactor configs #681

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Universal / mappings += (resourceDirectory in Compile).value / "logback.xml" ->

val sep = java.io.File.separator
jdkPackagerJVMArgs := Seq(
"-Dconfig.file=." + sep + "conf" + sep + "mantis.conf",
"-Dconfig.file=." + sep + "conf" + sep + "app.conf",
"-Dlogback.configurationFile=." + sep + "conf" + sep + "logback.xml",
"-Xss10M"
)
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,17 @@ mantis {
blockchains {
network = "etc"

etc { include "chains/etc.conf" }
etc { include "chains/etc-chain.conf"}

eth { include "chains/eth.conf" }
eth { include "chains/eth-chain.conf"}

mordor { include "chains/mordor.conf"}
mordor { include "chains/mordor-chain.conf"}

ropsten { include "chains/ropsten.conf" }
ropsten { include "chains/ropsten-chain.conf"}

test { include "chains/test.conf" }
test { include "chains/test-chain.conf"}

private { include "chains/private.conf" }
testnet-internal { include "chains/testnet-internal-chain.conf"}
}

sync {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
# Ethereum network identifier:
# 1 - mainnet, 7 - mordor
# 1 - mainnet, 3 - ropsten, 7 - mordor
network-id = 1

# Frontier block number
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/chains/etc.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,29 +1,58 @@
{
include "etc.conf"
# Ethereum network identifier:
# 1 - mainnet, 3 - ropsten, 7 - mordor
network-id = 1

# 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 = "1150000"

# 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 = "2463000"

# 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 = "2675000"
eip160-block-number = "2675000"
eip161-block-number = "2675000"

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

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

# EIP-170 max code size (Enabled from eip161-block-number)
# 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"

# Setting both values to zero disables difficulty bomb delay
# 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"
# Disabled for ethereumHF

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

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

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

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

# Petersburg fork block number (ETH only)
# https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1716.md
petersburg-block-number = "7280000"
Expand All @@ -49,18 +82,6 @@
# https://ecips.ethereumclassic.org/ECIPs/ecip-1098
ecip1098-block-number = "1000000000000000000"

monetary-policy {

# Setting era-duration for eth and ropsten chain to big number is necessery to ensure
# that those chains will always remain in era - 0. Later eras are only relevant for
# etc and morden chain.
# 500000000 blocks will ensure that 0 era will last at least 237 years.
#
era-duration = 500000000

reward-reduction-rate = 0
}

# DAO fork configuration (Ethereum HF/Classic split)
# https://blog.ethereum.org/2016/07/20/hard-fork-completed/
dao {
Expand Down Expand Up @@ -201,6 +222,51 @@
]
}

# 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 = "1"

# Custom genesis JSON file path
# null value indicates using default genesis definition that matches the main network
custom-genesis-file = null
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: should we maybe get rid of optional genesis path? (separate task for Piotr or Adiran maybe?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally! Here's the task for that: https://jira.iohk.io/browse/ETCM-128


# 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
# Setting era-duration for eth and ropsten chain to big number is necessery to ensure
# that those chains will always remain in era - 0. Later eras are only relevant for
# etc and morden chain.
# 500000000 blocks will ensure that 0 era will last at least 237 years.
#
era-duration = 500000000

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

# 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://a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c@52.16.188.185:30303",
"enode://3f1d12044546b76342d59d4a05532c14b85aa669704bfe1f864fe079415aa2c02d743e03218e57a33fb94523adb54032871a6c51b2cc5514cb7c7e35b3ed0a99@13.93.211.84:30303",
Expand All @@ -209,5 +275,5 @@
"enode://1118980bf48b0a3640bdba04e0fe78b1add18e1cd99bf22d53daac1fd9972ad650df52176e7c7d89d1114cfef2bc23a2959aa54998a46afcf7d91809f0855082@52.74.57.123:30303",
"enode://979b7fa28feeb35a4741660a16076f1943202cb72b6af70d327f053e248bab9ba81760f39d0701ef1d8f89cc1fbd2cacba0710a12cd5314d5e0c9021aa3637f9@5.1.83.226:30303",
]

}

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
# Ethereum network identifier:
# 1 - mainnet, 7 - mordor
# 1 - mainnet, 3 - ropsten, 7 - mordor
network-id = 7

# Frontier block number
Expand Down Expand Up @@ -94,7 +94,7 @@

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

# Monetary policy parameters
# Doc: https://github.com/ethereumproject/ECIPs/blob/master/ECIPs/ECIP-1017.md
Expand Down
22 changes: 0 additions & 22 deletions src/main/resources/chains/private.conf

This file was deleted.

Loading