delvingbitcoin

Warnet simulations

Original Postby pinheadmz

In a recent network testing, two nodes were examined to assess the impact of different connection types on memory usage, as indicated by the `getpeermemoryinfo` RPC.

The test compared a node with a branch named mzumsande/202308_increase_block_relay, which had Amiti's getpeermemoryinfo feature rebased onto it, against a control node that only included the getpeermemoryinfo feature.

During the test, 248 additional v25.1 nodes attempted to establish both full and block-relay-only connections with the two test nodes. Consequently, the first node (referred to as node 0) reached a total of 181 inbound connections, while the second node (node 1) had 114. Notably, node 0 had an excess of 65 block-relay-only connections compared to node 1.

Detailed network activity was generated and can be reviewed in the script found at this GitHub repository. The script includes random transactions between nodes and block generation by a random node. Metrics such as mempool size and total network bandwidth showed similar results for both test nodes. However, memory usage data revealed a linear increase in line with the additional peers connected to node 0.

Memory usage statistics collected via getpeermemoryinfo unveiled that for node 0, which had a maximum of 200 connections, approximately 5300 bytes were allocated for each CNode instance and about 2000 bytes for each Peer object per block-relay-only connection. In contrast, node 1 allocated a similar amount of memory for CNode instances but only around 1000 bytes for each Peer object per block-relay-only connection. This indicates that the memory used by Peer objects in the test node is twice that of the control, which could be significant.

The researcher conducting the test expressed enthusiasm about exploring different types of network activities or potential attacks on these test nodes to further understand their behavior and resilience.