Skip to content

Commit 5006ade

Browse files
refactor(config): remove deprecated, move sync_txs_chunk_size out from consensus
1 parent 1e49257 commit 5006ade

15 files changed

Lines changed: 18 additions & 71 deletions

File tree

common/config-parser/src/types.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ pub struct Config {
2929
pub network: ConfigNetwork,
3030
pub mempool: ConfigMempool,
3131
pub executor: ConfigExecutor,
32-
pub consensus: ConfigConsensus,
32+
#[serde(rename = "synchronization")]
33+
pub sync: ConfigSynchronization,
3334
#[serde(default)]
3435
pub logger: ConfigLogger,
3536
#[serde(default)]
@@ -38,8 +39,7 @@ pub struct Config {
3839
pub prometheus: Option<ConfigPrometheus>,
3940

4041
#[serde(default)]
41-
pub ibc_contract_address: H160,
42-
pub wckb_contract_address: H160,
42+
pub ibc_contract_address: H160,
4343
}
4444

4545
impl Config {
@@ -210,7 +210,7 @@ fn default_sync_txs_chunk_size() -> usize {
210210
}
211211

212212
#[derive(Clone, Debug, Deserialize)]
213-
pub struct ConfigConsensus {
213+
pub struct ConfigSynchronization {
214214
#[serde(default = "default_sync_txs_chunk_size")]
215215
pub sync_txs_chunk_size: usize,
216216
}
@@ -236,7 +236,6 @@ pub struct ConfigMempool {
236236

237237
#[derive(Clone, Debug, Deserialize)]
238238
pub struct ConfigExecutor {
239-
pub light: bool,
240239
pub triedb_cache_size: usize,
241240
}
242241

core/run/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl Axon {
361361
consensus_adapter.set_overlord_handler(overlord_consensus.get_overlord_handler());
362362

363363
let synchronization = Arc::new(OverlordSynchronization::<_>::new(
364-
self.config.consensus.sync_txs_chunk_size,
364+
self.config.sync.sync_txs_chunk_size,
365365
consensus_adapter,
366366
status_agent.clone(),
367367
lock,

devtools/chain/config.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ privkey = "0x37aa0f893d05914a4def0460c0a984d3611546cfb26924d7a7ca6e0db9950a2d"
44
# db config
55
data_path = "./devtools/chain/data"
66

7-
crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
8-
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"
9-
107
[[accounts]]
118
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
129
balance = "04ee2d6d415b85acef8100000000"
@@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
6259
listening_address = "/ip4/0.0.0.0/tcp/8001"
6360
rpc_timeout = 10
6461

65-
[consensus]
62+
[synchronization]
6663
sync_txs_chunk_size = 5000
6764

6865
[[network.bootstraps]]
@@ -75,7 +72,6 @@ broadcast_txs_size = 200
7572
broadcast_txs_interval = 200
7673

7774
[executor]
78-
light = false
7975
triedb_cache_size = 500
8076

8177
[logger]

devtools/chain/k8s/node_1.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ privkey = "0x37aa0f893d05914a4def0460c0a984d3611546cfb26924d7a7ca6e0db9950a2d"
44
# db config
55
data_path = "./devtools/chain/data1"
66

7-
crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
8-
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"
9-
107
[[accounts]]
118
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
129
balance = "04ee2d6d415b85acef8100000000"
@@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
6259
listening_address = "/ip4/0.0.0.0/tcp/8001"
6360
rpc_timeout = 10
6461

65-
[consensus]
62+
[synchronization]
6663
sync_txs_chunk_size = 5000
6764

6865
[[network.bootstraps]]
@@ -84,7 +81,6 @@ broadcast_txs_size = 200
8481
broadcast_txs_interval = 200
8582

8683
[executor]
87-
light = false
8884
triedb_cache_size = 500
8985

9086
[logger]

devtools/chain/k8s/node_2.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ privkey = "0x383fcff8683b8115e31613949be24254b4204ffbe43c227408a76334a2e3fb32"
44
# db config
55
data_path = "./devtools/chain/data2"
66

7-
crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
8-
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"
9-
107
[[accounts]]
118
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
129
balance = "04ee2d6d415b85acef8100000000"
@@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
6259
listening_address = "/ip4/0.0.0.0/tcp/8001"
6360
rpc_timeout = 10
6461

65-
[consensus]
62+
[synchronization]
6663
sync_txs_chunk_size = 5000
6764

6865
[[network.bootstraps]]
@@ -84,7 +81,6 @@ broadcast_txs_size = 200
8481
broadcast_txs_interval = 200
8582

8683
[executor]
87-
light = false
8884
triedb_cache_size = 500
8985

9086
[logger]

devtools/chain/k8s/node_3.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ privkey = "0x51ce21643b911347c5d5c85c323d9d5421810dc89f46b688720b2715f5e8e936"
44
# db config
55
data_path = "./devtools/chain/data3"
66

7-
crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
8-
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"
9-
107
[[accounts]]
118
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
129
balance = "04ee2d6d415b85acef8100000000"
@@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
6259
listening_address = "/ip4/0.0.0.0/tcp/8001"
6360
rpc_timeout = 10
6461

65-
[consensus]
62+
[synchronization]
6663
sync_txs_chunk_size = 5000
6764

6865
[[network.bootstraps]]
@@ -84,7 +81,6 @@ broadcast_txs_size = 200
8481
broadcast_txs_interval = 200
8582

8683
[executor]
87-
light = false
8884
triedb_cache_size = 500
8985

9086
[logger]

devtools/chain/k8s/node_4.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ privkey = "0x69ff51f4c22f30615f68b88efa740f8f1b9169e88842b83d189748d06f1a948e"
44
# db config
55
data_path = "./devtools/chain/data4"
66

7-
crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
8-
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"
9-
107
[[accounts]]
118
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
129
balance = "04ee2d6d415b85acef8100000000"
@@ -62,7 +59,7 @@ log_filter_max_block_range = 25000
6259
listening_address = "/ip4/0.0.0.0/tcp/8001"
6360
rpc_timeout = 10
6461

65-
[consensus]
62+
[synchronization]
6663
sync_txs_chunk_size = 5000
6764

6865
[[network.bootstraps]]
@@ -84,7 +81,6 @@ broadcast_txs_size = 200
8481
broadcast_txs_interval = 200
8582

8683
[executor]
87-
light = false
8884
triedb_cache_size = 500
8985

9086
[logger]

devtools/chain/k8s/sync_nodes/node_5.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ privkey = "0x0179ffa9c9d7bfdef64b29b5800bf6954caa033973a875ddc4393826b9c78db0"
44
# db config
55
data_path = "./devtools/chain/data5"
66

7-
crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
8-
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"
9-
107
[[accounts]]
118
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
129
balance = "04ee2d6d415b85acef8100000000"
@@ -58,7 +55,7 @@ client_version = "0.1.0"
5855
listening_address = "/ip4/0.0.0.0/tcp/8001"
5956
rpc_timeout = 10
6057

61-
[consensus]
58+
[synchronization]
6259
sync_txs_chunk_size = 5000
6360

6461
[[network.bootstraps]]
@@ -92,7 +89,6 @@ broadcast_txs_size = 200
9289
broadcast_txs_interval = 200
9390

9491
[executor]
95-
light = false
9692
triedb_cache_size = 500
9793

9894
[logger]

devtools/chain/k8s/sync_nodes/node_6.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ privkey = "0x3914e28bdc5da1112f60bba7c3b3138c75fdbd334043f25fd297589143860ad5"
44
# db config
55
data_path = "./devtools/chain/data6"
66

7-
crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
8-
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"
9-
107
[[accounts]]
118
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
129
balance = "04ee2d6d415b85acef8100000000"
@@ -57,7 +54,7 @@ client_version = "0.1.0"
5754
listening_address = "/ip4/0.0.0.0/tcp/8001"
5855
rpc_timeout = 10
5956

60-
[consensus]
57+
[synchronization]
6158
sync_txs_chunk_size = 5000
6259

6360
[[network.bootstraps]]
@@ -91,7 +88,6 @@ broadcast_txs_size = 200
9188
broadcast_txs_interval = 200
9289

9390
[executor]
94-
light = false
9591
triedb_cache_size = 500
9692

9793
[logger]

devtools/chain/k8s/sync_nodes/node_7.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ privkey = "0x69e99b40bc26bbbafe68989b3972eb1028b5c8de3eac20a1fb2b68f3a259722e"
44
# db config
55
data_path = "./devtools/chain/data7"
66

7-
crosschain_contract_address = "0xb9dc8bde1db42410d304b5e78c2ff843134e15e0"
8-
wckb_contract_address = "0xa13763691970d9373d4fab7cc323d7ba06fa9986"
9-
107
[[accounts]]
118
address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720"
129
balance = "04ee2d6d415b85acef8100000000"
@@ -58,7 +55,7 @@ client_version = "0.1.0"
5855
listening_address = "/ip4/0.0.0.0/tcp/8001"
5956
rpc_timeout = 10
6057

61-
[consensus]
58+
[synchronization]
6259
sync_txs_chunk_size = 5000
6360

6461
[[network.bootstraps]]
@@ -92,7 +89,6 @@ broadcast_txs_size = 200
9289
broadcast_txs_interval = 200
9390

9491
[executor]
95-
light = false
9692
triedb_cache_size = 500
9793

9894
[logger]

0 commit comments

Comments
 (0)