771 Commits

Author SHA1 Message Date
tudor.malene@gmail.com
7b86c2c3a3 Merge remote-tracking branch 'private/master' into tudor_os_merge_23_10
# Conflicts:
#	core/src/main/kotlin/net/corda/core/contracts/BelongsToContract.kt
#	core/src/main/kotlin/net/corda/core/contracts/TransactionState.kt
#	core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt
#	core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt
#	core/src/main/kotlin/net/corda/core/utilities/KotlinUtils.kt
#	core/src/test/kotlin/net/corda/core/internal/JarSignatureCollectorTest.kt
#	node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt
#	node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt
#	node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/dsl/TransactionDSLInterpreter.kt
2018-10-23 10:29:43 +01:00
Andrius Dagys
75c9c50abe Merge branch 'open/master-ba7727a4e1' into andrius/merge-10-22 2018-10-22 15:38:28 +01:00
Viktor Kolomeyko
b05a985d99 OS->Ent merge 2018-10-22 12:57:37 +01:00
Andrius Dagys
e0d8ea8a58
CORDA-535: Move implementation specific configuration values out of n… (#4058)
The configuration objects for specific notary implementations have been replaced
by a single untyped "extraConfig" Config object that is left to the notary service
itself to parse.

* Remove the raft bootstrapping command from node, we'll need a different
mechanism for that.

* Remove pre-generated identity config value.

* Split up obtainIdentity() in AbstractNode to make it easier to read.

* A temporary workaround for the bootstrapper tool to support BFT notaries.

* Update docs

* Add upgrade notes

* Fix rebase issue

* Add a config diff for the bft notary as well
2018-10-22 10:26:10 +01:00
Viktor Kolomeyko
88f368134f
ENT-2610: Separate passwords for store and for private keys in Corda OS. (#4090)
* ENT-2610: Separate passwords for store and for private keys in Corda OS.

When it comes to KeyStores there are *2* passwords: 1 for the keyStore as a whole and separately there is one private keys within this keyStore.
Unfortunately, those 2 passwords have to be the same due to Artemis limitation, for more details please see:
`org.apache.activemq.artemis.core.remoting.impl.ssl.SSLSupport.loadKeyManagerFactory`
where it is calling `KeyManagerFactory.init()` with store password.

Before change in this PR, throughout our codebase there are multiple places where we assume that storePassword is the same as keyPassword, even in the classes that have nothing to do with Artemis.
This is of course less than ideal as TLS communication may be used not only for Artemis connectivity (e.g. Bridge/Float interaction in Ent) and it is unfair to impose same passwords constraint on that communication channel.
Therefore this PR is removing this limitation and properly separating storePassword from keyPassword.

Linked Jira(https://r3-cev.atlassian.net/browse/ENT-2610) has for more background info.

Suggest to start review from `net.corda.core.crypto.X509NameConstraintsTest` to get an idea about the nature of the changes made.

* ENT-2610: Address PR input from @kchalkias

* ENT-2610: Address PR input from @kchalkias, s/privateKeyPassword/entryPassword/

* ENT-2610: Address PR input from @kchalkias, s/keyPassword/entryPassword/

In the implementation of `CertificateStoreSupplier`
2018-10-22 07:11:27 +01:00
szymonsztuka
e56d84fd5d Merge OS -> ENT 2018-10-21 21:57:37 +01:00
Tudor Malene
86bc0d9606 CORDA-1947 added packageOwnership parameter
CORDA-1947 add signers field to DbAttachment. Add check when importing attachments

CORDA-1947 add signers field to DbAttachment. Add check when importing attachments

CORDA-1947 add tests

CORDA-1947 fix comment

CORDA-1947 Fix test

CORDA-1947 fix serialiser

CORDA-1947 fix tests

CORDA-1947 fix tests

CORDA-1947 fix serialiser

CORDA-1947 Address code review changes

CORDA-1947 Address code review changes

CORDA-1947 Revert test fixes

CORDA-1947 address code review comments

CORDA-1947 move verification logic to LedgerTransaction.verify

CORDA-1947 fix test

CORDA-1947 fix tests

CORDA-1947 fix tests

CORDA-1947 address code review comments

CORDA-1947 address code review comments
2018-10-19 12:12:34 +01:00
rick.parker
e1b86d0422 Fix up errors 2018-10-19 08:05:15 +01:00
rick.parker
b571e16d0d Merge remote-tracking branch 'remotes/open/master' into parkri-os-merge-20181018-1 2018-10-19 08:02:59 +01:00
Katelyn Baker
7cfd44e383
CORDA-2113 - Include PNM ID in CSR (#4086)
* CORDA-2113 - Include PNM ID in CSR

If Compatibility Zone operator is using private networks and the node
should be joining one, optionally the ID (a UUID) of that network can be
included as part of the node's CSR to to the Doorman.

* fix broken test
2018-10-18 15:39:42 +01:00
Rick Parker
55731ef816
ENT-2431 Tidy up buildNamed and CacheFactory 2018-10-18 10:38:43 +01:00
Stefano Franz
5ca26b1345 Merge remote-tracking branch 'open/master' into stefano-merge-201810171215
# Conflicts:
#	docs/source/node-database.rst
2018-10-17 13:49:00 +01:00
Andrius Dagys
715c38766d CORDA-2109: Fix a bug that prevents consecutive multiparty contract upgrades
The contract upgrade handler assumes that the state to be upgraded is
created by a WireTransaction. This breaks the upgrade process if it was
in fact issued by a ContractUpgradeWireTransactions or a NotaryChangeWireTransaction.
2018-10-17 10:20:27 +01:00
Chris Rankin
430c4bcf83 Merge commit '47068e6b7ad0afb3ed8df61a429470f19331b7b5' into chrisr3-os-merf
Conflicts:
	docs/source/index.rst
	finance/build.gradle
	finance/src/integration-test/kotlin/net/corda/finance/flows/test/CashConfigDataFlowTest.kt
	node/src/test/java/net/corda/node/services/vault/VaultQueryJavaTests.java
	samples/simm-valuation-demo/build.gradle
2018-10-16 12:07:55 +01:00
Shams Asari
9b6eb02bab Merge fixes 2018-10-15 13:51:18 +01:00
Shams Asari
958f5dd65f Merge remote-tracking branch 'open/master' into os-merge-6d4bdb8
# Conflicts:
#	docs/source/changelog.rst
#	node-api/build.gradle
#	node/src/integration-test/kotlin/net/corda/node/flows/AsymmetricCorDappsTests.kt
#	node/src/integration-test/kotlin/net/corda/node/flows/FlowCheckpointVersionNodeStartupCheckTest.kt
#	node/src/integration-test/kotlin/net/corda/node/modes/draining/FlowsDrainingModeContentionTest.kt
#	node/src/integration-test/kotlin/net/corda/node/services/AttachmentLoadingTests.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/TestCordappDirectories.kt
2018-10-15 12:34:29 +01:00
Andrius Dagys
3981a88301 Merge branch 'open/master' into andrius/merge-10-15 2018-10-15 10:50:12 +01:00
Shams Asari
2c9a942e1a
CORDA-2088: Simplified the TestCordapp public API (#4064)
The entry point to the API has been simplified to just requireing a list of packages to scan, with sensible defaults provided for the metadata. Because of the wither methods, having parameters for the metadata (with default values) seems unnecessary. Also the ability to scan just individual classes has been made internal, as it seems unlikely app developers would need that level of control when testing their apps.

TestCordappImpl is a data class and thus acts as a natural key for the Jar caching, where previously the key was the package names. This fixes an issue where it was not possible to create two CorDapp Jars of the same package but different metadata.
2018-10-15 10:11:18 +01:00
Shams Asari
aced03df54
CORDA-1274: Migrated usage of FastClasspathScanner to ClassGraph (#4060)
FastClasspathScanner was renamed to ClassGraph for the version 4 release
2018-10-11 19:50:26 +01:00
Viktor Kolomeyko
0e68f26c0f
ENT-2569: Clean-up content of registeredShutdowns. (#4048)
Please see comment for more info.
2018-10-10 17:52:00 +01:00
Andrius Dagys
504cefc6f6 CORDA-535: Move MySQL notary into a separate module 2018-10-10 16:07:16 +01:00
Andrius Dagys
b7d59785e7 Merge remote-tracking branch 'open/master' into andrius/merge-10-10 2018-10-10 10:45:21 +01:00
Andrius Dagys
9ebeac1ad8
CORDA-535: Extract notary implementations into CorDapps (#3978)
* Move Raft and BFT notaries into separate modules

* Move schemas

* Fix tests & demos

* Modified logic for creating notary services:

Added a new field 'className' to the notary configuration. The node now
loads the specified implementation via reflection. The default className
value points to the simple notary implementation for backwards compatibility.
Relevant schemas are loaded in a similar fashion.

For backwards compatibility purposes the default SimpleNotaryService will
remain built-in to node, but its cordapp will be generated on startup – so
the loading of notary services is streamlined.

* Move test namedcache factory to test utils
2018-10-10 10:04:22 +01:00
Anthony Keenan
8771784181 Another enterprise only instance 2018-10-09 17:39:34 +01:00
Anthony Keenan
a6fd2ba903 Merge remote-tracking branch 'open/master' into anthonyk-os-merge-20181009
# Conflicts:
#	core/src/main/kotlin/net/corda/core/utilities/ByteArrays.kt
#	node/src/main/kotlin/net/corda/node/serialization/kryo/KryoCheckpointSerializer.kt
2018-10-09 16:15:59 +01:00
Dominic Fox
d9ea19855f
CORDA-2006: Simplify checkpoint serialization (#4042)
* CORDA-2006: Simplify checkpoint serialization

* Supply rule to KryoTest
2018-10-08 13:39:28 +01:00
Chris Rankin
4cb31f4c8b Merge commit '39434dcbecdd2cd656e40622530e84d02443b8e2' into chrisr3-os-merge 2018-10-08 10:42:55 +01:00
Chris Rankin
d75fd7bd8a
CORDA-2030: Resolve build warnings created by adding kotlin-stdlib-jre8 to node. (#4033) 2018-10-05 11:01:27 +01:00
Shams Asari
bffac331a3
Moved the PLATFORM_VERSION constant to core and added some missing usages (#4026) 2018-10-05 09:28:00 +01:00
josecoll
ec084cf8ef Merge remote-tracking branch 'open/master' into colljos-merge-031018 2018-10-03 15:07:48 +01:00
josecoll
7edc18f85d
CORDA-1997 Added constraint type information to vault states table. (#3975)
* Added constraint type information to vault states table.

* Added Vault Query criteria support for constraint data.

* Added documentation and changelog entry.

* Added missing @CordaSerializable.

* Fix minor bug in test setup and parsing code.

* Use binary encoding data types instead of serialize/deserialize.

* Optimized storage of constraints data.
Additional assertions on Vault Query constraint data contents (to validate encoding/decoding).
Tested with CompositeKey containing 10 keys.

* Addressing PR review feedback.

* Query by constraints type and data.

* Revert back accidentally removed code for contractStateType filtering.

* Incorporating final PR review feedback. Use @JvmOverloads on constructor.

* Make sure constraintInfo is class evolution friendly.
2018-10-03 13:41:25 +01:00
tudor.malene@gmail.com
40825fef99 Merge branch 'tudor_merge_os_master' into feature/ENT-2222/constraints_propagation_private
# Conflicts:
#	node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/internal/MockCordappProvider.kt
2018-10-02 16:10:19 +01:00
Viktor Kolomeyko
63ae29d153 OS->Ent merge 2018-10-01 14:45:01 +01:00
Rick Parker
8bbc0d9f43
ENT-2431 Add caching metrics, consolidate tracing config and better default cache sizes (#1418) 2018-10-01 14:28:03 +01:00
Christian Sailer
532d95ccac
ENT-1565 Enable the use of BoringSSL (#1358)
* BoringSsl dependency

* Merge over boring_ssl changes

* Merge over boring_ssl changes

*  Upgrade netty-tcnative (and netty to compatible version)

* Add openSSL flag to SSLConfiguration and implementations.

* Make SSL implementation switchable for Artemis

* Parameterize AMQP bridge tests on use of openSSL

* Plumb through open SSL flag to AMQP client/server.

* Add open ssl flag to reference.conf

* Slight clean-up

* Add LoggingTrustManagerWrapper for OpenSsl contexts

* Remove unneeded lazy and check for double wrapping

* Fix TrustMangerWrapper and test, clean-up

* Add key factory wrapper to get the current certificate chain out.

* Use cert chain returning key mananager factory to get local cert

* Force consistent netty-tcnative version across all dependencies

* Make proton wrapper tests check all combinations of client/server native/java SSL

* Add test netty server/client to run SSL tests with

* Simplify usage of test netty components and clean up

* Improve exception handling in NettyTestHandler

* Add openSSL test for X509UtilitiesTests

* Expose engine for test usage

* Add the X509 peer chain check from the socket based test

* Port of TLSAuthenticationTests to use Netty so we can use different SSL providers, add boringSSL tests

* Adapt tests to new config structure

* Readd `useOpenSsl` configuration

* Readd `useOpenSsl` configuration

* Fix up ArtemisTransport for OpenSSL plus tests

* Adapt auth tests

* Formatting

* Remove obsolte file

* Fix config misnomer

* Add SNI host logic to OpenSSL execution branch

* Remove TLS_DHE_RSA tests

* Make exception handling in the netty test infra deterministic
2018-10-01 13:59:52 +01:00
szymonsztuka
f2c0beb8d0
ENT-2530 Corda fails when running against PostgreSQL with uppercase schema namespace. (#1412)
Fix Liquibase quoting strategy for PostgreSQL to follow Corda convention.
In Liquibase for Postgres if schema name has uppercase or lowercase characters only then Liquibase would send it without double quotes and effectively make them lowercase.
Alter Postgres Liquibase dialect to wrap schema names in double quotes. This allows e.g. schemaName=ALICE be send as "ALICE" by Liquibase.
Corda persistence was already wrapping with double quotes, but certain cases in Liquibase were not following this. The result was that SQL run by Liquibase couldn't find schema (e.g. select ALICE.tablename ... in Postgres matched alice schema name not ALICE one).
The fix enables one integration test to be run now against standalone databases.
2018-10-01 12:04:57 +01:00
Konstantinos Chalkias
6980835e8c
[CORDA-2044] Allow more signature schemes to TestUtils (#4002) 2018-10-01 10:41:03 +01:00
Tudor Malene
f96a59932c ENT-2222 Constraints propagation
ENT-2222 Fix tests

ENT-2222 Fix tests

ENT-2222 Add ledger transaction verification logic

ENT-2222 Fixed IRS test

ENT-2222 Fixed IRS test

ENT-2222 Fixed unit test

ENT-2222 Better kdocs

ENT-2222 Support for reference states

ENT-2222 Fix support for reference states

ENT-2222 Revert wrong change

ENT-2222 Fix Kdoc

ENT-2222 Fix Kdoc

ENT-2222 Better docs

ENT-2222 Address code review comments

ENT-2222 Fix test

ENT-2222 Fix rebase

ENT-2222 Add documentation around constraint propagation

ENT-2222 Add tests for contract propagation

ENT-2222 Add Signature Constraints propagation - first draft

ENT-2222 fix tests

ENT-2222 more tests

ENT-2222 unseal the TransactionVerificationException

ENT-2222 unseal the TransactionVerificationException

ENT-2222 more docs

ENT-2222 address code review comments

ENT-2222 address code review comments

ENT-2222 re-implement transition logic

ENT-2222 better comments and checks

ENT-2222 Fix tests

ENT-2222 merge fixes
2018-09-28 13:38:35 +01:00
Florian Friemel
842eac5c43
[CORDA-1926] Implement target version and min platform version (#3899)
https://r3-cev.atlassian.net/browse/CORDA-1926
2018-09-28 09:46:06 +01:00
szymonsztuka
06150371ad CORDA-1726 Make sure test frameworks and nodes refuse to start on any… (#3993)
* CORDA-1726 Make sure test frameworks and nodes refuse to start on anything except the right Java versions

Move isValidJavaVersion(), hasMinimumJavaVersion() to Node as it can be use for check in DriverDSL for starting in-process node,
in-process node doesn't go via NodeStartup class where the correct Java version is checked.

Added safeguard to hasMinimumJavaVersion as some JDKs distributions may not have the update version number (e.g. AdoptOpenJDK) which causes unintended parse exception.

* CORDA-1726 Make sure test frameworks and nodes refuse to start on anything except the right Java versions - remove new test, for proper testing this would use reflection and field setting visibility modifiers which easly can has side effects on the subsequent tests

* Addressing PR comments.
2018-09-27 19:01:01 +01:00
rick.parker
5469e41458 Merge remote-tracking branch 'remotes/open/master' into parkri-os-merge-20180924-1
# Conflicts:
#	core/src/main/kotlin/net/corda/core/internal/NamedCache.kt
#	docs/source/index.rst
#	node/src/integration-test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTest.kt
#	node/src/integration-test/kotlin/net/corda/node/services/network/PersistentNetworkMapCacheTest.kt
#	node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt
#	node/src/main/kotlin/net/corda/node/services/messaging/P2PMessageDeduplicator.kt
#	node/src/main/kotlin/net/corda/node/services/messaging/P2PMessagingClient.kt
#	node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt
2018-09-24 10:13:01 +01:00
Rick Parker
965f9ce528
ENT-2431 Lay foundations for caching metrics (#3955) 2018-09-24 09:55:56 +01:00
szymonsztuka
ae2b96df41
Fix integration tests in database mode (#1401)
Add SQL setup in new test classes which were missing it.
Ignoring H2 tests when running against standalone database.
Revert datasource Enterprise specific configuration for RaftTransactionCommitLogTests.kt test, and mark it as required for test in database mode.
2018-09-21 15:03:46 +01:00
szymonsztuka
d1a831f7f2 Add missing empty methods to behave. 2018-09-20 17:55:43 +01:00
szymonsztuka
dc25fc28b7 Merge remote-tracking branch 'remotes/open/master' into corda/os-merge-20-09-2018
# Conflicts:
#	core-deterministic/build.gradle
#	core/src/test/kotlin/net/corda/core/utilities/KotlinUtilsTest.kt
#	node/src/integration-test/kotlin/net/corda/node/BootTests.kt
#	node/src/integration-test/kotlin/net/corda/node/flows/AsymmetricCorDappsTests.kt
#	node/src/integration-test/kotlin/net/corda/node/modes/draining/P2PFlowsDrainingModeTest.kt
#	node/src/main/kotlin/net/corda/node/internal/CordaRPCOpsImpl.kt
#	node/src/main/kotlin/net/corda/node/serialization/kryo/Kryo.kt
#	node/src/main/kotlin/net/corda/node/serialization/kryo/KryoSerializationScheme.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/InternalTestUtils.kt
2018-09-20 16:39:34 +01:00
Dominic Fox
98c92ef16f
CORDA-1391: Separate out Checkpoint serialization (#3922)
* Separate out Checkpoint serialization

* Update kdocs

* Rename checkpoint serialization extension methods

* Fix bungled rename

* Limit API changes

* Simplify CheckpointSerializationFactory

* Add CheckpointSerializationScheme to API checker

* CheckpointSerializationScheme should not be implemented

* Move checkpoint serialisation to internal package

* Remove CheckpointSerializationScheme from api-current

* Quarantine internal classes

* Remove checkpoint context from public API

* Remove checkpoint context from public API

* Fix test failures

* Completely decouple SerializationTestHelpers and CheckpointSerializationTestHelpers

* Remove CHECKPOINT use case

* Remove stray reference to checkpoint use case

* Fix broken test
2018-09-19 14:23:29 +01:00
Michele Sollecito
19b8f70117
[CORDA-1996]: Apply error code to exceptions that do not propagate to NodeStartup. (#3964) 2018-09-19 14:24:21 +02:00
Viktor Kolomeyko
4c68b515f8
ENT-2489: Experiment with multi-identity RPC worker (#1377)
* ENT-2489: Trivial change to prep for multiple RpcWorkerServiceHubs (i.e. identities)

* ENT-2489: Allow passing `targetLegalIdentity` from Client RPC call.

* ENT-2489: Starting RpcWorker with multiple RpcWorkerServiceHubs (unfinished)

* ENT-2489: Starting RpcWorker with single (for now) RpcWorkerServiceHub

* ENT-2489: Tighten-up integration tests assertions

* ENT-2489: Introduce RPCOpsRouting

* ENT-2489: Output configs for reference

* ENT-2489: Extend test for RpcWorker to operate with multiple identities.

* ENT-2489: Remove un-necessary P2P address

* ENT-2489: New test for RpcWorker getting paid.

* ENT-2489: Make RpcWorkerMultiIdentityTest work

* ENT-2489: Use MAX_RPC_MESSAGE_SIZE when configuring RPC broker.

* ENT-2489: Add exception clause when client attempts to use the wrong identity.

* ENT-2489: Fixes post merge from `master`.

* ENT-2489: Fixes post merge from `master`.

* ENT-2489: Explicitly specify X500 name in test.

* ENT-2489: Use single flow worker and switch anonymity off when making payment.

* ENT-2489: Fix for RpcWorkerTest.

Add `NetworkMapUpdater` to `FlowWorkerServiceHub` or else no-one will ever send a signal on `networkMapCache.nodeReady` future.
Not having `networkMapCache.nodeReady` in completed state, will prevent SMM from operating properly.

* ENT-2489: Handle gracefully the fact that session might be already closed.

* ENT-2489: Fix incorrect merge from `master`.

* ENT-2489: Make `RPCOpsRouting` generic with regard to `RPCOps` following discussion with @mnesbit

* ENT-2489: Make `methodTable` uniform for all the legal names.

* ENT-2489: Make `ObservableContext` non-generic.

* ENT-2489: Tidy-up shutdown sequence post merge from `master`

* ENT-2489: Correct exception type thrown

* ENT-2489: Generics test compilation fix.
2018-09-19 11:04:37 +01:00
Michele Sollecito
5113f4c8c1
[CORDA-1941]: Server-side draining node shutdown. (#3909) 2018-09-18 13:04:26 +02:00
Shams Asari
d22bab98fa Merge remote-tracking branch 'open/master' into os-merge-c79dd80
# Conflicts:
#	docs/source/changelog.rst
#	docs/source/clientrpc.rst
#	node/src/integration-test/kotlin/net/corda/node/services/network/NetworkMapTest.kt
#	node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcExceptionHandlingTest.kt
#	node/src/main/kotlin/net/corda/node/internal/rpc/proxies/ExceptionMaskingRpcOpsProxy.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt
2018-09-17 17:12:50 +01:00