-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Conversation
36de8c0
to
0a966ad
Compare
Changes in |
ff114e1
to
af73a33
Compare
ethcore/src/client/client.rs
Outdated
warn!(target: "client", "Block import failed for #{} ({})\nError: {:?}", header.number(), header.hash(), e); | ||
})?; | ||
|
||
if header.number() < self.engine().params().validate_receipts_transition && header.receipts_root() != locked_block.block().header().receipts_root() { | ||
locked_block.strip_receipts(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this violates the immutable interface that LockedBlock
presents -- it would be fine internal to block.rs
but exposing and using strip_receipts
externally seems to discard invariants we previously had.
af73a33
to
d7d20fd
Compare
d7d20fd
to
3915943
Compare
lgtm. @rphmeier should do a final review. |
sync/src/blocks.rs
Outdated
self.receipt_ids.remove(&receipt_root); | ||
match self.receipt_ids.entry(receipt_root) { | ||
Entry::Occupied(mut entry) => { | ||
let h = entry.get_mut().pop().expect("Empty vectors are not allowed in insert_receipt; qed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, if the receipts roots are all the same here then we should be able to drain all block hashes in the entry as soon as we get the correct set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not that simple. Every response must be matched against a request, otherwise we can't tell good behaviour from bad. I've made an additional commit that tracks unique receipts and only issues one download request for each receipt root.
@rphmeier sign off? |
@rphmeier sign off? |
No description provided.