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

feature: mempool v1 implementation #6466

Merged
merged 15 commits into from Jun 1, 2021
Merged

feature: mempool v1 implementation #6466

merged 15 commits into from Jun 1, 2021

Conversation

alexanderbez
Copy link
Contributor

@alexanderbez alexanderbez commented May 13, 2021

Implementation of ADR-067 -- mempool v1.

Note, to aid in review, I've decided to split up this work into two PRs:

  1. This PR, which handles the foundation of moving parts around to support versioned mempool reactors. Note, there are no actual protocol or software changes in this PR -- just moving things around.
  2. The mempool v1 reactor implementation. This PR (Mempool V1 Implementation #6468) contains the actual changes outlined in ADR-067.

@alexanderbez alexanderbez added the C:mempool Component: Mempool label May 13, 2021
@alexanderbez alexanderbez self-assigned this May 13, 2021
@codecov
Copy link

codecov bot commented May 13, 2021

Codecov Report

Merging #6466 (5de3dce) into master (b4307ca) will decrease coverage by 0.39%.
The diff coverage is 55.37%.

@@            Coverage Diff             @@
##           master    #6466      +/-   ##
==========================================
- Coverage   60.93%   60.54%   -0.40%     
==========================================
  Files         292      298       +6     
  Lines       27322    27943     +621     
==========================================
+ Hits        16650    16919     +269     
- Misses       8976     9301     +325     
- Partials     1696     1723      +27     
Impacted Files Coverage Δ
config/toml.go 59.09% <ø> (ø)
consensus/replay_stubs.go 57.57% <0.00%> (ø)
mempool/errors.go 0.00% <0.00%> (-25.00%) ⬇️
mempool/mempool.go 0.00% <0.00%> (-81.25%) ⬇️
mempool/metrics.go 0.00% <0.00%> (-15.16%) ⬇️
mempool/v1/reactor.go 0.00% <0.00%> (ø)
rpc/core/mempool.go 0.00% <0.00%> (ø)
mempool/ids.go 84.61% <33.33%> (-7.70%) ⬇️
mempool/tx.go 50.00% <50.00%> (ø)
mempool/cache.go 51.42% <51.42%> (ø)
... and 32 more

@alexanderbez alexanderbez changed the title Mempool V1 Implementation Mempool V1 Implementation [Base] May 13, 2021
@alexanderbez alexanderbez marked this pull request as ready for review May 13, 2021 19:33
Copy link
Contributor

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

Utack

Need a change log entry for the changes

Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

LGTM 👍

func DefaultMempoolConfig() *MempoolConfig {
return &MempoolConfig{
Version: MempoolV1,
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we want the default to be MempoolV0 at least until V1 is complete else the node is just going to panic for anything that uses the default config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, we want v1 to be default. Once I wrap up the 2nd PR, nothing will panic or fail.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. So do you plan to merge the PR's together before merging on master?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly :)

@alexanderbez
Copy link
Contributor Author

Need a change log entry for the changes

That will come in the 2nd PR.

@alexanderbez alexanderbez changed the title Mempool V1 Implementation [Base] [DNM] Mempool V1 Implementation (1/2) May 14, 2021
@tychoish
Copy link
Contributor

This seems fine, though I wonder if it's necessary:

  • the new mempool, passed with default (zero values) for the new chectx should have the same behavior and semantics as the legacy mempool.
  • adding a configuration option may be good as a back door, if there are any unforeseen problems with the new code at scale, but I think long term (certainly, by 1.0) it seems like it would be better to just have the one implementation (testing overhead, maintenance/support burden)

@alexanderbez
Copy link
Contributor Author

@tychoish,

the new mempool, passed with default (zero values) for the new chectx should have the same behavior and semantics as the legacy mempool.

I'm sorry, but I don't follow this...CheckTx will perform the same logic. Wdym by passing values?

adding a configuration option may be good as a back door, if there are any unforeseen problems with the new code at scale, but I think long term (certainly, by 1.0) it seems like it would be better to just have the one implementation (testing overhead, maintenance/support burden)

It depends. There could be multiple mempools we maintain (as @ValarDragon pointed out) and various operator types may want to use different ones, e.g. validators use X and and sentries/full-nodes use Y, etc...That being said, I see no reason why we'd maintain v0 after 0.35 or after.

@tychoish
Copy link
Contributor

I'm sorry, but I don't follow this...CheckTx will perform the same logic. Wdym by passing values?

My assertion/understanding is that using the new mempool with an old application (e.g. one that passes 0 priority for everything will have the same semantics, and be isomorphic to the legacy mempool. If this is true, is there any reason to let the mempool be configurable?

Similarly, particularly since we're not likely to maintain the legacy implementation in the long term, is providing configuration in the short term going to be valuable, and not just create more operational pain when we remove it/etc. Though it's definitely true that I don't 100% understand the operational case for using the legacy mempool in some cases?

@alexanderbez
Copy link
Contributor Author

My assertion/understanding is that using the new mempool with an old application (e.g. one that passes 0 priority for everything will have the same semantics, and be isomorphic to the legacy mempool. If this is true, is there any reason to let the mempool be configurable?

Gossiping remains the same, however, block inclusion/construction will not be the same.

@alexanderbez alexanderbez changed the title [DNM] Mempool V1 Implementation (1/2) feature: mempool v1 implementation Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:mempool Component: Mempool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants