-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch tx fee from onchain events #756
Comments
We explicitly decided against this because there is no guarantee that the We also discussed adding an event to the runtime for the fee, but decided against that as well because events are not free and the information can be deterministically reproduced by...something like Sidecar. |
Although I suppose if a parachain wanted to add a runtime event for this purpose, then sure, we could send Sidecar down that logic road. So we could make certain chain configs look for an event instead of providing a But to be clear: using the existing events in the Relay Chain runtime is not a good way to calculate fees. |
I see. That make sense. I know Subscan is using events to fetch fees and they had some issues with new runtime. Also the last treasury deposit should always be the fee deposit right? |
I thought of that too when we first designed Sidecar, but decided it was not an assumption we could rely on. |
I see. While that may not be true universally, it could be true for a particular parachain so could be a useful opt-in option. |
I wanted to bring this back to light. I think it could be useful to have a query parameter such like
Just some thoughts I had. |
Now transaction payment pallet is emitting an event to include the fee amount, sidecar should support it paritytech/substrate#11618 Although we have implemented similar event in our pallet, the format is not exactly the same, so need someway to handle the difference. I guess the easy way is simply expose the whole event details to the relevant field |
Agreed, I will attach a separate issue so we can track that within the following releases that those changes are included in via polkadot/substrate. As to how we will parse that info and display it i'll have to do some playing and give it some thought. I do like the idea of attaching an That all being said, Im currently working through the events and writing an implementation for extracting the fee. I'm seeing the |
Not sure of edge cases, but |
Good to know! Thanks. Yea my approach for now is to do some shallow analysis on the events, and compare it to the fee returned by I think the |
It will be useful if there is a mode to query tx fee info from onchain events data instead of calculating it.
But need to consider about paritytech/polkadot#4230
The text was updated successfully, but these errors were encountered: