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

Gasfree Tx support for MsgMicrotx submissions #56

Merged
merged 12 commits into from
Mar 14, 2024

Conversation

ChristianBorst
Copy link
Collaborator

@ChristianBorst ChristianBorst commented Mar 7, 2024

No description provided.

@ChristianBorst ChristianBorst force-pushed the christianborst/gasfree branch 4 times, most recently from 61fd791 to aa25692 Compare March 13, 2024 18:21
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 ChristianBorst force-pushed the christianborst/gasfree branch from aa25692 to 784a083 Compare March 13, 2024 18:29
@ChristianBorst ChristianBorst changed the title WIP: Gasfree Tx support for MsgMicrotx submissions Gasfree Tx support for MsgMicrotx submissions Mar 13, 2024
Copy link
Collaborator

@jkilpatr jkilpatr left a 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!

@ChristianBorst ChristianBorst merged commit 784a083 into main Mar 14, 2024
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants