core-rs-albatross
core-rs-albatross copied to clipboard
Review the current accounts tree implementation
After the last accounts tree refactor, there is some functionality that is missing (such as accounts pruning), which would helped mitigating issues like 417. The idea of this task is to do a general review of the accounts tree functionality to find holes or potential problems.
If I'm not mistaken, the accounts are now pruned immediately upon a transaction. So there shouldn't be any "prunable" accounts in the Accounts Trie.
The PR #430 is very weird, especially these lines https://github.com/nimiq/core-rs-albatross/pull/430/files#diff-7b33a1b9e51a684fa5c6dbe676f75ffb09387ae43273e1fa7a0b9fcf05a5a72cR173-R176 . The only way for new_balance
to be zero is if total_value
is also zero and the previous account balance was non-existent. So it seems we allow transactions from non-existent accounts as long as the total value of the transaction is zero.
Ok, got it. That behavior was introduced right here a5ed6b7.