Testnet block generation hangs when transfer with hbd amount larger than current hbd supply is sent
FYI: @bwrona @ABW @Ickiewicz
Related: #573 (closed)
There is a situation that may cause the transaction to be validated correctly and yet cannot be added to the block (apply_block
fails), which causes block production to stop (it doesn't crash the node, and it keeps trying to apply it in the loop, which is why the node hangs in this state)
It looks like this should not occur with #573 (closed) fixed.
An example test case looks like:
from __future__ import annotations
import test_tools as tt
def test_if_node_block_generation_hangs(init_node: tt.InitNode) -> None:
# ARRANGE
wallet = tt.Wallet(init_node)
# ACT
# We need to send a larger amount of HBD than the current supply is.
gdpo = init_node.api.database.get_dynamic_global_properties()
amount_to_send = tt.Asset.from_(gdpo["current_hbd_supply"]) + tt.Asset.Tbd(1)
wallet.api.transfer("initminer", "null", amount_to_send, "")
# ASSERT
assert wallet.api.get_account("initminer")["hbd_balance"] == tt.Asset.Tbd(7_000_000) - amount_to_send
Edited by Mateusz Żebrak