From 3c460deb680eabbe5cbbafa9af6b36d61baba2b4 Mon Sep 17 00:00:00 2001 From: Nadine Quin <103633799+nadinequinr3@users.noreply.github.com> Date: Wed, 28 Jun 2023 13:15:12 +0100 Subject: [PATCH 01/19] Tech Writer edit --- .../externalMessaging/1.0/corda.externalMessaging.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/externalMessaging/1.0/corda.externalMessaging.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/externalMessaging/1.0/corda.externalMessaging.json index 5ae9361c66..9188a6adeb 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/externalMessaging/1.0/corda.externalMessaging.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/externalMessaging/1.0/corda.externalMessaging.json @@ -14,19 +14,19 @@ "type": "string", "default": "ext.$HOLDING_ID.$CHANNEL_NAME.receive", "pattern": "^(ext|EXT)([a-zA-Z0-9\\._\\-]|\\$HOLDING_ID|\\$CHANNEL_NAME){1,100}$", - "description": "The pattern used to generate the external app receiving topic." + "description": "The pattern used to generate the external app receiving topic. When creating routes, Corda replaces any placeholders with the virtual node specific values. " }, "active": { "type": "boolean", "default": true, - "description": "The default activation type." + "description": "Specifies if the route is active." }, "inactiveResponseType": { "description": "The default behaviour of the external messaging API when publishing to an inactive route.", "oneOf": [ { "const": "ERROR", - "title": "The API will throw an exception if a flow publishes a message to an inactive topic" + "title": "The API will throw an exception if a flow publishes a message to an inactive topic." }, { "const": "IGNORE", @@ -40,4 +40,4 @@ "additionalProperties": false } } -} \ No newline at end of file +} From 4071eacef321465516952730761b257fb749a772 Mon Sep 17 00:00:00 2001 From: nargas-ritu <59389071+nargas-ritu@users.noreply.github.com> Date: Tue, 11 Jul 2023 10:11:50 +0100 Subject: [PATCH 02/19] CORE-5821: Updated snyk file with the latest reported issues --- .snyk | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/.snyk b/.snyk index 36101b2ced..ac47111e0b 100644 --- a/.snyk +++ b/.snyk @@ -2,23 +2,14 @@ version: v1.25.0 # ignores vulnerabilities until expiry date; change duration by modifying expiry date ignore: - SNYK-JAVA-ORGJETBRAINSKOTLIN-2628385: - - '*': - reason: >- - Gradle plugins use the version of Kotlin provided by Gradle itself, so - it is not susceptible to this vulnerability. In addition, this is a - build-time vulnerability, released artifacts are not affected due to - this. - expires: 2022-10-22T10:40:55.991Z - created: 2022-09-22T10:40:55.995Z - SNYK-JAVA-ORGJETBRAINSKOTLIN-2393744: + SNYK-JAVA-ORGJETBRAINSKOTLIN-2393744: - '*': reason: >- This vulnerability relates to information exposure via creation of temporary files via Kotlin functions with insecure permissions. Corda does not use any of the vulnerable functions so it not susceptible to this vulnerability. - expires: 2023-06-19T10:40:55.991Z + expires: 2023-10-19T10:40:55.991Z created: 2022-09-22T10:40:55.995Z SNYK-JAVA-COMFASTERXMLJACKSONCORE-3038424: - '*': @@ -27,16 +18,7 @@ ignore: where this dependency originates, this is used at compile / build time only for Kdoc generation and not shipped in any of our releasable artifacts. - expires: 2023-06-19T10:40:55.991Z - created: 2022-12-20T10:40:55.995Z - SNYK-JAVA-ORGJSOUP-2989728: - - '*': - reason: >- - Corda5 Shippable artifacts do not make use of dokka-core, which is - where this dependency originates, this is used at compile / build time - only for Kdoc generation and not shipped in any of our releasable - artifacts. - expires: 2023-06-19T10:40:55.991Z + expires: 2023-10-19T10:40:55.991Z created: 2022-12-20T10:40:55.995Z SNYK-JAVA-COMFASTERXMLJACKSONCORE-3038426: - '*': @@ -45,7 +27,7 @@ ignore: where this dependency originates, this is used at compile / build time only for Kdoc generation and not shipped in any of our releasable artifacts. - expires: 2023-06-19T10:40:55.991Z + expires: 2023-10-19T10:40:55.991Z created: 2022-12-20T10:40:55.995Z SNYK-JAVA-COMFASTERXMLWOODSTOX-3091135: - '*': @@ -54,6 +36,6 @@ ignore: where this dependency originates, this is used at compile / build time only for Kdoc generation and not shipped in any of our releasable artifacts. - expires: 2023-06-19T13:28:02.582Z + expires: 2023-10-19T13:28:02.582Z created: 2023-03-20T13:28:02.597Z patch: {} From 813604fa9feaf2019ebae2912a50d54fe71ef2b8 Mon Sep 17 00:00:00 2001 From: Nikolett Nagy <61757742+nikinagy@users.noreply.github.com> Date: Tue, 11 Jul 2023 15:33:54 +0100 Subject: [PATCH 03/19] CORE-13098 - Merge feature branch back into release branch (#1169) Merging re-registration feature branch to release. --- .../registration/RegistrationCommand.avsc | 2 ++ .../PersistMemberRegistrationState.avsc | 2 +- .../mgm/CheckForPendingRegistration.avsc | 23 +++++++++++++++ .../registration/mgm/QueueRegistration.avsc | 28 +++++++++++++++++++ .../registration/mgm/StartRegistration.avsc | 18 +----------- .../common/RegistrationRequestDetails.avsc | 7 ++++- .../common/v2/RegistrationStatus.avsc | 20 +++++++++++++ .../command/PersistRegistrationRequest.avsc | 2 +- .../UpdateRegistrationRequestStatus.avsc | 2 +- .../query/QueryRegistrationRequests.avsc | 2 +- .../p2p/v2/SetOwnRegistrationStatus.avsc | 21 ++++++++++++++ .../configuration/MembershipConfig.java | 10 +++++++ .../membership/1.0/corda.membership.json | 14 ++++++++++ gradle.properties | 2 +- 14 files changed, 130 insertions(+), 23 deletions(-) create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/CheckForPendingRegistration.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/QueueRegistration.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/membership/common/v2/RegistrationStatus.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/membership/p2p/v2/SetOwnRegistrationStatus.avsc diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/RegistrationCommand.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/RegistrationCommand.avsc index 6b1f09e8cc..192e984626 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/RegistrationCommand.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/RegistrationCommand.avsc @@ -8,6 +8,8 @@ "name": "command", "doc": "Indicator of the type of registration command that was issued.", "type": [ + "net.corda.data.membership.command.registration.mgm.QueueRegistration", + "net.corda.data.membership.command.registration.mgm.CheckForPendingRegistration", "net.corda.data.membership.command.registration.mgm.StartRegistration", "net.corda.data.membership.command.registration.mgm.VerifyMember", "net.corda.data.membership.command.registration.mgm.ProcessMemberVerificationResponse", diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/member/PersistMemberRegistrationState.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/member/PersistMemberRegistrationState.avsc index 66dc1e3f02..5a4e606f66 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/member/PersistMemberRegistrationState.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/member/PersistMemberRegistrationState.avsc @@ -12,7 +12,7 @@ { "name": "setStatusRequest", "doc" : "The request to set the status.", - "type": "net.corda.data.membership.p2p.SetOwnRegistrationStatus" + "type": "net.corda.data.membership.p2p.v2.SetOwnRegistrationStatus" } ] } \ No newline at end of file diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/CheckForPendingRegistration.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/CheckForPendingRegistration.avsc new file mode 100644 index 0000000000..7b48eeb335 --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/CheckForPendingRegistration.avsc @@ -0,0 +1,23 @@ +{ + "type": "record", + "name": "CheckForPendingRegistration", + "namespace": "net.corda.data.membership.command.registration.mgm", + "doc": " Command issued when a member registration request is successfully queued.", + "fields": [ + { + "name": "mgm", + "doc": "Holding identity of the MGM.", + "type": "net.corda.data.identity.HoldingIdentity" + }, + { + "name": "member", + "doc": "Holding identity of the registering member as provided during P2P communication. Used to verify the registration request.", + "type": "net.corda.data.identity.HoldingIdentity" + }, + { + "name": "numberOfRetriesSoFar", + "doc": "The number of times this request failed so far.", + "type": "int" + } + ] +} \ No newline at end of file diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/QueueRegistration.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/QueueRegistration.avsc new file mode 100644 index 0000000000..b77d6ae081 --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/QueueRegistration.avsc @@ -0,0 +1,28 @@ +{ + "type": "record", + "name": "QueueRegistration", + "namespace": "net.corda.data.membership.command.registration.mgm", + "doc": " Command issued when a member registration request is received and needs to be processed.", + "fields": [ + { + "name": "mgm", + "doc": "Holding identity of the target MGM.", + "type": "net.corda.data.identity.HoldingIdentity" + }, + { + "name": "member", + "doc": "Holding identity of the requesting member.", + "type": "net.corda.data.identity.HoldingIdentity" + }, + { + "name": "memberRegistrationRequest", + "doc": "The full registration request as received from a registering member.", + "type": "net.corda.data.membership.p2p.MembershipRegistrationRequest" + }, + { + "name": "numberOfRetriesSoFar", + "doc": "The number of times this request failed so far.", + "type": "int" + } + ] +} \ No newline at end of file diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/StartRegistration.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/StartRegistration.avsc index 76bcdcb00b..586942d895 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/StartRegistration.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/command/registration/mgm/StartRegistration.avsc @@ -3,21 +3,5 @@ "name": "StartRegistration", "namespace": "net.corda.data.membership.command.registration.mgm", "doc": " Command issued when a member registration request is received and needs to be processed.", - "fields": [ - { - "name": "destination", - "doc": "Holding identity of the target MGM.", - "type": "net.corda.data.identity.HoldingIdentity" - }, - { - "name": "source", - "doc": "Holding identity of the requesting member.", - "type": "net.corda.data.identity.HoldingIdentity" - }, - { - "name": "memberRegistrationRequest", - "doc": "The full registration request as received from a registering member.", - "type": "net.corda.data.membership.p2p.MembershipRegistrationRequest" - } - ] + "fields": [] } \ No newline at end of file diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/common/RegistrationRequestDetails.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/common/RegistrationRequestDetails.avsc index 9ea0e18c67..b3b90d6550 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/common/RegistrationRequestDetails.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/common/RegistrationRequestDetails.avsc @@ -23,13 +23,18 @@ { "name": "registrationStatus", "doc": "Status of the registration request.", - "type": "RegistrationStatus" + "type": "net.corda.data.membership.common.v2.RegistrationStatus" }, { "name": "registrationId", "doc": "ID of the registration request.", "type": "string" }, + { + "name": "holdingIdentityId", + "doc": "ID of the owner of this registration request.", + "type": "string" + }, { "name": "registrationProtocolVersion", "doc": "Registration protocol number.", diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/common/v2/RegistrationStatus.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/common/v2/RegistrationStatus.avsc new file mode 100644 index 0000000000..da88957759 --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/common/v2/RegistrationStatus.avsc @@ -0,0 +1,20 @@ +{ + "type": "enum", + "name": "RegistrationStatus", + "namespace": "net.corda.data.membership.common.v2", + "doc": "Registration request status.", + "symbols": [ + "NEW", + "SENT_TO_MGM", + "RECEIVED_BY_MGM", + "STARTED_PROCESSING_BY_MGM", + "PENDING_MEMBER_VERIFICATION", + "PENDING_MANUAL_APPROVAL", + "PENDING_AUTO_APPROVAL", + "DECLINED", + "INVALID", + "FAILED", + "APPROVED" + ], + "default": "NEW" +} \ No newline at end of file diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/PersistRegistrationRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/PersistRegistrationRequest.avsc index 414f6ee40d..eb2baffe3c 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/PersistRegistrationRequest.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/PersistRegistrationRequest.avsc @@ -7,7 +7,7 @@ { "name": "status", "doc": "Indicator of the current status of the request.", - "type": "net.corda.data.membership.common.RegistrationStatus" + "type": "net.corda.data.membership.common.v2.RegistrationStatus" }, { "name": "registeringHoldingIdentity", diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/UpdateRegistrationRequestStatus.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/UpdateRegistrationRequestStatus.avsc index e204e8604d..db1331d894 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/UpdateRegistrationRequestStatus.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/UpdateRegistrationRequestStatus.avsc @@ -15,7 +15,7 @@ { "name": "registrationStatus", "doc": "The new status for this registration request.", - "type": "net.corda.data.membership.common.RegistrationStatus" + "type": "net.corda.data.membership.common.v2.RegistrationStatus" }, { "name": "reason", diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/query/QueryRegistrationRequests.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/query/QueryRegistrationRequests.avsc index 1bd3ca4d42..cec36111f3 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/query/QueryRegistrationRequests.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/query/QueryRegistrationRequests.avsc @@ -14,7 +14,7 @@ "doc": "Requests in the specified statuses will be included in the query result.", "type": { "type": "array", - "items": "net.corda.data.membership.common.RegistrationStatus" + "items": "net.corda.data.membership.common.v2.RegistrationStatus" } }, { diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/p2p/v2/SetOwnRegistrationStatus.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/p2p/v2/SetOwnRegistrationStatus.avsc new file mode 100644 index 0000000000..f58ed8ee4c --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/p2p/v2/SetOwnRegistrationStatus.avsc @@ -0,0 +1,21 @@ +{ + "type": "record", + "name": "SetOwnRegistrationStatus", + "namespace": "net.corda.data.membership.p2p.v2", + "doc": "Set the member registration status.", + "fields": [ + { + "name": "registrationId", + "doc": "ID of the registration to set the status.", + "type": { + "type": "string", + "logicalType": "uuid" + } + }, + { + "name": "newStatus", + "doc": "The new registration status.", + "type": "net.corda.data.membership.common.v2.RegistrationStatus" + } + ] +} \ No newline at end of file diff --git a/data/config-schema/src/main/java/net/corda/schema/configuration/MembershipConfig.java b/data/config-schema/src/main/java/net/corda/schema/configuration/MembershipConfig.java index 65ff5397ce..4f57ee2562 100644 --- a/data/config-schema/src/main/java/net/corda/schema/configuration/MembershipConfig.java +++ b/data/config-schema/src/main/java/net/corda/schema/configuration/MembershipConfig.java @@ -12,6 +12,16 @@ private MembershipConfig() { */ public static final String MAX_DURATION_BETWEEN_SYNC_REQUESTS_MINUTES = "maxDurationBetweenSyncRequestsMinutes"; + /** + * The configuration key to get the maximum duration in minutes between polling for expired registration requests. + */ + public static final String MAX_DURATION_BETWEEN_EXPIRED_REGISTRATION_REQUESTS_POLLS = "frequencyOfExpirationPoll"; + + /** + * The configuration key to get the time frame in minutes after which a registration request is considered as expired and gets force declined. + */ + public static final String EXPIRATION_DATE_FOR_REGISTRATION_REQUESTS = "expirationTimeFrame"; + public static final class TtlsConfig { private TtlsConfig() { } diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/membership/1.0/corda.membership.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/membership/1.0/corda.membership.json index be6e1ec153..664165aab7 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/membership/1.0/corda.membership.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/membership/1.0/corda.membership.json @@ -13,6 +13,20 @@ "maximum": 2880, "default": 480 }, + "frequencyOfExpirationPoll": { + "description": "The maximum duration in minutes between polling for expired registration requests.", + "type": "integer", + "minimum": 1, + "maximum": 2880, + "default": 300 + }, + "expirationTimeFrame": { + "description": "The time frame in minutes after which a registration request is considered as expired and gets force declined.", + "type": "integer", + "minimum": 1, + "maximum": 2880, + "default": 180 + }, "TTLs": { "description": "The maximum durations in minutes to wait for different types of message to send. If set to null, Corda waits forever.", "type": "object", diff --git a/gradle.properties b/gradle.properties index b754bfecee..6fdb3d926e 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 = 5 +cordaApiRevision = 6 # Main kotlinVersion = 1.8.21 From a83bee3623141f1d34261a4a1d6c52268995f7f3 Mon Sep 17 00:00:00 2001 From: Ronan Browne Date: Wed, 12 Jul 2023 14:19:32 +0100 Subject: [PATCH 04/19] CORE-5821: fix indentation in snyk file (#1176) --- .snyk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.snyk b/.snyk index ac47111e0b..63aea5eda8 100644 --- a/.snyk +++ b/.snyk @@ -11,7 +11,7 @@ ignore: this vulnerability. expires: 2023-10-19T10:40:55.991Z created: 2022-09-22T10:40:55.995Z - SNYK-JAVA-COMFASTERXMLJACKSONCORE-3038424: + SNYK-JAVA-COMFASTERXMLJACKSONCORE-3038424: - '*': reason: >- Corda5 Shippable artifacts do not make use of dokka-core, which is @@ -20,7 +20,7 @@ ignore: artifacts. expires: 2023-10-19T10:40:55.991Z created: 2022-12-20T10:40:55.995Z - SNYK-JAVA-COMFASTERXMLJACKSONCORE-3038426: + SNYK-JAVA-COMFASTERXMLJACKSONCORE-3038426: - '*': reason: >- Corda5 Shippable artifacts do not make use of dokka-core, which is @@ -29,7 +29,7 @@ ignore: artifacts. expires: 2023-10-19T10:40:55.991Z created: 2022-12-20T10:40:55.995Z - SNYK-JAVA-COMFASTERXMLWOODSTOX-3091135: + SNYK-JAVA-COMFASTERXMLWOODSTOX-3091135: - '*': reason: >- Corda5 Shippable artifacts do not make use of dokka-core, which is From 7e9f75f2d3dc3664ad76206074341b78175ff432 Mon Sep 17 00:00:00 2001 From: Yash Nabar Date: Fri, 14 Jul 2023 11:53:52 +0100 Subject: [PATCH 05/19] CORE-9519 Add schemas for group parameters update (#1175) Adds avro schemas UpdateGroupParameters and DistributeGroupParameters required for group parameters update functionality via MGM API. --- .../DistributeGroupParameters.avsc | 18 ++++++++++++++++++ .../MembershipActionsRequest.avsc | 5 ++++- .../request/MembershipPersistenceRequest.avsc | 1 + .../request/command/UpdateGroupParameters.avsc | 17 +++++++++++++++++ gradle.properties | 2 +- 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/membership/actions.request/DistributeGroupParameters.avsc create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/UpdateGroupParameters.avsc diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/actions.request/DistributeGroupParameters.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/actions.request/DistributeGroupParameters.avsc new file mode 100644 index 0000000000..ab606d18a5 --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/actions.request/DistributeGroupParameters.avsc @@ -0,0 +1,18 @@ +{ + "type": "record", + "name": "DistributeGroupParameters", + "namespace": "net.corda.data.membership.actions.request", + "doc": "Distribute group parameters to the rest of the network.", + "fields": [ + { + "name": "mgm", + "doc": "The membership group manager of the group.", + "type": "net.corda.data.identity.HoldingIdentity" + }, + { + "name": "minimumGroupParametersEpoch", + "doc": "The minimum group parameters epoch to be distributed (if null, the latest version is used). If the group parameters with this epoch have not been published, then the membership actions processor will requeue this request to be retried later.", + "type": ["null", "int"] + } + ] +} \ No newline at end of file diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/actions.request/MembershipActionsRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/actions.request/MembershipActionsRequest.avsc index 628a08cbdd..aab33c3d3b 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/actions.request/MembershipActionsRequest.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/actions.request/MembershipActionsRequest.avsc @@ -7,7 +7,10 @@ { "name": "request", "doc": "Request's payload, depends on the requested action.", - "type": ["DistributeMemberInfo"] + "type": [ + "DistributeMemberInfo", + "DistributeGroupParameters" + ] } ] } \ No newline at end of file diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/MembershipPersistenceRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/MembershipPersistenceRequest.avsc index 5ff7056166..6196ace8db 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/MembershipPersistenceRequest.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/MembershipPersistenceRequest.avsc @@ -31,6 +31,7 @@ "net.corda.data.membership.db.request.command.SuspendMember", "net.corda.data.membership.db.request.command.ActivateMember", "net.corda.data.membership.db.request.command.UpdateStaticNetworkInfo", + "net.corda.data.membership.db.request.command.UpdateGroupParameters", "net.corda.data.membership.db.request.query.QueryGroupPolicy", "net.corda.data.membership.db.request.query.QueryMemberInfo", "net.corda.data.membership.db.request.query.QueryMemberSignature", diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/UpdateGroupParameters.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/UpdateGroupParameters.avsc new file mode 100644 index 0000000000..1694969dbc --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/membership/db/request/command/UpdateGroupParameters.avsc @@ -0,0 +1,17 @@ +{ + "type": "record", + "name": "UpdateGroupParameters", + "namespace": "net.corda.data.membership.db.request.command", + "doc": "Update group parameters", + "fields": [ + { + "name": "update", + "doc": "Updated version of the group parameters.", + "type": + { + "type": "map", + "values": "string" + } + } + ] +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 6fdb3d926e..e68b455f00 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 = 6 +cordaApiRevision = 7 # Main kotlinVersion = 1.8.21 From 1c3ed30dcbb1baccb8e55b62e4b3e5af67f7f082 Mon Sep 17 00:00:00 2001 From: Filipe Oliveira Date: Tue, 18 Jul 2023 09:32:09 +0100 Subject: [PATCH 06/19] CORE-15178 - Allowed the db worker to access the FlowEventTopics. (#1177) Updated the topic permissions to allow the `db worker` to access the topics `services.token.event`, `services.token.event.state`, and `services.token.sync.event`. The `flow worker` was removed from the topics previously mentioned since it no longer requires access to them. --- .../main/resources/net/corda/schema/Services.yaml | 13 ++++++------- gradle.properties | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/data/topic-schema/src/main/resources/net/corda/schema/Services.yaml b/data/topic-schema/src/main/resources/net/corda/schema/Services.yaml index 739be0aff2..7a0de0606a 100644 --- a/data/topic-schema/src/main/resources/net/corda/schema/Services.yaml +++ b/data/topic-schema/src/main/resources/net/corda/schema/Services.yaml @@ -2,7 +2,7 @@ topics: ServicesTokenEventTopic: name: services.token.event consumers: - - flow + - db producers: - flow - db @@ -10,9 +10,9 @@ topics: ServicesTokenEventStateTopic: name: services.token.event.state consumers: - - flow + - db producers: - - flow + - db config: cleanup.policy: compact segment.ms: 600000 @@ -23,16 +23,15 @@ topics: ServicesTokenEventDLQTopic: name: services.token.event.dlq consumers: - - flow + - db producers: - - flow + - db config: ServicesTokenSyncEventTopic: name: services.token.sync.event consumers: - db producers: - - flow - db config: ServicesTokenSyncEventStateTopic: @@ -54,4 +53,4 @@ topics: - db producers: - db - config: \ No newline at end of file + config: diff --git a/gradle.properties b/gradle.properties index e68b455f00..e80dc75aeb 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 = 7 +cordaApiRevision = 8 # Main kotlinVersion = 1.8.21 From ff359407b11b5cf1bac62167160d83185ef81667 Mon Sep 17 00:00:00 2001 From: Ben Yip Date: Tue, 18 Jul 2023 15:57:38 +0100 Subject: [PATCH 07/19] CORE-15539: Increase actor_user column character length (#1179) * Change actor_user length from 36 to 255 --- .../net/corda/db/schema/rbac/migration/rbac-creation-v1.0.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/db-schema/src/main/resources/net/corda/db/schema/rbac/migration/rbac-creation-v1.0.xml b/data/db-schema/src/main/resources/net/corda/db/schema/rbac/migration/rbac-creation-v1.0.xml index 6a109f460c..c0daab5257 100644 --- a/data/db-schema/src/main/resources/net/corda/db/schema/rbac/migration/rbac-creation-v1.0.xml +++ b/data/db-schema/src/main/resources/net/corda/db/schema/rbac/migration/rbac-creation-v1.0.xml @@ -134,7 +134,7 @@ - + From c9bc1de9381642d52c8320fa085ce8043a45ccdd Mon Sep 17 00:00:00 2001 From: Ben Millar <44114751+ben-millar@users.noreply.github.com> Date: Thu, 20 Jul 2023 14:07:40 +0100 Subject: [PATCH 08/19] CORE-9483 Adding clear comments to session send/receive APIs describing accepted types (#1184) --- .../application/messaging/FlowMessaging.java | 19 +++++++++++++++++-- .../v5/application/messaging/FlowSession.java | 18 +++++++++++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/application/src/main/java/net/corda/v5/application/messaging/FlowMessaging.java b/application/src/main/java/net/corda/v5/application/messaging/FlowMessaging.java index f23e0acddb..14c9db118e 100644 --- a/application/src/main/java/net/corda/v5/application/messaging/FlowMessaging.java +++ b/application/src/main/java/net/corda/v5/application/messaging/FlowMessaging.java @@ -128,8 +128,13 @@ public interface FlowMessaging { * Suspends until a message has been received for each session in the specified {@code sessions}. *

