Commit Graph

1857 Commits

Author SHA1 Message Date
Tudor Malene
24f63b2e64 CORDA-2689 Remove annoying ProgressTracker warning. (#4970) 2019-04-01 17:20:39 +01:00
Dominic Fox
17e7cd3abc ENT-3121 - restrict custom serializers (#1852)
* Tests for custom registry restrictions

* ENT-3121 restrict custom serialisation

* Remove redundant code

* Only count declared annotations

* Check annotation on superclasses, remove annotation from ByteArray

* Forbid custom serialization of primitive types

* Remove @CordaSerializable from another class that is always handled by custom serialisation

* Add log warnings to aid diagnosis of custom serialization issues

* Remove another annotation

* Remove another annotation

* Remove another annotation

* Remove another annotation

* Fixup api-current

* Fixup api-current

* KDocs on exceptions
2019-03-29 14:48:07 +00:00
JamesHR3
d9e11b21ae Remove targetPlatformVersion check from FinalityFlow and update docs (#4955)
In Corda 4, FinalityFlow was updated to become an initiated flow, in order to ensure a node does not have to accept any signed transaction it receives without being able to check it first. The old behaviour of FinalityFlow was gated behind a targetPlatformVersion check, to prevent apps targeting V4 from using the old behaviour.

This is problematic for a few reasons. For an app wishing to be backwards compatible with a version running on V3, this forces the app to set targetPlatformVersion = 3, even if the app is thoroughly tested against V4. This goes against the purpose of the targetPlatformVersion. Another consequence is that an app remains pinned to targetPlatformVersion = 3 until it is sure that there are no other apps running at a lower version in the network, which would prevent newer versions of the app from taking advantage of features gated behind targetPlatformVersion checks. (Note that the restriction only prevents a new version of the app from initiating FinalityFlow with the old version - the old version is able to initiate a FinalityFlow and the new version will handle it, assuming the app has been written correctly.)

This fix removes the targetPlatformVersion check from FinalityFlow, and also provides a few documentation updates to clarify what level of testing would be expected to set a targetPlatformVersion.
2019-03-28 14:21:59 +00:00
dazraf
270444ab3e CORDA-2769 - fixed infinite recursive call for copy implementation. (#4912) 2019-03-27 18:51:35 +00:00
Chris Rankin
6cd2e6eb86 CORDA-2804: Replace JPA 2.1 annotations with JPA 2.2. 2019-03-27 15:33:23 +01:00
Tudor Malene
b0cf41ef58 CORDA-2615 - add fix for serialization failure on relevancy check.
CORDA-2615 - add fix for serialization failure on relevancy check.

CORDA-2615 - add fix for serialization failure on relevancy check.

CORDA-2615 - add fix for serialization failure on relevancy check.

CORDA-2615 - fix test

Create reconnecting proxies
2019-03-27 11:51:36 +01:00
Tudor Malene
51a983bd8e CORDA-2803: Add default timeouts for the http connections (#4929) 2019-03-25 17:03:13 +00:00
dazraf
b6f9b86998 CORDA-2772 - fix edge case when stickTo.hashCode return Int.MIN_VALUE 2019-03-22 14:56:05 +01:00
josecoll
5eea37679f
Minor clarification on implication of setting 'checkSufficientSignatures' parameter. (#4919) 2019-03-22 13:48:09 +00:00
Dominic Fox
0ab6b4de89 CORDA-2765 Make TransactionVerificationExceptions serializable (#4908) 2019-03-20 17:33:37 +00:00
Chris Rankin
3333464c39 BUILD: Fix some warnings about @BelongsToContract in tests. (#4902) 2019-03-19 18:16:24 +00:00
JamesHR3
a90f394d43 [CORDA-2738] Allow the ProgressTracker to cope with child trackers with the same steps (#4894) 2019-03-18 13:50:29 +00:00
JamesHR3
76dc981b91 [CORDA-2737] Buffer events from observables in ProgressTracker until subscribed to (#4882) 2019-03-13 16:33:29 +00:00
Chris Rankin
ea263b3e54 CORDA-2569: Add "flow kill <ID>" command to Corda's shell. (#4861)
* CORDA-2569: Add "flow kill <ID>" command to Corda's shell.

* Add testing and documentation for RPC killFlow operation.
2019-03-08 16:39:22 +00:00
Rick Parker
1c38ecee7b
ENT-3256 Small performance enhancement and OS preparation for ENT changes (#4857) 2019-03-07 14:47:51 +00:00
Tudor Malene
9ab4a3e24c ENT-3141 - Improve jar verification. (#4841)
ENT-3141 Address code review comments
2019-03-05 13:26:06 +00:00
Tudor Malene
1337c35ee6 ENT-3219 Handle more exceptions for addMissingDependencies (#4839)
CORDA-2692 Addressed code review comments.

CORDA-2692 Address code review comments

CORDA-2692 Address code review comments
2019-03-05 13:25:04 +00:00
Chris Rankin
fae74eecde CORDA-2694: Prevent Node Explorer from crashing should it receive unknown transaction objects. (#4842)
* CORDA-2694: Prevent Node Explorer from crashing should it receive unknown transaction objects.
Also ensure that LazyMappedList can only handle TransactionDeserialisationExceptions.

* CORDA-2694: Add unit tests for eager LazyMappedList behaviour.

* CORDA-2694: Hide LazyMappedList from the client:jfx module.

* CORDA-2694: Create an unknown transaction state that has the correct notary.
2019-03-05 08:49:23 +00:00
Katelyn Baker
cfccfd075e
CORDA-2688 - Add Serialization Context option for no carpenting (#4849)
* CORDA-2688 - Add Serialization Context option for no carpenting

Can be used by the attachment class loader - Serialization Framework
will still consume all Exceptions and throw a NotSerializableException

* Fix tests
2019-03-04 17:44:56 +00:00
Katarzyna Streich
a000ac3dcc ENT-3075 Java versions with -ea at the end are valid too (#1853) 2019-03-02 17:41:48 +01:00
Dominic Fox
45c56b68fb ENT-3166 don't depend on cause for message 2019-03-01 11:33:43 +01:00
Rick Parker
adad7862d6
ENT-3187 Check that we're not calling toList on concurrent collections (#4828)
* ENT-3165 Kotlin toList() does not work on concurrent collections.  OS backport.

ENT-3165 Added comment.

* ENT-3187 Additional use of toList() on concurrent data structure.
2019-02-28 16:01:33 +00:00
James Higgs
fbda11dbc8 Ensure criteria sent from a V3 RPC client can be deserialized 2019-02-28 09:47:13 +01:00
Rick Parker
4721b1d095
ENT-3165 Add unit test for reference state consumption. (#4818) 2019-02-26 20:30:47 +00:00
Tommy Lillehagen
8fb3d4dc01
CORDA-2669 - Reintroduce pendingFlowsCount (#4806)
* CORDA-2669 - pendingFlowsCount not in public API

Reintroduce `pendingFlowsCount` to public API (as deprecated). Advise
to use the `gracefulShutdown` command in the shell instead.

* CORDA-2669 - Add pendingFlowsCount to api-current.txt
2019-02-23 17:10:32 +00:00
JamesHR3
efabab35c4 [CORDA-2636] Ensure states created with contract upgrades can be migrated (#4786)
* Ensure states created with contract upgrades can be migrated

* Remove line from api-current.txt representing an uncallable constructor
2019-02-19 09:48:39 +00:00
Tommy Lillehagen
21d32681ff
CORDA-2634 - Fix derivation of currentTargetVersion for abstract classes (#4784)
* CORDA-2634 - Fix default currentTargetVersion

* CORDA-2634 - Include abstract flow classes in CorDapp class scanning

* CORDA-2634 - Run test for target platform version 4
2019-02-19 08:47:49 +00:00
Tudor Malene
626fa19769 CORDA-2631 - removed unused version mapping and revert tracking test (#4781)
CORDA-2631 - removed unused version mapping and revert tracking test
2019-02-18 14:49:57 +00:00
Mike Hearn
69ba95a961 Minor: Fix deprecation warnings from a unit test. 2019-02-18 14:02:36 +01:00
JamesHR3
9353e4dd93 [CORDA-2561] Use the attachments classloader to deserialise contract states in migrations (#4754)
* Use the attachments classloader to deserialize contract states in migrations

* Added some comments to explain serialisation behaviour and how tests work.

* Add debug log to indicate when attachment classloading has failed.

* Use a servicesForResolution to load states for compatibility with notary changes and contract upgrades

* Add test case to cover notary change transactions

* Address review comments

* Change logging message in MigrationServicesForResolution

* Read the network-parameters file if there is nothing in the database

* Update documentation and provide a warning if there are many states.
2019-02-17 08:24:02 +00:00
Tudor Malene
e5c7355d43 CORDA-2550 use cordapp classloader for explicit upgrades (#4766)
CORDA-2550 use cordapp classloader for explicit upgrades

CORDA-2550 Fix api break

CORDA-2550 Fix api break

CORDA-2550 Fix api break

CORDA-2550 Address code review comments

CORDA-2550 Fix error

CORDA-2550 Remove redundant field.

CORDA-2550 Remove redundant field.

CORDA-2550 remove unnecessary copy method

CORDA-2550 remove unnecessary copy method
2019-02-16 17:46:23 +00:00
JamesHR3
9b2725d3aa [CORDA-2486] Improve transaction deserialisation errors and fix possible migration issue (#4761)
* Improve error when transaction deserialisation fails and move migrations for finance to contracts CorDapp

* Revert move of migrations and errors thrown from CordaRPCOps

* Ensure VaultQueryException is thrown from vault queries and remove unused import

* Improve error reporting from VaultQueryException

* Fix API break

* Fix vault query test failure due to exception change
2019-02-15 17:43:04 +00:00
Tudor Malene
3d362e066c CORDA-2595 - check that all attachments are trusted before loading (#4763)
CORDA-2595 - Fix test and api.

CORDA-2595 add test

CORDA-2595 fix tests

CORDA-2595 fix test and address code review comments

CORDA-2595 address code review comments
2019-02-15 17:33:14 +00:00
josecoll
a17ab0d547 Revert unnecessary refactoring. 2019-02-15 10:55:13 +01:00
josecoll
758c855493 Adjust warning level. 2019-02-15 10:55:13 +01:00
josecoll
6314c1757a Incorporating feedback from PR review. 2019-02-15 10:55:13 +01:00
josecoll
4feac7f3f0 Shorten system property name. 2019-02-15 10:55:13 +01:00
josecoll
e252401169 Disable hash constraints using system property. 2019-02-15 10:55:13 +01:00
Roger Willis
060bbb0a9d CORDA-2563: Assign external IDs when creating new keys (#4727)
* First pass at fixing 2563.

* In memory KMS now maps keys to IDs.

* CreateDatabaseAndMockServices now creates a persistent key management service and a can take a persistent identity service, so now the external id mapping works for mock services.

* * Created a helper for mock services which allows the creation of a mock services with persistent identity management service key management service and vault.
* MockNode now uses persistent key management service - not sure why it didn't do before?

* * MockNode now uses BasicHSMKeyManagementService
* Updated api-current file

* Little fix required after rebase to master.

* Fixed broken test.

* Added informative error messages to UnsupportedOperationExceptions thrown by E2ETestKeyManagementService.

* Removed redundant private constructor for mock services from api-current.txt.

* Addressed Rick's comments.
2019-02-14 15:18:37 +00:00
josecoll
0bdc8b363a
CORDA-2576 Viral update propagation: select attachments from those loaded by node on startup. (#4745)
* Retrieve contract attachment(s) loaded by node.

* Remove redundant integration test case (downgrade rule checking)

* Address PR review comments.

* Revert changes to classloading dependencies hack.
2019-02-14 13:39:14 +00:00
Stephen Houston
a0fb21446e Simple change to the message returned when the requested legal identity does not exist on the Node. Previously it returned Node does not have an identity, which is slightly confusing as the Node does have a legal identity, just not the one that was requested. Changing the message text to Node does not have the requested identity of makes it clearer that the client requested an identity different to any of the ones that this Node represents.
Added an isLegalIdentity function that allows the client to check if the Node represents the requested CordaX500Name without throwing an exception if it does not.
2019-02-14 09:55:33 +01:00
Tudor Malene
3fef5d8239 CORDA-2570 Add comment for future performance optimisation. 2019-02-13 13:42:42 +00:00
Tudor Malene
fc0b1431ad CORDA-2570 fix KDoc 2019-02-13 13:30:37 +00:00
tudor.malene@gmail.com
00ddb5793d Merge branch 'master' into feature/CORDA-2570/revert-to-one-attachment-per-contract
# Conflicts:
#	core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt
#	core/src/test/kotlin/net/corda/core/contracts/ConstraintsPropagationTests.kt
2019-02-13 13:10:28 +00:00
Tudor Malene
764b33ded5 CORDA-2570 address code review comments 2019-02-13 12:17:48 +00:00
szymonsztuka
10e7c07c11
CORDA-2577 Disable or delete the no-downgrade rule (#4741)
With (Contract JARs) rolling upgrades the downgrade rule cannot be effectively check as the platform can't tell the difference between a transaction that's downgrading because of an attack, vs a transaction that's downgrading because Alice has upgraded but Bob hasn't yet. During a rolling upgrade we would expect state versions to fluctuate up and down as data gets read/written by a mix of nodes. With the feature as implemented Alice will upgrade and start trading with Bob. Bob will be able to read and process the states Alice sent him, but the moment he tries to consume such a state he will fail. This will result in cascading flow deaths and a hung business network the moment an upgrade starts.
2019-02-13 11:36:43 +00:00
Tudor Malene
4a4788ad41 CORDA-2570 fix test 2019-02-13 10:58:28 +00:00
Tudor Malene
9448b9bd86 CORDA-2570 revert multiple contract attachments per transaction 2019-02-12 18:49:05 +00:00
Tudor Malene
a6510ae952 CORDA-2570 revert multiple contract attachments per transaction 2019-02-12 18:41:45 +00:00
Mike Hearn
f541843eff Temporary workaround for a bug that was exposed by a refactoring. Will follow up with a fix in another PR. 2019-02-11 17:10:50 +01:00