Commit Graph

1640 Commits

Author SHA1 Message Date
tudor.malene@gmail.com
063efe0c6d Merge branch 'master' into tudor_merge_os_master 2018-10-02 15:50:20 +01:00
Florian Friemel
df4936c1fa
[CORDA-1926] Make CordappInfoResolver.withCordappInfoResolution @VisibleForTesting. (#4011)
Make CordappInfoResolver.withCordappInfoResolution and CordappInfoResolver.clear @VisibleForTesting.
2018-10-02 15:48:22 +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
Konstantinos Chalkias
e92ad538cf
CORDA-2031 put "AlgorithmParameters.SHA256WITHECDSA" to BC (#3997) 2018-09-27 15:21:12 +01:00
Rick Parker
965f9ce528
ENT-2431 Lay foundations for caching metrics (#3955) 2018-09-24 09:55:56 +01:00
Roger Willis
c4d86b1b26
CORDA-1999 Changed isRelevant to relevancyStatus. (#3966)
* Changed isRelevant to relevancyStatus.

* Fix cash selection from breaking.

* Fixed non-backwards compatible API change.

* Updated schema migration changelog.

* Updated comment.
2018-09-19 15:50:39 +01:00
Michal Kit
492c25fedd
CORDA-1995 removing DigitalSignatureWithCertPath (#3953)
* CORDA-1995 removing DigitalSignatureWithCertPath

* Fixing unit tests

* Addressing review comments
2018-09-19 14:30:21 +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
Konstantinos Chalkias
7b4c4803b9
isRelevant didn't work for composite ownership, it's now fixed (under certain assumptions). (#3967) 2018-09-19 10:03:16 +01:00
Tudor Malene
32f279a243 ENT-2506 Changes signers field type
ENT-2506 Clean up some docs

ENT-2506 Fix tests and api

ENT-2506 Fix compilation error

ENT-2506 Fix compilation error
2018-09-19 08:48:21 +01:00
Michele Sollecito
5113f4c8c1
[CORDA-1941]: Server-side draining node shutdown. (#3909) 2018-09-18 13:04:26 +02:00
Shams Asari
c79dd8017d
CORDA-1264: Mask internal errors if devMode is false (#3942) 2018-09-17 15:44:51 +01:00
Thomas Schroeter
057ee74611
Single node notary thread safety (#3924) 2018-09-12 13:36:04 +01:00
Viktor Kolomeyko
90a7dd2bf4
ENT-2489: Fix serialization for some of the CordaExceptions. (#3925)
Also add a unit test that exposes the problem.

Without these changes AMQP serialization fails with the following:
```
 net.corda.serialization.internal.amqp.AMQPNotSerializableException: Constructor parameter - "reason" -  doesn't refer to a property of "class net.corda.node.services.statemachine.SessionRejectException"
	at net.corda.serialization.internal.amqp.SerializationHelperKt.toPropertyAccessorConstructor(SerializationHelper.kt:120) ~[corda-serialization-4.0-SNAPSHOT.jar:?]
	at net.corda.serialization.internal.amqp.SerializationHelperKt.propertiesForSerializationFromConstructor(SerializationHelper.kt:107) ~[corda-serialization-4.0-SNAPSHOT.jar:?]
	at net.corda.serialization.internal.amqp.custom.ThrowableSerializer.toProxy(ThrowableSerializer.kt:28) [corda-serialization-4.0-SNAPSHOT.jar:?]
	at net.corda.serialization.internal.amqp.custom.ThrowableSerializer.toProxy(ThrowableSerializer.kt:12) [corda-serialization-4.0-SNAPSHOT.jar:?]
	at net.corda.serialization.internal.amqp.CustomSerializer$Proxy.writeDescribedObject(CustomSerializer.kt:159) [corda-serialization-4.0-SNAPSHOT.jar:?]
```
2018-09-12 11:29:36 +01:00
Shams Asari
ca5d88e65a
Minor changes made in ENT which should have been ported over (#3932) 2018-09-12 11:26:37 +01:00
Shams Asari
83e66d542d
Syncing Cordapp info code from ENT so that ENT-1731 is fully ported (#3914)
Also, Cordapp.Info has been made internal as it's not used in the public API
2018-09-10 10:43:00 +01:00
Dan Newton
db6c7f38a5 Support for case insensitive vault queries (#3853)
* Make the criteria builder functions case insensitive

Add IGNORE_CASE versions of the comparison operator enums
Add exactMatch argument to criteria builder functions where strings can be passed in and set its default value to true
Use JvmOverrides to provide the default true version to java without needing to specify a value manually
If exactMatch is true then the original enums will be used, if false the IGNORE_CASE enums will be used instead
HibernateQueryCriteriaParser.columnPredicateToPredicate now takes into account the IGNORE_CASE versions of the enums

* Tidy up QueryCriteriaUtils and HibernateQueryCriteriaParser

Split HibernateQueryCriteriaParser.columnPredicateToPredicate into smaller functions
Reduce duplicated code in QueryCriteriaUtils

* Tidy up QueryCriteriaUtils and HibernateQueryCriteriaParser

Split HibernateQueryCriteriaParser.columnPredicateToPredicate into smaller functions
Reduce duplicated code in QueryCriteriaUtils (missed some code here)

* update changelog and api-vault-query docs with new API functions

* reorder Operator enums so that the ignore case enums are at the end

In case anyone is depending on the order of the enums, to keep compatibility with existing CorDapps the enums should be added at the end to prevent ordinals from breaking.
2018-09-07 10:20:21 +01:00
Michele Sollecito
584387d5ec
Fixed some problem I discovered while working on another story (#3901)
* - Fixed some problems with error handling for Observables.
- Eliminated incorrect double `stop()` call for RpcBroker.
- Added `Schedulers.shutdown()` call in `stop()` implementation for Node and Driver, to avoid stuck processes when observable pipelines go wrong.

* Fixed a missing import.

* Removed `Schedulers.shutdown()` for now.

* Fixed an issue with `pendingFlowsCount()` function.
2018-09-06 13:11:41 +01:00
Shams Asari
be45096082
CORDA-1864: Added getter for network parameters to RPC (#3892) 2018-09-05 11:17:13 +01:00
Michele Sollecito
d01dd22419
[CORDA-1937]: Refactor NodeConfiguration hierarchy. (#3856) 2018-09-04 10:26:10 +01:00
Mike Hearn
33f5aa4190 RPC: make the client library require the platform version it is built for.
Remove an unnecessary override on the CordaRPCOps interface.
2018-09-03 19:05:47 +02:00
Shams Asari
9544fac2c0
Clean up of MerkleTransaction.kt (#3880)
Primarily making the deserialiseComponentGroup method simpler.
2018-08-31 12:44:53 +01:00
Michal Kit
8e6a9818b7
CORDA-1932 Fixing network map certificate path verification (#3843)
* CORDA-1932 Fixing network map certificate path verification to be certificate hierarchy agnostic

* Addressing review comments
2018-08-31 09:35:36 +01:00
Michal Kit
d7b85b4928
CORDA-1934 Renaming INTERMEDIATE_CA certificate role to DOORMAN_CA certificate role (#3844) 2018-08-31 09:35:06 +01:00
Dominic Fox
7ee946b98f
ENT-2320 Introduce BelongsToContract annotation (#1)
* ENT-2320 Introduce BelongsToContract annotation

* Update kdoc

* Eliminate duplicate warnings
2018-08-30 10:02:18 +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
Dominic Fox
f81428eb53
Corda 1916: signature attachment constraints (#3839)
* Create constraint, extract Jar signature collection

* Extract JarSignatureCollector into its own file

* Jar signature collection throws exception if signatures are inconsistent

* Focus testing in Jar signature collection

* Extract some helper functions in test

* Patch tests with mock attachment storage

* Assert that generated constraint is satisfied by signed attachment

* Clarify constraint selection logic

* Explicit return types on extension methods

* Link to docsite Signature Contrainsts documentation

* Fix issue with shared JAR reading buffer
2018-08-24 17:21:54 +01: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
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
Mike Hearn
785bae9e48 Minor: add a missing kdoc for InsufficientBalanceException 2018-08-23 13:12:18 +02:00
Chris Rankin
040de41e27
CORDA-1925: Include Requirements object in core-deterministic. (#3841) 2018-08-23 10:08:20 +01:00
Florian Friemel
2fae95c58f
[CORDA-1917] Fix smoke test (#3823) 2018-08-22 13:16:07 +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
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
Michele Sollecito
e5e4596461
[CORDA-1681]: It is not possible to run stateMachinesSnapshot from the shell (fixed). (#3791) 2018-08-15 17:02:25 +01:00
Michele Sollecito
7a1b75ef35
[CORDA-1822]: Derive error code from exception signature (#3774) 2018-08-15 10:22:09 +01:00
Roger Willis
75ac13815b
Updates to new resolve tx flows... (#3766) 2018-08-10 16:19:09 +01: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
Andrius Dagys
ce5f38104b
ENT-2168: Add a shell command to check for an existing transaction (#3762)
* ENT-2168: Add a shell command to check for an existing transaction

When a double-spend occurs the notary returns the hash of the consuming
transaction id. I've added a 'hash-lookup' shell command that matches
any recorded transactions on the node against this id hash to determine
whether the state has been consumed by this node (that could happen in certain race conditions).
2018-08-09 18:33:51 +01:00
Viktor Kolomeyko
441fe78e41
CORDA-1568: Change Java source files encoding for all the projects. (#3707)
* CORDA-1568: Change Java source files encoding for all the projects.

See: https://ci-master.corda.r3cev.com/viewLog.html?buildId=103073&tab=buildResultsDiv&buildTypeId=Corda_BuildWindowsTest

```
InteractiveShellJavaTest.flowStartWithComplexTypes
show details
No applicable constructor for flow. Problems were:
[party: Party]: missing parameter party
[pair: Pair]: missing parameter pair
[Amount]: Could not parse as a command: Did not recognise the currency in £10 or could not parse
```
2018-08-06 11:59:30 +01:00
Tudor Malene
055ba90e0d
CORDA-1724 Add tx access right validity check during resolution (#3732)
* CORDA-1724 Add tx access right validity check during resolution

* CORDA-1724 Fix missing payload type

* CORDA-1724 Fix test

* CORDA-1724 Add test

* CORDA-1865 Improve comments

* CORDA-1724 Address code review comments
2018-08-02 08:26:58 +01:00
Jonathan Sphar
56c0067540 Added jvmoverloads annotation to SignTxnFlow constructor (#3735) 2018-08-01 23:06:43 +01:00
Tudor Malene
6499a13951
CORDA-1865 Fix race on inserting attachments (#3734)
* CORDA-1865 Fix race on inserting attachments

* CORDA-1865 Fix race on inserting attachments
2018-08-01 18:11:42 +01:00
Dominic Fox
7182542724
Matchers (#3716)
* Move common matches to testing, add some missing ones

* Clarify test logic

* Move common matches to testing, add some missing ones

* Clarify test logic

* Rename 'randomise'

* endregion

* Fix broken unit test
2018-08-01 10:18:54 +01:00
Shams Asari
dfafdbcb9f
Added checks against the use of the special uploader tokens (#3724)
"app", "rpc", "p2p" and "unknown" have security implications (see isUploaderTrusted method) and thus they are not allowed to be used in the uploader field when importing attachments via the public API.
2018-07-31 17:01:39 +01:00
Shams Asari
994fe0dbdc
CORDA-1845: Check for min plaform version of 4 when building transactions with reference states (#3705)
Also includes some minor cleanup brought up in a previous PR.
2018-07-31 16:07:35 +01:00
Tudor Malene
85caa9ee9d
Feature/corda 1847/remove hibernate observers (#3696)
* CORDA-1847 Fix hibernate observer issue

* CORDA-1847 Fix hibernate observer issue

* CORDA-1847 Fix hibernate observer issue

* CORDA-1847 Fix tests

* CORDA-1847 Fix tests

* CORDA-1847 Fix tests
2018-07-31 13:52:13 +01:00
Shams Asari
93bb24ed17
Internal mock node clean up (#3715)
* InMemoryMessagingNetwork.InMemoryMessaging renamed to MockNodeMessagingService and moved to internal package
* start method added to MockNodeMessagingService which enables AbstractNode to call makeMessagingService in its c'tor
* Removed TopicStringValidator as it's no longer used
* Clean up of TestStartedNode
* Merged InMemoryMessagingTests into InternalMockNetworkTests as it's testing InternalMockNetwork
2018-07-30 10:35:03 +01:00
Roger Willis
8207ac3222
CORDA-1332 Reference input states (#3525)
* * First commit for reference input states feature.

* Added docs.
* Added additional test.

* Fixed whitespace.

* Rebased to master.
* Updated Raft and persistent notary implementations.

* Updated changelog.

* Updated topo sort to handle reference states.
* Stubbed out with referenced states flow.

* Added WithReferencedStatesFlow.
* Added Tests for WithReferencedStatesFlow.
* Added ReferenceState type.
* Rebased to latest version of master.

* Added better comments.
* Updated unit test.

* Added comment to explain a little hack.
* Fixed broken contract upgrade RPC test.

* Added minimum platform version check.
* Updated mock network so that notary nodes inherit the platform version set by the network's minimum platform version.
* References states can now only be used when minimum platform version >= 4.

* Created a new file to hold async operations as "WaitForStatesToUpdate" is broadly reusable.
* Refactored WithReferenceStatesFlow

* Updated javadoc for WaitForStatesToUpdate aysnc operation.

* Added network parameters property to InternalMockNetwork.

* Added min platform version capability to mock services.

* Removed erroneous chars from file.

* Made async operation internal and now call it from FlowLogic.
* Moved some transaction checking code around.

* Removed serializable annotation from referenced state and ref.
* Added reference states design doc.
* Added missing KDocs.
* Updated with reference states flow to handle consecutive update races.
* Made platform version info an inheritable thread local.
* Fixed various typos.
* Updated docs.

* Fixed race.

* Removed min platform version checks as API needs more thought.

* Added deprecation to method and supressed warnings.

* Renamed WaitForStatesToUpdate to WaitForStateConsumption.
* Fixed race in WaitForStateConsumption.

* Addressed PR comments and updated comments / KDocs.

* Reverse vault bugfixes.

* * Vault bug fixes.

* * Fixed broken test.
* Moved WaitForStateConsumption to internal package.
2018-07-25 14:06:56 +01:00
Dominic Fox
f5b86d32f8
Eliminate StartedNode (#3690)
* Shrink StartedNode

* Eliminate StartedNode
2018-07-25 13:49:34 +01:00