forest
forest copied to clipboard
RPC Gas Limit Estimation Under Estimating
** Acceptance Criteria **
- [ ] Gas API should accurately estimate the gas without hardcoding extra gas
Describe the bug
- Gas estimation is done when sending a transaction
- Gas estimation simulates the call into the VM and uses that as a gas limit
- Originally, ran into this when spamming our node with send calls (just hardcoded a workaround at the time)
- The Gas API's gas limit estimation keeps under reporting. Right now, we just add some extra gas to the gas limit, but this is a temporary fix for the sake of unblocking us in other areas. There is a TODO to fix this and should be looked into https://github.com/ChainSafe/forest/blob/main/node/rpc/src/gas_api.rs#L253
most likely because it's missing the gas fee cap calculation
Not sure if this is still relevant since we haven't been running local devnets
Relevant code: https://github.com/ChainSafe/forest/blob/e27085d0c5808062a91cdb4a9f685ff714ade050/node/rpc/src/gas_api.rs#L235
We should investigate if this still happens. Moving to the FVM might have fixed the underlying problem.
It should be fixed by #4187.