Skip to content
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

genutil and globalfee init order #2489

Closed
5 tasks
Tracked by #2270
yaruwangway opened this issue May 12, 2023 · 1 comment
Closed
5 tasks
Tracked by #2270

genutil and globalfee init order #2489

yaruwangway opened this issue May 12, 2023 · 1 comment
Assignees
Labels
status: waiting-triage This issue/PR has not yet been triaged by the team. type: bug Issues that need priority attention -- something isn't working

Comments

@yaruwangway
Copy link
Contributor

yaruwangway commented May 12, 2023

Summary of Bug

In genutils module, there is DeliverGenTxs which is called in initGenesis, DeliverGenTxs calls DeliverTx which will call the antehandler involved in deliverTx check.

initGenesis -> DeliverGenTxs -> deliverTx -> antehandler

In the next gaia release, global fee will does fee check also in DeliverTx. Which means in DeliverGenTxs call stack, the globalfee antehandler will be called, global fee module should be inited this moment.

Solution 1:
init globalfee before genutil module in initBlock.

Disadvantage: if the chain is inited with non-zero globalfee, calling gentx need to be paid, which might cause trouble.

Solution 2:

when getting globalfee Params for fee checks, we check only get the params if they exist, otherwise, return empty params.
this means gentx will go through fee check with min-gas-price 0uatom, bypass-msg=[], and BypassMinFeeMsgTypes = 0
see this fix.

the fix is to make sure to check if key exists before get it to avoid panic

Disadvantage: works, but this put gentx at a different fee check condition, which is empty fees.

Solution 3:

Put gentx as bypass-msg which means it is free.
concerns: will the gentx exceed bypass allowed max gas ? bypass can be always proposed to be changed.

Solution 4:
only does globalfee fee antehandler in checkTx.

Version

Steps to Reproduce


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
  • Is a spike necessary to map out how the issue should be approached?
@yaruwangway yaruwangway added type: bug Issues that need priority attention -- something isn't working status: waiting-triage This issue/PR has not yet been triaged by the team. labels May 12, 2023
@yaruwangway yaruwangway self-assigned this May 12, 2023
@mpoke
Copy link
Contributor

mpoke commented May 12, 2023

I think solution 2 is the way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-triage This issue/PR has not yet been triaged by the team. type: bug Issues that need priority attention -- something isn't working
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants