-
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: estimate_gas doesn't reflect changes in mirror-node #2409
fix: estimate_gas doesn't reflect changes in mirror-node #2409
Conversation
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
…t-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts
…t-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts
Signed-off-by: Victor Yanev <[email protected]>
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.
Amazing work! Few nits
If possible fix some of the SonarCloud issues |
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Quality Gate passedIssues Measures |
…n-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts # packages/relay/tests/lib/eth/eth_call.spec.ts # packages/relay/tests/lib/eth/eth_estimateGas.spec.ts
…n-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts # packages/relay/tests/lib/eth/eth_call.spec.ts # packages/relay/tests/lib/eth/eth_estimateGas.spec.ts
Signed-off-by: Victor Yanev <[email protected]>
…n-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/precheck.ts
…n-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/precheck.ts
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.
Please resolve the merge issue.
…n-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/clients/mirrorNodeClient.ts
…n-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/clients/mirrorNodeClient.ts
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.
LG
* fix: estimate_gas doesn't reflect changes in mirror-node Signed-off-by: Victor Yanev <[email protected]> * fix: estimate_gas doesn't reflect changes in mirror-node Signed-off-by: Victor Yanev <[email protected]> * fix: tests in eth_estimateGas.spec.ts Signed-off-by: Victor Yanev <[email protected]> * Merge branch 'refs/heads/main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts * chore: simplify isNonZeroValue condition Signed-off-by: Victor Yanev <[email protected]> * chore: add docs + fix compilation errors Signed-off-by: Victor Yanev <[email protected]> * chore: fix remaining sonar issues Signed-off-by: Victor Yanev <[email protected]> * Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts # packages/relay/tests/lib/eth/eth_call.spec.ts # packages/relay/tests/lib/eth/eth_estimateGas.spec.ts * chore: revert changes to EthImpl#call Signed-off-by: Victor Yanev <[email protected]> * Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/precheck.ts * Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/clients/mirrorNodeClient.ts --------- Signed-off-by: Victor Yanev <[email protected]> Signed-off-by: ebadiere <[email protected]>
* fix: estimate_gas doesn't reflect changes in mirror-node Signed-off-by: Victor Yanev <[email protected]> * fix: estimate_gas doesn't reflect changes in mirror-node Signed-off-by: Victor Yanev <[email protected]> * fix: tests in eth_estimateGas.spec.ts Signed-off-by: Victor Yanev <[email protected]> * Merge branch 'refs/heads/main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts * chore: simplify isNonZeroValue condition Signed-off-by: Victor Yanev <[email protected]> * chore: add docs + fix compilation errors Signed-off-by: Victor Yanev <[email protected]> * chore: fix remaining sonar issues Signed-off-by: Victor Yanev <[email protected]> * Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts # packages/relay/tests/lib/eth/eth_call.spec.ts # packages/relay/tests/lib/eth/eth_estimateGas.spec.ts * chore: revert changes to EthImpl#call Signed-off-by: Victor Yanev <[email protected]> * Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/precheck.ts * Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/clients/mirrorNodeClient.ts --------- Signed-off-by: Victor Yanev <[email protected]> Signed-off-by: ebadiere <[email protected]>
* fix: estimate_gas doesn't reflect changes in mirror-node Signed-off-by: Victor Yanev <[email protected]> * fix: estimate_gas doesn't reflect changes in mirror-node Signed-off-by: Victor Yanev <[email protected]> * fix: tests in eth_estimateGas.spec.ts Signed-off-by: Victor Yanev <[email protected]> * Merge branch 'refs/heads/main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts * chore: simplify isNonZeroValue condition Signed-off-by: Victor Yanev <[email protected]> * chore: add docs + fix compilation errors Signed-off-by: Victor Yanev <[email protected]> * chore: fix remaining sonar issues Signed-off-by: Victor Yanev <[email protected]> * Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/eth.ts # packages/relay/tests/lib/eth/eth_call.spec.ts # packages/relay/tests/lib/eth/eth_estimateGas.spec.ts * chore: revert changes to EthImpl#call Signed-off-by: Victor Yanev <[email protected]> * Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/precheck.ts * Merge branch 'main' into 2379-estimate_gas-does-not-reflect-changes-in-mirror-node Signed-off-by: Victor Yanev <[email protected]> # Conflicts: # packages/relay/src/lib/clients/mirrorNodeClient.ts --------- Signed-off-by: Victor Yanev <[email protected]> Signed-off-by: ebadiere <[email protected]>
Description:
This PR updates the fallback calculations of
estimateGas
(in cases where the request to mirror node fails):Precheck.transactionIntrinsicGasCost
methodTX_CONTRACT_CALL_AVERAGE_GAS: 500_000
which we use instead of usingTX_DEFAULT_GAS: 400_000
500_000
is an informed guess which adds a small buffer on top of the default gas of400_000
400_000
which is set forTX_DEFAULT_GAS
is definitely not enough for contract calls and in some scenarios the method would return insufficient amount of gas as an estimation.Related issue(s):
Fixes #2379
Notes for reviewer:
Checklist