Fetch changes trie roots + CHT-based proof for these roots (#896)

* build CHT for changes tries roots

* collect chnages tries roots proof in key_changes_proof

* flush check_changes_proof

* fixed compilation

* LightDataChecker now has a ref to the blockchain

* continue passing proofs

* new light db tests

* more CHT tests

* more tests for key changes proof when headers are missing

* lost files
This commit is contained in:
Svyatoslav Nikolsky
2018-11-14 18:06:10 +03:00
committed by Gav Wood
parent 7f8ee0f53b
commit fa84cec382
19 changed files with 1035 additions and 313 deletions
+8 -2
View File
@@ -88,8 +88,8 @@ error_chain! {
display("This method is not currently available when running in light client mode"),
}
/// Invalid remote header proof.
InvalidHeaderProof {
/// Invalid remote CHT-based proof.
InvalidCHTProof {
description("invalid header proof"),
display("Remote node has responded with invalid header proof"),
}
@@ -135,6 +135,12 @@ error_chain! {
description("Potential long-range attack: block not in finalized chain."),
display("Potential long-range attack: block not in finalized chain."),
}
/// Hash that is required for building CHT is missing.
MissingHashRequiredForCHT(cht_num: u64, block_number: u64) {
description("missed hash required for building CHT"),
display("Failed to get hash of block#{} for building CHT#{}", block_number, cht_num),
}
}
}