subscan-explorer / subscan-issue-tracker

The issue tracker for Subscan.io.
3 stars 5 forks source link

Estimated fees appear to be used in account balance calculations #31

Closed masa-matt closed 1 year ago

masa-matt commented 1 year ago

Confirmation

Affected Network(s)

Westend

Steps to reproduce

  1. westend
  2. https://westend.subscan.io
  3. open account page / also same at api.query.system.account(address)
  4. balance is incorrect

Expected output

explorer shows 2.885849322278WND (result of used fee calculation) in balance

Actual output

I am developing a wallet for institutional investors. I am getting account balances with the following API, but I detected that the balances are misaligned and investigated. api.query.system.account(address)

I checked my account balance at https://westend.subscan.io and it appeared to be calculated on estimated fees and not on used fees. This is the transaction that caused the displacement in question. When the estimated commission and the consumption commission were different, we found that the balance was calculated using the estimated commission.

2.885849322278WND (result of used fee calculation) - 2.884514861930WND (balance in explorer) = 0.001334460348WND

0.014081481387WND (Estimated Fee) - 0.012747021039WND (Used Fee) = 0.001334460348WND (same as above!)

https://westend.subscan.io/extrinsic/0x07b89e86af9d0dc1ffedd8b9a03aa9f4ba0022af0538f89a00f62a4f1ef62215

image

And this is the history at the time I checked. (I don't have any captures left from that time, but you can see if you can calculate the history.)

https://westend.subscan.io/extrinsic/0xa1a4de979baac019b86323263617b7b639c0f783b6458befb664d23ee7136c47 the account have 3WND in the start.

https://westend.subscan.io/extrinsic/0xd90717f96e836fd4be26c73496b462bcd0bab6ca74827aa771e55d6b32b64f5a Estimated Fee: 0.016441640956WND Used Fee: 0.016441640956WND https://westend.subscan.io/extrinsic/0xe6060dc9ec8bd573ff71483a06f9eb862a861c6c6bbf20b447985dec4c908898 Estimated Fee: 0.012871948968WND Used Fee: 0.012871948968WND https://westend.subscan.io/extrinsic/0x60674dcb4fb446f91552a70c3dc127701ae94080162ef6588d79019123108dae Estimated Fee: 0.013987424135WND Used Fee: 0.013987424135WND https://westend.subscan.io/extrinsic/0x07b89e86af9d0dc1ffedd8b9a03aa9f4ba0022af0538f89a00f62a4f1ef62215 Estimated Fee: 0.014081481387WND Used Fee: 0.012747021039WND https://westend.subscan.io/extrinsic/0x927f43279f86e0d6addd05260d39c482a2847a300701ae7c90d0880b02d50cf3 Estimated Fee: 0.013887424135WND Used Fee: 0.013887424135WND https://westend.subscan.io/extrinsic/0x3afce57686f698c1fed4c8f3fc8bb17880e2ab4ecafdecb3defc758e193bce4c Estimated Fee: 0.013987424135WND Used Fee: 0.013987424135WND https://westend.subscan.io/extrinsic/0xda5222a19b97ecb76ef378d8a318ab8c4659b0b65afcaf9091785b484b28d4d5 Estimated Fee: 0.013787407697WND Used Fee: 0.013786153397WND https://westend.subscan.io/extrinsic/0xa96b103931f965b713822005646dcf324551e1681a1dccc0e28303baae90cba1 Estimated Fee: 0.016441640956WND Used Fee: 0.016441640956WND

Thank you.

Additional factoids or references

No response

Daanvdplas commented 1 year ago

I've come across some questions on stackexchange (e.g.) where it is unsure what the estimated fee and used fee is based upon due to the fact that in their case the used fee is higher than the estimated fee. This would mean that the estimated fee can't be the estimated fee resulting from the weight system (or it is a bug in the weight estimation). Please provide some information on where these results are based upon

freehere107 commented 1 year ago

@masa-matt @Daanvdplas This issue has been fixed. Thanks for your feedback

masa-matt commented 1 year ago

@freehere107 Thanks for fixing!