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

Underflow in verify_transfer #421

Closed
kirk-baird opened this issue Jul 3, 2019 · 1 comment
Closed

Underflow in verify_transfer #421

kirk-baird opened this issue Jul 3, 2019 · 1 comment

Comments

@kirk-baird
Copy link
Member

@kirk-baird kirk-baird commented Jul 3, 2019

Description

In eth2/state_processing/src/per_block_processing/verify_transfer.rs
Verifying the balance of sender should check against amount + fee rather just amount.

Present Behaviour

Currently the code has a check sender_balance >= transfer.amount

    // Verify the sender has adequate balance.
    verify!(
        time_independent_only || sender_balance >= transfer.amount,
        Invalid::FromBalanceInsufficient(transfer.amount, sender_balance)
    );

Which does not account for the fee.

Expected Behaviour

sender_balance >= total_amount

Steps to resolve

Change transfer.amount to total_amount to also account for the fee.

@paulhauner
Copy link
Member

@paulhauner paulhauner commented Jul 29, 2019

Closed via #457

Loading

@paulhauner paulhauner closed this Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants