celestiaorg / celestia-core

A fork of CometBFT
Apache License 2.0
476 stars 257 forks source link

Proposal: Reduce redundant block part transmissions post-RoundStepPrevote in DataChannel protocol #1134

Open staheri14 opened 10 months ago

staheri14 commented 10 months ago

Summary

Optimizing the DataChannel protocol by halting block part transmissions when peers reach the RoundStepPrevote, indicating they have the complete proposal.

Problem Definition

Within the DataChannel protocol of the consensus reactor, peers are programmed to exchange parts of a proposed block continuously. This exchange persists until either (1) all parts of the proposed block have been transmitted successfully, or (2) a peer's round state advances, indicating a transition to a new height and round with a subsequent proposal. A limitation of the current protocol is that it does not account for a peer potentially acquiring the necessary block parts from multiple connections, which can render further transmissions redundant. Currently, the decision to transmit block parts is solely based on a peer's individual perspective of other peers' states.

Proposal

To enhance efficiency, the protocol could be modified to consider whether peers have progressed to a stage that implies they have already compiled the full block proposal. Specifically, when a node receives a NewRoundStepMessage that includes its connected peer's current step, and if that step is RoundStepPrevote, it could be inferred that the peer has acquired the entire block proposal. Consequently, there would be no further need to send parts of that block proposal for the same height and round to that peer. This change would prevent unnecessary data transmission, optimizing network bandwidth and resource usage.

staheri14 commented 10 months ago

cc: @evan-forbes @cmwaters @rootulp would be interested to know your pov