Skip to content

refactor(mempool)!: remove PreUpdate from Mempool interface and move its logic to Lock#3361

Merged
hvanz merged 2 commits intov0.38.xfrom
hvanz/revert-mempool-preupdate
Jun 28, 2024
Merged

refactor(mempool)!: remove PreUpdate from Mempool interface and move its logic to Lock#3361
hvanz merged 2 commits intov0.38.xfrom
hvanz/revert-mempool-preupdate

Conversation

@hvanz
Copy link
Collaborator

@hvanz hvanz commented Jun 28, 2024

This PR partially reverts the backport of #3314 into the recently released v0.38.8 (and v0.37.7). With this change the Mempool interface is the same as in previous versions.

The reason is that we do not want to break the public API. We still keep in the code the feature that #3314 introduced by moving it inside the existing Lock method. We also keep the RecheckFull bool field that we added to ErrMempoolIsFull.

#3363 does the same for v0.37.x.


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 the mempool label Jun 28, 2024
@hvanz hvanz self-assigned this Jun 28, 2024
@hvanz hvanz marked this pull request as ready for review June 28, 2024 14:54
@hvanz hvanz requested a review from a team as a code owner June 28, 2024 14:54
// Safe for concurrent use by multiple goroutines.
func (mem *CListMempool) Lock() {
if mem.recheck.setRecheckFull() {
mem.logger.Debug("the state of recheckFull has flipped")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this message is not very useful if it doesn't say from X to Y, as we need to trace back all occurrences of this message for a node to find out if it is now full, or no longer full.
I think this message would be better inside recheck.setRecheckFull where it can provide this info.

In any case, I don't know if it should be done here, or in a different PR from main, and then backported all the way down.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree. I will do it from main in a different PR.

Copy link
Collaborator

@sergio-mena sergio-mena left a comment

Choose a reason for hiding this comment

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

🚀

@hvanz hvanz merged commit 1e22f66 into v0.38.x Jun 28, 2024
@hvanz hvanz deleted the hvanz/revert-mempool-preupdate branch June 28, 2024 15:13
@hvanz
Copy link
Collaborator Author

hvanz commented Jun 28, 2024

Just realised the changelog file is in the wrong directory. It should be .changelog/unreleased/breaking-changes/3361-mempool-preupdate.md.

hvanz added a commit that referenced this pull request Jun 28, 2024
…its logic to Lock (#3363)

Complements #3361 

This PR partially reverts the backport of
#3314 into the recently
released v0.37.7. With this change the Mempool interface is the same as
in previous versions.

The reason is that we do not want to break the public API. We still keep
in the code the feature that
#3314 introduced by moving it
inside the existing Lock method. We also keep the RecheckFull bool field
that we added to ErrMempoolIsFull.

<!--

Please add a reference to the issue that this PR addresses and indicate
which
files are most critical to review. If it fully addresses a particular
issue,
please include "Closes #XXX" (where "XXX" is the issue number).

If this PR is non-trivial/large/complex, please ensure that you have
either
created an issue that the team's had a chance to respond to, or had some
discussion with the team prior to submitting substantial pull requests.
The team
can be reached via GitHub Discussions or the Cosmos Network Discord
server in
the #cometbft channel. GitHub Discussions is preferred over Discord as
it
allows us to keep track of conversations topically.
https://github.com/cometbft/cometbft/discussions

If the work in this PR is not aligned with the team's current
priorities, please
be advised that it may take some time before it is merged - especially
if it has
not yet been discussed with the team.

See the project board for the team's current priorities:
https://github.com/orgs/cometbft/projects/1

-->

---

#### PR checklist

- [ ] 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
- [ ] Title follows the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants