Skip to content

Commit

Permalink
Merge branch 'release/os/5.2' into juliaf/DA5-22-Distribution-and-Val…
Browse files Browse the repository at this point in the history
…idation-of-draft-transactions

# Conflicts:
#	gradle.properties
#	ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml
  • Loading branch information
julia-filipczak committed Dec 16, 2023
2 parents f588698 + ea7dd88 commit c83abe5
Show file tree
Hide file tree
Showing 21 changed files with 200 additions and 31 deletions.
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ buildscript {

plugins {
id 'net.corda.cordapp.cordapp-configuration'
id 'org.jetbrains.kotlin.jvm' apply false
id 'org.jetbrains.kotlin.plugin.allopen' apply false
id 'org.jetbrains.kotlin.plugin.jpa' apply false
alias libs.plugins.kotlin.jvm apply false
alias libs.plugins.kotlin.allopen apply false
alias libs.plugins.kotlin.jpa apply false
alias libs.plugins.detekt apply false
alias libs.plugins.snyk
alias libs.plugins.grgit // used for GIT interaction (e.g. extract commit hash)
Expand Down Expand Up @@ -52,11 +52,11 @@ def revision = {
void configureKotlinForOSGi(Configuration configuration) {
configuration.resolutionStrategy {
dependencySubstitution {
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk8') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk7') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-common') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-stdlib') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-reflect') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:$kotlinVersion")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk8') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-jdk7') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
substitute module('org.jetbrains.kotlin:kotlin-stdlib-common') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
substitute module('org.jetbrains.kotlin:kotlin-stdlib') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
substitute module('org.jetbrains.kotlin:kotlin-reflect') using module("org.jetbrains.kotlin:kotlin-osgi-bundle:${libs.versions.kotlinVersion.get()}")
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions corda-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ dependencies {
api project(':serialization')

api(libs.javax.persistence.api)
api('org.jetbrains.kotlin:kotlin-osgi-bundle') {
version {
require kotlinVersion
}
}
api(libs.kotlin.osgi.bundle)
api('org.jetbrains:annotations') {
version {
require jetbrainsAnnotationsVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
"name": "id",
"type": "string",
"doc": "The id of the request corresponding to this response."
},
{
"name": "payload",
"type": [
"null",
"net.corda.data.p2p.crypto.AuthenticatedEncryptedDataMessage",
"net.corda.data.p2p.crypto.AuthenticatedDataMessage"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"type": [
"net.corda.data.virtualnode.VirtualNodeCreateResponse",
"net.corda.data.virtualnode.VirtualNodeStateChangeResponse",
"net.corda.data.virtualnode.VirtualNodeUpdateDbStatusResponse",
"net.corda.data.virtualnode.VirtualNodeDBResetResponse",
"net.corda.data.virtualnode.VirtualNodeManagementResponseFailure",
"net.corda.data.virtualnode.VirtualNodeOperationStatusResponse"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"type": "record",
"name": "VirtualNodeUpdateDbStatusResponse",
"namespace": "net.corda.data.virtualnode",
"fields": [
{
"name": "requestId",
"type": "string"
},
{
"name": "operationType",
"type": "string"
},
{
"name": "virtualNodeOperationStatus",
"type": "net.corda.data.virtualnode.VirtualNodeOperationStatus"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ private FlowConfig() {
public static final String PROCESSING_MAX_RETRY_DELAY = "processing.maxRetryDelay";
public static final String PROCESSING_MAX_FLOW_SLEEP_DURATION = "processing.maxFlowSleepDuration";
public static final String PROCESSING_FLOW_CLEANUP_TIME = "processing.cleanupTime";
public static final String PROCESSING_THREAD_POOL_SIZE = "processing.poolSize";
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ private Subscription() {
public static final String SUBSCRIBE_RETRIES = SUBSCRIPTION + ".subscribeRetries";
public static final String COMMIT_RETRIES = SUBSCRIPTION + ".commitRetries";
public static final String PROCESSOR_TIMEOUT = SUBSCRIPTION + ".processorTimeout";
public static final String PROCESSING_THREAD_POOL_SIZE = SUBSCRIPTION + ".mediator.poolSize";
public static final String PROCESSING_MIN_POOL_RECORD_COUNT = SUBSCRIPTION + ".mediator.minPoolRecordCount";
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@
"minimum": 1000,
"maximum": 2147483647,
"default": 15000
},
"mediator": {
"description": "Settings for the multi source mediator",
"type": "object",
"default": {},
"properties": {
"poolSize": {
"description": "The size of the mediator event processing pool size.",
"type": "integer",
"minimum": 1,
"maximum": 2147483647,
"default": 8
},
"minPoolRecordCount": {
"description": "The minimum number of events in a single mediator processing pool. If the number of records polled is less than this, then the polled records are used in a single pool.",
"type": "integer",
"minimum": 1,
"maximum": 2147483647,
"default": 20
}
}
}
},
"additionalProperties": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ cordaProductVersion = 5.2.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=17
cordaApiRevision = 17

# Main
kotlinVersion = 1.8.21
kotlin.stdlib.default.dependency = false

# These are the same annotations that Kotlin uses.
Expand All @@ -34,4 +33,4 @@ org.gradle.caching = true
gradleEnterpriseUrl = https://gradle.dev.r3.com

# Kotlin build
kotlin.build.report.output=file,build_scan
kotlin.build.report.output=file,build_scan
17 changes: 13 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ slf4jVersion = { strictly = "1.7.36" }
# Main implementation dependencies
avroVersion = "1.11.3"
commonsCompressVersion = "1.25.0"
bouncycastleVersion = "1.73"
bouncycastleVersion = "1.77"
javaxPersistenceApiVersion = "2.2"
jacksonVersion = "2.16.0"
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"
junitVersion = "5.10.1"
mockitoVersion = "5.3.0"
mockitoKotlinVersion = "4.1.0"
mockitoKotlinVersion = "5.2.1"

# Plugins
artifactoryVersion = "4.28.2"
Expand All @@ -31,7 +31,7 @@ detektVersion = "1.23.4"
dependencyCheckVersion = "0.46.0"
gradleDataVersion = "1.8.2"
gradleEnterpriseVersion = "3.14.1"
grgitVersion = "5.2.0"
grgitVersion = "5.2.1"
snykVersion = "0.4"
taskTreeVersion = "2.1.1"

Expand All @@ -46,6 +46,12 @@ jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-datab
jackson-kotlin = { group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version.ref = "jacksonVersion" }
jackson-yaml = { group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-yaml", version.ref = "jacksonVersion" }
assertj-core = { group = "org.assertj", name = "assertj-core", version.ref = "assertjVersion" }
kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlinVersion" }
kotlin-stdlib-common = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-common", version.ref = "kotlinVersion" }
kotlin-stdlib-jdk7 = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk7", version.ref = "kotlinVersion" }
kotlin-stdlib-jdk8 = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib-jdk8", version.ref = "kotlinVersion" }
kotlin-osgi-bundle = { group = "org.jetbrains.kotlin", name = "kotlin-osgi-bundle", version.ref = "kotlinVersion" }
kotlin-reflect= { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlinVersion" }
kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlinVersion" }
junit = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junitVersion" }
junit-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junitVersion" }
Expand Down Expand Up @@ -80,5 +86,8 @@ dokka = { id = "org.jetbrains.dokka", version.ref = "dokkaVersion" }
gradle-data = { id = "com.gradle.common-custom-user-data-gradle-plugin", version.ref = "gradleDataVersion" }
gradle-enterprise = { id = "com.gradle.enterprise", version.ref = "gradleEnterpriseVersion" }
grgit = { id = "org.ajoberstar.grgit", version.ref = "grgitVersion" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlinVersion" }
kotlin-allopen = { id = "org.jetbrains.kotlin.plugin.allopen", version.ref = "kotlinVersion" }
kotlin-jpa = { id = "org.jetbrains.kotlin.plugin.jpa", version.ref = "kotlinVersion" }
snyk = { id = "io.snyk.gradle.plugin.snykplugin", version.ref = "snykVersion" }
task-tree = { id = "com.dorongold.task-tree", version.ref = "taskTreeVersion" }
54 changes: 51 additions & 3 deletions ledger/ledger-utxo/scans/corda-ledger-utxo-5.2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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<net.corda.v5.application.crypto.DigitalSignatureAndMetadata>
keyIdToNotaryKeys:
annotation:
- NotNull
type: "java.util.Map<String, java.util.Map<net.corda.v5.crypto.SecureHash,\
\ java.security.PublicKey>>"
net.corda.v5.ledger.utxo.StateAndRef:
annotations:
- CordaSerializable
Expand Down Expand Up @@ -538,6 +568,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
sendWireTransaction:
annotations:
- Suspendable
Expand Down Expand Up @@ -1650,6 +1690,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<net.corda.v5.ledger.utxo.StateAndRef<?>>
referenceStateAndRefs:
annotation: []
type: java.util.List<net.corda.v5.ledger.utxo.StateAndRef<?>>
net.corda.v5.ledger.utxo.transaction.UtxoTransactionBuilder:
annotations:
- DoNotImplement
Expand Down Expand Up @@ -1910,7 +1957,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:
Expand Down Expand Up @@ -2044,10 +2092,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<net.corda.v5.ledger.utxo.ContractState>
type: java.util.List<Integer>
withOutputStatesSize:
annotations:
- Suspendable
Expand Down
Original file line number Diff line number Diff line change
@@ -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<DigitalSignatureAndMetadata> signatures,
@NotNull Map<String, Map<SecureHash, PublicKey>> keyIdToNotaryKeys
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<StateAndRef<?>> inputStateAndRefs, List<StateAndRef<?>> referenceStateAndRefs);
}
Loading

0 comments on commit c83abe5

Please sign in to comment.