-
Notifications
You must be signed in to change notification settings - Fork 108
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
fix: exempt system txs from min gas check and fee deduction #1605
Conversation
in antehandlers. System txs are 7 zetaclient txs from observers.
Hi @brewmaster012 I am already working on a branch for this Overall I think instead of making it free we can adjust the gas price based on tx type , so that system tx cost similar to a standard tx . I am using Checking for observers would still open it up to a dos attack from one of our observers if they try to . |
I looked at it, and we need to pick one to work on and get deployed quickly.
I think this PR is a better base, would you like to work on it together?
Yes: how about this: allow the system txs to pass with 1% of min gas price. (this roughly fixes the discrapency between cosmos txs vs ethereum txs gas meter for our system txs). 1% reflects two things:
|
That makes sense. I can work on this branch as well; |
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.
- We need to add unit tests for the added functionality.
I think we can implement a separate function taking the message and isAuthorized
as an argument and returning a bool if the other anteHandler should be used.
And we can add unit test for this function.
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.
This looks like great start ,
I do think , if we can take some and implement a function , which ,adjusts the gas prices based on the gas_limit , when the tx matches the following condition
- IsAuthorized
- IsSystemTx
would be good .
!!!WARNING!!! Be very careful about using Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203 Pay extra attention to the way |
Factored out |
Descriptions
The following System txs types from observers are now exempt from minimum gas price check
and gas fee deduction in antehandler. This practically means that system transactions carry less effective gas price than regular txs. They still consume gas units.
Tested in smoketest, by setting gas price in
broadcast.go
to %1.1 of current base price. Smoketest passed despite minimum gas price setto 1GWEI. No negative tests conducted.
Closes:
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.
Checklist: