-
Notifications
You must be signed in to change notification settings - Fork 1
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
Gasless feature review report #6
Comments
entrypoint:
the rest is all good. as for |
|
Do you mean implement this |
This was
linked to
pull requests
Feb 16, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a summary of the internal review of the gas-less feature.
We suggest some improvements to the contracts. And suggest a mechanism to mitigate the DOS risk, which can be implemented on the Godwoken.
Repository
Repository License
eth-infinitism/account-abstraction
are licensed under GPL-3.0 (BasePaymaster.sol), but this repo relicensed source code in MIT, which is violent the GPL-3.0 license.Test coverage
Documentation
ERC-4337
and eth-infinitism/account-abstraction in the document or README.Contracts
EntryPoint
block.coinbase
instead ofGW_FULL_NODE
,GW_FULLNODE
should be removed.outOpInfo.preOpGas
differs from the original code. We should add a comment to explain it.outOpInfo.preOpGas = preGas - gasleft();
outOpInfo.preOpGas = preGas - gasleft() + userOp.preVerificationGas;
paymasterDeadline
with uninitializeddeadline
in L265simulateValidation
can be removed.actualGasUsed
instead ofgasPrice
in theUserOperationEvent
https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/interfaces/IEntryPoint.sol#L25BasePayMaster
BasePayMaster
has an interval variable admin, duplicated to the Owner. We should remove the admin variable, useonlyOwner
modifier to check permission.onlyOwner
. Should remove admin.AvailAddr
should be implemented as an interface. Please move theavailAddrs
into a standalone interface, and add an example to demonstrate how to use it.availAddrs
isn't clear. Rename it towhitelistContracts
PayMaster reputation
In ERC-4337, we don't know whether the paymaster or the user causes a failed tx. The bundler takes the risk by simulating the tx before submitting the tx to the miner.
In Godwoken gasless, the block producer is also a bundler. We must control the risk of being attacked by malicious users and paymasters.
The basic idea is to use a tiny gas to check the validity of user operation. The paymaster must decide whether the tx is valid - the paymaster takes the risk of being banned, or the tx is invalid - the block producer will simply reject the tx.
So we have these situations when a gas-less fails:
IPaymaster(paymaster).validatePaymasterUserOp
PAY_MASTER_VALIDATE_GAS_LIMIT
(PAY_MASTER_VALIDATE_GAS_LIMIT
is a very small value)PAY_MASTER_VALIDATE_GAS_LIMIT
handlePostOp
total invalid gas
.validatePaymasterUserOp
and still fails, the used gas should be accumulated to paymaster'stotal invalid gas
total invalid gas
reach a limit.The text was updated successfully, but these errors were encountered: