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

Recovering lost parked nodes #344

Merged
merged 9 commits into from
Aug 16, 2023
Merged

Recovering lost parked nodes #344

merged 9 commits into from
Aug 16, 2023

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Aug 15, 2023

Recover parked nodes and the top layer of the tree from the layercache.bin files saved on disk instead from the round's state.bin.

Parked nodes recovery

Parked nodes on disk-cached layers are recovered from the files (representing the tree's bottom layers). If a layer contains an odd number of nodes/leafs, the last one is a parked node.

Parked nodes on mem-cached layers are recovered by rebuilding a subtree, in which the bottom layer is built from the nodes in the top disk-cached layer.

mem-cached nodes recovery

The top of the tree that is not persisted on disk is rebuilt as the aforementioned subtree. It's layers from 1 to the root are moved into the recovered tree.

TODO:

  • remove parked nodes completely from the round execution state and rely solely on recovery implemented in this PR.

Copy link
Member

@noamnelke noamnelke left a comment

Choose a reason for hiding this comment

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

:shipit:

@poszu poszu self-assigned this Aug 15, 2023
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #344 (3123490) into develop (ec4b107) will decrease coverage by 0.3%.
The diff coverage is 64.6%.

@@            Coverage Diff            @@
##           develop    #344     +/-   ##
=========================================
- Coverage     73.1%   72.8%   -0.3%     
=========================================
  Files           17      17             
  Lines         1568    1641     +73     
=========================================
+ Hits          1147    1196     +49     
- Misses         318     334     +16     
- Partials       103     111      +8     
Files Changed Coverage Δ
prover/prover.go 60.9% <63.8%> (+1.3%) ⬆️
service/round.go 77.6% <70.0%> (-0.8%) ⬇️

... and 1 file with indirect coverage changes

prover/prover.go Outdated Show resolved Hide resolved
@poszu poszu added this pull request to the merge queue Aug 16, 2023
Merged via the queue into develop with commit 607393a Aug 16, 2023
10 of 11 checks passed
@fasmat fasmat deleted the recover-parked-nodes branch September 15, 2023 11:06
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.

3 participants