-
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
fix: Inconsistent handling of failed EVM transactions #3158
base: main
Are you sure you want to change the base?
fix: Inconsistent handling of failed EVM transactions #3158
Conversation
Signed-off-by: Victor Yanev <[email protected]>
Quality Gate passedIssues Measures |
Test Results 21 files + 1 292 suites +20 36m 59s ⏱️ + 3m 26s For more details on these failures, see this check. Results for commit 52fb0e1. ± Comparison against base commit 6442c98. This pull request removes 2 and adds 2 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
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.
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.
LGTM, but we should consider adding an exception for this check as well https://github.com/hashgraph/hedera-services/blob/develop/hedera-node/hedera-smart-contract-service-impl/src/main/java/com/hedera/node/app/service/contract/impl/exec/TransactionProcessor.java#L233 in a follow-up PR.
@@ -566,4 +566,66 @@ describe('@ethGetBlockByNumber using MirrorNode', async function () { | |||
args, | |||
); | |||
}); | |||
|
|||
it('eth_getBlockByNumber should skip transactions with wrong nonces when showDetails = false', async function () { |
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.
Aren't these two test cases basically the same module showDetails=true|false
? If that's the case, maybe it's worth to merge them into a single test case, something like
[false, true].forEach(showDetails => {
it(`eth_getBlockByNumber should skip transactions with wrong nonces when showDetails = ${showDetails}`, async function () {
});
});
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.
Fair point, that would simplify things a bit
@@ -2308,7 +2320,7 @@ export class EthImpl implements Eth { | |||
} | |||
|
|||
transactionArray = this.populateSyntheticTransactions(showDetails, logs, transactionArray, requestDetails); | |||
transactionArray = showDetails ? _.uniqBy(transactionArray, 'hash') : _.uniq(transactionArray); | |||
transactionArray = showDetails ? transactionArray : _.uniq(transactionArray); |
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'm not sure showDetails
should change the length of the array, it concerns only with returning either transaction hashes or the transaction objects.
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.
Well, we never want to show duplicated transaction hashes in the response when showDetails
is false
, so that's why I left this one there just in case.
Filtering the WRONG_NONCE
transactions should be sufficient to remove duplicate hashes, but I am not sure if this is the only pre-check where this scenario could happen, that's why I left it just in case.
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.
Hmm, I agree with Luis here. The size should be the same regardless of showDetails
.
I'm not sure why this logic exists, shouldn't they always be unique transactions based on hash?
Maybe something to follow up on, why should we ever have duplicates when showDetails
is true?
@natanasow Could you open a new issue for that, we could prioritize it in the next sprint. 😄 |
Okay. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3158 +/- ##
==========================================
- Coverage 83.19% 82.87% -0.32%
==========================================
Files 66 69 +3
Lines 4254 4421 +167
Branches 829 870 +41
==========================================
+ Hits 3539 3664 +125
- Misses 472 508 +36
- Partials 243 249 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
|
ConfigService.get('TEST') | ||
? constants.DEFAULT_FEE_HISTORY_MAX_RESULTS | ||
: Number(ConfigService.get('FEE_HISTORY_MAX_RESULTS')); | ||
const maxResults = ConfigService.get('TEST') |
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.
nit: for a different PR this feels like something the ConfigService should handle internally.
Is that possible?
@@ -2308,7 +2320,7 @@ export class EthImpl implements Eth { | |||
} | |||
|
|||
transactionArray = this.populateSyntheticTransactions(showDetails, logs, transactionArray, requestDetails); | |||
transactionArray = showDetails ? _.uniqBy(transactionArray, 'hash') : _.uniq(transactionArray); | |||
transactionArray = showDetails ? transactionArray : _.uniq(transactionArray); |
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.
Hmm, I agree with Luis here. The size should be the same regardless of showDetails
.
I'm not sure why this logic exists, shouldn't they always be unique transactions based on hash?
Maybe something to follow up on, why should we ever have duplicates when showDetails
is true?
Description:
This PR fixes the issue discussed in the comments of #3115
Related issue(s):
Fixes #3115
Notes for reviewer:
Checklist