-
Notifications
You must be signed in to change notification settings - Fork 935
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
Discussion: 1 body per request vs multiple bodies per request #226
Comments
I am mainly worried about potential DoS vectors - a malicious node could send us a list of transactions that are not associated with any known header, we should not do anything with the bodies until we map it to a header. Overall though I think requesting multiple bodies per p2p message is alright. The bodies stage already fetches headers for each body we request, so we can use the txroots from each header to create an in-memory map There are a few advantages to computing roots:
|
As @Rjected suggested in Discord:
|
I want to move the discussion, from single or multi bodies request (as it does not matter a lot) to where to check transaction roots is it in the body stage or later? multi bodies request is probably more optimal on network bandwidth as fewer requests are sent/received but it does not matter and can be switched later if we find it is a big trouble. In both cases, we "trust" the peer f that they are delivering the requested body. and it is more safer to ask block body by its hash, Other than that complexity, you will not have information about peer that was malicious/faulty to disconnect him. |
#247 will make this much easier |
We are now doing multiple bodies per request |
Creating this issue to unblock #220 and continue the discussion here.
The question is: What are the tradeoffs between requesting 1 body per request to a peer vs requesting multiple bodies per request to a peer?
Currently:
Alternatively:
TxRoot => HeaderHash
, and the downloader would need a RO transaction to the database (which is not the case currently)In other words: Is the added complexity (extra database calls, more computation) worth the upside? What is the upside?
Worth noting:
The text was updated successfully, but these errors were encountered: