diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f5a90dc2cf..c320902c02 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,7 +5,9 @@ Jenkinsfile @corda/blt .ci/** @corda/blt -gradle/* @corda/blt +gradle/wrapper @corda/blt +*.toml @corda/corda5-team-leads + *.gradle @corda/blt gradle.properties @corda/corda5-team-leads diff --git a/data/config-schema/src/main/java/net/corda/schema/configuration/BootConfig.java b/data/config-schema/src/main/java/net/corda/schema/configuration/BootConfig.java index 219239b23d..555cdaec4f 100644 --- a/data/config-schema/src/main/java/net/corda/schema/configuration/BootConfig.java +++ b/data/config-schema/src/main/java/net/corda/schema/configuration/BootConfig.java @@ -48,4 +48,5 @@ private BootConfig() { public static final String UNIQUENESS_WORKER_REST_ENDPOINT = BOOT_WORKER_SERVICE + ".endpoints.uniqueness"; public static final String PERSISTENCE_WORKER_REST_ENDPOINT = BOOT_WORKER_SERVICE + ".endpoints.persistence"; public static final String TOKEN_SELECTION_WORKER_REST_ENDPOINT = BOOT_WORKER_SERVICE + ".endpoints.tokenSelection"; + public static final String P2P_LINK_MANAGER_WORKER_REST_ENDPOINT = BOOT_WORKER_SERVICE + ".endpoints.p2pLinkManager"; } 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 b932a5fd2e..a9dfc3fd56 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 @@ -72,7 +72,8 @@ "examples": [ "true", "false" - ] + ], + "default": "true" }, "corda.notary.service.flow.protocol.name": { "description": "Name of the flow protocol used by the notary service. Valid only when one of the roles is notary.", 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 aa7a14897e..8ff0827688 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 @@ -47,7 +47,8 @@ "examples": [ "true", "false" - ] + ], + "default": "true" }, "corda.notary.service.flow.protocol.name": { "description": "Name of the flow protocol used by the notary service. Valid only when one of the roles is notary.", diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b9eda79c90..3892ac59bb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,7 @@ osgiVersion = "8.0.0" osgiAnnotationVersion = "8.1.0" osgiSvcAnnotationVersion = "1.5.1" bndVersion = "6.4.0" -bndlibVersion = "6.4.1" +bndlibVersion = "7.0.0" # Testing assertjVersion = "3.24.2" diff --git a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml index b8e6f03588..273a6c7a42 100644 --- a/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml +++ b/ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml @@ -145,6 +145,36 @@ net.corda.v5.ledger.utxo.FinalizationResult: default: false type: public abstract returnType: net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction +net.corda.v5.ledger.utxo.NotarySignatureVerificationService: + annotations: + - DoNotImplement + type: public interface + extends: [] + interface: true + methods: + verifyNotarySignatures: + annotations: [] + default: false + type: public abstract + returnType: void + params: + transaction: + annotation: + - NotNull + type: net.corda.v5.ledger.common.transaction.TransactionWithMetadata + notaryKey: + annotation: + - NotNull + type: java.security.PublicKey + signatures: + annotation: + - NotNull + type: java.util.List + keyIdToNotaryKeys: + annotation: + - NotNull + type: "java.util.Map>" net.corda.v5.ledger.utxo.StateAndRef: annotations: - CordaSerializable @@ -526,6 +556,16 @@ net.corda.v5.ledger.utxo.UtxoLedgerService: annotation: - NotNull type: net.corda.v5.application.messaging.FlowSession + verify: + annotations: + - Suspendable + default: false + type: public abstract + returnType: void + params: + ledgerTransaction: + annotation: [] + type: net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction net.corda.v5.ledger.utxo.VisibilityChecker: annotations: - DoNotImplement @@ -1623,6 +1663,13 @@ net.corda.v5.ledger.utxo.transaction.UtxoSignedTransaction: default: false type: public abstract returnType: net.corda.v5.ledger.utxo.transaction.UtxoLedgerTransaction + params: + inputStateAndRefs: + annotation: [] + type: java.util.List> + referenceStateAndRefs: + annotation: [] + type: java.util.List> net.corda.v5.ledger.utxo.transaction.UtxoTransactionBuilder: annotations: - DoNotImplement @@ -1883,7 +1930,8 @@ net.corda.v5.ledger.utxo.transaction.filtered.UtxoFilteredTransaction: - CordaSerializable - DoNotImplement type: public interface - extends: [] + extends: + - net.corda.v5.ledger.common.transaction.TransactionWithMetadata interface: true methods: getCommands: @@ -2017,10 +2065,10 @@ net.corda.v5.ledger.utxo.transaction.filtered.UtxoFilteredTransactionBuilder: type: public abstract returnType: net.corda.v5.ledger.utxo.transaction.filtered.UtxoFilteredTransactionBuilder params: - predicate: + indexes: annotation: - NotNull - type: java.util.function.Predicate + type: java.util.List withOutputStatesSize: annotations: - Suspendable diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/NotarySignatureVerificationService.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/NotarySignatureVerificationService.java new file mode 100644 index 0000000000..fd280192ba --- /dev/null +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/NotarySignatureVerificationService.java @@ -0,0 +1,31 @@ +package net.corda.v5.ledger.utxo; + +import net.corda.v5.application.crypto.DigitalSignatureAndMetadata; +import net.corda.v5.base.annotations.DoNotImplement; +import net.corda.v5.crypto.SecureHash; +import net.corda.v5.ledger.common.transaction.TransactionSignatureException; +import net.corda.v5.ledger.common.transaction.TransactionWithMetadata; +import org.jetbrains.annotations.NotNull; +import java.security.PublicKey; +import java.util.List; +import java.util.Map; + +@DoNotImplement +public interface NotarySignatureVerificationService { + + /** + * Verifies given transaction by id is signed by the notary signatures. + * + * @param transaction that is expected to be signed over + * @param notaryKey that is expected to be signed with + * @param signatures to verify + * @param keyIdToNotaryKeys a map of keyId to notaryKeys + * @throws TransactionSignatureException if verification of given signatures failed. + */ + void verifyNotarySignatures( + @NotNull TransactionWithMetadata transaction, + @NotNull PublicKey notaryKey, + @NotNull List signatures, + @NotNull Map> keyIdToNotaryKeys + ); +} \ No newline at end of file diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java index 890bcc1587..09e3bf7ce7 100644 --- a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/UtxoLedgerService.java @@ -37,6 +37,14 @@ public interface UtxoLedgerService { @Suspendable UtxoTransactionBuilder createTransactionBuilder(); + /** + * Verifies {@link UtxoLedgerTransaction}. + * + * @param ledgerTransaction The {@link UtxoLedgerTransaction} to verify. + */ + @Suspendable + void verify(UtxoLedgerTransaction ledgerTransaction); + /** * Resolves the specified {@link StateRef} instances into {@link StateAndRef} instances of the specified {@link ContractState} type. * diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/UtxoSignedTransaction.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/UtxoSignedTransaction.java index c85fe7721a..f46eb02476 100644 --- a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/UtxoSignedTransaction.java +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/UtxoSignedTransaction.java @@ -121,4 +121,15 @@ public interface UtxoSignedTransaction extends TransactionWithMetadata { @NotNull @Suspendable UtxoLedgerTransaction toLedgerTransaction(); + + /** + * Converts the current {@link UtxoSignedTransaction} into a {@link UtxoLedgerTransaction}. + * + * @param inputStateAndRefs input state and state refs associated with the {@link UtxoSignedTransaction} + * @param referenceStateAndRefs reference state and state refs + * @return Returns a {@link UtxoLedgerTransaction} from the current {@link UtxoSignedTransaction}. + */ + @NotNull + @Suspendable + UtxoLedgerTransaction toLedgerTransaction(List> inputStateAndRefs, List> referenceStateAndRefs); } diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/filtered/UtxoFilteredTransaction.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/filtered/UtxoFilteredTransaction.java index 6d92b9288f..8146a3576b 100644 --- a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/filtered/UtxoFilteredTransaction.java +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/filtered/UtxoFilteredTransaction.java @@ -6,6 +6,7 @@ import net.corda.v5.base.types.MemberX500Name; import net.corda.v5.crypto.SecureHash; import net.corda.v5.ledger.common.transaction.TransactionMetadata; +import net.corda.v5.ledger.common.transaction.TransactionWithMetadata; import net.corda.v5.ledger.utxo.Command; import net.corda.v5.ledger.utxo.StateAndRef; import net.corda.v5.ledger.utxo.StateRef; @@ -36,7 +37,7 @@ */ @CordaSerializable @DoNotImplement -public interface UtxoFilteredTransaction { +public interface UtxoFilteredTransaction extends TransactionWithMetadata { /** * Gets the ID of the current transaction. diff --git a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/filtered/UtxoFilteredTransactionBuilder.java b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/filtered/UtxoFilteredTransactionBuilder.java index 663cbbd8c5..63e5f7b40c 100644 --- a/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/filtered/UtxoFilteredTransactionBuilder.java +++ b/ledger/ledger-utxo/src/main/java/net/corda/v5/ledger/utxo/transaction/filtered/UtxoFilteredTransactionBuilder.java @@ -9,6 +9,7 @@ import org.jetbrains.annotations.NotNull; import java.security.PublicKey; +import java.util.List; import java.util.function.Predicate; /** @@ -178,6 +179,19 @@ public interface UtxoFilteredTransactionBuilder { @Suspendable UtxoFilteredTransactionBuilder withOutputStates(@NotNull Predicate predicate); + /** + * Includes an audit proof of the output state refs component group from a {@link UtxoSignedTransaction} in the + * current {@link UtxoFilteredTransaction}. + * + * @param indexes indexes of transaction to include its output to {@link UtxoFilteredTransaction} + * @return Returns the current {@link UtxoFilteredTransaction} including the filtered output state refs component + * group. + */ + @Suspendable + @NotNull + UtxoFilteredTransactionBuilder withOutputStates(@NotNull List indexes); + + /** * Includes a size proof of the commands component group from a {@link UtxoSignedTransaction} in the current * {@link UtxoFilteredTransaction}.