Skip to content
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

Layered txpool: do not send notifications when moving tx between layers #7539

Merged

Conversation

fab-10
Copy link
Contributor

@fab-10 fab-10 commented Aug 29, 2024

PR description

Notifications for tx added to the layered txpool were incorrectly sent also when the tx was already added and was just internally moved between layers, potentially resulting in duplicated notifications.

Tests for this change are part of the following PR #7538 that is also fixing the drop notifications.

Fixed Issue(s)

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

@fab-10 fab-10 force-pushed the layered-txpool-no-notification-for-move branch from 0a770d5 to cb4b59f Compare August 29, 2024 13:52
@fab-10 fab-10 marked this pull request as ready for review August 29, 2024 14:15
@fab-10 fab-10 force-pushed the layered-txpool-no-notification-for-move branch from cb4b59f to b032acc Compare September 4, 2024 08:54
@fab-10 fab-10 force-pushed the layered-txpool-no-notification-for-move branch 2 times, most recently from 0ded40e to 26bcb4d Compare September 4, 2024 09:54
@fab-10 fab-10 force-pushed the layered-txpool-no-notification-for-move branch from 26bcb4d to 77e238c Compare September 4, 2024 09:59
Copy link
Contributor

@pinges pinges left a comment

Choose a reason for hiding this comment

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

Just one question, otherwise LGTM.

@@ -207,14 +208,14 @@ public void addRemoteTransactions() {
createRemotePendingTransaction(transaction0), Optional.empty());
assertThat(pendingTransactions.size()).isEqualTo(1);

assertThat(getAddedCount(REMOTE, NO_PRIORITY, layers.prioritizedTransactions.name()))
assertThat(getAddedCount(REMOTE, NO_PRIORITY, NEW, layers.prioritizedTransactions.name()))
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that you are only using the reason "NEW" in this file. Is that because other reasons don't make a difference here? Do the tests in LayersTest cover all the functionality that has changed with the "reasons"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using only NEW here because we are only adding new txs to the pool, and not moving existing txs between layers. Will review if more tests are needed to cover everything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added tests to cover also the move of txs between layers

@fab-10 fab-10 enabled auto-merge (squash) September 5, 2024 10:33
@fab-10 fab-10 merged commit 7f0982d into hyperledger:main Sep 5, 2024
40 checks passed
@fab-10 fab-10 deleted the layered-txpool-no-notification-for-move branch September 5, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants