-
Notifications
You must be signed in to change notification settings - Fork 237
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
Problem: tx inclusion logic when block gas limit exceeded is not tested #380
Conversation
expect to fail right now, but should success after #378. |
Codecov Report
@@ Coverage Diff @@
## main #380 +/- ##
===========================================
+ Coverage 21.51% 41.06% +19.54%
===========================================
Files 27 30 +3
Lines 1729 1505 -224
===========================================
+ Hits 372 618 +246
+ Misses 1324 841 -483
- Partials 33 46 +13
|
6cd9cb3
to
6fbadc4
Compare
Closes: crypto-org-chain#379 Solution: - add integration test to test tx inclusion logic when block gas limit exceeded.
aa1b35a
to
a29f498
Compare
sign_transaction( | ||
w3, | ||
{ | ||
"to": ADDRS["validator"], |
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.
the actual gas to send one transaction is 21,000
From your test I understand that the anteHandler will count the gas_limit, not the actual gas used. Isnt it a problem? It means that one can potentially block other transactions by setting very high gas limit
sign_transaction( | ||
w3, | ||
{ | ||
"to": ADDRS["validator"], |
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.
the actual gas to send one transaction is 21,000
From your test I understand that the anteHandler will count the gas_limit, not the actual gas used. Isnt it a problem?
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.
yeah, but that's how tendermint/cosmos-sdk works right now, in check tx mode it doesn't actually run the transaction, so it can only rely on the gas limit specified by the user. it's to make the validator run more efficiently.
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.
I see, I wonder if its possible to rely on the api estimate_gas to have a more accurate result... but it might bring performance degradation
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.
test looks good otherwise
Closes: #379
Solution:
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)