-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: eth_estimateGas
opts to fallback estimation for contract revert
#2834
fix: eth_estimateGas
opts to fallback estimation for contract revert
#2834
Conversation
…verts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
…verts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we include some tests for this new scenario?
…verts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Good point, I will extend the tests for eth_estimateGas |
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good, left some questions
Nit: I think we should the remove the |
…ED error message Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2834 +/- ##
==========================================
+ Coverage 81.26% 81.28% +0.02%
==========================================
Files 46 46
Lines 3394 3415 +21
Branches 707 716 +9
==========================================
+ Hits 2758 2776 +18
+ Misses 414 410 -4
- Partials 222 229 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
#2834) * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: extend tests in eth_estimateGas.spec.ts to cover the new logic Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: fix failing postman tests due to missing 'from' field Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: throw predefined.CONTRACT_REVERT only for CONTRACT_REVERT_EXECUTED error message Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: use `Status.ContractRevertExecuted` from `@hashgraph/sdk` Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
#2834) * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: extend tests in eth_estimateGas.spec.ts to cover the new logic Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: fix failing postman tests due to missing 'from' field Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: throw predefined.CONTRACT_REVERT only for CONTRACT_REVERT_EXECUTED error message Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: use `Status.ContractRevertExecuted` from `@hashgraph/sdk` Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com>
fix: `eth_estimateGas` opts to fallback estimation for contract revert (#2834) * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts * test: extend tests in eth_estimateGas.spec.ts to cover the new logic * test: fix failing postman tests due to missing 'from' field * fix: throw predefined.CONTRACT_REVERT only for CONTRACT_REVERT_EXECUTED error message * fix: use `Status.ContractRevertExecuted` from `@hashgraph/sdk` --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> Signed-off-by: Logan Nguyen <logan.nguyen@swirldslabs.com> Co-authored-by: Victor Yanev <161485803+victor-yanev@users.noreply.github.com>
#2834) * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: `eth_estimateGas` opts to fallback estimation when a contract reverts Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: extend tests in eth_estimateGas.spec.ts to cover the new logic Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * test: fix failing postman tests due to missing 'from' field Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: throw predefined.CONTRACT_REVERT only for CONTRACT_REVERT_EXECUTED error message Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> * fix: use `Status.ContractRevertExecuted` from `@hashgraph/sdk` Signed-off-by: Victor Yanev <victor.yanev@limechain.tech> --------- Signed-off-by: Victor Yanev <victor.yanev@limechain.tech>
Description:
This PR modifies the
EthImpl
class to improve error handling for gas estimation.predefined.CONTRACT_REVERT
JSON-RPC error with the revert reason in case of contract revertpredefined.CONTRACT_REVERT
to cover more edge cases when decoding error messagesdecodeErrorMessage
andpredefined.CONTRACT_REVERT
eth_estimateGas
with the new logic for reverting callsRelated issue(s):
Fixes #2830
Solves problem in #2821
Notes for reviewer:
Checklist