-
Notifications
You must be signed in to change notification settings - Fork 11
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
Follow up PR: Removes BetaProgramInitiator, Global is Global, return backward compatibility #279
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fc77d26
Removes BetaProgramInitiator
vzotova a6f8898
Coordinator: return back isEncryptionAuthorized
vzotova fbc8a32
GlobalAllowList: it's global allow list again
vzotova 4b1dd5d
Skip some tests in test_managed_allow_list
vzotova 9572617
BqETHSubscription: immutable accesscontroller
vzotova c87d99c
Coordinator: a deprecation notice comment for isEncryptionAuthorized
vzotova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
167 changes: 0 additions & 167 deletions
167
contracts/contracts/coordination/BetaProgramInitiator.sol
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,6 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable | |
BLS12381.G2Point publicKey; | ||
} | ||
|
||
bytes32 public constant INITIATOR_ROLE = keccak256("INITIATOR_ROLE"); | ||
bytes32 public constant TREASURY_ROLE = keccak256("TREASURY_ROLE"); | ||
|
||
ITACoChildApplication public immutable application; | ||
|
@@ -97,11 +96,11 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable | |
Ritual[] public rituals; | ||
uint32 public timeout; | ||
uint16 public maxDkgSize; | ||
bool public isInitiationPublic; | ||
bool private stub1; // former isInitiationPublic | ||
|
||
uint256 private stub1; // former totalPendingFees | ||
mapping(uint256 => uint256) private stub2; // former pendingFees | ||
address private stub3; // former feeModel | ||
uint256 private stub2; // former totalPendingFees | ||
mapping(uint256 => uint256) private stub3; // former pendingFees | ||
address private stub4; // former feeModel | ||
|
||
IReimbursementPool internal reimbursementPool; | ||
mapping(address => ParticipantKey[]) internal participantKeysHistory; | ||
|
@@ -144,6 +143,10 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable | |
return rituals[ritualId].accessController; | ||
} | ||
|
||
function getFeeModel(uint32 ritualId) external view returns (IFeeModel) { | ||
return rituals[ritualId].feeModel; | ||
} | ||
|
||
function getRitualState(uint32 ritualId) external view returns (RitualState) { | ||
return getRitualState(rituals[ritualId]); | ||
} | ||
|
@@ -190,11 +193,6 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable | |
} | ||
} | ||
|
||
function makeInitiationPublic() external onlyRole(DEFAULT_ADMIN_ROLE) { | ||
isInitiationPublic = true; | ||
_setRoleAdmin(INITIATOR_ROLE, bytes32(0)); | ||
} | ||
|
||
function setProviderPublicKey(BLS12381.G2Point calldata publicKey) external { | ||
uint32 lastRitualId = uint32(rituals.length); | ||
address stakingProvider = application.operatorToStakingProvider(msg.sender); | ||
|
@@ -280,10 +278,6 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable | |
) external returns (uint32) { | ||
require(authority != address(0), "Invalid authority"); | ||
|
||
require( | ||
isInitiationPublic || hasRole(INITIATOR_ROLE, msg.sender), | ||
"Sender can't initiate ritual" | ||
); | ||
require(feeModelsRegistry[feeModel], "Fee model must be approved"); | ||
uint16 length = uint16(providers.length); | ||
require(2 <= length && length <= maxDkgSize, "Invalid number of nodes"); | ||
|
@@ -549,6 +543,17 @@ contract Coordinator is Initializable, AccessControlDefaultAdminRulesUpgradeable | |
return found; | ||
} | ||
|
||
/// @dev Deprecated, see issue #195 | ||
function isEncryptionAuthorized( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a deprecation notice comment, with a link to #195 |
||
uint32 ritualId, | ||
bytes memory evidence, | ||
bytes memory ciphertextHeader | ||
) external view returns (bool) { | ||
Ritual storage ritual = rituals[ritualId]; | ||
require(getRitualState(ritual) == RitualState.ACTIVE, "Ritual not active"); | ||
return ritual.accessController.isAuthorized(ritualId, evidence, ciphertextHeader); | ||
} | ||
|
||
function processReimbursement(uint256 initialGasLeft) internal { | ||
if (address(reimbursementPool) != address(0)) { | ||
uint256 gasUsed = initialGasLeft - gasleft(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something occurred to me. What happens to the existing rituals on
mainnet
that would not have a feeModel set in theirRitual
struct? I guess those can't be extended? Other side effects?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are correct, old rituals can't be extended, I can create work around with FlatFeeRateModel as default for old rituals, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #282, so let's move on with the PR.