-
Notifications
You must be signed in to change notification settings - Fork 46
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
Gasfree Tx support for MsgMicrotx submissions #56
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ChristianBorst
force-pushed
the
christianborst/gasfree
branch
4 times, most recently
from
March 13, 2024 18:21
61fd791
to
aa25692
Compare
The gasfree module has the aim of enabling gasfree transactions on Althea-L1. A gasfree transaction contains only messages that the gasfree module has stored in its GasFreeMessageTypes Param (set by governance). This initial implementation defines a wrapper AnteDecorator which allows certain transactions to bypass other AnteDecorators if a transaction can be executed gasfree. It is up to other AnteDecorators (or message handlers) to charge fees outside of the normal gas fee process. The first gasfree message type will be MsgMicrotx, enabling Althea's decentralized peer-to-peer payments without requiring a balance of the Althea token. It is expected that Microtxs will charge a percentage fee and ignore gas requirements in exchange. It is critically important to protect the mempool and block space by kicking out invalid gasfree transactions and charging alternative fees early in transaction processing, or else the chain is susceptible to DoS attacks via spam.
The first gasfree msg will be MsgMicrotx (set by default in module genesis) and so special fee charges have been added to the AnteHandler via the new ChargeGasfreeFeesDecorator. This works together with the SelectiveBypassDecorator to avoid charging MsgMicrotx submissions fees in the native token if the submitted Tx contains solely gasfree msgs (for now, only MsgMicrotxs). The microtx module was modified to avoid double-charging MsgMicrotx fees by first checking the gasfree's current params. If MsgMicrotx is ever removed from the gasfree module's GasFreeMessageTypes list then the microtx should go back to charging fees in the message handler as normal.
ChristianBorst
force-pushed
the
christianborst/gasfree
branch
from
March 13, 2024 18:29
aa25692
to
784a083
Compare
ChristianBorst
changed the title
WIP: Gasfree Tx support for MsgMicrotx submissions
Gasfree Tx support for MsgMicrotx submissions
Mar 13, 2024
jkilpatr
reviewed
Mar 14, 2024
jkilpatr
approved these changes
Mar 14, 2024
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.
I really like the test suite!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.