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

Gas Logic for System-initiated Deposit Txs #107

Open
Tracked by #204
phasewalk1 opened this issue Aug 6, 2024 · 0 comments
Open
Tracked by #204

Gas Logic for System-initiated Deposit Txs #107

phasewalk1 opened this issue Aug 6, 2024 · 0 comments

Comments

@phasewalk1
Copy link
Contributor

phasewalk1 commented Aug 6, 2024

As the first transaction in every block, Monomer gets L1 block attributes from Optimism's L1 Attributes Deposited Tx. This is a system-initiated transaction that is considered to be part of state-transition processing, and therefore, these transactions are not charged any ETH for gas.

We need to design a way to exempt them from consuming block gas and paying fees on the L2.

On the Comsos SDK side, the AnteHandler is in charge of performing validity checks on transactions -- during both CheckTx and DeliverTx -- and is also responsible for deducting fees from the sender account.

In order to exempt the L1AttributesDepositedTx from being charged fees, we should either

  1. Design a custom decorator for detecting these transactions and subverting the rest of the ante chain, or
  2. Construct two different ante chains that represent unique paths; one for native L2 txs and user-initiated L1 deposits (essentially, this would be the default x/auth/ante chain), and another for system-initiated L1 deposits.

The meaningful difference here is that (1) might carry security affects (wrt to skipping all other validity checks -- still working on formalizing these concerns; ref: #106), whereas (2) supports the possibility of creating custom decorators specifically tuned for system-initiated txs. Since the system-initiated path would essentially be operating at an elevated privilege level, it could reject any user-initiated transactions (similar to how Evmos rejects specific messages in their RejectMessagesDecorator).

Both of these solutions can effectively exempt these transactions from paying a fee in the AnteHandler chain, however, there is still the concern that block gas can be consumed outside of the AnteHandler chain as well. One place I've spotted this occurring is in baseapp/baseapp.go.(runTx). I'm not yet sure how to reconcile this, but I am exploring our options.

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

No branches or pull requests

1 participant