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

Moves frozen gold transfer check after check that transactor balance covers gas #895

Merged
merged 1 commit into from
Mar 6, 2020

Conversation

alecps
Copy link
Contributor

@alecps alecps commented Mar 6, 2020

Description

The frozen gold transfer check in validateTx() of tx_pool queries smart contracts for the isFrozen boolean and address whitelist. Currently, this check occurs before ensuring the transactor's balance covers the gas cost. @nategraf pointed out that this might open up a potential denial of service vector, as someone could send many transactions attempting to transfer gold without actually having the requisite gas, each of which would trigger these relatively slow reads from layer 2. This PR addresses this concern by simply rearranging the order of the checks.

Tested

Tests for gold transfer freezing already exist in e2e transfer_tests in celo-monorepo.

Other changes

None.

Related issues

  • None

Backwards compatibility

Yes.

@alecps alecps requested a review from nategraf March 6, 2020 18:43
@alecps alecps requested review from asaj and timmoreton as code owners March 6, 2020 18:43
@alecps alecps requested review from nategraf and removed request for timmoreton, asaj and nategraf March 6, 2020 18:44
Copy link
Contributor

@nategraf nategraf left a comment

Choose a reason for hiding this comment

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

Looks good to me

@alecps alecps assigned alecps and unassigned nategraf Mar 6, 2020
@alecps alecps merged commit dccce21 into master Mar 6, 2020
@alecps alecps removed their assignment Mar 6, 2020
@alecps alecps deleted the alecps/frozenGold branch March 6, 2020 20:28
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.

2 participants