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

Fix: Mark block stake as withdrawn for the block #652

Merged
merged 1 commit into from
May 11, 2022

Conversation

daveroga
Copy link
Contributor

@daveroga daveroga commented May 11, 2022

Critical bug detected.
A proposer could call repeatedly the function requestBlockPayment in the Shield contract for the same block and will add BLOCK_STAKE to his pending withdrawal each time.

Adding state.setBlockStakeWithdrawn(blockHash) at the end of the function fixes this bug as it's checked in the function that the block stake is not already withdrawn for the blocHash.

require(
            state.isBlockStakeWithdrawn(blockHash) == false,
            'The block stake for this block is already claimed'
        );

@Westlad Westlad merged commit 1a33ede into master May 11, 2022
@Westlad Westlad deleted the daveroga/fix-request-block-payment branch May 11, 2022 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants