Skip to content

Commit

Permalink
Merge pull request #988 from skalenetwork/bug/IS-683-check-rotation-i…
Browse files Browse the repository at this point in the history
…d-before-broadcast

IS-683 check rotation id before dkg broadcast
  • Loading branch information
olehnikolaiev authored Dec 26, 2023
2 parents bba42e4 + 003005f commit 7a0e7bf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
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 @@ def init_bls(dkg_client, node_id, sgx_key_name, rotation_id=0):

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 '
f'different from the one passed by SKALE ADMIN {rotation_id}.'
f' Need to restart')
raise DkgError(f'sChain {schain_name}: restarting DKG')

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

0 comments on commit 7a0e7bf

Please sign in to comment.