Skip to content

Conversation

@pdyraga
Copy link
Member

@pdyraga pdyraga commented Apr 21, 2022

Refs #88
Refs threshold-network/keep-core#2935

Depends on #87 (keeping as a draft until #87 is merged)

There is an implicit contract in TokenStaking that IApplication may
revert in case the minimum authorization requirement is not met. The
problem is that IApplication does not clearly define what is the minimum
authorization.

This change improves it. First, the contract about
increaseAuthorization reverting if the minimum requirement is not met
is now explicit. Second, IApplication exposes minimumAuthorization
information.

cygnusv
cygnusv previously approved these changes Apr 21, 2022
/// authorized amount for the given staking provider increased.
/// The application may do any necessary housekeeping.
/// The application may do any necessary housekeeping. The
/// application may revert the transaction in case the authorization
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// application may revert the transaction in case the authorization
/// application must revert the transaction in case the authorization

Otherwise, it doesn't make much sense to define it as a "minimum authorization"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Updated in the last commit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code format is complaining but I'll fix it once #87 is merged when rebasing over main. Ignoring for now.

vzotova
vzotova previously approved these changes Apr 22, 2022
Base automatically changed from reduce-all to main April 22, 2022 07:30
@cygnusv cygnusv dismissed stale reviews from vzotova and themself via ee07c82 April 22, 2022 07:30
@cygnusv cygnusv marked this pull request as ready for review April 22, 2022 07:31
pdyraga added 2 commits April 22, 2022 09:37
There is an implicit contract in TokenStaking that IApplication may
revert in case the minimum authorization requirement is not met. The
problem is that IApplication does not clearly define what is the minimum
authorization.

This change improves it. First, the contract about
`increaseAuthorization` reverting if the minimum requirement is not met
is now explicit. Second, `IApplication` exposes `minimumAuthorization`
information.
Application *must* revert increaseAuthorization in case the minimum
required authorization is not satisfied.
@pdyraga
Copy link
Member Author

pdyraga commented Apr 22, 2022

#87 got merged so I am rebasing this PR over main and undrafting!

@pdyraga
Copy link
Member Author

pdyraga commented Apr 22, 2022

System tests are failing because of a Hardhat problem described here #87 (comment).

@cygnusv cygnusv merged commit c49b9b2 into main Apr 22, 2022
@cygnusv cygnusv deleted the better-api branch April 22, 2022 07:44
@pdyraga pdyraga added this to the v1.2.0 milestone Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants