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

Add helpers for fee currency handling #72

Closed
Tracked by #6
palango opened this issue Oct 24, 2023 · 2 comments
Closed
Tracked by #6

Add helpers for fee currency handling #72

palango opened this issue Oct 24, 2023 · 2 comments
Assignees

Comments

@palango
Copy link

palango commented Oct 24, 2023

In the txpool we need a new interface that provides information required for handling fee currencies.

FeeContext:

  • IsWhitelisted(feeCurrency address): bool
  • GetBalanceOf(account address, feeCurrency address): int
  • CompareFees(fee1 int, feCurrency1 address, fee2 int, feeCurrency2 address): int

@hbandura Please have a look and add things that would help you. Also please improve naming if you have better ideas :)

@hbandura
Copy link

There's one extra method so far that I see needed. The balance of a user has the l1cost of rollup deducted to check for tx costs. For this I'm needing a method that translate this l1cost in native currency to a feecurrency. However we can think of a different approach and directly ask what's the L1Cost of a feecurrency.

personal preference: that the cmp method receives only two values instead of 4, but that can be workaround and not' important (I always have to squint my eyes to double check that the first 2 values correspond to the first tx and the 3rd and 4th to the second tx).

All of this, being in the context of the txpool, has to be dependant of the txpool muted and change in a 1:1 fashion to the 'currentStateDb' of the txpool. I see as a little more explicit directly taking this value in the signatures (for easily reading) but I also understand the value on not sending it and treating this as also a possible cache fixed to one statedb.

@palango palango self-assigned this Nov 2, 2023
@palango palango changed the title Add FeeContext Add helper for fee currency handling Nov 7, 2023
@palango palango changed the title Add helper for fee currency handling Add helpers for fee currency handling Nov 7, 2023
@palango
Copy link
Author

palango commented Nov 30, 2023

Implemented in celo-org/op-geth#27.

@palango palango closed this as completed Nov 30, 2023
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 a pull request may close this issue.

2 participants