post https://api.zan.top/node/v1///
Submits a UserOperation object to the UserOperation pool of the bundler. It returns a userOpHash if the UserOperation was accepted otherwise returns an error.
maxFeePerGas and maxPriorityFeePerGas
- baseFeePerGas This is the minimum amount of gas required for a transaction to be included in a block. It's algorithmically adjusted by the protocol based on network congestion. When the network is more congested, the base fee goes up; when it's less congested, the base fee goes down. Every transaction must at least pay the base fee.
- maxPriorityFeePerGas Also known as the "tip," this is an additional fee that a user can set to give their transaction higher priority for inclusion by miners. Essentially, it's the maximum amount a user is willing to pay on top of the base fee to incentivize miners to include their transaction in a block quickly.
How to calculate maxFeePerGas and maxPriorityFeePerGas:
- Fetch Current Base Fee: Use the method eth_getBlockByNumber with the 'latest' parameter to get the current baseFeePerGas.
- Apply Buffer on Base Fee: To account for potential fee changes, apply a buffer on the current base fee, according to the table below.
- Fetch Current Priority Fee: Use the eth_maxPriorityFeePerGas method to query the current priority fee for the network.
- Apply Buffer on Priority Fee: Once you have the current priority fee using eth_maxPriorityFeePerGas, increase it according to the table below.
- Determine maxFeePerGas: sum of the baseFeePerGas and maxPriorityFeePerGas, and the buffers.
Recomended Extra Fees
Ecosystem | Network | Extra Fee Requirement |
---|---|---|
Ethereum | Mainnet | Recommended 25% buffer on priority fee and 50% buffer on base fee for the network. |
Ethereum | Sepolia | No extra priority fee, minimal priority fee . Recommended 20% buffer on base fee for the network. |
Polygon PoS | Mainnet | No extra priority fee, minimal priority fee 30 GWei. Recommended 50% buffer on base fee for the network. |
Polygon PoS | Mumbai | No extra priority fee, minimal priority fee 1.5 GWei. Recommended 20% buffer on base fee for the network. |
Optimism | Mainnet | No extra priority fee, minimal priority fee 100,000. Recommended 50% buffer on base fee for the network. |
Optimism | Sepolia | No extra priority fee, minimal priority fee 100,000. Recommended 20% buffer on base fee for the network. |
Arbitrum | One | No priority fee. Recommended 5% buffer on base fee for the network. |
Arbitrum | Sepolia | No priority fee. Recommended 5% buffer on base fee for the network. |
Replacement Underpriced Error
When utilizing eth_sendUserOperation, you may encounter a 'Replacement Underpriced Error.' This error typically arises if there's already a pending operation from the same user in the transaction pool. Such operations can linger in the mempool when the gas fees set are insufficient for them to be packaged into a block.
To rectify the issue, it's necessary for the user to increment the maxFeePerGas and maxPriorityFeePerGas values by a minimum of 10%.