From 4bacbba102c2be4014a8006217accd1ba4d43e86 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 17 Jan 2024 18:49:01 +0200 Subject: [PATCH 1/9] Add resetPendingToBeReplaced function --- contracts/ISkaleDKG.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contracts/ISkaleDKG.sol b/contracts/ISkaleDKG.sol index dbc9f03..51c4023 100644 --- a/contracts/ISkaleDKG.sol +++ b/contracts/ISkaleDKG.sol @@ -60,7 +60,7 @@ interface ISkaleDKG { bytes32[2] publicKey; bytes32 share; } - + /** * @dev Emitted when a channel is opened. */ @@ -115,7 +115,7 @@ interface ISkaleDKG { * @dev Emitted when a complaint is sent. */ event ComplaintSent(bytes32 indexed schainHash, uint indexed fromNodeIndex, uint indexed toNodeIndex); - + function alright(bytes32 schainHash, uint fromNodeIndex) external; function broadcast( bytes32 schainHash, @@ -147,6 +147,7 @@ interface ISkaleDKG { function setStartAlrightTimestamp(bytes32 schainHash) external; function setBadNode(bytes32 schainHash, uint nodeIndex) external; function finalizeSlashing(bytes32 schainHash, uint badNode) external; + function resetPendingToBeReplaced(bytes32 schainHash) external; function getChannelStartedTime(bytes32 schainHash) external view returns (uint); function getChannelStartedBlock(bytes32 schainHash) external view returns (uint); function getNumberOfBroadcasted(bytes32 schainHash) external view returns (uint); From 0e06a680328d1480ed7fd889929ffdabc0cfa813 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 17 Jan 2024 18:49:39 +0200 Subject: [PATCH 2/9] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 58d4393..865ba11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skalenetwork/skale-manager-interfaces", - "version": "2.1.0", + "version": "2.2.0", "description": "Definitions of interfaces needed to integrate with skale-manager smart contracts", "main": "index.js", "repository": "git@github.com:skalenetwork/skale-manager-interfaces.git", From 4e89093f23591eaaf9a084e478ad29bf1191f4eb Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 18 Jan 2024 18:50:41 +0200 Subject: [PATCH 3/9] Remove changeLifetime --- contracts/ISchainsInternal.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/ISchainsInternal.sol b/contracts/ISchainsInternal.sol index c2f6ce9..624471c 100644 --- a/contracts/ISchainsInternal.sol +++ b/contracts/ISchainsInternal.sol @@ -66,7 +66,6 @@ interface ISchainsInternal { ) external returns (uint[] memory); - function changeLifetime(bytes32 schainHash, uint lifetime, uint deposit) external; function removeSchain(bytes32 schainHash, address from) external; function removeNodeFromSchain(uint nodeIndex, bytes32 schainHash) external; function deleteGroup(bytes32 schainHash) external; From 808a4c7317c67705012a35b90725e0ca023704f3 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 18 Jan 2024 19:11:45 +0200 Subject: [PATCH 4/9] Add getSkaleManager --- contracts/IContractManager.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/IContractManager.sol b/contracts/IContractManager.sol index 76dd3ae..d57418a 100644 --- a/contracts/IContractManager.sol +++ b/contracts/IContractManager.sol @@ -35,8 +35,9 @@ interface IContractManager { function getValidatorService() external view returns (address); function getTimeHelpers() external view returns (address); function getConstantsHolder() external view returns (address); + function getSkaleManager() external view returns (address) function getSkaleToken() external view returns (address); function getTokenState() external view returns (address); function getPunisher() external view returns (address); function getContract(string calldata name) external view returns (address); -} \ No newline at end of file +} From 7c5e35a7b37f9cd2c7b2dca0a66fdeb2fbf69a30 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 18 Jan 2024 19:12:02 +0200 Subject: [PATCH 5/9] Add getSkaleManager --- contracts/IContractManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/IContractManager.sol b/contracts/IContractManager.sol index d57418a..d42b925 100644 --- a/contracts/IContractManager.sol +++ b/contracts/IContractManager.sol @@ -35,7 +35,7 @@ interface IContractManager { function getValidatorService() external view returns (address); function getTimeHelpers() external view returns (address); function getConstantsHolder() external view returns (address); - function getSkaleManager() external view returns (address) + function getSkaleManager() external view returns (address); function getSkaleToken() external view returns (address); function getTokenState() external view returns (address); function getPunisher() external view returns (address); From c470ba09f1b9dee939a16eb6abb12498bc6407f9 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 18 Jan 2024 20:13:37 +0200 Subject: [PATCH 6/9] Add functions --- contracts/INodes.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/INodes.sol b/contracts/INodes.sol index 6cee352..e7f4f88 100644 --- a/contracts/INodes.sol +++ b/contracts/INodes.sol @@ -119,7 +119,7 @@ interface INodes { bytes4 previousIP, bytes4 newIP ); - + function removeSpaceFromNode(uint nodeIndex, uint8 space) external returns (bool); function addSpaceToNode(uint nodeIndex, uint8 space) external; function changeNodeLastRewardDate(uint nodeIndex) external; @@ -168,5 +168,7 @@ interface INodes { function isNodeExist(address from, uint nodeIndex) external view returns (bool); function isNodeActive(uint nodeIndex) external view returns (bool); function isNodeLeaving(uint nodeIndex) external view returns (bool); + function isNodeVisible(uint256 nodeIndex) external view returns (bool); function getLastChangeIpTime(uint nodeIndex) external view returns (uint); + function getFreeSpace(uint256 nodeIndex) external view returns (uint8 freeSpace); } From 73d107777384ec645a5f3fbd17c6f0613d856994 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Wed, 24 Jan 2024 16:59:08 +0200 Subject: [PATCH 7/9] Remove getSkaleManager() --- contracts/IContractManager.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/IContractManager.sol b/contracts/IContractManager.sol index d42b925..c584ef3 100644 --- a/contracts/IContractManager.sol +++ b/contracts/IContractManager.sol @@ -35,7 +35,6 @@ interface IContractManager { function getValidatorService() external view returns (address); function getTimeHelpers() external view returns (address); function getConstantsHolder() external view returns (address); - function getSkaleManager() external view returns (address); function getSkaleToken() external view returns (address); function getTokenState() external view returns (address); function getPunisher() external view returns (address); From 9a3a220f91eb58bafd100c2f731f72607e00fb86 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 29 Jan 2024 12:27:57 +0200 Subject: [PATCH 8/9] Add pendingToBeReplaced --- contracts/ISkaleDKG.sol | 57 ++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/contracts/ISkaleDKG.sol b/contracts/ISkaleDKG.sol index 51c4023..258468d 100644 --- a/contracts/ISkaleDKG.sol +++ b/contracts/ISkaleDKG.sol @@ -116,6 +116,8 @@ interface ISkaleDKG { */ event ComplaintSent(bytes32 indexed schainHash, uint indexed fromNodeIndex, uint indexed toNodeIndex); + // External + function alright(bytes32 schainHash, uint fromNodeIndex) external; function broadcast( bytes32 schainHash, @@ -125,7 +127,11 @@ interface ISkaleDKG { uint rotationCounter ) external; + function complaint(bytes32 schainHash, uint fromNodeIndex, uint toNodeIndex) external; function complaintBadData(bytes32 schainHash, uint fromNodeIndex, uint toNodeIndex) external; + function deleteChannel(bytes32 schainHash) external; + function finalizeSlashing(bytes32 schainHash, uint badNode) external; + function openChannel(bytes32 schainHash) external; function preResponse( bytes32 schainId, uint fromNodeIndex, @@ -134,7 +140,7 @@ interface ISkaleDKG { KeyShare[] memory secretKeyContribution ) external; - function complaint(bytes32 schainHash, uint fromNodeIndex, uint toNodeIndex) external; + function resetPendingToBeReplaced(bytes32 schainHash) external; function response( bytes32 schainHash, uint fromNodeIndex, @@ -142,23 +148,31 @@ interface ISkaleDKG { G2Point memory multipliedShare ) external; - function openChannel(bytes32 schainHash) external; - function deleteChannel(bytes32 schainHash) external; - function setStartAlrightTimestamp(bytes32 schainHash) external; function setBadNode(bytes32 schainHash, uint nodeIndex) external; - function finalizeSlashing(bytes32 schainHash, uint badNode) external; - function resetPendingToBeReplaced(bytes32 schainHash) external; - function getChannelStartedTime(bytes32 schainHash) external view returns (uint); + function setStartAlrightTimestamp(bytes32 schainHash) external; + + // External view + + function checkAndReturnIndexInGroup( + bytes32 schainHash, + uint nodeIndex, + bool revertCheck + ) + external + view + returns (uint, bool); + function getAlrightStartedTime(bytes32 schainHash) external view returns (uint); function getChannelStartedBlock(bytes32 schainHash) external view returns (uint); + function getChannelStartedTime(bytes32 schainHash) external view returns (uint); + function getComplaintData(bytes32 schainHash) external view returns (uint, uint); + function getComplaintStartedTime(bytes32 schainHash) external view returns (uint); function getNumberOfBroadcasted(bytes32 schainHash) external view returns (uint); function getNumberOfCompleted(bytes32 schainHash) external view returns (uint); function getTimeOfLastSuccessfulDKG(bytes32 schainHash) external view returns (uint); - function getComplaintData(bytes32 schainHash) external view returns (uint, uint); - function getComplaintStartedTime(bytes32 schainHash) external view returns (uint); - function getAlrightStartedTime(bytes32 schainHash) external view returns (uint); - function isChannelOpened(bytes32 schainHash) external view returns (bool); - function isLastDKGSuccessful(bytes32 groupIndex) external view returns (bool); + function isAllDataReceived(bytes32 schainHash, uint nodeIndex) external view returns (bool); + function isAlrightPossible(bytes32 schainHash, uint nodeIndex) external view returns (bool); function isBroadcastPossible(bytes32 schainHash, uint nodeIndex) external view returns (bool); + function isChannelOpened(bytes32 schainHash) external view returns (bool); function isComplaintPossible( bytes32 schainHash, uint fromNodeIndex, @@ -167,20 +181,15 @@ interface ISkaleDKG { external view returns (bool); - function isAlrightPossible(bytes32 schainHash, uint nodeIndex) external view returns (bool); + function isEveryoneBroadcasted(bytes32 schainHash) external view returns (bool); + function isLastDKGSuccessful(bytes32 groupIndex) external view returns (bool); + function isNodeBroadcasted(bytes32 schainHash, uint nodeIndex) external view returns (bool); function isPreResponsePossible(bytes32 schainHash, uint nodeIndex) external view returns (bool); function isResponsePossible(bytes32 schainHash, uint nodeIndex) external view returns (bool); - function isNodeBroadcasted(bytes32 schainHash, uint nodeIndex) external view returns (bool); - function isAllDataReceived(bytes32 schainHash, uint nodeIndex) external view returns (bool); - function checkAndReturnIndexInGroup( - bytes32 schainHash, - uint nodeIndex, - bool revertCheck - ) - external - view - returns (uint, bool); - function isEveryoneBroadcasted(bytes32 schainHash) external view returns (bool); + function pendingToBeReplaced(bytes32 schainHash) external view returns (uint256); + + // External pure + function hashData( KeyShare[] memory secretKeyContribution, G2Point[] memory verificationVector From 81f5f5c831f97045151c9abe902c957446f8c79f Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Mon, 29 Jan 2024 17:10:03 +0200 Subject: [PATCH 9/9] Bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 865ba11..d334ddb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@skalenetwork/skale-manager-interfaces", - "version": "2.2.0", + "version": "3.0.0", "description": "Definitions of interfaces needed to integrate with skale-manager smart contracts", "main": "index.js", "repository": "git@github.com:skalenetwork/skale-manager-interfaces.git",