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

IS-683 check rotation id before dkg broadcast #988

Merged
merged 7 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: [push, pull_request]
env:
ETH_PRIVATE_KEY: ${{ secrets.ETH_PRIVATE_KEY }}
SCHAIN_TYPE: ${{ secrets.SCHAIN_TYPE }}
MANAGER_TAG: "1.9.3-beta.0"
MANAGER_TAG: "1.10.0-v1.10.0.0"
IMA_TAG: "1.3.4-beta.5"
SGX_WALLET_TAG: "1.83.0-beta.5"
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "helper-scripts"]
path = helper-scripts
url = https://github.com/skalenetwork/helper-scripts.git
branch = develop
branch = fix-for-latest-sm
[submodule "hardhat-node"]
path = hardhat-node
url = https://github.com/skalenetwork/hardhat-node.git
url = https://github.com/skalenetwork/hardhat-node.git
2 changes: 2 additions & 0 deletions core/schains/dkg/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def __init__(
group_index_str = str(int(skale.web3.to_hex(self.group_index)[2:], 16))
self.poly_name = generate_poly_name(group_index_str, self.node_id_dkg, rotation_id)
self.bls_name = generate_bls_key_name(group_index_str, self.node_id_dkg, rotation_id)
self.rotation_id = rotation_id
self.incoming_verification_vector = ['0' for _ in range(n)]
self.incoming_secret_key_contribution = ['0' for _ in range(n)]
self.public_keys = public_keys
Expand Down Expand Up @@ -240,6 +241,7 @@ def broadcast(self):
self.node_id_contract,
verification_vector,
secret_key_contribution,
self.rotation_id
)
self.last_completed_step = DKGStep.BROADCAST
logger.info('Everything is sent from %d node', self.node_id_dkg)
Expand Down
7 changes: 7 additions & 0 deletions core/schains/dkg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@

channel_started_time = skale.dkg.get_channel_started_time(dkg_client.group_index)

rotaion_mainnet = dkg_client.skale.node_rotation.get_rotation_obj(schain_name).rotation_counter
if rotation_id != rotaion_mainnet:
logger.info(f'sChain {schain_name}: Rotaion id on SKALE MANAGER {rotaion_mainnet} is '

Check warning on line 61 in core/schains/dkg/main.py

View check run for this annotation

Codecov / codecov/patch

core/schains/dkg/main.py#L61

Added line #L61 was not covered by tests
f'different from the one passed by SKALE ADMIN {rotation_id}.'
f' Need to restart')
raise DkgError(f'sChain {schain_name}: restarting DKG')

Check warning on line 64 in core/schains/dkg/main.py

View check run for this annotation

Codecov / codecov/patch

core/schains/dkg/main.py#L64

Added line #L64 was not covered by tests

broadcast_and_check_data(dkg_client)

if not dkg_client.is_everyone_broadcasted():
Expand Down
2 changes: 1 addition & 1 deletion helper-scripts
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Jinja2==3.1.2
docker==6.1.3
python-iptables==1.0.1

skale.py==6.1dev1
skale.py==6.1dev4

ima-predeployed==2.0.0b0
etherbase-predeployed==1.1.0b3
Expand Down
Loading