Skip to content
Merged
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion proposals/0392-relax-minimum-balance-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ else:
assert(acc.post_exec_balance == 0 or acc.post_exec_balance >= min_allowed_balance)
```

The same pre/post-balance semantics MUST also be applied to fee distribution:
transaction fee debits and subsequent fee distribution are treated as an
additional balance-changing phase, and the invariant above MUST be enforced
using the pre-fee and post-fee balances.

The check ensures that an account's balance is always rent-exempt as of
the last (re)allocation of its data:

Expand All @@ -107,7 +112,9 @@ section for more details.
### Implementation details

- The pre-execution balance MUST be captured before any state is modified
(e.g. before fee collection, instruction execution, etc).
(e.g. before fee collection, instruction execution, etc). This same
`pre_exec_balance` snapshot MUST be reused when enforcing the minimum balance
invariant across both instruction execution and fee debiting/distribution.
- The pre and post-execution sizes are compared to determine if upwards
reallocation occurred.
- The pre-execution owner MUST be captured. If the account owner changes during
Expand Down
Loading