linera-protocol
linera-protocol copied to clipboard
Move tokens before closing a chain.
Analogous to https://github.com/linera-io/linera-protocol/issues/570, but for native tokens: When closing a chain, all native tokens on it become inaccessible.
We should:
- allow
Claimmessages to be handled by closed chains, or - automatically move all tokens to another chain (which one?), or
- fail: only allow closing a chain if the remaining tokens are below some threshold?
The close_chain runtime method and the CloseChain operation could take an optional ChainId argument. If that is specified and the chain balance is positive, at the end of the transaction a Credit message is inserted that transfers all of it to the specified chain.
For a closed chain, block fees on nonempty blocks are waived (that's already the case).
In addition, no fees are paid for that Credit message.
We also allow accepting Claim messages on closed chains. These are expected to come with a sufficient grant to pay for the fees.
Upon closing a chain, the mandatory applications are removed.