Closed talhamalik883 closed 1 year ago
Instead of adding a new end point on bundler, we can use the same bundler end point and pass the request parameters in form of JSON RPC Request
Url: Bundler URL Type: GET Params:
{
"method": "eth_getUserOpGasPrices",
"params": ["<Chain_ID_Value"],
"jsonrpc": "2.0",
"id": 1
}
Success Response
{
"jsonrpc": "2.0",
"id": 1,
"result" : {
"maxFeePerGas": "0x987239",
"maxPriorityFeePerGas": "0x86bac3"
}
}
Error Response
{
"jsonrpc": "2.0",
"id": 1,
"error" : {
"code": <Integer value>,
"message" : "String error message",
"data": {}. // Any data related to error
}
}
Instead of adding a new end point on bundler, we can use the same bundler end point and pass the request parameters in form of JSON RPC Request
Url: Bundler URL Type: GET Params:
{ "method": "eth_getUserOpGasPrices", "params": ["<Chain_ID_Value"], "jsonrpc": "2.0", "id": 1 }
Success Response
{ "jsonrpc": "2.0", "id": 1, "result" : { "maxFeePerGas": "0x987239", "maxPriorityFeePerGas": "0x86bac3" } }
Error Response
{ "jsonrpc": "2.0", "id": 1, "error" : { "code": <Integer value>, "message" : "String error message", "data": {}. // Any data related to error } }
yeah that sounds good. Can we add gasPrice another attribute also in response ? Some chains do not support type 2 transaction so we will just use gasPrice in that case.
For those who don't support type 2, value of maxFeePerGas and maxPriorityFeePerGas value will be same in this case. This is mentioned in the ERC-4337 as well, as UserOp doesn't have gasPrice field.
You can check how EntryPoint handles this case here https://github.com/eth-infinitism/account-abstraction/blob/develop/contracts/core/EntryPoint.sol#L593
field
using gasPrice meant that i will assign gasPrice to maxFee and maxPriorityFee for chains that don't support type 2.
const { maxFeePerGas, maxPriorityFeePerGas, gasPrice } = await this.provider.getGasPrices()
userOp.maxFeePerGas = maxFeePerGas ?? gasPrice
userOp.maxPriorityFeePerGas = maxPriorityFeePerGas ?? gasPrice
}
This issue has been inactive for 30 days. It will be closed due to inactivity. If this issue is still relevant, please comment to keep it open. Alternatively, you can create a new issue with updated information.
In client-sdk provider.getFeeData() function is called to populate maxFeePerGas and maxPriorityFeePerGas for any userOp created in client-sdk. The fee values returned by getFeeData are either null or low as compared to on chain network fee. This can be sorted by switching from provider to an external api that send's accurate data. Following are the requirements for external endpoint for fetching fee values.
Response