Skip to content

Commit

Permalink
Merge branch 'develop' into update-actions-cache-version
Browse files Browse the repository at this point in the history
  • Loading branch information
yavrsky authored Dec 17, 2024
2 parents ce5b887 + f85d914 commit 3b84405
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 31 deletions.
10 changes: 10 additions & 0 deletions contracts/IConstantsHolder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ interface IConstantsHolder {
function setComplaintTimeLimit(uint timeLimit) external;
function setMinNodeBalance(uint newMinNodeBalance) external;
function reinitialize() external;
// Corresponds to the public field
// solhint-disable func-name-mixedcase
// slither-disable-start naming-convention
function BOUNTY_LOCKUP_MONTHS() external view returns (uint256);
function NODE_DEPOSIT() external view returns (uint256);
function SECONDS_TO_YEAR() external view returns (uint32);
function SMALL_DIVISOR() external view returns (uint8);
function TOTAL_SPACE_ON_NODE() external view returns (uint8);
// solhint-enable func-name-mixedcase
// slither-disable-end naming-convention
function msr() external view returns (uint);
function launchTimestamp() external view returns (uint);
function rotationDelay() external view returns (uint);
Expand Down
2 changes: 1 addition & 1 deletion contracts/IContractManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ interface IContractManager {
function getTokenState() external view returns (address);
function getPunisher() external view returns (address);
function getContract(string calldata name) external view returns (address);
}
}
12 changes: 10 additions & 2 deletions contracts/INodes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ interface INodes {
uint16 nonce;
string domainName;
}


// struct for storing additional fields for Node
struct NodeExtras {
uint lastChangeIpTime;
}

/**
* @dev Emitted when a node is created.
*/
Expand Down Expand Up @@ -114,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;
Expand Down Expand Up @@ -163,4 +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);
}
34 changes: 34 additions & 0 deletions contracts/IPaymasterController.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// SPDX-License-Identifier: AGPL-3.0-only

/*
IPaymasterController.sol - SKALE Manager
Copyright (C) 2018-Present SKALE Labs
@author Artem Payvin
SKALE Manager is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SKALE Manager is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with SKALE Manager. If not, see <https://www.gnu.org/licenses/>.
*/

pragma solidity >=0.6.10 <0.9.0;

interface IPaymasterController {
function addSchain(string calldata name) external;
function addValidator(uint256 validatorId, address validatorAddress) external;
function removeSchain(bytes32 schainHash) external;
function setImaAddress(address imaAddress) external;
function setMarionetteAddress(address payable marionetteAddress) external;
function setNodesAmount(uint256 validatorId, uint256 nodesAmount) external;
function setPaymasterAddress(address paymasterAddress) external;
function setPaymasterChainHash(bytes32 chainHash) external;
function setValidatorAddress(uint256 validatorId, address validatorAddress) external;
}
63 changes: 37 additions & 26 deletions contracts/ISkaleDKG.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ interface ISkaleDKG {
bytes32[2] publicKey;
bytes32 share;
}

/**
* @dev Emitted when a channel is opened.
*/
Expand Down Expand Up @@ -115,16 +115,23 @@ interface ISkaleDKG {
* @dev Emitted when a complaint is sent.
*/
event ComplaintSent(bytes32 indexed schainHash, uint indexed fromNodeIndex, uint indexed toNodeIndex);


// External

function alright(bytes32 schainHash, uint fromNodeIndex) external;
function broadcast(
bytes32 schainHash,
uint nodeIndex,
G2Point[] memory verificationVector,
KeyShare[] memory secretKeyContribution
KeyShare[] memory secretKeyContribution,
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,
Expand All @@ -133,30 +140,39 @@ 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,
uint secretNumber,
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 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,
Expand All @@ -165,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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@skalenetwork/skale-manager-interfaces",
"version": "2.0.0",
"version": "3.2.0",
"description": "Definitions of interfaces needed to integrate with skale-manager smart contracts",
"main": "index.js",
"repository": "[email protected]:skalenetwork/skale-manager-interfaces.git",
Expand Down
2 changes: 1 addition & 1 deletion scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
slither-analyzer==0.8.0
slither-analyzer==0.10.3

0 comments on commit 3b84405

Please sign in to comment.