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

transition cache leak during ledger catchup #2168

Merged
merged 39 commits into from Apr 19, 2019

Conversation

ghost-not-in-the-shell
Copy link
Member

@ghost-not-in-the-shell ghost-not-in-the-shell commented Apr 5, 2019

  1. Currently, if transitions received from peers didn't pass validation, those transitions are not getting invalidated in unprocessed_transition_cache.
  2. In current implementation ledger_catchup would be blocked by transitions in cache, and the catchup would fail. This is super inefficient.
  3. The subtree of catchup_scheduler that passed to ledger_catchup is not used effectively; besides instead of passing just 1 subtree, we should pass a forest.

This PR try to fix the above problems.

@wu-s-john wu-s-john self-requested a review April 9, 2019 15:20
src/lib/cache_lib/intf.ml Outdated Show resolved Hide resolved
src/lib/cache_lib/impl.ml Outdated Show resolved Hide resolved
src/lib/cache_lib/impl.ml Outdated Show resolved Hide resolved
src/lib/ledger_catchup/ledger_catchup.ml Outdated Show resolved Hide resolved
src/lib/ledger_catchup/ledger_catchup.ml Outdated Show resolved Hide resolved
src/lib/ledger_catchup/inputs.ml Show resolved Hide resolved
src/lib/transition_handler/validator.ml Show resolved Hide resolved
@ghost-not-in-the-shell ghost-not-in-the-shell changed the title [WIP] transition cache leak during ledger catchup transition cache leak during ledger catchup Apr 15, 2019
Copy link
Contributor

@wu-s-john wu-s-john left a comment

Choose a reason for hiding this comment

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

The PR looks good. Just have a question about test_ledger_catchup.ml Also, is it possible to dedup the tests you wrote in test_ledger_catchup?

@wu-s-john
Copy link
Contributor

Also, after I approve this PR, can you update the documentation for Ledger_catchup? It's slightly different after this PR update.

@nholland94
Copy link
Member

I'm trying to understand the whole final_state stuff that was added to the cache stuff. It seems like the only way it's used is just in a single test? If that's the case, is adding this really necessary? This adds a pretty good deal of complexity to the abstraction, and some of the changes made me question whether or not the cache can leak now, although I need to look closer and understand it better. Just some initial questions upon starting reviewing.

Copy link
Member

@nholland94 nholland94 left a comment

Choose a reason for hiding this comment

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

Looks good. Just had some minor nits, mostly for readability.

src/lib/cache_lib/impl.ml Show resolved Hide resolved
src/lib/cache_lib/impl.ml Show resolved Hide resolved
src/lib/transition_handler/validator.ml Show resolved Hide resolved
@ghost-not-in-the-shell ghost-not-in-the-shell dismissed nholland94’s stale review April 19, 2019 21:58

I already addressed those in my PR

@ghost-not-in-the-shell ghost-not-in-the-shell merged commit 1bc7fdd into master Apr 19, 2019
@ghost-not-in-the-shell ghost-not-in-the-shell deleted the fix/ledger-catchup-be-aware-of-cache branch April 19, 2019 21:58
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.

None yet

3 participants