Skip to content

Commit

Permalink
refactor(config): remove deprecated, move sync_txs_chunk_size out f…
Browse files Browse the repository at this point in the history
…rom `consensus` (#1333)
  • Loading branch information
yangby-cryptape authored and Eason Gao committed Aug 25, 2023
1 parent 92d1633 commit 1885f5c
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 71 deletions.
9 changes: 4 additions & 5 deletions common/config-parser/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ pub struct Config {
pub network: ConfigNetwork,
pub mempool: ConfigMempool,
pub executor: ConfigExecutor,
pub consensus: ConfigConsensus,
#[serde(rename = "synchronization")]
pub sync: ConfigSynchronization,
#[serde(default)]
pub logger: ConfigLogger,
#[serde(default)]
Expand All @@ -38,8 +39,7 @@ pub struct Config {
pub prometheus: Option<ConfigPrometheus>,

#[serde(default)]
pub ibc_contract_address: H160,
pub wckb_contract_address: H160,
pub ibc_contract_address: H160,
}

impl Config {
Expand Down Expand Up @@ -210,7 +210,7 @@ fn default_sync_txs_chunk_size() -> usize {
}

#[derive(Clone, Debug, Deserialize)]
pub struct ConfigConsensus {
pub struct ConfigSynchronization {
#[serde(default = "default_sync_txs_chunk_size")]
pub sync_txs_chunk_size: usize,
}
Expand All @@ -236,7 +236,6 @@ pub struct ConfigMempool {

#[derive(Clone, Debug, Deserialize)]
pub struct ConfigExecutor {
pub light: bool,
pub triedb_cache_size: usize,
}

Expand Down
2 changes: 1 addition & 1 deletion core/run/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ impl Axon {
consensus_adapter.set_overlord_handler(overlord_consensus.get_overlord_handler());

let synchronization = Arc::new(OverlordSynchronization::<_>::new(
self.config.consensus.sync_txs_chunk_size,
self.config.sync.sync_txs_chunk_size,
consensus_adapter,
status_agent.clone(),
lock,
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x37aa0f893d05914a4def0460c0a984d3611546cfb26924d7a7ca6e0db9950a2d"
# db config
data_path = "./devtools/chain/data"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
listening_address = "/ip4/0.0.0.0/tcp/8001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand All @@ -75,7 +72,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/k8s/node_1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x37aa0f893d05914a4def0460c0a984d3611546cfb26924d7a7ca6e0db9950a2d"
# db config
data_path = "./devtools/chain/data1"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
listening_address = "/ip4/0.0.0.0/tcp/8001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand All @@ -84,7 +81,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/k8s/node_2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x383fcff8683b8115e31613949be24254b4204ffbe43c227408a76334a2e3fb32"
# db config
data_path = "./devtools/chain/data2"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
listening_address = "/ip4/0.0.0.0/tcp/8001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand All @@ -84,7 +81,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/k8s/node_3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x51ce21643b911347c5d5c85c323d9d5421810dc89f46b688720b2715f5e8e936"
# db config
data_path = "./devtools/chain/data3"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
listening_address = "/ip4/0.0.0.0/tcp/8001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand All @@ -84,7 +81,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/k8s/node_4.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x69ff51f4c22f30615f68b88efa740f8f1b9169e88842b83d189748d06f1a948e"
# db config
data_path = "./devtools/chain/data4"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
listening_address = "/ip4/0.0.0.0/tcp/8001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand All @@ -84,7 +81,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/k8s/sync_nodes/node_5.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x0179ffa9c9d7bfdef64b29b5800bf6954caa033973a875ddc4393826b9c78db0"
# db config
data_path = "./devtools/chain/data5"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -58,7 +55,7 @@ client_version = "0.1.0"
listening_address = "/ip4/0.0.0.0/tcp/8001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand Down Expand Up @@ -92,7 +89,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/k8s/sync_nodes/node_6.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x3914e28bdc5da1112f60bba7c3b3138c75fdbd334043f25fd297589143860ad5"
# db config
data_path = "./devtools/chain/data6"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -57,7 +54,7 @@ client_version = "0.1.0"
listening_address = "/ip4/0.0.0.0/tcp/8001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand Down Expand Up @@ -91,7 +88,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/k8s/sync_nodes/node_7.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x69e99b40bc26bbbafe68989b3972eb1028b5c8de3eac20a1fb2b68f3a259722e"
# db config
data_path = "./devtools/chain/data7"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -58,7 +55,7 @@ client_version = "0.1.0"
listening_address = "/ip4/0.0.0.0/tcp/8001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand Down Expand Up @@ -92,7 +89,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/k8s/sync_nodes/node_8.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x2df9df719f297aa88bfa2d5278743ac7c6612285716ea5db49a2fb8b6216a4a2"
# db config
data_path = "./devtools/chain/data8"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -58,7 +55,7 @@ client_version = "0.1.0"
listening_address = "/ip4/0.0.0.0/tcp/8001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand Down Expand Up @@ -92,7 +89,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/nodes/node_1.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x37aa0f893d05914a4def0460c0a984d3611546cfb26924d7a7ca6e0db9950a2d"
# db config
data_path = "./devtools/chain/data/node_1"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -61,7 +58,7 @@ log_filter_max_block_range = 25000
listening_address = "/ip4/127.0.0.1/tcp/10001"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand All @@ -83,7 +80,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/nodes/node_2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x383fcff8683b8115e31613949be24254b4204ffbe43c227408a76334a2e3fb32"
# db config
data_path = "./devtools/chain/data/node_2"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -61,7 +58,7 @@ log_filter_max_block_range = 25000
listening_address = "/ip4/127.0.0.1/tcp/10002"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand All @@ -83,7 +80,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/nodes/node_3.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x51ce21643b911347c5d5c85c323d9d5421810dc89f46b688720b2715f5e8e936"
# db config
data_path = "./devtools/chain/data/node_3"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -61,7 +58,7 @@ log_filter_max_block_range = 25000
listening_address = "/ip4/127.0.0.1/tcp/10003"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand All @@ -83,7 +80,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down
6 changes: 1 addition & 5 deletions devtools/chain/nodes/node_4.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ privkey = "0x69ff51f4c22f30615f68b88efa740f8f1b9169e88842b83d189748d06f1a948e"
# db config
data_path = "./devtools/chain/data/node_4"

crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"

[[accounts]]
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
balance = "04ee2d6d415b85acef8100000000"
Expand Down Expand Up @@ -61,7 +58,7 @@ log_filter_max_block_range = 25000
listening_address = "/ip4/127.0.0.1/tcp/10004"
rpc_timeout = 10

[consensus]
[synchronization]
sync_txs_chunk_size = 5000

[[network.bootstraps]]
Expand All @@ -83,7 +80,6 @@ broadcast_txs_size = 200
broadcast_txs_interval = 200

[executor]
light = false
triedb_cache_size = 500

[logger]
Expand Down

0 comments on commit 1885f5c

Please sign in to comment.