Skip to content

fix(mempool): tx is skipped when sending to a lagging peer or sending fails - #3647

Merged
hvanz merged 11 commits into
mainfrom
hvanz/mempool-fix-gossip-lagging-peer
Aug 9, 2024
Merged

hvanz merged 11 commits into
mainfrom
hvanz/mempool-fix-gossip-lagging-peer

Conversation

@hvanz

@hvanz hvanz commented Aug 8, 2024 •

Copy link
Copy Markdown
Collaborator

Fixes a bug introduced in #3459 where instead of retrying the same tx when the peer is lagging, it was skipping it and moving on to the next entry. The same used to happen when sending the transaction failed: instead of retrying to send, it skipped it and proceeded to the next tx. This PR also reverts #3430, which was not working as expected.

Note that the first commit introduces a new test TestMempoolReactorSendLaggingPeer that initially fails and then it's fixed: https://github.com/cometbft/cometbft/actions/runs/10300181146/job/28509056466?pr=3647


PR checklist

  • Tests written/updated
  • [ ] Changelog entry added in .changelog (we use unclog to manage our changelog)
  • [ ] Updated relevant documentation (docs/ or spec/) and code comments
  • Title follows the Conventional Commits spec

@hvanz hvanz added bug Something isn't working mempool backport-to-v1.x labels Aug 8, 2024
@hvanz hvanz self-assigned this Aug 8, 2024
@hvanz hvanz changed the title fix(mempool): tx is not send when peer is lagging fix(mempool): tx is skipped when sending to a lagging peer Aug 8, 2024
@hvanz hvanz changed the title fix(mempool): tx is skipped when sending to a lagging peer fix(mempool): tx is skipped when sending to a lagging peer or sending fails Aug 9, 2024
@hvanz
hvanz marked this pull request as ready for review August 9, 2024 09:58
@hvanz
hvanz requested a review from a team as a code owner August 9, 2024 09:58
@hvanz
hvanz requested a review from a team August 9, 2024 09:58

@melekes melekes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

@hvanz
hvanz added this pull request to the merge queue Aug 9, 2024
Merged via the queue into main with commit 1ac8832 Aug 9, 2024
@hvanz
hvanz deleted the hvanz/mempool-fix-gossip-lagging-peer branch August 9, 2024 11:30
mergify Bot pushed a commit that referenced this pull request Aug 9, 2024
… fails (#3647)

Fixes a bug introduced in #3459 where instead of retrying the same tx
when the peer is lagging, it was skipping it and moving on to the next
entry. The same used to happen when sending the transaction failed:
instead of retrying to send, it skipped it and proceeded to the next tx.
This PR also reverts #3430, which was not working as expected.

Note that the first commit introduces a new test
`TestMempoolReactorSendLaggingPeer` that initially fails and then it's
fixed:
https://github.com/cometbft/cometbft/actions/runs/10300181146/job/28509056466?pr=3647

---

#### PR checklist

- [X] Tests written/updated
- ~~[ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)~~
- ~~[ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments~~
- [X] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

(cherry picked from commit 1ac8832)

# Conflicts:
#	mempool/reactor.go
hvanz added a commit that referenced this pull request Aug 9, 2024
… fails (backport #3647) (#3657)

Fixes a bug introduced in #3459 where instead of retrying the same tx
when the peer is lagging, it was skipping it and moving on to the next
entry. The same used to happen when sending the transaction failed:
instead of retrying to send, it skipped it and proceeded to the next tx.
This PR also reverts #3430, which was not working as expected.

Note that the first commit introduces a new test
`TestMempoolReactorSendLaggingPeer` that initially fails and then it's
fixed:
https://github.com/cometbft/cometbft/actions/runs/10300181146/job/28509056466?pr=3647

---

#### PR checklist

- [X] Tests written/updated
- ~~[ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)~~
- ~~[ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments~~
- [X] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
<hr>This is an automatic backport of pull request #3647 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Hernán Vanzetto <[email protected]>
Co-authored-by: hvanz <[email protected]>
@hvanz

hvanz commented Sep 16, 2024

Copy link
Copy Markdown
Collaborator Author

@Mergifyio backport mergify/bp/v1.x/pr-3459

@mergify

mergify Bot commented Sep 16, 2024 •

Copy link
Copy Markdown
Contributor

backport mergify/bp/v1.x/pr-3459

✅ Backports have been created

Details

mergify Bot pushed a commit that referenced this pull request Sep 16, 2024
… fails (#3647)

Fixes a bug introduced in #3459 where instead of retrying the same tx
when the peer is lagging, it was skipping it and moving on to the next
entry. The same used to happen when sending the transaction failed:
instead of retrying to send, it skipped it and proceeded to the next tx.
This PR also reverts #3430, which was not working as expected.

Note that the first commit introduces a new test
`TestMempoolReactorSendLaggingPeer` that initially fails and then it's
fixed:
https://github.com/cometbft/cometbft/actions/runs/10300181146/job/28509056466?pr=3647

---

#### PR checklist

- [X] Tests written/updated
- ~~[ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)~~
- ~~[ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments~~
- [X] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec

(cherry picked from commit 1ac8832)

# Conflicts:
#	mempool/reactor_test.go
hvanz added a commit that referenced this pull request Sep 16, 2024
… fails (backport #3647) (#4109)

Fixes a bug introduced in #3459 where instead of retrying the same tx
when the peer is lagging, it was skipping it and moving on to the next
entry. The same used to happen when sending the transaction failed:
instead of retrying to send, it skipped it and proceeded to the next tx.
This PR also reverts #3430, which was not working as expected.

Note that the first commit introduces a new test
`TestMempoolReactorSendLaggingPeer` that initially fails and then it's
fixed:
https://github.com/cometbft/cometbft/actions/runs/10300181146/job/28509056466?pr=3647

---

#### PR checklist

- [X] Tests written/updated
- ~~[ ] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)~~
- ~~[ ] Updated relevant documentation (`docs/` or `spec/`) and code
comments~~
- [X] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
<hr>This is an automatic backport of pull request #3647 done by
[Mergify](https://mergify.com).

---------

Co-authored-by: Hernán Vanzetto <[email protected]>
Co-authored-by: hvanz <[email protected]>
@andynog
andynog restored the hvanz/mempool-fix-gossip-lagging-peer branch September 16, 2024 21:16
@hvanz
hvanz deleted the hvanz/mempool-fix-gossip-lagging-peer branch December 20, 2024 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working mempool

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants