Open crystalin opened 2 years ago
cc @jacogr as he might know better how to compute/handle the fees in polkadotjs
As far as I understand the queryInfo
actually executes the block and then returns the fees based on that - so it should be 100%.
Where it does fall short is where refunds come into play. (I have a mental note of this somewhere, sometime ago to look at the actual Rust code in these cases, but sadly have not had a gap since I made that note)
Thank you @jacogr that was my understanding. I can't understand why it is different :(
After some more investigation, it looks like this affects extrinsics which return a DispatchResultWithPostInfo
with a different weight than their declared #[pallet::weight(..)]
fn.
Here are some we've noticed:
councilCollective.close
councilCollective.propose
identity.clearIdentity
identity.setIdentity
identity.setSubs
techCommitteeCollective.close
techCommitteeCollective.propose
utility.batch
utility.batchAll
I believe the problem is simply that pallet_transaction_payment
's query_info
only queries the extrinsic's get_dispatch_info
without actually executing it:
Yeah that makes sense. Executing them would be way too costly.
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
When querying the fees through
api.rpc.payment.queryInfo
the value returns is different from what is expected. The following program computes the fees using this rpc method and compares it to the treasury deposit event in that same extrinsic.Running it with
ts-node block-fees.tx 9468639
shows:As you can see the 80% of the
council.propose
fees don't match the deposit to the treasury (but it works for all the other extrinsics).I've verified it with other Operational and most (if not all) are failing to report the right value. Except when the extrinsic fails, in that case it has the correct value. I've also verified it with parachains and it is the same error.
Steps to reproduce
Code to check the block fees: