pyquarkchain
pyquarkchain copied to clipboard
Support collecting root block coinbase in other native tokens
which is not supported right now (using hard-coded genesis token):
https://github.com/QuarkChain/pyquarkchain/blob/c3a76bc0527387a606b87a87b0706b929d88c95b/quarkchain/cluster/shard_state.py#L94-L123
that's why even this root block has QTSLA token in coinbase (which comes from tx fee), the root block miner didn't collect it
ahh, right, now I remember missing this part... looks to me CrossShardTransactionDeposit shall encode a map of tokens. But this map mostly would contain just one entry (from x-shard transactions) and just rarely contain multiple tokens as a result of tokens in coinbase like in the example above
This will be a problem for current code with multiple tokens, but since we only support one token (QKC) at the monent, we should be fine.
In the future, we will implement PoSW in rootchain, which means
- all coinbase rewards will be stored on roothchain db,
- a user of rootchain must explicitly transfer its balance (one token) to a shard which automatically address the problem.
@qizhou should we re-prioritize this task to post-1.1 or even post-1.2? since in the near future we only have QKC token
Agree.
we should make CrossShardTransactionDeposit
use token balance map to fix this issue
https://github.com/QuarkChain/pyquarkchain/blob/master/quarkchain/core.py#L1100
We may just have the cursor to return multiple deposits with different transfer token IDs.
We may just have the cursor to return multiple deposits with different transfer token IDs.
agree. in this way it will not be a breaking change (because we don't have other tokens for now)