Merge commit '5b50ef49bcca2d1be8bb0604e1be167e3bb5da24' into chrisr3-44-merge

This commit is contained in:
Chris Rankin 2020-03-06 09:55:00 +00:00
commit 493a92ca39
13 changed files with 122 additions and 16 deletions

View File

@ -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
)
}
}

View File

@ -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 <https://r3-cev.atlassian.net/browse/CORDA-2744>`_]
* Add an exception for Unrecoverable RPC errors [`CORDA-3192 <https://r3-cev.atlassian.net/browse/CORDA-3192>`_]
* Fix the misleading Flow has been waiting message [`CORDA-3197 <https://r3-cev.atlassian.net/browse/CORDA-3197>`_]
* Update Quasar agent so that we can exclude entire ClassLoaders from being instrumented [`CORDA-3228 <https://r3-cev.atlassian.net/browse/CORDA-3228>`_]
* Don't fail on liquibase errors when using H2 [`CORDA-3302 <https://r3-cev.atlassian.net/browse/CORDA-3302>`_]
* Exceptions thrown in raw vault observers can cause critical issues [`CORDA-3329 <https://r3-cev.atlassian.net/browse/CORDA-3329>`_]
* Migration from Corda 3.x to 4.x for PostgreSQL require a manual workaround [`CORDA-3348 <https://r3-cev.atlassian.net/browse/CORDA-3348>`_]
* Prepare DJVM library for 1.0 release [`CORDA-3377 <https://r3-cev.atlassian.net/browse/CORDA-3377>`_]
* Improve node configuration override documentation [`CORDA-3386 <https://r3-cev.atlassian.net/browse/CORDA-3386>`_]
* Allow EvolutionSerializer to handle primitive types becoming nullable [`CORDA-3390 <https://r3-cev.atlassian.net/browse/CORDA-3390>`_]
* Fix caching of local AMQPSerializer [`CORDA-3392 <https://r3-cev.atlassian.net/browse/CORDA-3392>`_]
* Fixed NPE in BlobInspector [`CORDA-3396 <https://r3-cev.atlassian.net/browse/CORDA-3396>`_]
* Update DemoBench so that using the DJVM is configurable [`CORDA-3406 <https://r3-cev.atlassian.net/browse/CORDA-3406>`_]
* Scanning for Custom Serializers in the context of transaction verification is broken [`CORDA-3464 <https://r3-cev.atlassian.net/browse/CORDA-3464>`_]
* Allow EvolutionSerializer to handle boxed types becoming primitive [`CORDA-3469 <https://r3-cev.atlassian.net/browse/CORDA-3469>`_]
* Create interface to perform transactional operations from custom CordaServices [`CORDA-3471 <https://r3-cev.atlassian.net/browse/CORDA-3471>`_]
* Fix typo in node database table documentation [`CORDA-3476 <https://r3-cev.atlassian.net/browse/CORDA-3476>`_]
* Fix node database page [`CORDA-3477 <https://r3-cev.atlassian.net/browse/CORDA-3477>`_]
* Add timestamp column to NODE_TRANSACTIONS table [`CORDA-3479 <https://r3-cev.atlassian.net/browse/CORDA-3479>`_]
* Support adding new mandatory field and removal of optional [`CORDA-3489 <https://r3-cev.atlassian.net/browse/CORDA-3489>`_]
* Fix link to network builder [`CORDA-3495 <https://r3-cev.atlassian.net/browse/CORDA-3495>`_]
* Provide option for user to specify custom serializers without classpath scanning [`CORDA-3501 <https://r3-cev.atlassian.net/browse/CORDA-3501>`_]
* The CordaRPCClientConfiguration is not respected when GracefulReconnect is used [`CORDA-3507 <https://r3-cev.atlassian.net/browse/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 <https://r3-cev.atlassian.net/browse/CORDA-3513>`_]
* Support whitelists and custom serializers inside the DJVM [`CORDA-3523 <https://r3-cev.atlassian.net/browse/CORDA-3523>`_]
* Load DJVM serialization types more precisely to avoid runtime warnings [`CORDA-3536 <https://r3-cev.atlassian.net/browse/CORDA-3536>`_]
* Use the config values for reconnecting retry interval and max reconnect attempts [`CORDA-3542 <https://r3-cev.atlassian.net/browse/CORDA-3542>`_]
* SSH memory leak and security [`CORDA-3520 <https://r3-cev.atlassian.net/browse/CORDA-3520>`_]
* Remove support for outdated ciphers and algorithms from SSH [`CORDA-3550 <https://r3-cev.atlassian.net/browse/CORDA-3550>`_]
* Deserialization using the DJVM creates too many SerializerFactory objects [`CORDA-3552 <https://r3-cev.atlassian.net/browse/CORDA-3552>`_]
* Allow initial registration errors to propagate up so the node exits with a failure code [`CORDA-3558 <https://r3-cev.atlassian.net/browse/CORDA-3558>`_]
* Remove reference to man run [`CORDA-3559 <https://r3-cev.atlassian.net/browse/CORDA-3559>`_]
* Always add TestCordapps to the classpath when building _driverSerializationEnv [`CORDA-3566 <https://r3-cev.atlassian.net/browse/CORDA-3566>`_]
* Use the connectionMaxRetryInterval configuration when reconnection the RPC client [`CORDA-3576 <https://r3-cev.atlassian.net/browse/CORDA-3576>`_]
* Update docs for X500 name and SSH hostkey [`CORDA-3585 <https://r3-cev.atlassian.net/browse/CORDA-3585>`_]
* hashLookup command help misspelling [`CORDA-3587 <https://r3-cev.atlassian.net/browse/CORDA-3587>`_]
* Exit the InteractiveShell on shutdown command [`CORDA-3593 <https://r3-cev.atlassian.net/browse/CORDA-3593>`_]
.. _release_notes_v4_3:

View File

@ -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<IllegalStateException> {
newCordappProvider(signedJarPath.toUri().toURL(), duplicateJarPath.toUri().toURL())
val urls = asList(signedJarPath.toUri().toURL(), duplicateJarPath.toUri().toURL())
JarScanningCordappLoader.fromJarUrls(urls, VersionInfo.UNKNOWN).use {
assertFailsWith<IllegalStateException> {
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<IllegalStateException> {
newCordappProvider(jarA.toUri().toURL(), jarB.toUri().toURL())
val urls = asList(jarA.toUri().toURL(), jarB.toUri().toURL())
JarScanningCordappLoader.fromJarUrls(urls, VersionInfo.UNKNOWN).use {
assertFailsWith<IllegalStateException> {
CordappProviderImpl(it, stubConfigProvider, attachmentStore).apply { start() }
}
}
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -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<Attributes.Name, String>) {
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)
}
}

View File

@ -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 {

View File

@ -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<String> = 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)
}
}

View File

@ -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)
}
}

View File

@ -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)
}
}

View File

@ -23,6 +23,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 {

View File

@ -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 {

View File

@ -33,6 +33,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 {