Skip to content

Commit

Permalink
Merge pull request #1025 from skalenetwork/fix-automatic-repair
Browse files Browse the repository at this point in the history
Fix skaled config broken by automatic repair option
  • Loading branch information
DmytroNazarenko authored Dec 11, 2023
2 parents 5ae0367 + 7b9d1f5 commit 0a1faef
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion core/schains/config/static_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ def get_static_node_info(schain_type: SchainType, env_type: str = ENV_TYPE) -> d

def get_automatic_repair_option(env_type: str = ENV_TYPE) -> bool:
static_params = get_static_params(env_type)
return static_params['node']['common'].get('automatic_repair', True)
node_params = static_params['node']
if 'admin' in node_params:
return node_params['admin'].get('automatic_repair', True)
return True
2 changes: 1 addition & 1 deletion helper-scripts
3 changes: 3 additions & 0 deletions tests/schains/config/static_params_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ def test_get_static_node_info():

def test_get_automatic_repair_option():
assert get_automatic_repair_option()
assert get_automatic_repair_option(env_type='mainnet')
assert get_automatic_repair_option(env_type='testnet')
assert get_automatic_repair_option(env_type='devnet')
assert not get_automatic_repair_option(env_type='qanet')
5 changes: 4 additions & 1 deletion tests/skale-data/config/static_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,12 @@ envs:
["-v 3", "--web3-trace", "--enable-debug-behavior-apis", "--aa no"]

node:
admin:
automatic_repair: false
common:
bindIP: "0.0.0.0"
logLevel: "info"
logLevelConfig: "info"
automatic_repair: false
small:
minCacheSize: 1000000
maxCacheSize: 2000000
Expand Down Expand Up @@ -266,6 +267,8 @@ envs:
["-v 3", "--web3-trace", "--enable-debug-behavior-apis", "--aa no"]

node:
admin:
automatic_repair: true
common:
bindIP: "0.0.0.0"
logLevel: "info"
Expand Down

0 comments on commit 0a1faef

Please sign in to comment.