-
Notifications
You must be signed in to change notification settings - Fork 731
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
Allow API configuration to override supplied gasLimit #6978
Merged
garyschulte
merged 5 commits into
hyperledger:main
from
garyschulte:feature/configurable-simulation-tx-gas-limit
May 1, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e7e33b1
allow gasLimit configuration for transaction simulation
matkt c3e9cf3
revise unit test to reflect new behavior of rpcGasCap
garyschulte cbf457c
Merge branch 'main' into feature/configurable-simulation-tx-gas-limit
garyschulte 3cb8dcf
Merge branch 'main' into feature/configurable-simulation-tx-gas-limit
garyschulte d8cac98
Merge branch 'main' into feature/configurable-simulation-tx-gas-limit
garyschulte File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -565,8 +565,9 @@ public void shouldCapGasLimitWhenOriginalTransactionExceedsGasCap() { | |
} | ||
|
||
@Test | ||
public void shouldKeepOriginalGasLimitWhenCapIsHigherThanOriginalValue() { | ||
// generate a transaction with a gas limit that is lower than the gas cap | ||
public void shouldUseRpcGasCapWhenCapIsHigherThanGasLimit() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what if cap is lower than gasLimit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, this test can really just be renamed to something like "when present rpc gas cap supersedes request gas limit" |
||
// generate a transaction with a gas limit that is lower than the gas cap, | ||
// expect the gas cap to override parameter gas limit | ||
final CallParameter callParameter = | ||
eip1559TransactionCallParameter(Wei.ZERO, Wei.ZERO, GASCAP - 1); | ||
|
||
|
@@ -589,6 +590,7 @@ public void shouldKeepOriginalGasLimitWhenCapIsHigherThanOriginalValue() { | |
.value(callParameter.getValue()) | ||
.payload(callParameter.getPayload()) | ||
.signature(FAKE_SIGNATURE) | ||
.gasLimit(GASCAP) | ||
.build(); | ||
|
||
// call process with original transaction | ||
|
Oops, something went wrong.
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.
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.
so no longer comparing gasCap to gasLimit, just if > zero?
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.
yes, it is essentially an override value from the cli. @matkt can speak to the specifics about why we would raise the cap beyond the requested limit, but I think it has something to do with simulating transactions that will exceed the anticipated gas, but not exceed some predefined hard cap (DoS vector).
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.
yes it is need in order to allow user setting a high gasLimit for ethcall