Skip to content

initiator mode on incoming connections #660

@rkuhn

Description

@rkuhn

Abstract

We add the ability to promote a downstream connection to use both responder and initiator roles if the peer permits this. This corresponds to the transition Warm → Hot in the Haskell implementation

Why?

Downstream connections are a source of potential upstream peers which we need to harness, just like the Haskell node does. The connecting peer tells us as part of the handshake protocol whether it expects us to ask for headers or blocks, so this is part of the expected behaviour of a Cardano node.

How?

The Connection stage is extended to support the transition from Responder mode to FullDuplex mode, which is then exposed as a command that can be sent to the Manager stage. The peer selection stage (#659) will be extended to send this command to the manager when appropriate.

The Initiator mode of the Connection stage is also extended to offer the responder role for the keepalive, chainsync, blockfetch, tx_submission protocols. The handshake protocol implementation adds a configuration option to advertise full duplex capability by setting InitiatorOnlyMode=False.

Testing Strategy / Acceptance Criteria

We create an integration test (see #657) with a downstream peer that has a longer chain than the upstream and accepts responder mode on its outgoing connection. The upstream peer will have more transactions than the downstream. At the end of the test, the chain has flowed upstream and the transactions downstream.

Discussion points

No response

Dependencies & Related Tasks

depends on #659

Checklist

  • I understand that feature requests and unrefined work item should be open as GitHub Discussions instead.
  • I have assigned this item to an existing milestone from the roadmap
  • I have added a label capturing the impact of this item (i.e. value for users/stakeholders if successful)
  • I have added a label capturing the delivery risk of this item (i.e. how likely is it that this task will succeed as planned)
  • I have added a label capturing the effort of this item (i.e. how large is the task?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    .EFFORT.Medium1–2 weeks.RISK.LowWell-understood task, mostly mechanical.VALUE.MediumImproves reliability, performance, or developer experienceTOPIC.ConsensusMostly related to amaru-consensus / amaru-ouroboros

    Type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions