Re-enable kernel history validation, re-add lost fix to validate the txhashset in a read only extension.
This commit is contained in:
+7
-1
@@ -544,9 +544,15 @@ impl Chain {
|
||||
let mut txhashset =
|
||||
txhashset::TxHashSet::open(self.db_root.clone(), self.store.clone(), Some(&header))?;
|
||||
|
||||
// validate against a read-only extension first (some of the validation
|
||||
// runs additional rewinds)
|
||||
txhashset::extending_readonly(&mut txhashset, |extension| {
|
||||
extension.rewind(&header, &header)?;
|
||||
extension.validate(&header, false, status)
|
||||
})?;
|
||||
|
||||
// all good, prepare a new batch and update all the required records
|
||||
let mut batch = self.store.batch()?;
|
||||
// Note: we are validating against a writeable extension.
|
||||
txhashset::extending(&mut txhashset, &mut batch, |extension| {
|
||||
// TODO do we need to rewind here? We have no blocks to rewind
|
||||
// (and we need them for the pos to unremove)
|
||||
|
||||
@@ -911,8 +911,7 @@ impl<'a> Extension<'a> {
|
||||
|
||||
// Verify kernel roots for all past headers, need to be last as it rewinds
|
||||
// a lot without resetting
|
||||
// TODO broken in fast sync, fix
|
||||
// self.verify_kernel_history(header)?;
|
||||
self.verify_kernel_history(header)?;
|
||||
|
||||
Ok((output_sum, kernel_sum))
|
||||
}
|
||||
@@ -1047,7 +1046,6 @@ impl<'a> Extension<'a> {
|
||||
// header, rewind and check each root. This fixes a potential weakness in
|
||||
// fast sync where a reorg past the horizon could allow a whole rewrite of
|
||||
// the kernel set.
|
||||
let header_head = header.clone();
|
||||
let mut current = header.clone();
|
||||
let empty_bitmap = Bitmap::create();
|
||||
loop {
|
||||
|
||||
Reference in New Issue
Block a user