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

Towards validator recovery, 1-to-1 Entry to Blob #397

Merged
merged 1 commit into from
Jun 22, 2018

Conversation

rob-solana
Copy link
Contributor

@rob-solana rob-solana commented Jun 21, 2018

hoping this looks like a "ready" part one

feedback appreciated.

issue #309 part 1

  • limit the number of Entries per Blob to at most one
  • limit the number of Transactions per Entry such that an Entry will
    always fit in a Blob

With a one-to-one map of Entries to Blobs, recovery of a validator
is a simple fast-forward from the end of the initial genesis.log
and tx-*.logs Entries.

TODO: initialize validators' blob index with initial # of Entries.

src/ledger.rs Outdated
use std::mem::size_of;
use transaction::Transaction;

// a Block is a vector of Entries
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a slice of Entries

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ack

src/entry.rs Outdated
entry
}

/// Creates the next entries for given transactions, outputs
/// updates start_hash to id of last Entry, sets cur_hashes to 0
pub fn from_transactions_mut(
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like this should be in ledger.rs, where Block is defined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed, refactoring

src/tvu.rs Outdated
while let Ok(msg) = r_reader.recv_timeout(timer) {
println!("msg #{}: {:?}", i, msg);
Copy link
Contributor

Choose a reason for hiding this comment

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

print before trace of the same msg?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

leftovers from debugging

@garious
Copy link
Contributor

garious commented Jun 21, 2018

Can you update the PR description to offer more context?

@garious garious changed the title Issue 309 Towards validator recovery, 1-to-1 Entry to Blob Jun 22, 2018
@rob-solana rob-solana force-pushed the issue-309 branch 2 times, most recently from baac1da to e0eca1b Compare June 22, 2018 05:21
@rob-solana
Copy link
Contributor Author

incorporated the "Cleanup entry" PR as well as I could... will continue to clean this up tomorrow...

@rob-solana
Copy link
Contributor Author

rob-solana commented Jun 22, 2018

speed of serialization/deserialization on master:
test ledger::bench::bench_blocks_to_blobs ... bench: 25,160 ns/iter (+/- 1,487)
after this PR:
test ledger::bench::bench_blocks_to_blobs ... bench: 15,862 ns/iter (+/- 1,181)

* limit the number of Tntries per Blob to at most one
* limit the number of Transactions per Entry such that an Entry will
    always fit in a Blob

With a one-to-one map of Entries to Blobs, recovery of a validator
  is a simple fast-forward from the end of the initial genesis.log
  and tx-*.logs Entries.

TODO: initialize validators' blob index with initial # of Entries.
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