-
Notifications
You must be signed in to change notification settings - Fork 68
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
Implement gasLimit Precheck #304
Conversation
Signed-off-by: Mitchell Martin <[email protected]>
Signed-off-by: Mitchell Martin <[email protected]>
# Conflicts: # packages/relay/src/lib/errors.ts # packages/relay/src/lib/precheck.ts
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
# Conflicts: # packages/relay/src/lib/errors.ts # packages/relay/tests/lib/precheck.spec.ts # packages/server/tests/acceptance/rpc.spec.ts
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
# Conflicts: # packages/relay/src/lib/eth.ts # packages/relay/src/lib/precheck.ts # packages/relay/tests/lib/precheck.spec.ts # packages/server/tests/acceptance/rpc.spec.ts
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
# Conflicts: # packages/relay/src/lib/eth.ts
Signed-off-by: Mitchell Martin <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Signed-off-by: Nana-EC <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #304 +/- ##
==========================================
+ Coverage 57.84% 58.29% +0.45%
==========================================
Files 9 9
Lines 835 856 +21
Branches 135 139 +4
==========================================
+ Hits 483 499 +16
- Misses 322 325 +3
- Partials 30 32 +2
Continue to review full report at Codecov.
|
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
Hopefully this addresses the DApp test timeouts also
…gasLimit-precheck # Conflicts: # packages/relay/src/lib/constants.ts # packages/relay/src/lib/precheck.ts # packages/relay/tests/lib/precheck.spec.ts
Signed-off-by: Ivo Yankov <[email protected]>
# Conflicts: # packages/relay/src/lib/constants.ts # packages/server/tests/acceptance/rpc.spec.ts
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Signed-off-by: Ivo Yankov <[email protected]>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
} | ||
} | ||
|
||
const nonZeros = data.replace('0x', '').length - zeros; |
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.
This was causing a wrong calculation of the gas cost. If 0x
is not removed from data
, that counts as 2 nonZero
bytes, and the calculated gas cost is TX_BASE_COST + 2 * ISTANBUL_TX_DATA_NON_ZERO_COST
, which meant that transactions with empty data (hbar transfer transactions) could not pass the precheck if the default gasLimit (21000) was used.
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.
Nice catch
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
Description:
Implements gasLimit over/under checks before submitting in sendRawTransactions
Related issue(s):
Fixes #128
Notes for reviewer:
Checklist