Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't send expedited blocks until PoW verified #502

Merged
merged 1 commit into from
May 5, 2017
Merged

Don't send expedited blocks until PoW verified #502

merged 1 commit into from
May 5, 2017

Conversation

kyuupichan
Copy link
Contributor

@kyuupichan kyuupichan commented May 2, 2017

At present we send an expedited block before checking the PoW or merkle root. This is a bad idea, but worse it means our peer will ban us if we send something bad, and without the above checks it's easy for an attacker to get a BU node to send an invalid expedited block.

This patch remedies that by not sending one until both checks are done.

@kyuupichan
Copy link
Contributor Author

I've just realised there is no point in the inv in thinblock.cpp. Let me resubmit.

@kyuupichan
Copy link
Contributor Author

Re-pushed without pointless Inv.

@ptschip
Copy link
Collaborator

ptschip commented May 2, 2017

@kyuupichan I understand the intent here but I'm not sure we can do this...checking the merkle root for expedited processing will take too much time if re-requests are needed and will also add a fair amount of time just in checking for collisions and verifying we have all the tx hashes , and will thus defeat the purpose of expedited forwarding. @gandrewstone what do you think? you know more about expedited performance...

As for bans on the expedited network , I think expedited nodes should be all whitelisting each other anyway, but we still need a bigger discussion (as you've mentioned) about creating a proper policy for when , when not to ban nodes.

@kyuupichan
Copy link
Contributor Author

@ptschip I want expedited to be the ultimate default method of operation to extract the maximum gain xthin has to offer. We cannot be selecting trusted peers and whitelisting them. It has to be good for any peer to be an expedited peer, otherwise something is wrong.

We can't be sending invalid stuff around the network. bitcoind was always very careful about that, and for good reason. Validation is an unfortunate necessity.

@kyuupichan kyuupichan changed the title Don't send expedited blocks until PoW and merkle root verified Don't send expedited blocks until PoW verified May 2, 2017
@kyuupichan
Copy link
Contributor Author

Updated to only check PoW which is nearly instant. Merkle root checking is deferred and banning removed.

@kyuupichan
Copy link
Contributor Author

Rebased to avoid the conflict now #482 is in.

@gandrewstone gandrewstone merged commit a182020 into BitcoinUnlimited:dev May 5, 2017
@kyuupichan kyuupichan deleted the exp-1 branch May 5, 2017 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants