delvingbitcoin

Hyperion: A discrete time network event simulator for Bitcoin (Core)

Hyperion: A discrete time network event simulator for Bitcoin (Core)

Posted on: July 23, 2024 20:13 UTC

The revival of Erlay has been undertaken due to its potential to enhance bandwidth efficiency for Bitcoin nodes.

The initiative, which had previously stalled, presumably from a lack of sufficient review, necessitated revisiting and modifying the original proposal's design. Key changes include the criteria for selecting fanout peers, such as whether the selection should be done on a transaction or connection basis, if the peer's direction (inbound or outbound) should influence the choice, and whether the selection process should be proportional to the number of peers or not. These alterations prompted further simulations to understand the trade-offs involved and refine the parameters accordingly.

To facilitate this analysis, a network simulator named Hyperion was developed, accessible at Hyperion GitHub. Hyperion is an event-based simulator that operates on discrete time, creating a network of nodes assigned deterministically at random, including both reachable and unreachable nodes. Within this simulated network, transactions are initiated from random nodes and broadcasted to their peers, triggering a sequence of events designed to disseminate the transaction across the entire network. This simulation adheres strictly to well-defined behaviors in transaction relaying, mirroring Bitcoin Core's approach to privacy and denial-of-service (DoS) protection, with specific protocols for handling inv, getdata, and tx messages based on the node's status as inbound or outbound.

Hyperion's design incorporates detailed mechanisms for managing transaction announcements and requests, ensuring that transactions are not announced more than once to any peer or sent out multiple times by any node. It also prioritizes GETDATA requests to outbound peers, thereby delaying requests from inbound peers unless they supersede those from outbound ones. This structure aims to offer a realistic portrayal of transaction flow within the Bitcoin network, providing valuable insights into the operational dynamics under different conditions.

Currently, Hyperion supports the traditional transaction workflow prevalent within the Bitcoin network. Efforts are ongoing to integrate Erlay-specific functionalities into the simulator. The project welcomes contributions, feedback, and suggestions from the community to enhance its capabilities and accuracy. The development of Hyperion represents a significant step towards optimizing Bitcoin's network efficiency and understanding the nuanced impacts of proposed changes like Erlay.