From 28ffabb79f0af6b94b8ed1b305022a9afe23c3fb Mon Sep 17 00:00:00 2001 From: Lorcan Wogan <69468264+LWogan@users.noreply.github.com> Date: Thu, 21 Sep 2023 16:59:00 +0100 Subject: [PATCH] CORE-16860 Add counterparty info request and response events (#1256) Adds counterparty info request and response events, and removes unneeded flow events and states. The session changes introduced in 5.1 mean that it is possible to request counterparty information before the counterparty is aware the flow exists and has started its initiated flow. This change allows the act of requesting counterparty information to start the initiated flow if required. --------- Co-authored-by: James Higgs --- .../avro/net/corda/data/flow/event/FlowEvent.avsc | 1 - .../net/corda/data/flow/event/SessionEvent.avsc | 4 ++-- .../avro/net/corda/data/flow/event/Wakeup.avsc | 7 ------- .../data/flow/event/session/SessionConfirm.avsc | 7 ------- .../session/SessionCounterpartyInfoRequest.avsc | 13 +++++++++++++ .../session/SessionCounterpartyInfoResponse.avsc | 7 +++++++ gradle.properties | 2 +- 7 files changed, 23 insertions(+), 18 deletions(-) delete mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/Wakeup.avsc delete mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionConfirm.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionCounterpartyInfoRequest.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionCounterpartyInfoResponse.avsc diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/FlowEvent.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/FlowEvent.avsc index e55a08d157..53b7fcb9b1 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/FlowEvent.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/FlowEvent.avsc @@ -11,7 +11,6 @@ "name": "payload", "type": [ "net.corda.data.flow.event.StartFlow", - "net.corda.data.flow.event.Wakeup", "net.corda.data.flow.output.FlowStatus", "net.corda.data.flow.event.SessionEvent", "net.corda.data.flow.event.external.ExternalEventResponse" diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/SessionEvent.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/SessionEvent.avsc index d40abd5746..980ad4a443 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/SessionEvent.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/SessionEvent.avsc @@ -50,8 +50,8 @@ { "name": "payload", "type": [ - "net.corda.data.flow.event.session.SessionInit", - "net.corda.data.flow.event.session.SessionConfirm", + "net.corda.data.flow.event.session.SessionCounterpartyInfoRequest", + "net.corda.data.flow.event.session.SessionCounterpartyInfoResponse", "net.corda.data.flow.event.session.SessionData", "net.corda.data.flow.event.session.SessionClose", "net.corda.data.flow.event.session.SessionError" diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/Wakeup.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/Wakeup.avsc deleted file mode 100644 index 0421ca665e..0000000000 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/Wakeup.avsc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type": "record", - "name": "Wakeup", - "namespace": "net.corda.data.flow.event", - "fields": [] -} - diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionConfirm.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionConfirm.avsc deleted file mode 100644 index d51b9f99a5..0000000000 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionConfirm.avsc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "type": "record", - "name": "SessionConfirm", - "doc" : "Acknowledge to counterparty that the session has been confirmed and is ready to send and receive messages.", - "namespace": "net.corda.data.flow.event.session", - "fields": [] -} diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionCounterpartyInfoRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionCounterpartyInfoRequest.avsc new file mode 100644 index 0000000000..99758c5d76 --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionCounterpartyInfoRequest.avsc @@ -0,0 +1,13 @@ +{ + "type": "record", + "name": "SessionCounterpartyInfoRequest", + "doc" : "Request counterparties flow session information. This includes the flow protocol version that they are running.", + "namespace": "net.corda.data.flow.event.session", + "fields": [ + { + "name": "sessionInit", + "type": "net.corda.data.flow.event.session.SessionInit", + "doc": "Contains information that can be used to start an initiated flow. Will be null for messages sent to the initiator. Will be null when initiated party is confirmed to be present to ensure out of order messages that arrive first contain this info." + } + ] +} diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionCounterpartyInfoResponse.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionCounterpartyInfoResponse.avsc new file mode 100644 index 0000000000..039e4d4e3a --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/flow/event/session/SessionCounterpartyInfoResponse.avsc @@ -0,0 +1,7 @@ +{ + "type": "record", + "name": "SessionCounterpartyInfoResponse", + "doc" : "Sent from initiated to initiating party to inform them which protocol version of the flow they are running.", + "namespace": "net.corda.data.flow.event.session", + "fields": [] +} diff --git a/gradle.properties b/gradle.properties index 46577e1014..b775b41a9c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ cordaProductVersion = 5.1.0 # NOTE: update this each time this module contains a breaking change ## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to ## a per module property in which case module versions can change independently. -cordaApiRevision = 20 +cordaApiRevision = 21 # Main kotlinVersion = 1.8.21