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

Blocktree now only loads complete blocks (err, slots) #2928

Merged
merged 3 commits into from
Mar 1, 2019

Conversation

mvines
Copy link
Member

@mvines mvines commented Feb 25, 2019

Loading a Blocktree at node startup is tedious because the code needs to care about a last_entry_id, as the ledger may halt at any entry. But once the node is running it never needs to care about a last_entry_id again as rotation always occurs on a last_id boundary (eg, bank.last_id()).

By restricting Blocktree to only load complete blocks, we can remove the usage of last_entry_id from all ledger processing at fullnode startup

Note that at present the same effect could have been accomplished by halting ledger loading at the last tick of a partially filled block. However this approach would break when we move from a tick-based last_ids to a block-based last_ids.

TODO:

@mvines mvines added work in progress This isn't quite right yet noCI Suppress CI on this Pull Request labels Feb 25, 2019
src/blocktree_processor.rs Outdated Show resolved Hide resolved
@rob-solana
Copy link
Contributor

where's the proposal to change last_id to a block's last_id?

@mvines
Copy link
Member Author

mvines commented Feb 26, 2019

#2710

@mvines mvines force-pushed the onlyfull branch 2 times, most recently from b9e8ad2 to 9015e0e Compare February 26, 2019 05:50
src/blocktree.rs Outdated Show resolved Hide resolved
src/blocktree.rs Outdated Show resolved Hide resolved
@carllin
Copy link
Contributor

carllin commented Feb 26, 2019

@mvines, why do we want to delete a partial slot, rather than just stopping processing at the end of the previous slot and letting replay stage detect the forks?

@mvines
Copy link
Member Author

mvines commented Feb 26, 2019

I’d love to not delete anything. Hmmm, yeah I think you’re probably right. If startup processing just stops at the last fully completed slot, replay stage should be able to read the partial last slot and pick up from there. I’ll give that a shot

@rob-solana
Copy link
Contributor

this change will eliminate a couple of parameters to replay_stage startup, but is the main goal simplification of TPU startup?

@mvines
Copy link
Member Author

mvines commented Feb 26, 2019

Main goal is to make most of the code base stop caring about last_entry_id, which definitely includes both TPU and TVU startup.

@mvines mvines added CI Pull Request is ready to enter CI and removed noCI Suppress CI on this Pull Request labels Feb 26, 2019
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Feb 26, 2019
@codecov
Copy link

codecov bot commented Feb 26, 2019

Codecov Report

Merging #2928 into master will increase coverage by <.1%.
The diff coverage is 97%.

@@           Coverage Diff            @@
##           master   #2928     +/-   ##
========================================
+ Coverage    76.7%   76.8%   +<.1%     
========================================
  Files         130     130             
  Lines       19993   20039     +46     
========================================
+ Hits        15352   15403     +51     
+ Misses       4641    4636      -5

@mvines mvines added the noCI Suppress CI on this Pull Request label Feb 26, 2019
@mvines mvines added CI Pull Request is ready to enter CI and removed noCI Suppress CI on this Pull Request labels Feb 28, 2019
@solana-grimes solana-grimes removed the CI Pull Request is ready to enter CI label Feb 28, 2019
@mvines mvines force-pushed the onlyfull branch 2 times, most recently from bad18e5 to 04fb5f5 Compare February 28, 2019 23:54
@mvines mvines force-pushed the onlyfull branch 2 times, most recently from 7ebe218 to 7758fc4 Compare February 28, 2019 23:58
@mvines mvines requested a review from carllin February 28, 2019 23:58
@mvines mvines removed the work in progress This isn't quite right yet label Feb 28, 2019
@rob-solana
Copy link
Contributor

a TPU will slash itself if restarted during its slot, I think?

@mvines
Copy link
Member Author

mvines commented Mar 1, 2019

We might want to add some logic later where if a node that tries to restart as slot leader skips it's slot entirely and lets the cluster move to the next leader (well once we can do that!)

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.

5 participants