Content pfp
Content
@
0 reply
0 recast
2 reactions

Abhishek Yadav pfp
Abhishek Yadav
@abhixh
How do you calculate maxFeePerGas on Scroll and Mantle because they do not return maxFeePerGas and maxPriorityFeePerGas when fetching fee data?
1 reply
0 recast
0 reaction

Steve pfp
Steve
@stevedylandev.eth
Following this one; I haven’t been able to use scroll reliably on testnet so far :(
1 reply
0 recast
1 reaction

Abhishek Yadav pfp
Abhishek Yadav
@abhixh
Figured how to make it work on Scroll, Mantle not yet.
1 reply
0 recast
0 reaction

Steve pfp
Steve
@stevedylandev.eth
What’s the key?? 👀👀
1 reply
0 recast
1 reaction

Abhishek Yadav pfp
Abhishek Yadav
@abhixh
Started with the bare basics: maxFeePerGas = baseFeePerGas + maxPriorityFeePerGas if we know the two right hand side variables then we can calculate maxFeePerGas.
1 reply
0 recast
0 reaction

Abhishek Yadav pfp
Abhishek Yadav
@abhixh
The problem was since the RPC doesn’t return any value it’s difficult to even estimate baseFeePerGas which should be of the preceding block.
1 reply
0 recast
0 reaction

Abhishek Yadav pfp
Abhishek Yadav
@abhixh
But the network is live and blocks are being processed which means it’s the RPC that’s at fault. We decided to fetch baseFeePerGas from a different method. This was interesting https://github.com/ethers-io/ethers.js/discussions/3601
1 reply
0 recast
0 reaction

Abhishek Yadav pfp
Abhishek Yadav
@abhixh
“it simply multiplies the base fee by 2 and then adds the miner’s tip (maxPriorityFeePerGas)” Since the networks are actually working lastBaseFeePerGas cannot be null. Or unless the RPCs do not have a way to deconstruct the original equation and get the different values back.
1 reply
0 recast
0 reaction

Abhishek Yadav pfp
Abhishek Yadav
@abhixh
So we decided to do it ourselves. We could parse this data directly and recreate the equation on our own and then submit it. Worked for Scroll at 1.5x. Failed for Mantle even at 2x which means we need a different equation and this won’t work.
1 reply
0 recast
0 reaction