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
Stateless bootstrap server #3975
Stateless bootstrap server #3975
Conversation
messages.cpp
…ifferent traffic types
This will be useful for querying which account contains source gapping block
nano/node/messages.cpp
Outdated
debug_assert (header.extensions.to_ulong () > 0); // Block payload must have least `not_a_block` terminator | ||
header.serialize (stream); | ||
nano::write (stream, type); | ||
nano::write (stream, id); |
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.
Endianness should be specified.
nano/node/messages.cpp
Outdated
error = deserialize (stream); | ||
if (!error) | ||
{ | ||
update_header (); |
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.
Why is this updating the header? The header should either be right or wrong. It should not need updating/adjusting.
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.
Good catch, there is no reason to do that in there. Personally I would update the header during serialization, but that is the const method and I didn't want to suddenly refactor all message classes
This eliminates the need for allocating response messages
We discussed internally that adding account info query to the bootstrap server might be useful feature (even though it cannot be 100% trusted). The latest update added just that. @dsiganos |
This PR introduces stateless bootstrap server, a component that aims to replace the old bootstrap serving infrastructure. Old design relied on using dedicated tcp connections for bootstrapping, here I only utilize the realtime channels that are already established. Because of this, it is now possible to bootstrap from nodes that for any reason do not allow incoming connections (behind NAT, firewall rules). It will also reduce the number of needed sockets per peer. Lastly, it is also much faster because the requests are done asynchronously, so the effect of latency is minimized.