2987 Commits

Author SHA1 Message Date
szymonsztuka
b98f91ee61 Merge remote-tracking branch 'remotes/origin/master' into feature/ENT-2253-NonStop-changes
# Conflicts:
#	node/src/main/resources/migration/node-info.changelog-master.xml
#	node/src/main/resources/migration/node-info.changelog-v3.xml
2018-08-30 15:51:38 +01:00
szymonsztuka
dbc1088417
CORDA-1939 Regression: Liquibase fails to migrate existing pre-liquibase database (#3855)
* Bugfix for corda.jar manually deployed without coping the matching corda-finance-VERSION.jar.
If the older finance cordapp version is detected (which doesn't have Liquibase migration scripts) fail node at startup and print message: "Could not create the DataSource: Detected incompatible corda-finance cordapp without database migration scripts, replace the existing corda-finance-VERSION.jar with the latest one."
Since coda-finance is an optional cordapp,the presence of Liquibase scripts is only checked if corda-finance-VERSION.jar is present in cordapps folder.
*  Allow to start using Liquibase from any point of 4.0-SNAPSHOT before Liquibase was introduced (not only from 3.0/3.X versions) - 2 database changes introduced after 3.2 but before Liquibase are now conditional database changes.
2018-08-30 13:40:02 +01:00
Dominic Fox
bdc12341cb Restore ENT-only logic clobbered in merge 2018-08-30 11:45:57 +01:00
Dominic Fox
f061235cc8 Resolve merge conflict 2018-08-30 10:47:56 +01:00
Matthew Nesbit
7ead9e5698 ENT-2293 & ENT-2353: Basic implementation of an RPC worker and Flow Worker (#1308) 2018-08-29 13:45:27 +01:00
Christian Sailer
43f7b8477e Merge commit 'bc330bd9890d41904bbeea6e579f5fc4438872b6' into christians/merge-ENT-2414 2018-08-28 12:26:57 +01:00
josecoll
36bfe268af
Revert back to using "relevancy" as "modifiable" states are not permissible by definition on an immutable ledger. (#3847) 2018-08-28 11:04:40 +02:00
Christian Sailer
bc330bd989
ENT-2414 Named caches (#3848)
* Add named caches and apply to NonInvalidingUnboundCache and all usages.

* Add named caches and apply to NonInvalidingCache and all usages.

* Add named caches and apply to NonInvalidingWeightBasedCache and all usages.

* Move NamedCache to core/internal

* Remove type `NamedCache` and `NamedLoadingCache`

* Suppressed 'name not used' warning, added comment, and fixed generic parameters on the buildNamed functions.

* Use `buildNamed` in all caffeine instances in production code. Not using it for caches that are created in test code.

* Add checks for the cache name

* Formatting

* Minor code review revisions
2018-08-24 17:17:22 +01:00
Clinton
3594ccd89b
CORDA-1924: Remove references to Cordform definition and cordform-common (#3842) 2018-08-24 16:29:14 +01:00
szymonsztuka
33e8e05a8d Fixes after merge remote-tracking branch 'remotes/open/master' into szymonsztuka/os-merge-20180824 2018-08-24 13:24:43 +01:00
szymonsztuka
c7f666102f Fixes after merge remote-tracking branch 'remotes/open/master' into szymonsztuka/os-merge-20180824 2018-08-24 12:27:47 +01:00
szymonsztuka
598e3a327a Merge remote-tracking branch 'remotes/open/master' into szymonsztuka/os-merge-20180824
# Conflicts:
#	build.gradle
#	core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt
#	finance/src/main/kotlin/net/corda/finance/schemas/CashSchemaV1.kt
#	finance/src/main/kotlin/net/corda/finance/schemas/CommercialPaperSchemaV1.kt
#	finance/src/main/resources/migration/cash.changelog-init.xml
#	finance/src/main/resources/migration/cash.changelog-master.xml
#	finance/src/main/resources/migration/commercial-paper.changelog-init.xml
#	finance/src/main/resources/migration/commercial-paper.changelog-master.xml
#	finance/src/main/resources/migration/commercial-paper.changelog-v1.xml
#	node-api/src/main/kotlin/net/corda/nodeapi/internal/MigrationHelpers.kt
#	node-api/src/main/kotlin/net/corda/nodeapi/internal/persistence/SchemaMigration.kt
#	node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt
#	node/src/main/kotlin/net/corda/node/internal/schemas/NodeInfoSchema.kt
#	node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt
#	node/src/main/kotlin/net/corda/node/services/schema/NodeSchemaService.kt
#	node/src/main/resources/migration/common.changelog-init.xml
#	node/src/main/resources/migration/common.changelog-master.xml
#	node/src/main/resources/migration/node-core.changelog-init.xml
#	node/src/main/resources/migration/node-core.changelog-master.xml
#	node/src/main/resources/migration/node-core.changelog-pkey.xml
#	node/src/main/resources/migration/node-core.changelog-postgres-blob.xml
#	node/src/main/resources/migration/node-core.changelog-tx-mapping.xml
#	node/src/main/resources/migration/node-core.changelog-v3.xml
#	node/src/main/resources/migration/node-core.changelog-v4.xml
#	node/src/main/resources/migration/node-info.changelog-init.xml
#	node/src/main/resources/migration/node-info.changelog-master.xml
#	node/src/main/resources/migration/node-info.changelog-v1.xml
#	node/src/main/resources/migration/node-info.changelog-v2.xml
#	node/src/main/resources/migration/node-notary.changelog-init.xml
#	node/src/main/resources/migration/node-notary.changelog-master.xml
#	node/src/main/resources/migration/node-notary.changelog-pkey.xml
#	node/src/main/resources/migration/node-notary.changelog-v1.xml
#	node/src/main/resources/migration/vault-schema.changelog-init.xml
#	node/src/main/resources/migration/vault-schema.changelog-master.xml
#	node/src/main/resources/migration/vault-schema.changelog-pkey.xml
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/MockServices.kt
2018-08-24 12:23:30 +01:00
Tommy Lillehagen
793a937482
Merge pull request #1355 from corda/tlil/os-merge-20180823
OS->ENT merge 20180823
2018-08-23 17:49:50 +01:00
szymonsztuka
c4f33ef533 Rename column HOST to HOST_NAME in table NODE_INFO_HOSTS - required by ENT-2253 2018-08-23 17:08:05 +01:00
szymonsztuka
487cad7d06
CORDA-1471 Database schema setup for internal tables via Liquibase (#3815)
Internal tables (the tables from node and finance modules) are now tracked /created by Liquibase script.
Tables backing MappedSchemma in Cordapps are created by Hibernate (as before). 
The PR scope added Liquibase library, setup code SchemaMigration and XML scripts and from Enterprise.
For existing database installation - the node will auto-upgrade to use Liquibase.
Method migrateOlderDatabaseToUseLiquibase checks for any 3.X existing Corda database to upgrade database to use Liquibase. When the existing database without Liquibase integral tables is detected, the node (at startup) will create Liquibase tracking tables and fill them with all migration scripts (marked as done), this ensure the database will look as it would use Liquibase from the beginning.
The database changes gradually introduced by the subsequent 3.X releases (3.1, 3.2) are conditionally run by Liquibase.
2018-08-23 16:30:02 +01:00
Rick Parker
79909a5ea9
ENT-2430 Swap over output_index and transaction_id in database indexes (#1354)
(cherry picked from commit 2d33ba3)
2018-08-23 16:24:56 +01:00
Tommy Lillehagen
acd3f44181 Merge remote-tracking branch 'open/master' 2018-08-23 13:55:11 +01:00
Mike Hearn
409b4e2a42 Minor: make the trace logging for the RPC server a bit more helpful. 2018-08-23 13:12:18 +02:00
Mike Hearn
626b3e6bd3 Minor: make the :node:capsule:build task depend on buildCordaJAR 2018-08-23 13:12:18 +02:00
Rick Parker
759419fcc1
ENT-2355 Insert transactions without checking for duplicates (#1350)
* ENT-2355 Make transactions storage optimistic if in a flow and the flow has never restored from a checkpoint.

(cherry picked from commit 9a2e9b0)

* ENT-2355 Insert transactions with optimism.

* Added some comments.
2018-08-23 11:06:14 +01:00
Anthony Keenan
bcfadfeebf
CORDA-1833: Create a picocli base class (#3826)
* Add shell extensions to CLI utils class and move into its own module

* Fix issue with completion script generation and slight refactor

* Fix autocompletion for logging level

* Delete uneeded comment

* More tidying up

* Make run function final

* Fixed an issue with the program being run twice.

* Address review comments
2018-08-22 21:51:25 +01:00
Viktor Kolomeyko
feaf6aa03c CORDA-1878: Improve exception handling when base directory is not readable or writable by the application user. 2018-08-22 15:55:52 +01:00
rick.parker
217c3b1e3e ENT-2202 Liquibase migration scripts for schema change coming from OS. 2018-08-22 15:13:50 +01:00
rick.parker
571eec5a72 Merge remote-tracking branch 'remotes/open/master' into parkri-os-merge-20180822-1 2018-08-22 15:06:56 +01:00
Rick Parker
30d07bc998
ENT-2202 Fold transaction mapping column into transactions table (#3836)
* ENT-2202 Fold transaction mapping column into transactions table

* Remove from node schema.

* Fix bug.
2018-08-22 14:14:55 +01:00
Mike Hearn
0a5dcc91ea Merge remote-tracking branch 'open/master' into mike-merge-2fae95c58f9 2018-08-22 14:27:45 +02:00
Thomas Schroeter
79309ae94a
Liquibase: add column is_modifiable to vault_states table (#1346) 2018-08-22 13:13:42 +01:00
Rick Parker
1d05c16942
ENT-2439 Fix compression in serialization (#3825)
* ENT-2439 Fix compression in serialization
2018-08-22 10:37:18 +01:00
Michele Sollecito
f94abf726b
Fixing exception messages not showing up in the console because of log4j2.xml setup. (#3830) 2018-08-21 21:28:13 +01:00
Florian Friemel
41fc8d6c55
Remove BFTSMaRtTests. (#3822) 2018-08-21 13:02:18 +01:00
rick.parker
0045fe24fd Merge remote-tracking branch 'remotes/open/master' into parkri-os-merge-20180821-1
# Conflicts:
#	docs/source/index.rst
2018-08-21 09:37:56 +01:00
Chris Rankin
a287673432 Merge commit 'ff62df8d5a0ab9eabfe919b65a8c73baa3dca7f3' into chrisr3-os-merge
Conflicts:
	finance/src/main/kotlin/net/corda/finance/contracts/asset/cash/selection/CashSelectionSQLServerImpl.kt
	node/src/main/kotlin/net/corda/node/NodeArgsParser.kt
	node/src/main/kotlin/net/corda/node/internal/NodeStartup.kt
	node/src/main/kotlin/net/corda/node/services/vault/NodeVaultService.kt
2018-08-20 15:46:20 +01:00
Thomas Schroeter
7082e68409 Cleanup the Jib build task 2018-08-20 15:13:55 +01:00
Rick Parker
2f76651d00
ENT-2378 ENT-2377 Minimise database access during transaction creation and recording for public key handling (#3812)
* ENT-2378 ENT-2377 minimise database access by making more use of caches for filterMyKeys, and don't make a redundant database check for existence of new random keys.

* ENT-2378 Unit test for new method in PersistentIdentityService.
2018-08-20 15:01:51 +01:00
Ivan Schasny
9bb9c6ae30
Merge pull request #3727 from corda/improved-error-message-for-missing-suspendable-cases
Added more descriptive error message for the cases when a transaction…
2018-08-20 13:18:26 +01:00
Thomas Schroeter
88dd6a2888
Fix Jib build (#3811) 2018-08-20 13:08:58 +01:00
Ivan Schasny
d0ecab0781 Added more descriptive error message for the cases when a transaction context is missing from the flow state machine 2018-08-20 08:31:35 +01:00
Christian Sailer
9a3b1629a2
ENT-2414 Cache trace capture (#1337)
* Naive implementation of a trace capturing wrapper.

* Thread-safe cache tracing wrapper using a queue

* Use sipHash to get a long representing secure hash

* Code review rework

* Add copyright headers

* Move config back to enterprise config and remove trace name from CacheTracingConfig so it can be injected when the cache is created.
Add defaults to reference.conf
Add code and test to create directories when required.

* Remove empty line

* Sort out writer thread

* Blank line

* Revert: Code review rework (892911a)
2018-08-17 17:28:28 +01:00
Roger Willis
b7867c3bcb
* Added "isRelevant" functionality to the vault. (#3789)
* * Added "isRelevant" functionality to the vault.

* * Changed "isRelevant" to "isParticipant" as this makes more sense in the context of Corda.
* Minor tweak to "isParticipant" method in NodeVaultService.
* Fixed API break and broken JAva tests.

* * Addressed PR comments from Jose.
* Changed all mentions of "relevant" and "participant" to "modifiable".
* Made the default behaviour of vault queries to return ALL states instead of just MODIFIABLE states as this is what always previously happened.
* Updated cash balance queries to only return MODIFIABLE states.

* * Updated cash selection and tryLockFungfibleStatesForSpending.
2018-08-17 13:39:05 +01:00
josecoll
2b69789a30
Fix Vault contractStateType's bootstrapping bug, and add integration test. (#3785) 2018-08-15 15:15:11 +01:00
Michele Sollecito
7a1b75ef35
[CORDA-1822]: Derive error code from exception signature (#3774) 2018-08-15 10:22:09 +01:00
Thomas Schroeter
7ec41fba43
Config file and base dir can be specified together (#3783) 2018-08-14 12:13:22 +01:00
rick.parker
237c133804 Merge remote-tracking branch 'remotes/open/master' into parkri-os-merge-20180814-1
# Conflicts:
#	CONTRIBUTORS.md
#	constants.properties
#	docs/source/index.rst
#	docs/source/upgrading-cordapps.rst
#	node/build.gradle
2018-08-14 11:26:52 +01:00
josecoll
f684cb29bd
CORDA-1888 Fix Vault Query composite queries (#3775)
* Reproduce composite query failures.

* Fixes to OR querying and composite queries that use the same QueryCriteria (Linear, Fungible, Custom) more than once.

* Revert debug logging for Hibernate SQL.

* Cleanup and remove redundant joinPredicates global var.

* Fix failing Java Unit test.

* Fix Java compilation error in example-code section of docs.

* Include copy() function for original constructor to maintain backwards API compatibility.
2018-08-13 18:11:29 +01:00
Michele Sollecito
3b63723934
[CORDA-1822]: Improved error message when too many results are asked with default pagination. (#3776) 2018-08-13 16:50:29 +01:00
Rick Parker
0a18979307
CORDA-1894 Remove if condition from service hub that prevents vault logic executing. (#3773) 2018-08-13 14:17:03 +01:00
Andrius Dagys
0746b1f927
CORDA-1850: Minor: improve flow timeout error message (#3764) 2018-08-13 10:05:55 +01:00
Mike Hearn
68bfb7ff66 New jokes. 2018-08-10 14:32:16 +02:00
Roger Willis
b0d36b6617
* Minor formatting changes. (#3758)
* NotaryServiceFlow now takes references into account when comparing number of inputs vs maxAllowedInputs.
* Added reference state support for BFTSMaRt notary.

* Fixes broken BFT notary tests.
2018-08-10 08:51:56 +01:00
Tommy Lillehagen
66739c138c NOTICK - Fix version reference for New Relic dependency (#3765) 2018-08-09 18:17:20 +01:00