From 4c944f048ce193117ebe9ae1d196c92193bb6967 Mon Sep 17 00:00:00 2001 From: Ritu Gupta Date: Thu, 5 Mar 2020 12:12:05 +0000 Subject: [PATCH 1/4] [NOTICK] The list added for Bugs and Storys without Epic link --- docs/source/release-notes.rst | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/docs/source/release-notes.rst b/docs/source/release-notes.rst index ff9c00a567..6c0309d3ad 100644 --- a/docs/source/release-notes.rst +++ b/docs/source/release-notes.rst @@ -63,6 +63,43 @@ For more information on platform version, please see :doc:`versioning`. For more Issues Fixed ~~~~~~~~~~~~ +* A failure response from Doorman during initial registration causes a class cast exception [`CORDA-2744 `_] +* Add an exception for Unrecoverable RPC errors [`CORDA-3192 `_] +* Fix the misleading Flow has been waiting message [`CORDA-3197 `_] +* Update Quasar agent so that we can exclude entire ClassLoaders from being instrumented [`CORDA-3228 `_] +* Don't fail on liquibase errors when using H2 [`CORDA-3302 `_] +* Exceptions thrown in raw vault observers can cause critical issues [`CORDA-3329 `_] +* Migration from Corda 3.x to 4.x for PostgreSQL require a manual workaround [`CORDA-3348 `_] +* Prepare DJVM library for 1.0 release [`CORDA-3377 `_] +* Improve node configuration override documentation [`CORDA-3386 `_] +* Allow EvolutionSerializer to handle primitive types becoming nullable [`CORDA-3390 `_] +* Fix caching of local AMQPSerializer [`CORDA-3392 `_] +* Fixed NPE in BlobInspector [`CORDA-3396 `_] +* Update DemoBench so that using the DJVM is configurable [`CORDA-3406 `_] +* Scanning for Custom Serializers in the context of transaction verification is broken [`CORDA-3464 `_] +* Allow EvolutionSerializer to handle boxed types becoming primitive [`CORDA-3469 `_] +* Create interface to perform transactional operations from custom CordaServices [`CORDA-3471 `_] +* Fix typo in node database table documentation [`CORDA-3476 `_] +* Fix node database page [`CORDA-3477 `_] +* Add timestamp column to NODE_TRANSACTIONS table [`CORDA-3479 `_] +* Support adding new mandatory field and removal of optional [`CORDA-3489 `_] +* Fix link to network builder [`CORDA-3495 `_] +* Provide option for user to specify custom serializers without classpath scanning [`CORDA-3501 `_] +* The CordaRPCClientConfiguration is not respected when GracefulReconnect is used [`CORDA-3507 `_] +* Fix for Could not start flow as connection failed error on starting flow via ShellCli if user is not authorized to use this flow [`CORDA-3513 `_] +* Support whitelists and custom serializers inside the DJVM [`CORDA-3523 `_] +* Load DJVM serialization types more precisely to avoid runtime warnings [`CORDA-3536 `_] +* Use the config values for reconnecting retry interval and max reconnect attempts [`CORDA-3542 `_] +* SSH memory leak and security [`CORDA-3520 `_] +* Remove support for outdated ciphers and algorithms from SSH [`CORDA-3550 `_] +* Deserialization using the DJVM creates too many SerializerFactory objects [`CORDA-3552 `_] +* Allow initial registration errors to propagate up so the node exits with a failure code [`CORDA-3558 `_] +* Remove reference to man run [`CORDA-3559 `_] +* Always add TestCordapps to the classpath when building _driverSerializationEnv [`CORDA-3566 `_] +* Use the connectionMaxRetryInterval configuration when reconnection the RPC client [`CORDA-3576 `_] +* Update docs for X500 name and SSH hostkey [`CORDA-3585 `_] +* hashLookup command help misspelling [`CORDA-3587 `_] +* Exit the InteractiveShell on shutdown command [`CORDA-3593 `_]* A failure response from Doorman during initial registration causes a class cast exception [`CORDA-2744 `_] .. _release_notes_v4_3: From 2c2d7e938a38129900826b4ffc332c7ee7b7f0e4 Mon Sep 17 00:00:00 2001 From: Ritu Gupta Date: Thu, 5 Mar 2020 15:06:20 +0000 Subject: [PATCH 2/4] [NOTICK] The list added for Bugs and Storys without Epic link --- docs/source/release-notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/release-notes.rst b/docs/source/release-notes.rst index 6c0309d3ad..67291c790e 100644 --- a/docs/source/release-notes.rst +++ b/docs/source/release-notes.rst @@ -99,7 +99,7 @@ Issues Fixed * Use the connectionMaxRetryInterval configuration when reconnection the RPC client [`CORDA-3576 `_] * Update docs for X500 name and SSH hostkey [`CORDA-3585 `_] * hashLookup command help misspelling [`CORDA-3587 `_] -* Exit the InteractiveShell on shutdown command [`CORDA-3593 `_]* A failure response from Doorman during initial registration causes a class cast exception [`CORDA-2744 `_] +* Exit the InteractiveShell on shutdown command [`CORDA-3593 `_] .. _release_notes_v4_3: From e5a8888232ae087ec69a1ba9d26441114860024c Mon Sep 17 00:00:00 2001 From: Rick Parker Date: Thu, 5 Mar 2020 17:39:55 +0000 Subject: [PATCH 3/4] CORDA-3644: Add Corda-Testing tag to test artifacts' MANIFEST.MF. (#6032) --- client/mock/build.gradle | 8 ++++++- .../dbfailure/dbfcontracts/build.gradle | 7 ++++++- .../dbfailure/dbfworkflows/build.gradle | 7 ++++++- testing/node-driver/build.gradle | 5 +++++ .../testing/node/internal/DriverDSLImpl.kt | 21 +++++++++++++++---- testing/smoke-test-utils/build.gradle | 8 +++++++ testing/test-cli/build.gradle | 10 +++++---- testing/test-common/build.gradle | 5 +++++ testing/test-db/build.gradle | 5 +++++ testing/test-utils/build.gradle | 5 +++++ 10 files changed, 70 insertions(+), 11 deletions(-) diff --git a/client/mock/build.gradle b/client/mock/build.gradle index 3cebd33402..712ada2bf1 100644 --- a/client/mock/build.gradle +++ b/client/mock/build.gradle @@ -29,7 +29,13 @@ dependencies { jar { baseName 'corda-mock' manifest { - attributes 'Automatic-Module-Name': 'net.corda.client.mock' + attributes( + 'Automatic-Module-Name': 'net.corda.client.mock', + + // This JAR is part of Corda's testing framework. + // Driver will not include it as part of an out-of-process node. + 'Corda-Testing': true + ) } } diff --git a/testing/cordapps/dbfailure/dbfcontracts/build.gradle b/testing/cordapps/dbfailure/dbfcontracts/build.gradle index 76dd8b8082..8767f08a31 100644 --- a/testing/cordapps/dbfailure/dbfcontracts/build.gradle +++ b/testing/cordapps/dbfailure/dbfcontracts/build.gradle @@ -13,6 +13,11 @@ dependencies { compile project(":core") } -jar{ +jar { baseName "testing-dbfailure-contracts" + manifest { + // This JAR is part of Corda's testing framework. + // Driver will not include it as part of an out-of-process node. + attributes('Corda-Testing': true) + } } \ No newline at end of file diff --git a/testing/cordapps/dbfailure/dbfworkflows/build.gradle b/testing/cordapps/dbfailure/dbfworkflows/build.gradle index 571a3cb3a5..26e0058cc5 100644 --- a/testing/cordapps/dbfailure/dbfworkflows/build.gradle +++ b/testing/cordapps/dbfailure/dbfworkflows/build.gradle @@ -7,6 +7,11 @@ dependencies { compile project(":testing:cordapps:dbfailure:dbfcontracts") } -jar{ +jar { baseName "testing-dbfailure-workflows" + manifest { + // This JAR is part of Corda's testing framework. + // Driver will not include it as part of an out-of-process node. + attributes('Corda-Testing': true) + } } \ No newline at end of file diff --git a/testing/node-driver/build.gradle b/testing/node-driver/build.gradle index 152abc037d..02664e0a38 100644 --- a/testing/node-driver/build.gradle +++ b/testing/node-driver/build.gradle @@ -66,6 +66,11 @@ task integrationTest(type: Test) { jar { baseName 'corda-node-driver' + manifest { + // This JAR is part of Corda's testing framework. + // Driver will not include it as part of an out-of-process node. + attributes('Corda-Testing': true) + } } publish { diff --git a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt index c3c5037470..744f455c6b 100644 --- a/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt +++ b/testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt @@ -1,3 +1,4 @@ +@file:Suppress("TooManyFunctions") package net.corda.testing.node.internal import co.paralleluniverse.fibers.instrument.JavaAgent @@ -112,6 +113,7 @@ import java.util.concurrent.TimeUnit import java.util.concurrent.TimeoutException import java.util.concurrent.atomic.AtomicInteger import java.util.jar.JarInputStream +import java.util.jar.Manifest import kotlin.collections.ArrayList import kotlin.collections.HashMap import kotlin.collections.HashSet @@ -806,6 +808,8 @@ class DriverDSLImpl( Permissions.invokeRpc(CordaRPCOps::killFlow) ) + private const val CORDA_TESTING_ATTRIBUTE = "Corda-Testing" + private val CORDAPP_MANIFEST_ATTRIBUTES: List = unmodifiableList(listOf( CORDAPP_CONTRACT_NAME, CORDAPP_CONTRACT_LICENCE, @@ -952,7 +956,7 @@ class DriverDSLImpl( val cpPathEntry = Paths.get(cpEntry) cpPathEntry.isRegularFile() && !isTestArtifact(cpPathEntry.fileName.toString()) - && !cpPathEntry.isCorDapp + && !cpPathEntry.isExcludedJar } return ProcessUtilities.startJavaProcess( @@ -980,12 +984,21 @@ class DriverDSLImpl( || name.startsWith("mockito") } + // Identify Corda's own testing framework by attribute in MANIFEST.MF. + private fun isTestArtifact(manifest: Manifest): Boolean { + return manifest[CORDA_TESTING_ATTRIBUTE] != null + } + // Identify CorDapp JARs by their attributes in MANIFEST.MF. - private val Path.isCorDapp: Boolean get() { + private fun isCordapp(manifest: Manifest): Boolean { + return CORDAPP_MANIFEST_ATTRIBUTES.any { manifest[it] != null } + || (manifest[TARGET_PLATFORM_VERSION] != null && manifest[MIN_PLATFORM_VERSION] != null) + } + + private val Path.isExcludedJar: Boolean get() { return JarInputStream(Files.newInputStream(this).buffered()).use { jar -> val manifest = jar.manifest ?: return false - CORDAPP_MANIFEST_ATTRIBUTES.any { manifest[it] != null } - || (manifest[TARGET_PLATFORM_VERSION] != null && manifest[MIN_PLATFORM_VERSION] != null) + isCordapp(manifest) || isTestArtifact(manifest) } } diff --git a/testing/smoke-test-utils/build.gradle b/testing/smoke-test-utils/build.gradle index 0868951903..0a1023a061 100644 --- a/testing/smoke-test-utils/build.gradle +++ b/testing/smoke-test-utils/build.gradle @@ -7,3 +7,11 @@ dependencies { compile project(':test-common') compile project(':client:rpc') } + +tasks.named('jar', Jar) { + manifest { + // This JAR is part of Corda's testing framework. + // Driver will not include it as part of an out-of-process node. + attributes('Corda-Testing': true) + } +} \ No newline at end of file diff --git a/testing/test-cli/build.gradle b/testing/test-cli/build.gradle index ac45c22be9..a668c605f4 100644 --- a/testing/test-cli/build.gradle +++ b/testing/test-cli/build.gradle @@ -14,10 +14,12 @@ dependencies { testRuntimeOnly "org.junit.vintage:junit-vintage-engine:${junit_vintage_version}" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junit_jupiter_version}" testRuntimeOnly "org.junit.platform:junit-platform-launcher:${junit_platform_version}" - } -compileKotlin { - kotlinOptions { - languageVersion = "1.2" + +tasks.named('jar', Jar) { + manifest { + // This JAR is part of Corda's testing framework. + // Driver will not include it as part of an out-of-process node. + attributes('Corda-Testing': true) } } \ No newline at end of file diff --git a/testing/test-common/build.gradle b/testing/test-common/build.gradle index f522d75d40..f3d667e49a 100644 --- a/testing/test-common/build.gradle +++ b/testing/test-common/build.gradle @@ -25,6 +25,11 @@ dependencies { jar { baseName 'corda-test-common' + manifest { + // This JAR is part of Corda's testing framework. + // Driver will not include it as part of an out-of-process node. + attributes('Corda-Testing': true) + } } publish { diff --git a/testing/test-db/build.gradle b/testing/test-db/build.gradle index f4e906addb..3be30d52fe 100644 --- a/testing/test-db/build.gradle +++ b/testing/test-db/build.gradle @@ -16,6 +16,11 @@ dependencies { jar { baseName 'corda-test-db' + manifest { + // This JAR is part of Corda's testing framework. + // Driver will not include it as part of an out-of-process node. + attributes('Corda-Testing': true) + } } publish { diff --git a/testing/test-utils/build.gradle b/testing/test-utils/build.gradle index 797c607c70..f8a85f6607 100644 --- a/testing/test-utils/build.gradle +++ b/testing/test-utils/build.gradle @@ -36,6 +36,11 @@ dependencies { jar { baseName 'corda-test-utils' + manifest { + // This JAR is part of Corda's testing framework. + // Driver will not include it as part of an out-of-process node. + attributes('Corda-Testing': true) + } } publish { From 5b50ef49bcca2d1be8bb0604e1be167e3bb5da24 Mon Sep 17 00:00:00 2001 From: Adel El-Beik <48713346+adelel1@users.noreply.github.com> Date: Fri, 6 Mar 2020 09:14:36 +0000 Subject: [PATCH 4/4] CORDA-3651: addManifest now uses separate files for reading and writing. (#6026) * CORDA-3651: addManifest now uses separate files for reading and writing. * CORDA-3651: The jar scanning loader now closes itsself. Co-authored-by: Adel El-Beik --- .../internal/cordapp/CordappProviderImplTests.kt | 15 +++++++++++---- .../core/internal/JarSignatureTestUtils.kt | 5 ++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt b/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt index f981b11e24..2bd8a10258 100644 --- a/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt +++ b/node/src/test/kotlin/net/corda/node/internal/cordapp/CordappProviderImplTests.kt @@ -18,6 +18,7 @@ import java.io.FileOutputStream import java.lang.IllegalStateException import java.net.URL import java.nio.file.Files +import java.util.Arrays.asList import java.util.jar.JarOutputStream import java.util.zip.Deflater.NO_COMPRESSION import java.util.zip.ZipEntry @@ -200,8 +201,11 @@ class CordappProviderImplTests { val duplicateJarPath = signedJarPath.parent.resolve("duplicate-" + signedJarPath.fileName) Files.copy(signedJarPath, duplicateJarPath) - assertFailsWith { - newCordappProvider(signedJarPath.toUri().toURL(), duplicateJarPath.toUri().toURL()) + val urls = asList(signedJarPath.toUri().toURL(), duplicateJarPath.toUri().toURL()) + JarScanningCordappLoader.fromJarUrls(urls, VersionInfo.UNKNOWN).use { + assertFailsWith { + CordappProviderImpl(it, stubConfigProvider, attachmentStore).apply { start() } + } } } } @@ -212,8 +216,11 @@ class CordappProviderImplTests { SelfCleaningDir().use { file -> val jarA = ContractJarTestUtils.makeTestContractJar(file.path, listOf("com.example.MyContract", "com.example.AnotherContractForA"), generateManifest = false, jarFileName = "sampleA.jar") val jarB = ContractJarTestUtils.makeTestContractJar(file.path, listOf("com.example.MyContract", "com.example.AnotherContractForB"), generateManifest = false, jarFileName = "sampleB.jar") - assertFailsWith { - newCordappProvider(jarA.toUri().toURL(), jarB.toUri().toURL()) + val urls = asList(jarA.toUri().toURL(), jarB.toUri().toURL()) + JarScanningCordappLoader.fromJarUrls(urls, VersionInfo.UNKNOWN).use { + assertFailsWith { + CordappProviderImpl(it, stubConfigProvider, attachmentStore).apply { start() } + } } } } diff --git a/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/JarSignatureTestUtils.kt b/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/JarSignatureTestUtils.kt index 00a827c1e1..4c21340f84 100644 --- a/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/JarSignatureTestUtils.kt +++ b/testing/test-utils/src/main/kotlin/net/corda/testing/core/internal/JarSignatureTestUtils.kt @@ -12,6 +12,7 @@ import java.nio.file.Files import java.nio.file.NoSuchFileException import java.nio.file.Path import java.nio.file.Paths +import java.nio.file.StandardCopyOption.REPLACE_EXISTING import java.security.PublicKey import java.util.jar.Attributes import java.util.jar.JarInputStream @@ -88,12 +89,13 @@ object JarSignatureTestUtils { JarInputStream(FileInputStream((this / fileName).toFile())).use(JarSignatureCollector::collectSigners) fun Path.addManifest(fileName: String, vararg entries: Pair) { + val outputFile = this / (fileName + "Output") JarInputStream(FileInputStream((this / fileName).toFile())).use { input -> val manifest = input.manifest ?: Manifest() entries.forEach { (attributeName, value) -> manifest.mainAttributes[attributeName] = value } - val output = JarOutputStream(FileOutputStream((this / fileName).toFile()), manifest) + val output = JarOutputStream(FileOutputStream(outputFile.toFile()), manifest) var entry = input.nextEntry val buffer = ByteArray(1 shl 14) while (true) { @@ -108,5 +110,6 @@ object JarSignatureTestUtils { } output.close() } + Files.copy(outputFile, this / fileName, REPLACE_EXISTING) } }