* Consider {@link #receiveAllMap(Map)} when sessions are expected to receive different types. + *

+ * The {@code receiveType} should be of a type that is annotated with @CordaSerializable or a primitive type. This + * function cannot handle types that do not meet these criteria. * - * @param receiveType type of object to be received for all {@code sessions}. + * @param type of object to be received for all {@code sessions}. + * @param receiveType Type of object to be received for all {@code sessions}, which should be either a primitive type + * or a type annotated with @CordaSerializable. * @param sessions Set of sessions to receive from. * @return a {@link List} containing the objects received from the {@code sessions}. * @@ -143,6 +148,9 @@ public interface FlowMessaging { * Suspends until a message has been received for each session in the specified {@code sessions}. *

* Consider {@link #receiveAll(Class, Set)} when the same type is expected from all sessions. + *

+ * The types of objects expected to be received should be annotated with @CordaSerializable or be a primitive type. This + * function cannot handle types that do not meet these criteria. * * @param sessions Map of session to the type of object that is expected to be received * @return a {@link Map} containing the objects received by the {@link FlowSession}s who sent them. @@ -159,8 +167,11 @@ public interface FlowMessaging { * Note that the other parties may receive the message at some arbitrary later point or not at all: if one of the provided [sessions] * is offline then message delivery will be retried until the session expires. Sessions are deemed to be expired when this session * stops receiving heartbeat messages from the counterparty within the configurable timeout. + *

+ * The {@code payload} object should be of a type that is annotated with @CordaSerializable or a primitive type. This + * function cannot handle types that do not meet these criteria. * - * @param payload the payload to send. + * @param payload the payload to send, which should be either a primitive type or a type annotated with @CordaSerializable. * @param sessions the sessions to send the provided payload to. * * @throws CordaRuntimeException if any session is closed or in a failed state. @@ -174,8 +185,12 @@ public interface FlowMessaging { * Note that the other parties may receive the message at some arbitrary later point or not at all: if one of the provided [sessions] * is offline then message delivery will be retried until the session expires. Sessions are deemed to be expired when this session * stops receiving heartbeat messages from the counterparty within the configurable timeout. + *

+ * The objects in {@code payloadsPerSession} should be of types that are annotated with @CordaSerializable or be primitive types. This + * function cannot handle types that do not meet these criteria. * * @param payloadsPerSession a mapping that contains the payload to be sent to each session. + * The payloads should be either of primitive types or types annotated with @CordaSerializable. * * @throws CordaRuntimeException if any session is closed or in a failed state. */ diff --git a/application/src/main/java/net/corda/v5/application/messaging/FlowSession.java b/application/src/main/java/net/corda/v5/application/messaging/FlowSession.java index 2672b6395d..4615a0498c 100644 --- a/application/src/main/java/net/corda/v5/application/messaging/FlowSession.java +++ b/application/src/main/java/net/corda/v5/application/messaging/FlowSession.java @@ -71,10 +71,14 @@ public interface FlowSession { * Note that this function is not just a simple send and receive pair. It is more efficient and more correct to use * sendAndReceive when you expect to do a message swap rather than use {@link FlowSession#send} and then * {@link FlowSession#receive}. + *

+ * Both the {@code payload} object and the {@code receiveType} should be of a type that is annotated + * with @CordaSerializable or a primitive type. This function cannot handle types that do not meet these criteria. * * @param The data type received from the counterparty. * @param receiveType The data type received from the counterparty. - * @param payload The data sent to the counterparty. + * @param payload The data sent to the counterparty, which should be either a primitive type + * or a type annotated with @CordaSerializable. * * @return The received data * @@ -87,9 +91,13 @@ public interface FlowSession { /** * Suspends until a message of type is received from {@link #getCounterparty}. + *

+ * The {@code receiveType} should be a type that is annotated with @CordaSerializable or a primitive type. This + * function cannot handle types that do not meet these criteria. * * @param The data type received from the counterparty. - * @param receiveType The data type received from the counterparty. + * @param receiveType The data type received from the counterparty, which should be either a primitive type + * or a type annotated with @CordaSerializable. * * @return The received data * @@ -106,8 +114,12 @@ public interface FlowSession { * Note that the other party may receive the message at some arbitrary later point or not at all: if {@link #getCounterparty} * is offline then message delivery will be retried until it comes back or until the message is older than the * network's event horizon time. + *

+ * The {@code payload} object should be of a type that is annotated with @CordaSerializable or a primitive type. This + * function cannot handle types that do not meet these criteria. * - * @param payload The data sent to the counterparty. + * @param payload The data sent to the counterparty, which should be either a primitive type + * or a type annotated with @CordaSerializable. * * @throws CordaRuntimeException if the session is closed or in a failed state. */ From 9b9c30174a08f02175e19330f1f87a7b143e4a9d Mon Sep 17 00:00:00 2001 From: Yash Nabar Date: Fri, 21 Jul 2023 10:55:25 +0100 Subject: [PATCH 09/19] CORE-10114 Schema update for custom metadata (#1180) Update static registration context and group policy schemas to allow custom properties to be added to the MemberInfo and group parameters. --- .../group/policy/1.0/corda.group.policy.json | 19 +++++++++++++++++++ .../1.0/corda.member.static.registration.json | 5 +++++ gradle.properties | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json b/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json index 092edad2b2..6134018ad1 100644 --- a/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json +++ b/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json @@ -259,6 +259,25 @@ "description": "A member template as a map of values for a member to be added to the static network member list.", "type": "object" } + }, + "groupParameters": { + "description": "Custom key-value properties to be included in the group parameters of a static network.", + "type": "object", + "patternProperties": { + "^ext\\.[a-zA-Z0-9.]+$": { + "description": "Optional. User-specified additional properties, which must be prefixed with `ext.`.", + "type": "string", + "maxLength": 256 + } + }, + "properties": { + "corda.minimum.platform.version": { + "description": "Optional. The minimum platform version of the static network.", + "type": "integer", + "minimum": 50000, + "maximum": 99999 + } + } } } } diff --git a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json index 3d7960e803..cd779bbf27 100644 --- a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json +++ b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json @@ -17,6 +17,11 @@ "description": "Version supported for the flow protocol used by the notary service. Valid only when one of the roles is notary.", "type": "integer", "minimum": 1 + }, + "^ext\\.[a-zA-Z0-9.]+$": { + "description": "Optional. User-specified additional properties, which must be prefixed with `ext.`.", + "type": "string", + "maxLength": 256 } }, "properties": { diff --git a/gradle.properties b/gradle.properties index e80dc75aeb..71830fe65e 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 = 8 +cordaApiRevision = 9 # Main kotlinVersion = 1.8.21 From 29cc7091722cce28155b9d7a277691672edcf22b Mon Sep 17 00:00:00 2001 From: Dimos Raptis Date: Tue, 25 Jul 2023 09:58:29 +0100 Subject: [PATCH 10/19] CORE-11805 - Update json schema spec (#1183) Upgrade json schema spec to 2019-09. --- .../net/corda/schema/configuration/crypto/1.0/corda.crypto.json | 2 +- .../net/corda/schema/configuration/db/1.0/corda.db.json | 2 +- .../externalMessaging/1.0/corda.externalMessaging.json | 2 +- .../net/corda/schema/configuration/flow/1.0/corda.flow.json | 2 +- .../schema/configuration/ledger.utxo/1.0/corda.ledger.utxo.json | 2 +- .../schema/configuration/membership/1.0/corda.membership.json | 2 +- .../schema/configuration/messaging/1.0/corda.messaging.json | 2 +- .../schema/configuration/messaging/1.0/kafka-properties.json | 2 +- .../net/corda/schema/configuration/messaging/1.0/publisher.json | 2 +- .../corda/schema/configuration/messaging/1.0/subscription.json | 2 +- .../schema/configuration/p2p.gateway/1.0/corda.p2p.gateway.json | 2 +- .../p2p.linkManager/1.0/corda.p2p.linkManager.json | 2 +- .../configuration/reconciliation/1.0/corda.reconciliation.json | 2 +- .../net/corda/schema/configuration/rest/1.0/corda.rest.json | 2 +- .../corda/schema/configuration/sandbox/1.0/corda.sandbox.json | 2 +- .../corda/schema/configuration/secrets/1.0/corda.secrets.json | 2 +- .../corda/schema/configuration/security/1.0/corda.security.json | 2 +- .../external.messaging/1.0/corda.external.messaging.json | 2 +- .../corda/schema/configuration/test/1.0/schema-fragment.json | 2 +- .../schema/cordapp/configuration/test/1.0/schema-fragment.json | 2 +- .../schema/membership/group/policy/1.0/corda.group.policy.json | 2 +- .../registration/1.0/corda.member.dynamic.registration.json | 2 +- .../registration/1.0/corda.member.static.registration.json | 2 +- .../membership/mgm/registration/1.0/corda.mgm.registration.json | 2 +- gradle.properties | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/crypto/1.0/corda.crypto.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/crypto/1.0/corda.crypto.json index 9b50493310..62f006c0c6 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/crypto/1.0/corda.crypto.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/crypto/1.0/corda.crypto.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/crypto/1.0/corda.crypto.json", "title": "Corda Crypto Library Configuration Schema", "description": "Configuration schema for the crypto library subsection.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/db/1.0/corda.db.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/db/1.0/corda.db.json index 58bbc27f1c..97cb1c96f1 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/db/1.0/corda.db.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/db/1.0/corda.db.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/db/1.0/corda.db.json", "title": "Corda Database Configuration Schema", "description": "Configuration schema for the database section. Note that this configuration cannot be updated dynamically through the REST endpoint.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/externalMessaging/1.0/corda.externalMessaging.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/externalMessaging/1.0/corda.externalMessaging.json index 9188a6adeb..2adbbcc84e 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/externalMessaging/1.0/corda.externalMessaging.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/externalMessaging/1.0/corda.externalMessaging.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/external.messaging/1.0/corda.external.messaging.json", "title": "Corda External Messaging Configuration Schema", "description": "Configuration schema for external messaging.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.0/corda.flow.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.0/corda.flow.json index 1c1cb5f1c4..5fe591b4b7 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.0/corda.flow.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/flow/1.0/corda.flow.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/flow/1.0/corda.flow.json", "title": "Corda Flow Configuration Schema", "description": "Configuration schema for the flow section.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/ledger.utxo/1.0/corda.ledger.utxo.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/ledger.utxo/1.0/corda.ledger.utxo.json index 686baca7d8..b3d2415539 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/ledger.utxo/1.0/corda.ledger.utxo.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/ledger.utxo/1.0/corda.ledger.utxo.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/ledger/utxo/1.0/corda.ledger.utxo.json", "title": "Corda UTXO ledger Configuration Schema", "description": "Configuration schema for the UTXO ledger.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/membership/1.0/corda.membership.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/membership/1.0/corda.membership.json index 664165aab7..3fc98ff0ec 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/membership/1.0/corda.membership.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/membership/1.0/corda.membership.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/membership/1.0/corda.membership.json", "title": "Corda Membership Configuration Schema", "description": "Configuration schema for the membership subsection.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/corda.messaging.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/corda.messaging.json index baa2ad090a..57eaf5e018 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/corda.messaging.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/corda.messaging.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/messaging/1.0/corda.messaging.json", "title": "Corda Messaging Configuration Schema", "description": "Configuration schema for the messaging section. This configures the interactions of the workers with the underlying message bus.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/kafka-properties.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/kafka-properties.json index da8daba67a..bd04888dc1 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/kafka-properties.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/kafka-properties.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/messaging/1.0/kafka-properties.json", "title": "Kafka properties schema", "description": "Schema container for Kafka properties", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/publisher.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/publisher.json index d8a2cb486f..d751660f0d 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/publisher.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/publisher.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/messaging/1.0/publisher.json", "title": "Publisher configuration", "description": "Settings for all publishers that write to the message bus.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/subscription.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/subscription.json index 0c2a19485b..14113fdcad 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/subscription.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/messaging/1.0/subscription.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/messaging/1.0/subscription.json", "title": "Common subscription configuration", "description": "Configuration settings for all subscriptions to the message bus.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/p2p.gateway/1.0/corda.p2p.gateway.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/p2p.gateway/1.0/corda.p2p.gateway.json index 17b5b8b320..383ebd2c4e 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/p2p.gateway/1.0/corda.p2p.gateway.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/p2p.gateway/1.0/corda.p2p.gateway.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/p2p/1.0/corda.p2p.gateway.json", "title": "Corda P2P Gateway Configuration Schema", "description": "Configuration schema for the P2P gateway.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/p2p.linkManager/1.0/corda.p2p.linkManager.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/p2p.linkManager/1.0/corda.p2p.linkManager.json index 17a94725e2..5177b39dba 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/p2p.linkManager/1.0/corda.p2p.linkManager.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/p2p.linkManager/1.0/corda.p2p.linkManager.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/p2p/1.0/corda.p2p.linkmanager.json", "title": "Corda P2P Link Manager Configuration Schema", "description": "Configuration schema for the P2P link manager.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/reconciliation/1.0/corda.reconciliation.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/reconciliation/1.0/corda.reconciliation.json index 79b0b969c3..8dc1246e5a 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/reconciliation/1.0/corda.reconciliation.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/reconciliation/1.0/corda.reconciliation.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/reconciliation/1.0/corda.reconciliation.json", "title": "Corda Reconciliation Configuration Schema", "description": "Configuration schema for the reconciliation section.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/rest/1.0/corda.rest.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/rest/1.0/corda.rest.json index a4a8ef2ee5..d67fbec7a1 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/rest/1.0/corda.rest.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/rest/1.0/corda.rest.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/rest/1.0/corda.rest.json", "title": "Corda REST Configuration Schema", "description": "Configuration schema for the REST section.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/sandbox/1.0/corda.sandbox.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/sandbox/1.0/corda.sandbox.json index 949d60366e..00fd131199 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/sandbox/1.0/corda.sandbox.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/sandbox/1.0/corda.sandbox.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/sandbox/1.0/corda.sandbox.json", "title": "Corda Sandbox Configuration Schema", "description": "Configuration schema for the sandbox section.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/secrets/1.0/corda.secrets.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/secrets/1.0/corda.secrets.json index 9263d8cc68..3d17366729 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/secrets/1.0/corda.secrets.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/secrets/1.0/corda.secrets.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/secrets/1.0/corda.secrets.json", "title": "Corda Secrets Configuration Schema", "description": "Configuration schema for the secrets subsection.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/security/1.0/corda.security.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/security/1.0/corda.security.json index 5fb1bf49aa..efc6ace176 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/security/1.0/corda.security.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/security/1.0/corda.security.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/security/1.0/corda.security.json", "title": "Corda Security Configuration Schema", "description": "Configuration schema for the security subsection.", diff --git a/data/config-schema/src/main/resources/net/corda/schema/cordapp/configuration/external.messaging/1.0/corda.external.messaging.json b/data/config-schema/src/main/resources/net/corda/schema/cordapp/configuration/external.messaging/1.0/corda.external.messaging.json index 49f8f97a81..b66ee8b294 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/cordapp/configuration/external.messaging/1.0/corda.external.messaging.json +++ b/data/config-schema/src/main/resources/net/corda/schema/cordapp/configuration/external.messaging/1.0/corda.external.messaging.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/cordapp/configuration/external/messaging/1.0/corda.external.messaging.json", "title": "Corda External Messaging Configuration Schema", "description": "Configuration schema for the external messaging.", diff --git a/data/config-schema/src/test/resources/net/corda/schema/configuration/test/1.0/schema-fragment.json b/data/config-schema/src/test/resources/net/corda/schema/configuration/test/1.0/schema-fragment.json index 317eeb8883..9d7b5c31cf 100644 --- a/data/config-schema/src/test/resources/net/corda/schema/configuration/test/1.0/schema-fragment.json +++ b/data/config-schema/src/test/resources/net/corda/schema/configuration/test/1.0/schema-fragment.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/test/1.0/schema-fragment.json", "title": "Test schema fragment", "description": "Schema fragment for testing", diff --git a/data/config-schema/src/test/resources/net/corda/schema/cordapp/configuration/test/1.0/schema-fragment.json b/data/config-schema/src/test/resources/net/corda/schema/cordapp/configuration/test/1.0/schema-fragment.json index 6786c23589..af623850f3 100644 --- a/data/config-schema/src/test/resources/net/corda/schema/cordapp/configuration/test/1.0/schema-fragment.json +++ b/data/config-schema/src/test/resources/net/corda/schema/cordapp/configuration/test/1.0/schema-fragment.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/cordapp/configuration/test/1.0/schema-fragment.json", "title": "Test schema fragment", "description": "Schema fragment for testing", diff --git a/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json b/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json index 6134018ad1..3e7836316b 100644 --- a/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json +++ b/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json", "title": "Corda Group Policy Schema", "description": "Schema for the group policy file included in distributed CPIs.", diff --git a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/dynamic/registration/1.0/corda.member.dynamic.registration.json b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/dynamic/registration/1.0/corda.member.dynamic.registration.json index 7d8733504f..a199df440e 100644 --- a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/dynamic/registration/1.0/corda.member.dynamic.registration.json +++ b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/dynamic/registration/1.0/corda.member.dynamic.registration.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/membership/member/dynamic/registration/1.0/corda.member.dynamic.registration.json", "title": "Corda dynamic member registration context schema", "type": "object", diff --git a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json index cd779bbf27..7876a43859 100644 --- a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json +++ b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json", "title": "Corda static member registration context schema", "description": "Definition of the registration context required for registering a member in a static group.", diff --git a/data/membership-schema/src/main/resources/net/corda/schema/membership/mgm/registration/1.0/corda.mgm.registration.json b/data/membership-schema/src/main/resources/net/corda/schema/membership/mgm/registration/1.0/corda.mgm.registration.json index 1adbcf008b..3247bddfa5 100644 --- a/data/membership-schema/src/main/resources/net/corda/schema/membership/mgm/registration/1.0/corda.mgm.registration.json +++ b/data/membership-schema/src/main/resources/net/corda/schema/membership/mgm/registration/1.0/corda.mgm.registration.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/membership/mgm/registration/1.0/corda.mgm.registration.json", "title": "Corda MGM registration context schema", "type": "object", diff --git a/gradle.properties b/gradle.properties index 71830fe65e..f8e8abf1bc 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 = 9 +cordaApiRevision = 10 # Main kotlinVersion = 1.8.21 From f4b430b39cc1a0736b839e60756351e966a49a41 Mon Sep 17 00:00:00 2001 From: Kyriakos Tharrouniatis Date: Tue, 25 Jul 2023 13:29:02 +0100 Subject: [PATCH 11/19] CORE-13570 Default datasource properties for vnode connections (#1186) Introduces vnode datasource pool configuration for DDL and DML connections as a dynamic config. * adds a dedicated config schema for vnode datasource pool configurations (DDL and DML) with appropriate defaulted values * adds a dedicated section (row) in config DB table for vnode datasource pool configurations --- .../schema/configuration/ConfigKeys.java | 1 + .../VirtualNodeDatasourceConfig.java | 16 +++ .../1.0/corda.vnode.datasource.json | 114 ++++++++++++++++++ .../db/schema/config/db.changelog-master.xml | 2 + .../config/migration/config-creation-v5.1.xml | 19 +++ 5 files changed, 152 insertions(+) create mode 100644 data/config-schema/src/main/java/net/corda/schema/configuration/VirtualNodeDatasourceConfig.java create mode 100644 data/config-schema/src/main/resources/net/corda/schema/configuration/vnode.datasource/1.0/corda.vnode.datasource.json create mode 100644 data/db-schema/src/main/resources/net/corda/db/schema/config/migration/config-creation-v5.1.xml diff --git a/data/config-schema/src/main/java/net/corda/schema/configuration/ConfigKeys.java b/data/config-schema/src/main/java/net/corda/schema/configuration/ConfigKeys.java index 829770651b..7b7ec6b18a 100644 --- a/data/config-schema/src/main/java/net/corda/schema/configuration/ConfigKeys.java +++ b/data/config-schema/src/main/java/net/corda/schema/configuration/ConfigKeys.java @@ -23,6 +23,7 @@ private ConfigKeys() { public static final String RECONCILIATION_CONFIG = "corda.reconciliation"; public static final String MEMBERSHIP_CONFIG = "corda.membership"; public static final String SECURITY_CONFIG = "corda.security"; + public static final String VNODE_DATASOURCE_CONFIG = "corda.vnode.datasource"; // REST public static final String REST_ADDRESS = "address"; diff --git a/data/config-schema/src/main/java/net/corda/schema/configuration/VirtualNodeDatasourceConfig.java b/data/config-schema/src/main/java/net/corda/schema/configuration/VirtualNodeDatasourceConfig.java new file mode 100644 index 0000000000..e90694dffa --- /dev/null +++ b/data/config-schema/src/main/java/net/corda/schema/configuration/VirtualNodeDatasourceConfig.java @@ -0,0 +1,16 @@ +package net.corda.schema.configuration; + +public class VirtualNodeDatasourceConfig { + private VirtualNodeDatasourceConfig() { + } + + public static final String VNODE_DDL_POOL_CONFIG = "pool.ddl"; + public static final String VNODE_DML_POOL_CONFIG = "pool.dml"; + + public static final String VNODE_POOL_MAX_SIZE = "max_size"; + public static final String VNODE_POOL_MIN_SIZE = "min_size"; + public static final String VNODE_POOL_IDLE_TIMEOUT_SECONDS = "idleTimeoutSeconds"; + public static final String VNODE_POOL_MAX_LIFETIME_SECONDS = "maxLifetimeSeconds"; + public static final String VNODE_POOL_KEEPALIVE_TIME_SECONDS = "keepaliveTimeSeconds"; + public static final String VNODE_VALIDATION_TIMEOUT_SECONDS = "validationTimeoutSeconds"; +} diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/vnode.datasource/1.0/corda.vnode.datasource.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/vnode.datasource/1.0/corda.vnode.datasource.json new file mode 100644 index 0000000000..814cd95a3b --- /dev/null +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/vnode.datasource/1.0/corda.vnode.datasource.json @@ -0,0 +1,114 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://corda.r3.com/net/corda/schema/configuration/db/1.0/corda.db.json", + "title": "Corda Virtual Node Datasource Configuration Schema", + "description": "Configuration schema for the Virtual Node Datasource section.", + "type": "object", + "properties": { + "pool": { + "description": "Datasource pool settings.", + "type": "object", + "default": {}, + "properties": { + "ddl": { + "description": "DDL Datasource pool config.", + "type": "object", + "default": {}, + "properties": { + "max_size": { + "description": "The maximum database pool size.", + "type": "integer", + "minimum": 1, + "default": 1 + }, + "min_size": { + "description": "The minimum database pool size. If left null will default to the `max_size` value.", + "default": null, + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ] + }, + "idleTimeoutSeconds": { + "description": "The maximum time (in seconds) a connection can stay idle in the pool. A value of 0 means that idle connections are never removed from the pool.", + "type": "integer", + "minimum": 0, + "default": 120 + }, + "maxLifetimeSeconds": { + "description": "The maximum time (in seconds) a connection can stay in the pool, regardless if it has been idle or has been recently used. If a connection is in-use and has reached \"maxLifetime\" timeout, it will be removed from the pool only when it becomes idle.", + "type": "integer", + "minimum": 1, + "default": 1800 + }, + "keepaliveTimeSeconds": { + "description": "The interval time (in seconds) in which connections will be tested for aliveness. Connections which are no longer alive are removed from the pool. A value of 0 means this check is disabled.", + "type": "integer", + "minimum": 0, + "default": 0 + }, + "validationTimeoutSeconds": { + "description": "The maximum time (in seconds) that the pool will wait for a connection to be validated as alive.", + "type": "integer", + "minimum": 1, + "default": 5 + } + }, + "additionalProperties": false + }, + "dml": { + "description": "DML Datasource pool config.", + "type": "object", + "default": {}, + "properties": { + "max_size": { + "description": "The maximum database pool size.", + "type": "integer", + "minimum": 1, + "default": 10 + }, + "min_size": { + "description": "The minimum database pool size.", + "type": "integer", + "default": 0, + "minimum": 0 + }, + "idleTimeoutSeconds": { + "description": "The maximum time (in seconds) a connection can stay idle in the pool. A value of 0 means that idle connections are never removed from the pool.", + "type": "integer", + "minimum": 0, + "default": 120 + }, + "maxLifetimeSeconds": { + "description": "The maximum time (in seconds) a connection can stay in the pool, regardless if it has been idle or has been recently used. If a connection is in-use and has reached \"maxLifetime\" timeout, it will be removed from the pool only when it becomes idle.", + "type": "integer", + "minimum": 1, + "default": 1800 + }, + "keepaliveTimeSeconds": { + "description": "The interval time (in seconds) in which connections will be tested for aliveness. Connections which are no longer alive are removed from the pool. A value of 0 means this check is disabled.", + "type": "integer", + "minimum": 0, + "default": 0 + }, + "validationTimeoutSeconds": { + "description": "The maximum time (in seconds) that the pool will wait for a connection to be validated as alive.", + "type": "integer", + "minimum": 1, + "default": 5 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "default": {} + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/data/db-schema/src/main/resources/net/corda/db/schema/config/db.changelog-master.xml b/data/db-schema/src/main/resources/net/corda/db/schema/config/db.changelog-master.xml index a3950057bb..555289cace 100644 --- a/data/db-schema/src/main/resources/net/corda/db/schema/config/db.changelog-master.xml +++ b/data/db-schema/src/main/resources/net/corda/db/schema/config/db.changelog-master.xml @@ -6,4 +6,6 @@ + + diff --git a/data/db-schema/src/main/resources/net/corda/db/schema/config/migration/config-creation-v5.1.xml b/data/db-schema/src/main/resources/net/corda/db/schema/config/migration/config-creation-v5.1.xml new file mode 100644 index 0000000000..cda0f02c7e --- /dev/null +++ b/data/db-schema/src/main/resources/net/corda/db/schema/config/migration/config-creation-v5.1.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file From f502069f439b9355684cece28f5825984e3ec6aa Mon Sep 17 00:00:00 2001 From: Kyriakos Tharrouniatis Date: Tue, 25 Jul 2023 14:20:44 +0100 Subject: [PATCH 12/19] Align schema version of vnode datasource schema (#1187) --- .../vnode.datasource/1.0/corda.vnode.datasource.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/config-schema/src/main/resources/net/corda/schema/configuration/vnode.datasource/1.0/corda.vnode.datasource.json b/data/config-schema/src/main/resources/net/corda/schema/configuration/vnode.datasource/1.0/corda.vnode.datasource.json index 814cd95a3b..ea7ce9347b 100644 --- a/data/config-schema/src/main/resources/net/corda/schema/configuration/vnode.datasource/1.0/corda.vnode.datasource.json +++ b/data/config-schema/src/main/resources/net/corda/schema/configuration/vnode.datasource/1.0/corda.vnode.datasource.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2019-09/schema", "$id": "https://corda.r3.com/net/corda/schema/configuration/db/1.0/corda.db.json", "title": "Corda Virtual Node Datasource Configuration Schema", "description": "Configuration schema for the Virtual Node Datasource section.", From 37bc5598c2e3044ef0b3227c342a8d75c3fd1d34 Mon Sep 17 00:00:00 2001 From: Ronan Browne Date: Fri, 28 Jul 2023 10:28:58 +0100 Subject: [PATCH 13/19] CORE-15787: fix downstream compatibility jobs which now compile against J17 (#1190) --- .ci/JenkinsApiCompatibility | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ci/JenkinsApiCompatibility b/.ci/JenkinsApiCompatibility index 9d073b5a2b..2fb1d7ca2e 100644 --- a/.ci/JenkinsApiCompatibility +++ b/.ci/JenkinsApiCompatibility @@ -1,4 +1,6 @@ // Check corda-api compatibility with downstream consumers which implement CordApps @Library('corda-shared-build-pipeline-steps@5.1') _ -cordaApiCompatibilityCheck() +cordaApiCompatibilityCheck( + javaVersion: '17' +) From 667cc4cb619d274234c4f2f8690c9a785c3f0de5 Mon Sep 17 00:00:00 2001 From: Sean Brereton <46895769+seanbrereton@users.noreply.github.com> Date: Fri, 28 Jul 2023 17:40:05 +0100 Subject: [PATCH 14/19] point at public repos (#1173) Co-authored-by: Ronan Browne --- gradle.properties | 1 + settings.gradle | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index cfc16fe71a..b8f9a577a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,6 +24,7 @@ licenseUrl = http://www.apache.org/licenses/LICENSE-2.0.txt # Artifactory artifactoryContextUrl = https://software.r3.com/artifactory +publicArtifactURL = https://download.corda.net/maven # Gradle # dokka need more metaspace - https://github.com/Kotlin/dokka/issues/1405 diff --git a/settings.gradle b/settings.gradle index e1c275f069..cbf2191272 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,7 +15,7 @@ pluginManagement { } } else { maven { - url "$artifactoryContextUrl/corda-releases" + url "${publicArtifactURL}/corda-releases" content { includeGroupByRegex 'net\\.corda\\.plugins(\\..*)?' } @@ -67,7 +67,7 @@ dependencyResolutionManagement { mavenCentral() maven { - url = "$artifactoryContextUrl/corda-dependencies" + url = "${publicArtifactURL}/corda-dependencies" } maven { From 69502c853515c8847f79b81ef8deaa9018c035df Mon Sep 17 00:00:00 2001 From: Yash Nabar Date: Tue, 1 Aug 2023 09:22:03 +0100 Subject: [PATCH 15/19] CORE-15641 Revise character limit on custom metadata values (#1195) Update registration context and group policy schemas to apply revised character limit on custom metadata values. --- .../membership/group/policy/1.0/corda.group.policy.json | 2 +- .../registration/1.0/corda.member.dynamic.registration.json | 4 ++-- .../registration/1.0/corda.member.static.registration.json | 2 +- gradle.properties | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json b/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json index 3e7836316b..908f7217d4 100644 --- a/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json +++ b/data/membership-schema/src/main/resources/net/corda/schema/membership/group/policy/1.0/corda.group.policy.json @@ -267,7 +267,7 @@ "^ext\\.[a-zA-Z0-9.]+$": { "description": "Optional. User-specified additional properties, which must be prefixed with `ext.`.", "type": "string", - "maxLength": 256 + "maxLength": 800 } }, "properties": { diff --git a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/dynamic/registration/1.0/corda.member.dynamic.registration.json b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/dynamic/registration/1.0/corda.member.dynamic.registration.json index a199df440e..b54178bc4c 100644 --- a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/dynamic/registration/1.0/corda.member.dynamic.registration.json +++ b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/dynamic/registration/1.0/corda.member.dynamic.registration.json @@ -51,9 +51,9 @@ "type": "string" }, "^ext\\.[a-zA-Z0-9.]+$": { - "description": "Optional. A user can specify additional properties, they must be prefixed with `ext.`.", + "description": "Optional. User-specified additional properties, which must be prefixed with `ext.`.", "type": "string", - "maxLength": 256 + "maxLength": 800 } }, "properties": { diff --git a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json index 7876a43859..653613198b 100644 --- a/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json +++ b/data/membership-schema/src/main/resources/net/corda/schema/membership/member/static/registration/1.0/corda.member.static.registration.json @@ -21,7 +21,7 @@ "^ext\\.[a-zA-Z0-9.]+$": { "description": "Optional. User-specified additional properties, which must be prefixed with `ext.`.", "type": "string", - "maxLength": 256 + "maxLength": 800 } }, "properties": { diff --git a/gradle.properties b/gradle.properties index 3ddffb4960..da1b836127 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 = 10 +cordaApiRevision = 11 # Main kotlinVersion = 1.8.21 From 120a5d7efd02fe9e6884fb4151b11a84cc6868f8 Mon Sep 17 00:00:00 2001 From: Dan Newton Date: Wed, 2 Aug 2023 09:48:27 +0100 Subject: [PATCH 16/19] CORE-14023 Find ledger transaction and resolve states (#1193) Changes to support retrieving a ledger transaction in one step, including resolving the input and reference states of the transaction and retrieving the transaction's signatures. --- .../FindSignedLedgerTransaction.avsc | 18 ++++ .../persistence/LedgerPersistenceRequest.avsc | 3 +- ...rsistenceRequestSchemaCompatibilityTest.kt | 98 +++++++++++++++++++ gradle.properties | 2 +- 4 files changed, 119 insertions(+), 2 deletions(-) create mode 100644 data/avro-schema/src/main/resources/avro/net/corda/data/ledger/persistence/FindSignedLedgerTransaction.avsc create mode 100644 data/avro-schema/src/test/kotlin/net/corda/data/ledger/persistence/LedgerPersistenceRequestSchemaCompatibilityTest.kt diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/ledger/persistence/FindSignedLedgerTransaction.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/ledger/persistence/FindSignedLedgerTransaction.avsc new file mode 100644 index 0000000000..3f8e2d19e6 --- /dev/null +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/ledger/persistence/FindSignedLedgerTransaction.avsc @@ -0,0 +1,18 @@ +{ + "type": "record", + "name": "FindSignedLedgerTransaction", + "doc": "Retrieve the specified ledger transaction, specified by id. One of several types of ledger persistence request {@link LedgerPersistenceRequest}", + "namespace": "net.corda.data.ledger.persistence", + "fields": [ + { + "name": "id", + "type": "string", + "doc": "The transaction ID, derived from the root hash of its Merkle tree" + }, + { + "name": "transactionStatus", + "type": "string", + "doc": "The status of the transaction" + } + ] +} diff --git a/data/avro-schema/src/main/resources/avro/net/corda/data/ledger/persistence/LedgerPersistenceRequest.avsc b/data/avro-schema/src/main/resources/avro/net/corda/data/ledger/persistence/LedgerPersistenceRequest.avsc index 7ba53d16e7..f45bde6967 100644 --- a/data/avro-schema/src/main/resources/avro/net/corda/data/ledger/persistence/LedgerPersistenceRequest.avsc +++ b/data/avro-schema/src/main/resources/avro/net/corda/data/ledger/persistence/LedgerPersistenceRequest.avsc @@ -38,7 +38,8 @@ "net.corda.data.ledger.persistence.UpdateTransactionStatus", "net.corda.data.persistence.FindWithNamedQuery", "net.corda.data.ledger.persistence.FindSignedGroupParameters", - "net.corda.data.ledger.persistence.PersistSignedGroupParametersIfDoNotExist" + "net.corda.data.ledger.persistence.PersistSignedGroupParametersIfDoNotExist", + "net.corda.data.ledger.persistence.FindSignedLedgerTransaction" ] }, { diff --git a/data/avro-schema/src/test/kotlin/net/corda/data/ledger/persistence/LedgerPersistenceRequestSchemaCompatibilityTest.kt b/data/avro-schema/src/test/kotlin/net/corda/data/ledger/persistence/LedgerPersistenceRequestSchemaCompatibilityTest.kt new file mode 100644 index 0000000000..834a6bb292 --- /dev/null +++ b/data/avro-schema/src/test/kotlin/net/corda/data/ledger/persistence/LedgerPersistenceRequestSchemaCompatibilityTest.kt @@ -0,0 +1,98 @@ +package net.corda.data.ledger.persistence + +import net.corda.data.flow.event.external.ExternalEventContext +import net.corda.data.identity.HoldingIdentity +import net.corda.data.persistence.FindWithNamedQuery +import org.apache.avro.Schema +import org.apache.avro.SchemaCompatibility +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test + +@Suppress("MaxLineLength") +class LedgerPersistenceRequestSchemaCompatibilityTest { + + @Test + fun `LedgerPersistenceRequest schema changes between Corda 5_0 and 5_1 are compatible`() { + val oldSchemaJson = """ + { + "type": "record", + "name": "LedgerPersistenceRequest", + "doc": "Make a persistence request on a ledger. The action is determined by the type of the {@link LedgerPersistenceRequest#request} payload. See also: {@link EntityResponse}, {@link PersistTransaction}", + "namespace": "net.corda.data.ledger.persistence", + "fields": [ + { + "name": "timestamp", + "type": { + "type": "long", + "logicalType": "timestamp-millis" + }, + "doc": "Time ({@link java.time.Instant}) in milliseconds when the record was created." + }, + { + "name": "holdingIdentity", + "type": "net.corda.data.identity.HoldingIdentity", + "doc": "The holding identity of the user making the DB request." + }, + { + "name": "ledgerType", + "type": { + "name": "LedgerTypes", + "type": "enum", + "symbols": ["UTXO","CONSENSUAL"] + }, + "doc": "The type of ledger the request is for." + }, + { + "name": "request", + "doc": "The 'request' that we wish to make to the ledger persistence API.", + "type": [ + "net.corda.data.ledger.persistence.PersistTransaction", + "net.corda.data.ledger.persistence.PersistTransactionIfDoesNotExist", + "net.corda.data.ledger.persistence.FindTransaction", + "net.corda.data.ledger.persistence.FindUnconsumedStatesByType", + "net.corda.data.ledger.persistence.ResolveStateRefs", + "net.corda.data.ledger.persistence.UpdateTransactionStatus", + "net.corda.data.persistence.FindWithNamedQuery", + "net.corda.data.ledger.persistence.FindSignedGroupParameters", + "net.corda.data.ledger.persistence.PersistSignedGroupParametersIfDoNotExist" + ] + }, + { + "name": "flowExternalEventContext", + "type": "net.corda.data.flow.event.external.ExternalEventContext", + "doc": "The context of the external event that this request was sent from." + } + ] + } + """.trimIndent() + + val oldSchema = Schema.Parser() + .addTypes( + mapOf( + HoldingIdentity::class.java.name to HoldingIdentity.`SCHEMA$`, + PersistTransaction::class.java.name to PersistTransaction.`SCHEMA$`, + PersistTransactionIfDoesNotExist::class.java.name to PersistTransactionIfDoesNotExist.`SCHEMA$`, + FindTransaction::class.java.name to FindTransaction.`SCHEMA$`, + FindUnconsumedStatesByType::class.java.name to FindUnconsumedStatesByType.`SCHEMA$`, + ResolveStateRefs::class.java.name to ResolveStateRefs.`SCHEMA$`, + UpdateTransactionStatus::class.java.name to UpdateTransactionStatus.`SCHEMA$`, + FindWithNamedQuery::class.java.name to FindWithNamedQuery.`SCHEMA$`, + FindSignedGroupParameters::class.java.name to FindSignedGroupParameters.`SCHEMA$`, + PersistSignedGroupParametersIfDoNotExist::class.java.name to PersistSignedGroupParametersIfDoNotExist.`SCHEMA$`, + FindSignedLedgerTransaction::class.java.name to FindSignedLedgerTransaction.`SCHEMA$`, + ExternalEventContext::class.java.name to ExternalEventContext.`SCHEMA$`, + ) + ) + .parse(oldSchemaJson) + + val newSchema = LedgerPersistenceRequest.`SCHEMA$` + + val compatibility = SchemaCompatibility.checkReaderWriterCompatibility(newSchema, oldSchema) + + assertEquals( + compatibility.type, + SchemaCompatibility.SchemaCompatibilityType.COMPATIBLE, + "Failed due to incompatible change. ${compatibility.description}" + ) + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index da1b836127..386bafbe49 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 = 11 +cordaApiRevision = 12 # Main kotlinVersion = 1.8.21 From 0393fa08ed5d61efd0b0126e2d6a5d88da459d7e Mon Sep 17 00:00:00 2001 From: Jenny Yang <135036209+jennyang-r3@users.noreply.github.com> Date: Wed, 2 Aug 2023 14:46:40 +0100 Subject: [PATCH 17/19] CORE-15789: upgrade api repo to use Java 17 but compile to 11 bytecode (#1196) upgraded API repo to use Java 17 but made it compile to 11 bytecode --- .ci/JenkinsfileSnykDelta | 3 ++- .ci/nightly/JenkinsfileNightly | 3 ++- .ci/nightly/JenkinsfileSnykScan | 3 ++- Jenkinsfile | 1 + build.gradle | 8 ++++---- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.ci/JenkinsfileSnykDelta b/.ci/JenkinsfileSnykDelta index dbb04113df..edbcec3751 100644 --- a/.ci/JenkinsfileSnykDelta +++ b/.ci/JenkinsfileSnykDelta @@ -2,5 +2,6 @@ snykDelta( snykOrgId: 'corda5-snyk-org-id', - snykTokenId: 'r3-snyk-corda5' + snykTokenId: 'r3-snyk-corda5', + javaVersion: '17' ) diff --git a/.ci/nightly/JenkinsfileNightly b/.ci/nightly/JenkinsfileNightly index eb836f8963..a1b6dbf1f9 100644 --- a/.ci/nightly/JenkinsfileNightly +++ b/.ci/nightly/JenkinsfileNightly @@ -4,5 +4,6 @@ cordaPipelineKubernetesAgent( runIntegrationTests: false, dailyBuildCron: 'H 02 * * *', gradleAdditionalArgs: '-Dscan.tag.Nightly-Build', - generateSbom: true + generateSbom: true, + javaVersion: '17' ) diff --git a/.ci/nightly/JenkinsfileSnykScan b/.ci/nightly/JenkinsfileSnykScan index 5d18b08b68..c654195c7a 100644 --- a/.ci/nightly/JenkinsfileSnykScan +++ b/.ci/nightly/JenkinsfileSnykScan @@ -1,5 +1,6 @@ @Library('corda-shared-build-pipeline-steps@5.1') _ cordaSnykScanPipeline ( - snykTokenId: 'r3-snyk-corda5' + snykTokenId: 'r3-snyk-corda5', + javaVersion: '17' ) diff --git a/Jenkinsfile b/Jenkinsfile index 000dba9570..77b1931115 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,4 +9,5 @@ cordaPipeline( localPublishVersionSuffixOverride: '-beta-9999999999999', // allow publishing artifacts to S3 bucket publishToMavenS3Repository: true, + javaVersion: '17' ) diff --git a/build.gradle b/build.gradle index a701f8e2a6..6781274fb1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import static org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11 import static org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8 -import static org.gradle.api.JavaVersion.VERSION_11 +import static org.gradle.api.JavaVersion.VERSION_17 import static org.gradle.jvm.toolchain.JavaLanguageVersion.of import org.jetbrains.dokka.gradle.DokkaTask @@ -71,7 +71,7 @@ void configureKotlinForOSGi(Configuration configuration) { } def releaseType = System.getenv('RELEASE_TYPE') ?: "SNAPSHOT" -def javaVersion = VERSION_11 +def javaVersion = VERSION_17 logger.quiet("********************** CORDA BUILD **********************") if (!JavaVersion.current().isCompatibleWith(javaVersion)) { @@ -129,8 +129,8 @@ subprojects { tasks.withType(JavaCompile).configureEach { options.compilerArgs << '-parameters' - options.encoding = 'UTF-8' + options.release.set(11) } // Added to support junit5 tests @@ -406,4 +406,4 @@ if (project.hasProperty('generateSBOM')) { artifactoryPublish { publications('sbom') } -} +} \ No newline at end of file From bba7588fbb01eea0bf452cbcca1ebd5cb13a623e Mon Sep 17 00:00:00 2001 From: Ronan Browne Date: Thu, 3 Aug 2023 14:50:45 +0100 Subject: [PATCH 18/19] ES-1061: use correct version of shared pipeline along with correct javaVersion override (#1198) --- .ci/nightly/JenkinsfileWindowsCompatibility | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.ci/nightly/JenkinsfileWindowsCompatibility b/.ci/nightly/JenkinsfileWindowsCompatibility index 73e0c7aec4..ee576237e9 100644 --- a/.ci/nightly/JenkinsfileWindowsCompatibility +++ b/.ci/nightly/JenkinsfileWindowsCompatibility @@ -1,6 +1,7 @@ -@Library('corda-shared-build-pipeline-steps@5.0.1') _ +@Library('corda-shared-build-pipeline-steps@5.1') _ windowsCompatibility( runIntegrationTests: false, - dailyBuildCron: 'H 02 * * *' + dailyBuildCron: 'H 02 * * *', + javaVersion: '17' ) From ae8638305b3a3b42463ac92ffc6a520c67d6ed39 Mon Sep 17 00:00:00 2001 From: Jenny Yang <135036209+jennyang-r3@users.noreply.github.com> Date: Tue, 8 Aug 2023 11:10:26 +0100 Subject: [PATCH 19/19] CORE-15778: add meaningful exception messages in StateRef.parse() (#1199) added an exception in malformed value in StateRef where delimiter, ":", isn't in value & optimised the method by utilising an existing index exception. --- .../net/corda/v5/ledger/utxo/StateRef.java | 10 ++- .../v5/ledger/utxo/StateRefParseTest.java | 62 +++++++++++++++++++ 2 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 ledger/ledger-utxo/src/test/java/net/corda/v5/ledger/utxo/StateRefParseTest.java diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/StateRef.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/StateRef.java index 72baeee3f1..e3a94ff57d 100644 --- a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/StateRef.java +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/StateRef.java @@ -69,12 +69,18 @@ public int getIndex() { * @throws IllegalArgumentException if the specified value cannot be parsed. */ public static StateRef parse(@NotNull final String value, DigestService digestService) { + final int lastIndexOfDelimiter = value.lastIndexOf(DELIMITER); + if (lastIndexOfDelimiter == -1) { + throw new IllegalArgumentException( + MessageFormat.format("Failed to parse a StateRef from the specified value. At least one delimiter ({0}) is expected in value: {1}.", DELIMITER, value) + ); + } + try { - final int lastIndexOfDelimiter = value.lastIndexOf(DELIMITER); final String subStringBeforeDelimiter = value.substring(0, lastIndexOfDelimiter); final String subStringAfterDelimiter = value.substring(lastIndexOfDelimiter + 1); + final int index = Integer.parseUnsignedInt(subStringAfterDelimiter); final SecureHash transactionId = digestService.parseSecureHash(subStringBeforeDelimiter); - final int index = Integer.parseInt(subStringAfterDelimiter); return new StateRef(transactionId, index); } catch (NumberFormatException numberFormatException) { throw new IllegalArgumentException( diff --git a/ledger/ledger-utxo/src/test/java/net/corda/v5/ledger/utxo/StateRefParseTest.java b/ledger/ledger-utxo/src/test/java/net/corda/v5/ledger/utxo/StateRefParseTest.java new file mode 100644 index 0000000000..91219d60b7 --- /dev/null +++ b/ledger/ledger-utxo/src/test/java/net/corda/v5/ledger/utxo/StateRefParseTest.java @@ -0,0 +1,62 @@ +package net.corda.v5.ledger.utxo; + +import net.corda.v5.application.crypto.DigestService; +import net.corda.v5.crypto.SecureHash; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; + + +public class StateRefParseTest { + private static final String DELIMITER = ":"; + private final DigestService digestService = mock(DigestService.class); + + @Test + void parseValidValue() { + final String value = "SHA-256D:ED87C7285E1E34BF5E46302086F76317ACE9B17AEF7BD086EE09A5ACBD17CEA4:0"; + final int lastIndexOfDelimiter = value.lastIndexOf(DELIMITER); + final String subStringBeforeDelimiter = value.substring(0, lastIndexOfDelimiter); + final SecureHash secureHash = mock(SecureHash.class); + + doReturn(secureHash).when(digestService).parseSecureHash(subStringBeforeDelimiter); + + final StateRef stateRef = new StateRef(secureHash, Integer.parseUnsignedInt(value.substring(lastIndexOfDelimiter + 1))); + + Assertions.assertEquals(StateRef.parse(value, digestService).getTransactionId().toString(), stateRef.getTransactionId().toString()); + } + + @Test + void parseMalformedWithZeroDelimiter() { + final String value = "XXX"; + final String errorMessage = assertThrows(IllegalArgumentException.class, () -> StateRef.parse(value, digestService)).getMessage(); + Assertions.assertEquals(String.format("Failed to parse a StateRef from the specified value. At least one delimiter (%s) is expected in value: %s.", DELIMITER, value), errorMessage); + } + + @Test + void parseMalformedIndex() { + final String value = ":asdf:a"; + final String errorMessage = assertThrows(IllegalArgumentException.class, () -> StateRef.parse(value, digestService)).getMessage(); + Assertions.assertEquals(String.format("Failed to parse a StateRef from the specified value. The index is malformed: %s.", value), errorMessage); + } + + @Test + void parseMalformedTransactionId() { + final String value = "SHA-256D:asdf:0"; + final String valueBeforeDelimiter = value.substring(0, value.lastIndexOf(DELIMITER)); + final String digestName = "SHA-256D"; + final String hexString = valueBeforeDelimiter.substring(digestName.length() + 1); + final Integer digestHexStringLength = 64; + + doThrow(new IllegalArgumentException(String.format("Digest algorithm's: \"%s\" required hex string length: %s " + + "is not met by hex string: \"%s\"", digestName, digestHexStringLength, hexString))).when(digestService).parseSecureHash(valueBeforeDelimiter); + + + final String errorMessage = assertThrows(IllegalArgumentException.class, () -> StateRef.parse(value, digestService)).getMessage(); + + Assertions.assertEquals(String.format("Failed to parse a StateRef from the specified value. The transaction ID is malformed: %s.", value), errorMessage); + } +}