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

Add bulk put blockstore function and update header persisting #570

Merged
merged 9 commits into from
Jul 30, 2020

Conversation

austinabell
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

  • Should be more efficient to have bulk writes and the wrong functionality was included when persisting headers
  • Update persist header functionality to not try to update heaviest on persisting headers
    • cc: @ec2 let me know if this is all that is needed, I'm trying to keep scope of changes small

There are still other things to be updated and checked within the chain store for sure I've noticed, and that can be gone through later

Reference issue to close (if applicable)

Closes

Other information and links

}

fn persist_headers<DB>(db: &DB, bh: &[BlockHeader]) -> Result<(), Error>
pub fn persist_objects<DB, C>(db: &DB, headers: &[C]) -> Result<(), Error>
Copy link
Contributor

Choose a reason for hiding this comment

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

Add comment

}

Ok(db.bulk_write(&keys, &raw_header_data)?)
Ok(())
}

pub fn put_messages<DB, T: Cbor>(db: &DB, msgs: &[T]) -> Result<(), Error>
Copy link
Contributor

Choose a reason for hiding this comment

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

Add comment

@austinabell austinabell merged commit 25203cb into main Jul 30, 2020
@austinabell austinabell deleted the austin/bulk_persist branch July 30, 2020 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants