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 transfer invariant, credits to @holiman for finding the edge case #916

Merged
merged 2 commits into from
Apr 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions specs/core/0_beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -2416,6 +2416,8 @@ def process_transfer(state: BeaconState, transfer: Transfer) -> None:
get_balance(state, transfer.sender) == transfer.amount + transfer.fee or
get_balance(state, transfer.sender) >= transfer.amount + transfer.fee + MIN_DEPOSIT_AMOUNT
)
# No self-transfers (to enforce >= MIN_DEPOSIT_AMOUNT or zero balance invariant)
assert transfer.sender != transfer.recipient
# A transfer is valid in only one slot
assert state.slot == transfer.slot
# Only withdrawn or not-yet-deposited accounts can transfer
Expand Down