Skip to content
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

Assume stake is elevated if currentRequiredStake reverts #2293

Merged
merged 2 commits into from
May 13, 2024

Conversation

PlasmaPower
Copy link
Collaborator

As the currentRequiredStake docstring states:

    /**
     * @notice Calculate the current amount of funds required to place a new stake in the rollup
     * @dev If the stake requirement get's too high, this function may start reverting due to overflow, but
     * that only blocks operations that should be blocked anyway
     * @return The current minimum stake requirement
     */
    function currentRequiredStake(

We should assume the stake is elevated if this function reverts. I also swapped the order of the baseStake and currentRequiredStake checks, so that if all calls to the rollup are reverting for whatever reason, we'll correctly return an error there.

@cla-bot cla-bot bot added the s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA. label May 10, 2024
@PlasmaPower PlasmaPower force-pushed the stake-revert-elevated branch from 4a26a41 to b744328 Compare May 10, 2024 05:54
Copy link
Member

@joshuacolvin0 joshuacolvin0 left a comment

Choose a reason for hiding this comment

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

LGTM

@joshuacolvin0 joshuacolvin0 enabled auto-merge May 13, 2024 17:51
@joshuacolvin0 joshuacolvin0 merged commit 51189e4 into master May 13, 2024
8 of 9 checks passed
@joshuacolvin0 joshuacolvin0 deleted the stake-revert-elevated branch May 13, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s Automatically added by the CLA bot if the creator of a PR is registered as having signed the CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants