nano-node
nano-node copied to clipboard
Add `is_originator` flag to publish messages
This adds a new flag to publish
messages that indicates whether a block is coming from a node that performed initial flooding. This helps avoid a situation when under a high load, a legitimate block is dropped because blockprocessor queue for a peer is full of rebroadcasted blocks. However, the potential for exploiting this is limited, as both rebroadcasted and originator queues have the same max size and priority, so effectively this gives each peer two queues to spam the network - which is not much, but should be plenty for legitimate traffic.
Format of extended publish message:
/*
* Binary Format:
* [message_header] Common message header
* [variable] Block (serialized according to the block type specified in the header)
*
* Header extensions:
* - [0x0f00] Block type: Identifies the specific type of the block.
* - [0x0004] Originator flag
*/