-
Notifications
You must be signed in to change notification settings - Fork 29
fix: fix scaling gas requirement for hedera gas estimation #1053
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
4 files reviewed, no comments
milapsheth
approved these changes
Sep 29, 2025
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.
approved pending comment
milapsheth
reviewed
Sep 29, 2025
isi8787
reviewed
Sep 29, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
why?
fixing previously introduced bugs for hedera est gas fee
how?
reverted
scaleGasValue
to be what is passed in formsg.value
of txs and only using returned value fromestimateItsFee
forgasValue
param in ITS function calls.testing
tested ITS functionality with + without gas to confirm api runs when nothing is set and
gasValue
is hardcoded if user chooses to pass ingasValue
param in script.Note
Separates ITS
gasValue
from payablevalue
, adds bidirectional gas scaling, and updates call sites to use the correct amounts.estimateITSFee
to return{ gasValue, gasFeeValue }
; handle API0
/error, stringify large numbers, and derive EVMgasValue
via downscaling.scaleGasValue(chain, gasValue, up=true)
to support up/down scaling withBigNumber
.{ gasValue, gasFeeValue }
across actions:deployRemoteInterchainToken
,deployRemoteCanonicalInterchainToken
,linkToken
,interchain-transfer
,register-token-metadata
.gasValue
as function arg andgasFeeValue
as transactionvalue
in overrides.Written by Cursor Bugbot for commit ee361f9. This will update automatically on new commits. Configure here.
Greptile Overview
Updated On: 2025-09-28 18:24:38 UTC
Summary
This PR fixes a gas estimation bug for Hedera by separating the concerns of
gasValue
(used in ITS function calls) and transactionmsg.value
(which may need scaling for chains like Hedera).Key Changes:
scaleGasValue
function fromcommon/utils.js
toevm/utils.js
where it's actually usedestimateITSFee
to return rawgasValue
when provided, instead of applying scalingscaleGasValue(chain, gasValue)
for transactionvalue
parameter onlyBigNumber
import tocommon/utils.js
for proper return type fromestimateITSFee
The fix ensures that Hedera's lower decimal precision gas values are handled correctly - raw values are used for ITS function parameters while scaled values are used for transaction values when
gasScalingFactor
is configured.Confidence Score: 4/5
Important Files Changed
File Analysis
Sequence Diagram