Skip to content

fix: fixes check to remove duplicates from transactionArray #3731

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

simzzz
Copy link
Contributor

@simzzz simzzz commented Apr 28, 2025

Description:
This PR fixes a problem in the getBlock() method which caused duplicate transactions to be returned.

The old code transactionArray = showDetails ? transactionArray : _.uniq(transactionArray); didn't account for the situation where duplicate transaction could be returned in some cases where one transaction emits multiple events (e.g. minting multiple NFT serials in one transaction). In that case, duplicate transactions would be generated from the logs. I have changed this line to account for that and exclude duplicates.

Related issue(s):

Fixes #3724

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@simzzz simzzz requested review from a team as code owners April 28, 2025 12:47
@simzzz simzzz requested a review from quiet-node April 28, 2025 12:47
Copy link

github-actions bot commented Apr 28, 2025

Test Results

 22 files  +  2  289 suites  +34   41m 32s ⏱️ +3s
632 tests +  3  624 ✅ +  2  4 💤 ±0  4 ❌ +1 
937 runs  +122  926 ✅ +120  4 💤 ±0  7 ❌ +2 

For more details on these failures, see this check.

Results for commit fabe373. ± Comparison against base commit dbc5f68.

♻️ This comment has been updated with latest results.

@simzzz simzzz self-assigned this Apr 28, 2025
@simzzz simzzz added the bug Something isn't working label Apr 28, 2025
@simzzz simzzz added this to the 0.68.0 milestone Apr 28, 2025
Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add some tests to prevent regressions. We should enforce a requirement that all updates be covered by tests.

Signed-off-by: Simeon Nakov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate transactions in eth_getBlockByNumber responses
2 participants