Skip to content
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

Add change ip functionality, update monitors logic #1035

Merged
merged 14 commits into from
Jan 18, 2024

Conversation

dmytrotkk
Copy link
Collaborator

@dmytrotkk dmytrotkk commented Jan 15, 2024

Changes

This PR adds change IP support to skale-admin.

Main 2 parts that handle change IP in any sChain on the node:

  1. Config monitor that checks and compares IPs in config and on contracts and sets reload_ts to external config.
  2. Skale monitor that specifically handles change IP case and sends the timestamp to skaled.

Procedure in details:

  1. Config monitor collects info about current sChain nodes and passes it to checks and config action manager
  2. New check was added - node_ips. It verifies that all nodes in the config are identical to skale-manager contracts.
  3. If the check is False - reload_ts is calculated and saved to the external config, and a new upstream config is generated.
  4. If the check is True - reload_ts is changed to None and saved.
  5. Skaled montor checks external config for reload_ts, if relaod_ts is not None - ReloadIpSkaledMonitor is executed.
  6. ReloadIpSkaledMonitor updates firewall rules from the upstream config and sets exit ts to rotation file for skaled.
  7. The config monitor configs should be up-to-date on the next iteration, so reload_ts changed to None.

This PR also adds tests for the new functionality, including:

  1. Config monitor case with change IP.
  2. New skaled monitor test.

Performance

  • No performance related changes were made.

Testing

  • Modified existing and added new unit tests.
  • Verified on local network by executing changeIP transaction.

Fixes #832

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

Attention: 24 lines in your changes are missing coverage. Please review.

Comparison is base (6b2e975) 81.14% compared to head (280b4a8) 81.43%.
Report is 2 commits behind head on v2.6.x.

Files Patch % Lines
core/schains/monitor/skaled_monitor.py 52.00% 12 Missing ⚠️
core/node.py 86.15% 9 Missing ⚠️
core/schains/monitor/action.py 92.00% 2 Missing ⚠️
core/schains/monitor/main.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           v2.6.x    #1035      +/-   ##
==========================================
+ Coverage   81.14%   81.43%   +0.28%     
==========================================
  Files         101      101              
  Lines        5596     5709     +113     
==========================================
+ Hits         4541     4649     +108     
- Misses       1055     1060       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@badrogger badrogger merged commit fc95cd2 into v2.6.x Jan 18, 2024
5 of 6 checks passed
@badrogger badrogger deleted the add-change-ip-functionality branch January 18, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a procedure to update sChain configs when IP is changed on one of the nodes
2 participants