This project implements the RPC service based on the protocol described in EIP-4337, with several distinctive features that set it apart from the original workflow:
⛓️ White list of auxiliary smart contract bytecodes - UserOps using Factory, Account or Paymaster, whose bytecode is on the white list are added to the mempool without checking the opcodes used during simulation. Smart contract bytecode can be manually added to the white list by the pool administrator using a special command.
⛓️ Black list of auxiliary smart contract bytecodes - UserOps using Factory, Account, or Paymaster, whose bytecode is on the blacklist, are rejected. Smart contract bytecode can be added to the blacklist manually using a special command or the bytecode is added automatically during UserOp verification when added to the mempool. When a bytecode is added to the blacklist, any UserOps using that bytecode which have already been added to the mempool will be removed.
⛓️ Zero tolerance - Within the pool, only one UserOp that uses the same bytecode, not on the white list, can be present simultaneously. The stake check described in EIP-4337 is not performed at the same time.
eth_sendUserOperationeth_estimateUserOperationGaseth_getUserOperationByHasheth_getUserOperationReceipteth_supportedEntryPointseth_lastUserOperations
You can use the mempool with the entry point located at http://shchepetov.xyz/api/:
- Network: Gnosis
- UserOp lifetime: 30 minutes
- maxVerificationGasLimit: 200 000
- Minimum maxFeePerGas: 1 Gwei
- Minimum maxPriorityFeePerGas: 1 Gwei
- Allowed EntryPoints: 0xf5bF2a0441E28034B03B642C19787BB505c5fFc1
- Whitelisted Factory contracts byte-code: SimpleAcountFactory
- Whitelisted Paymaster contracts byte-code: DepositPaymaster
The repository contains a simple client application ./client.py for convenient
use of the remote mempool, which allows you to call all supported mempool
methods.
To learn more about how to call these methods on the remote mempool, run the
following command: python3 client.py --help.
apt-get update && apt-get install -y sudo gnupg2 software-properties-common nodejs npm postgresql postgresql-contrib gcc python3-dev python3-pipnpm install -g ganache-cli && npm install -g solcpython3 -m pip install -r requirements.txtThis project uses the Brownie framework for testing and generating ABI of smart contracts. Before beginning work, you need to install the necessary packages and compile the smart contracts:
brownie pm install OpenZeppelin/[email protected] && brownie pm install safe-global/[email protected]rm -r build/contracts/*.json && brownie compile- Run the PostgreSQL service:
service postgresql start && sudo -u postgres createdb mydb- Set the following environment variables:
DB_HOST(default islocalhost)DB_USERDB_PASSWORD
- Initialize databases:
python3 manage.py initialize-db- Set the
RPC_ENDPOINT_URIenvironment variable to the external entry point of the RPC API node.
⚠️ The node must support thedebug_traceCallmethod.
- Run the mempool service
python3 manage.py runserver --workers=%NUMBER_OF_WORKERS%To get additional information about mempool administration capabilities,
execute the following command: python3 manage.py --help