Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Include total difficulty in CHTs and hide implementation details from consumers #4428

Merged
merged 6 commits into from
Feb 6, 2017

Conversation

rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Feb 3, 2017

Changes the canonical hash trie implementation to map (block number -> (H256, U256)) rather than just to hashes. This is for two distinct reasons:

  • Easily fetch discarded TD for ancient blocks, relevant for RPC.
  • Preserve accurate TD accounting when reorganizing into a CHT.

The rest of this PR introduces a layer of abstraction between CHTs and their consumers via a CHT struct and utility methods for generation, so that constants like SIZE and assumptions about layout are no longer littered across various modules.

@rphmeier rphmeier added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Feb 3, 2017
@rphmeier rphmeier requested a review from arkpar February 3, 2017 18:58
@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Feb 6, 2017
@arkpar arkpar merged commit 4172a53 into master Feb 6, 2017
@arkpar arkpar deleted the cht-td branch February 6, 2017 16:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants