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

Kovan warp sync fixed #5337

Merged
merged 2 commits into from
Apr 2, 2017
Merged

Kovan warp sync fixed #5337

merged 2 commits into from
Apr 2, 2017

Conversation

arkpar
Copy link
Collaborator

@arkpar arkpar commented Mar 29, 2017

No description provided.

@arkpar arkpar added A0-pleasereview 🤓 Pull request needs code review. B0-patch M4-core ⛓ Core client code / Rust. labels Mar 29, 2017
@arkpar arkpar force-pushed the kovan-receipt-fix branch from 36de8c0 to 0a966ad Compare March 29, 2017 18:01
@arkpar
Copy link
Collaborator Author

arkpar commented Mar 29, 2017

Changes in ethsync are required to support non-unique receipts. With EIP-98 multiple blocks can have the the same non-empty receipt that needs to be matched against multiple headers.

@arkpar arkpar force-pushed the kovan-receipt-fix branch from ff114e1 to af73a33 Compare March 29, 2017 18:12
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();
Copy link
Contributor

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.

@arkpar arkpar force-pushed the kovan-receipt-fix branch from af73a33 to d7d20fd Compare March 30, 2017 10:35
@arkpar arkpar force-pushed the kovan-receipt-fix branch from d7d20fd to 3915943 Compare March 30, 2017 11:13
@gavofyork
Copy link
Contributor

lgtm. @rphmeier should do a final review.

@rphmeier rphmeier added A8-looksgood 🦄 Pull request is reviewed well. A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A0-pleasereview 🤓 Pull request needs code review. A8-looksgood 🦄 Pull request is reviewed well. labels Mar 30, 2017
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");
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

@arkpar arkpar added A0-pleasereview 🤓 Pull request needs code review. and removed A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. labels Mar 31, 2017
@gavofyork
Copy link
Contributor

@rphmeier sign off?

@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Mar 31, 2017
@gavofyork
Copy link
Contributor

@rphmeier sign off?

@rphmeier rphmeier merged commit 21e21f1 into master Apr 2, 2017
@arkpar arkpar deleted the kovan-receipt-fix branch April 2, 2017 19:25
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.

3 participants