Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Refund unused gas in sdk 0.46's posthandlers #1231

Closed
yihuang opened this issue Aug 10, 2022 · 4 comments
Closed

Refund unused gas in sdk 0.46's posthandlers #1231

yihuang opened this issue Aug 10, 2022 · 4 comments
Labels
pinned Pinned issues that won't be closed by stalebot ‼️ State Machine Breaking

Comments

@yihuang
Copy link
Contributor

yihuang commented Aug 10, 2022

Proposal: Refund unused gas in sdk 0.46's posthandlers

Now we upgraded to SDK 0.46 which supports posthandlers, and apply feemarket to native tx, we can do gas refund in posthandlers in a unified way.

Current behavior: [What currently happens]

Desired behavior: [What you would like to happen]

Use case: [Why is this important (helps with prioritizing requests)]

Requests may be closed if we're not actively planning to work on them.

@fedekunze
Copy link
Contributor

@yihuang are you planning to work on this or should we assign someone from our team?

@yihuang
Copy link
Contributor Author

yihuang commented Aug 24, 2022

@yihuang are you planning to work on this or should we assign someone from our team?

no, we are not working on it, do you plan to refund native tx gas just like eth tx?

@fedekunze
Copy link
Contributor

just Ethereum for now

@fedekunze
Copy link
Contributor

Ok I checked the current implementation of PostHandlers and the only way to accomplish the gas refund would be to use the ctx.GasMeter instead of relying on the transaction results (they are not passed to the post handler).

https://github.com/cosmos/cosmos-sdk/blob/81028cf93d0c0436110f350f0134f3c13a0ab7fd/baseapp/baseapp.go#L695-L710

I think we should deprioritize this until we've finished the module readiness (#1258) checklist and we have more extensive tests for gas metering behavior.

@fedekunze fedekunze removed this from the v0.20.x milestone Aug 24, 2022
@fedekunze fedekunze added the pinned Pinned issues that won't be closed by stalebot label Aug 24, 2022
@itsdevbear itsdevbear mentioned this issue Nov 16, 2022
11 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pinned Pinned issues that won't be closed by stalebot ‼️ State Machine Breaking
Projects
No open projects
Status: Canceled
Development

No branches or pull requests

3 participants