QuarkChain / pyquarkchain

Python implementation of QuarkChain
https://quarkchain.io
MIT License
224 stars 114 forks source link

Delayed Balance Substraction on Cross-shard Transactions #919

Open pichaoqkc opened 3 years ago

pichaoqkc commented 3 years ago

The Prometheus server was supposed to count the balance of each shard when the cross-shard transaction happens (#918), but the result sometimes gets wrong.

In this case, shard 0 transferred balances to each other shards(1 ~ 7), the curve of the total balance is supposed to be smooth but not. image Transactions happened at time 13:27:45, we can notice a total balance increase, which shouldn’t be there. When we dived deep into the change of each shard, we found that the balance of shard 1~7 increased as expected at time 13:27:45. image But the balance of shard 0 began to decrease till 13:31:45: image

Normally, the counting script would observe the decrease of sender first and then the increase of receiver: image image