-
Notifications
You must be signed in to change notification settings - Fork 6
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
[KIP-247] Gasless Transaction #47
base: main
Are you sure you want to change the base?
Conversation
I have a question about invalid swap tx. When the swap transactions sent by users without CL token are removed from a block? I think we need alternative checks instead of balance check. |
@ulbqb It'll revert by the condition R1 (GaslessSwapRouter). Token balance check in validateTx existed but has been removed because it's difficult to make a EVM call. |
insufficientFund error | ||
``` | ||
|
||
#### Promoting GaslessTx (promoteExecutables) |
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.
In practice, there is a more complicated case. I provide some examples:
[transfer_0, approve_1, swap_2] is queue contents.
[transfer_0, approve_1, swap_2] shoud be promoted to pending.
[approve_0, swap_1, approve_2, swap_3] is a queue list.
[approve_0, swap_1, approve_2, swap_3] shoud be promoted to pending.
[approve_0, approve_1, swap_2] is a queue list.
[] shoud be promoted to pending.
[approve_0, transfer_1, swap_2] is a queue list.
[] shoud be promoted to pending.
Is this correct? And I think there is a lack of checking of nonce overall.
AP1 and SPx: approveTx.Nonce + 1 == swapTX.Nonce
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 think we should only allow either
- (if approve exists) when getNonce(user) == GaslessApproveTx.nonce and getNonce(user) + 1 == GaslessSwapTx.nonce
- (else) when getNonce(user) == GaslessSwapTx.nonce
Thus, these are NOT regarded as GaslessTx:
- approve_1 and swap_2 in [transfer_0, approve_1, swap_2]
- approve_2 and swap_3 in [approve_0, swap_1, approve_2, swap_3]
- approve_1 and swap_2 in [approve_0, approve_1, swap_2]
The nonce check added by previous commit was meant to imply this nonce check.
--- | ||
kip: 247 | ||
title: Gasless Transaction | ||
author: Ian (@ian0371) and Ollie (@blukat29) |
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.
author: Ian (@ian0371) and Ollie (@blukat29) | |
author: Ian (@ian0371), Ollie (@blukat29) |
Proposed changes
Types of changes
Checklist
I have read the CLA Document and I hereby sign the CLA
in first time contributionRelated issues
Depends on #45