bitcoin-dev

Great Consensus Cleanup Revival

Great Consensus Cleanup Revival

Original Postby Eric Voskuil

Posted on: June 29, 2024 20:40 UTC

The discussion revolves around the complexities associated with caching identity in the context of Bitcoin blocks, particularly when dealing with invalid block messages.

A key point is that a fully-validated block has its identity established through its block hash, but an invalid block message can produce the same hash despite containing nonsensical data beyond the header. This raises questions about the utility and identification of block hashes when the data within the block is unparseable or invalid in various ways, highlighting nine different scenarios ranging from completely unparseable headers to valid headers with malleated or unmalleated committed data.

The conversation then shifts to the practical implications of attempting to reject repeated bogus messages through hashing, which is part of the peer-to-peer protocol and significantly cheaper than producing a Merkle root. However, the utility of using a Bitcoin block hash as a unique identifier for invalid peer-to-peer block messages is challenged, especially considering the ease of generating messages with unparseable data and the ambiguity of identifying blocks with malleated or invalid commitments.

A significant part of the discussion is dedicated to the consensus rule proposed to invalidate all 64-byte transactions to prevent re-downloading and re-validating them, aimed at improving performance. This rule specifically targets reducing the initial block download/catch-up time by precluding the computational cost associated with 64-byte malleations, which is deemed negligible compared to other forms of bogus messages. The argument suggests that there are more efficient methods to dismiss these bogus messages without resorting to hashing, which is both costly and unnecessary in many cases.

Furthermore, the analysis delves into the broader implications of prioritizing early dismissal of invalid messages and the trade-offs involved in storing and looking up identifiers for already validated blocks. It highlights the inefficiency of expending resources on hash/lookup processes when simpler, faster methods of dismissal could be applied, arguing against the necessity of a block hash cache requirement in many scenarios due to its limited applicability and suboptimal performance benefits.

In summary, the email engages with the technical challenges of handling invalid Bitcoin block messages, questioning the effectiveness of current strategies for identifying and dismissing such messages. It critiques the reliance on block hashes as identifiers for invalid messages and proposes more efficient alternatives for managing bogus messages without compromising the integrity or performance of the blockchain network.