Skip to content

Conversation

tbagrel1
Copy link
Contributor

Co-authored-by: nbacquey nbacquey@users.noreply.github.com

Description

Please include a meaningful description of the PR and link the relevant issues
this PR might resolve.

Also note that:

  • New code should be properly tested (even if it does not add new features).
  • The fix for a regression should include a test that reproduces said regression.

@tbagrel1 tbagrel1 changed the title Peras/experimental-object-diffusion-inbound-v2 [WIP] Experimental ObjectDiffusion v2 (just inbound side changes) for efficient vote retrieval Sep 29, 2025
@tbagrel1 tbagrel1 force-pushed the peras/experimental-object-diffusion-inbound-v2 branch 2 times, most recently from 9de5d64 to 443cfc8 Compare October 13, 2025 14:03
@tbagrel1 tbagrel1 force-pushed the peras/experimental-object-diffusion-inbound-v2 branch from 96b7016 to 8bd6007 Compare October 15, 2025 12:00
@tbagrel1 tbagrel1 changed the base branch from main-pr/object-diffusion to peras-staging October 15, 2025 12:03
@tbagrel1
Copy link
Contributor Author

@nbacquey nbacquey force-pushed the peras/experimental-object-diffusion-inbound-v2 branch from d28fe49 to f794d6f Compare October 20, 2025 18:08
- the inbound peer that submitted the object to pool might have acked it already at the moment the object is rejected by the pool, but the rejection indicates that the outbound peer which sent us the object is adversarial, and we should disconnect from it anyway. So there is no harm done by having acked the object to the adversarial outbound peer, as we won't want to re-download this object from it again (or any other object whatsoever).
- any other inbound peer that has this ID available from its outbound peer won't be able to ack it because this ID isn't in **their** `dpsObjectsOwtPool`, and is not in the pool either, so we will be able to download it from these other peers until we find a valid one.

As in TxSubmission, acknowledgement is done by indicating to the outbound peer the length of the (longest) prefix of the oustanding FIFO that we no longer care about (i.e. for which all IDs are eligible to acknowledgment by the definition above). The field `dpsOutstandingFifo` on the inbound peer is supposed to mirror exactly the state of the FIFO of the outbound peer, bar eventual discrepancies due to in-flight information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably missed something along the way, but what happens when a peer receives all but the first object it requests from an outbound peer? Can that object be re-requested from the same peer, or do we rely on some other peer sending it successfully and thus allowing us to move ahead in the outstanding FIFO?

When making decisions, we first divide the peers in two groups:

- Those who are currently executing a decision, i.e., those for which the (previous) decision in the decision channel verifies `pdStatus == DecisionBeingActedUpon`. These are further called _frozen peers_.
- Those who are not currently executing a decision, i.e., those for which the (previous) decision in the decision channel verifies `pdStatus == DecisionUnread || pdStatus == DecisionCompleted`. The former are the ones who didn't have time to read the previous decision yet, so it makes sense to recompute a more up-to-date decision for them. The latter are the ones who have completed executing the previous decision, so it also makes sense to compute a new decision for them. These two categories of peers are further called _active peers_.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The former are the ones who didn't have time to read the previous decision yet, so it makes sense to recompute a more up-to-date decision for them.

Could this somehow lead to starvation? I.e. the peer never leaving the DecisionUnread state because the decision thread keeps recomputing a new one.

- They are not already in the pool
- They are available from the peer, and won't be acked by the peer on its next request for IDs according to the partial decision computed by `computeAck` at the previous step (NOTE: theoretically, this second condition is redundant with other constraints and invariants of the current implementation).

Then we "reverse" this mapping to obtain a map of object IDs to the set of active peers that have the corresponding interesting objects available (according to the criteria above), further called _potential providers_.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any notion of quality of service that one could use to prioritize certain potential providers over others at this point?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Figure out non-trivial inbound logic for votes retrieval

3 participants