-
Notifications
You must be signed in to change notification settings - Fork 4
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
Merge sync node to develop, update monitors logic #1045
Conversation
…-node SKALE-799 Sync node functionality
…-node SKALE-779 Add fix for schain finish_ts
…-node SKALE-779 Add generate IMA sChain ABI
…-node SKALE-779 Fix ecdsa_key_name for sync node
…-node SKALE-779 SGX for sync node fix
Hotfix: add firewall rules to sync monitor and SSL reload support
Hotfix: update reload monitor test
…-admin into feature/add-static-accounts-for-chains
…-for-chains Feature/add static accounts for chains
Merge beta sync node to stable
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## v2.7.x #1045 +/- ##
==========================================
- Coverage 81.43% 80.88% -0.56%
==========================================
Files 101 103 +2
Lines 5709 5900 +191
==========================================
+ Hits 4649 4772 +123
- Misses 1060 1128 +68 ☔ View full report in Codecov by Sentry. |
) -> SChainConfig: | ||
"""Main function that is used to generate sChain config""" | ||
logger.info( | ||
f'Going to generate sChain config for {schain["name"]}, ' | ||
f'node_name: {node["name"]}, node_id: {node_id}, rotation_id: {rotation_id}, ' | ||
f'ecdsa keyname: {ecdsa_key_name}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to remove keyname and add sync_node logging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
core/schains/config/node_info.py
Outdated
'info-acceptors': 1, | ||
**self.static_node_info | ||
} | ||
} | ||
if self.archive is not None and self.sync_node: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to simply put true/false for archiveMode / syncFromCatchup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
core/schains/config/node_info.py
Outdated
wallets = {} if sync_node else generate_wallets_config(schain['name'], rotation_id) | ||
|
||
if ecdsa_key_name is None: | ||
logger.warning(f'Generating CurrentNodeInfo for {schain["name"]}, ecdsa_key_name is None') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a warning if sync node=true, since it's expected. Also if for sync_node=false it's better to raise and exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
@@ -113,8 +117,8 @@ def monitor_ima_container( | |||
) -> None: | |||
schain_name = schain["name"] | |||
|
|||
if DISABLE_IMA: | |||
logger.info(f'{schain_name} - IMA is disabled, skipping') | |||
if SYNC_NODE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this log line can be ommited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed log only
core/schains/monitor/main.py
Outdated
mon = RegularConfigMonitor(config_am, config_checks) | ||
|
||
if SYNC_NODE: | ||
logger.info('Sync node mode, running config checks') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Config check was executed before. It's better to remove the line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to running config monitor
elif is_config_update_time(status, skaled_status): | ||
mon_type = UpdateConfigSkaledMonitor | ||
elif is_reload_group_mode(status, action_manager.upstream_finish_ts): | ||
mon_type = ReloadGroupSkaledMonitor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about ReloadIpSkaledMonitor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added ReloadIpSkaledMonitor
to sync node
tools/logger.py
Outdated
@@ -87,6 +88,9 @@ def init_logger( | |||
log_file_path=None, | |||
debug_file_path=None | |||
): | |||
# for handler in logging.root.handlers[:]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
tools/configs/logs.py
Outdated
@@ -45,3 +49,4 @@ | |||
|
|||
ADMIN_LOG_FORMAT = '[%(asctime)s %(levelname)s][%(process)d][%(processName)s][%(threadName)s] - %(name)s:%(lineno)d - %(message)s' # noqa | |||
API_LOG_FORMAT = '[%(asctime)s] %(process)d %(levelname)s %(url)s %(module)s: %(message)s' # noqa | |||
SYNC_LOG_FORMAT = '[%(asctime)s %(levelname)s] - %(name)s:%(lineno)d - %(message)s' # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to use same log formant for regular and sync nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to ADMIN_LOG_FORMAT
tests/schains/cmd_test.py
Outdated
f'--aa no --ssl-key {ssl_key_path} --ssl-cert {ssl_cert_path}' | ||
) | ||
print(container_opts, 'IVD') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
requirements.txt
Outdated
@@ -30,3 +30,5 @@ pyOpenSSL==23.1.1 | |||
python-dateutil==2.8.2 | |||
python-telegram-bot==12.8 | |||
sh==1.14.1 | |||
|
|||
urllib3<2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not necessary anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
This PR merges sync-node branch into develop with minor modifications to the codebase to incorporate sync node into the new node architecture with separate config/skaled monitors.
Breaking news:
1 new monitor added
Existing monitors from the regular node are reused for the sync node.
Monitors available on the sync node:
NoConfigSkaledMonitor
RecreateSkaledMonitor
UpdateConfigSkaledMonitor
ReloadGroupSkaledMonitor
Also,
SyncConfigMonitor
was added to handle config generation on sync node.Tests were slightly modified to work with the new sync node params, no new tests added.
No performance changes.
Fixes https://github.com/skalenetwork/internal-support/issues/907