Previously, every incoming packet would get passed into ames.hoon (and,
subsequently, the event log) for processing. The changes here add a
pre-processing stop to ames.c's packet handling, reducing the amount of
work that goes into ames.hoon proper. Specifically, we do two things:
First, if we detect we won't be able to do anything useful with the packet
(for example, it has an Ames protocol version we are not aware of, the hash
is invalid, or it's generally unreadable), we simply drop it.
Secondly, if we detect the packet isn't for us, but meant to be forwarded,
and we can forward it correctly, we do so synchronously. This lets the
packet avoid the event loop, which improves performance and reduces event
log growth for ships doing forwarding.
From pending new vere release notes:
ames.c
packet filtering and stateless forwardingPreviously, every incoming packet would get passed into
ames.hoon
(and, subsequently, the event log) for processing. The changes here add a pre-processing stop toames.c
's packet handling, reducing the amount of work that goes intoames.hoon
proper. Specifically, we do two things:First, if we detect we won't be able to do anything useful with the packet (for example, it has an Ames protocol version we are not aware of, the hash is invalid, or it's generally unreadable), we simply drop it.
Secondly, if we detect the packet isn't for us, but meant to be forwarded, and we can forward it correctly, we do so synchronously. This lets the packet avoid the event loop, which improves performance and reduces event log growth for ships doing forwarding.