-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
x/authz charge extra gas for GrantAuthorization #8595
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8595 +/- ##
==========================================
- Coverage 61.37% 61.37% -0.01%
==========================================
Files 670 670
Lines 38286 38290 +4
==========================================
+ Hits 23499 23501 +2
- Misses 12329 12330 +1
- Partials 2458 2459 +1
|
…eem/8311-authz-gas
…os-sdk into aleem/8311-authz-gas
txLen := len(ctx.TxBytes()) | ||
for _, msg := range tx.GetMsgs() { | ||
if msg.Type() == authz.TypeMsgGrantAuthorization { | ||
extraGasCost += params.TxSizeCostPerByte * uint64(txLen/len(tx.GetMsgs())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will this be known client side? Unless a user simulates the transaction it will fail. Out of scope of this PR but we should provide an endpoint that displays all the custom gas amount.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree with @marbar3778 here, this is way too hacky and not scalable
maybe tomorrow's discussion will give more clarity on an overall protocol base fee to avoid msg pollution, and we don't even need this PR anymore?
@@ -9,6 +9,7 @@ import ( | |||
"github.com/cosmos/cosmos-sdk/types/tx/signing" | |||
"github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" | |||
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" | |||
authz "github.com/cosmos/cosmos-sdk/x/authz/exported" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should auth depend on authz like this? I thought we were trying to avoid direct module dependencies.
Wont block this PR but dont think this should be merged. It seems too hacky to me. |
txLen := len(ctx.TxBytes()) | ||
for _, msg := range tx.GetMsgs() { | ||
if msg.Type() == authz.TypeMsgGrantAuthorization { | ||
extraGasCost += params.TxSizeCostPerByte * uint64(txLen/len(tx.GetMsgs())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree with @marbar3778 here, this is way too hacky and not scalable
maybe tomorrow's discussion will give more clarity on an overall protocol base fee to avoid msg pollution, and we don't even need this PR anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for my delay here. Unfortunately this wasn't really the idea of the issue. We want to charge extra gas when creating an Authorization
grant, not when running messages when they pass through the ante handler...
This is charging extra gas on creating an authorization and not while on executing the messages. Cc @aleem1314 |
Yes so basically this needs to be done in the authz MsgServer using ConsumeGas. |
From our call on Wednesdsay, my memory is that we shouldn't add a gas based approach, but pursue a strategy that involves deposits that can be later retreived. |
Description
closes: #8311
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes