Commit Graph

679 Commits

Author SHA1 Message Date
Katelyn Baker
198fb4f264
CORDA-1192 - Quieten message when reflecting on a builtin Kotlin type (#2767)
* CORDA-1192 - Quieten message when reflecting on a builtin Kotlin type

* review comments
2018-03-08 23:07:41 +00:00
Matthew Nesbit
b3203c9f3e
Remove a mistakenly duplicated constant defined on ArtemisMessagingComponent (#2765) 2018-03-08 12:44:05 +00:00
Konstantinos Chalkias
d70cd26a7c
Kdoc/comment updates (#2626) 2018-03-08 10:52:07 +00:00
Katelyn Baker
e6ed91df8b
CORDA-1186 - Move ConstructorForDeserialization out of internal (#2759)
Since it's a user facing object it shouldn't exist in an internal
package. Move to core to exist with the other serialization annotations
2018-03-07 16:02:01 +00:00
Matthew Nesbit
519644ce0d
CORDA-1170: Define and whitelist the Artemis/AMQP application headers that are accepted by Corda (#2728)
* Whitelist headers copied across bridges

* Address PR comments
2018-03-07 08:56:58 +00:00
Matthew Nesbit
81f4bbcaf3
Fix flaky bridge test and an associated deadlock during rollback in the BridgeManager code. (#2739) 2018-03-06 10:49:29 +00:00
Tudor Malene
5efea22a9b
Network Bootstrap changes to master (#2736)
* Added exclude whitelist to Network Bootstrapper to enable fine grained testing (#2666)

* Added exclude whitelist to Network Bootstrapper to enable fine grained testing.

* code review change

(cherry picked from commit d4f9b10)

* CORDA-1150 - better log messages (#2721)

* CORDA-1150 better log messages

* CORDA-1150 better log messages

* CORDA-1150 better log messages

(cherry picked from commit 87c5ad8)

* fixed merge

* remove unused function
2018-03-05 19:10:48 +00:00
Katelyn Baker
d116b5e9f4
CORDA-1140 - FOR RPC Client P2P context use AMQP (#2716)
* CORDA-1140 - FOR RPC Client P2P context use AMQP

* Review comments

* Review comments

* review comments

* review comments
2018-03-05 18:05:32 +00:00
Andrzej Cichocki
26fe90c8e9
CORDA-973 Allow deserialization of any checkpoint/storage encoding. (#2693) 2018-03-05 10:11:26 +00:00
Katelyn Baker
799d90b350
CORDA-1134 - Don't use private serializes for all caps public properties (#2692)
* CORDA-1134 - Don't use private serializes for all caps public properties

* Small fix

* Review Comments
2018-03-02 13:21:27 +00:00
Katelyn Baker
06a6eace67
CORDA-1115 - Cannot serialize private nested objects (#2665)
* CORDA-1115 - Cannot serialize private nested objects

Shown up by the simm-valuation-demo the problem was where a private
object field of an object was being serialised within the outer objects
context (see tests added for example)

Fix is to switch from Kotlin reflection back to Java.

Additional fix to the test where it was comparing two lists of state
references in a flow and they weren't equal because they weren't in the
same order... This I assume is just an oversight (in that them being
in a different order but otherwise the same is actually fine) so
converting to set comparison

* Fix forward port issue where fingerprinting has moved

* Review Comments

* Review Comments

* Review Comments

* Gran -> Grab
2018-03-02 13:13:00 +00:00
Shams Asari
8616f24523
CORDA-1048: Making it simpler to move an existing local deployment of nodes to across different machines. (#2672)
This was achieved by having the hash in the node-info file to be just of the node's X.500 name. This also solves existing duplicate node-info file issues that we've been having.

Also updated the docsite.
2018-03-01 21:24:10 +00:00
Michele Sollecito
b580a2ac30
[CORDA-926]: Parsing NodeConfiguration will now fail if unknown properties are present. (#2484) 2018-03-01 14:57:36 +00:00
Christian Sailer
0ff37c0437
CORDA-1122 Switch AMQP bridge to use auto-commit sends and acks (#2661)
* CORDA-1122 Switch AMQP bridge to use auto-commit sends and acks

* CORDA-1122 Codereview: Add comment for extra commit to rollback and add better message sequence logging to tricky test
2018-02-27 15:25:58 +00:00
Maksymilian Pawlak
3066926f0f
Improved classloader closing (#2650)
* Better handling of classloader closing
2018-02-27 11:15:23 +00:00
Maksymilian Pawlak
cc84b34dca
Close classloader to release associated file (#2635)
[CORDA-1113] Close classloader to release associated file
2018-02-26 15:01:57 +00:00
Andrius Dagys
0edfef2409 CORDA-696 - Create separate transaction types for contract upgrade transactions (#2589)
* CORDA-986 and CORDA-985 CompositeKey and Signature verification performance fixes (#2467)

* CORDA-696: Create separate transaction types for contract upgrade transactions.

Add rationale around upgrade transactions

Move contract upgrade transaction resolution logic into internal until it's stabilised.

Throw a better exception when contract attachment not found

Default legacy contract constraint to always accepting - needs to be changed to whitelist constraint before merging

Introduce a new upgraded contract interface that allows specifying the legacy constraint.

Remove StateLoader, make all tx resolution functions take in ServicesForResolution

Contract upgrade transactions can handle whitelist by zone constraints

When creating a contract upgrade transaction, make sure the attachment of the old cordapp gets attached when using hash constraints.
Attachment lookup for a given contract class name only scans currently loaded cordapps, and we don't load old versions of cordapps.

CORDA-696: Update upgrade docs
2018-02-26 11:29:25 +00:00
Michele Sollecito
5be0e4b39e
[CORDA-941]: Add NetworkParameters contract implementation whitelist. (#2580) 2018-02-23 14:29:02 +00:00
Patrick Kuo
1552e992e7
ENT-1443 Add cert role to CSR and doorman issue cert according to the cert role (#2620)
* ENT-1443 Add cert role to CSR and doorman issue cert according to the cert role (#431)

* Doorman and HSM create certificate base on requested cert role specified in the certificate signing request.

(cherry picked from commit 94f7392)

* remove R3 corda code
2018-02-23 13:38:09 +00:00
Andrzej Cichocki
c8672d373f
CORDA-973 Compression support for serialization (#2473)
* Serialization magic is now 7 bytes
* Introduce encoding property and whitelist
2018-02-23 13:07:51 +00:00
Shams Asari
2af0feee04
Various cleanup of the network map code (#2604) 2018-02-23 09:13:00 +00:00
Katelyn Baker
a223fdb8d3
DOCS - Separate parameter names in exceptions in a clear fashion (#2577) 2018-02-20 16:38:47 +00:00
Andras Slemmer
dc268ebe63
Merge pull request #2477 from corda/aslemmer-corda/issues/2300
Add RPC deduplication to client and server
2018-02-19 16:25:36 +00:00
Andras Slemmer
32bcf0a06c Address more comments 2018-02-19 15:16:12 +00:00
Andras Slemmer
7f1bfac8b0 Write better test for dupes 2018-02-19 14:53:28 +00:00
Matthew Nesbit
fee89c044f
Enhance the pluggability of the bridging and messaging code, so that more complex HA and out of process bridges can be written. (#2558) 2018-02-16 16:13:05 +00:00
Matthew Nesbit
cb7a0229a8
Fix a hang in AMQP protocol code that occurs when pausing in debugger causes protocol timeout, but wasn't driving event procesing to actuially kill the socket. (#2557) 2018-02-16 16:03:39 +00:00
Shams Asari
2864ce1384
ENT-1519: Ensure NodeInfo always has at least one address by checking in the c'tor (#2538)
Further, the look up of the node's own node-info from its database has been tightened to ensure there isn't more than one.

Also fixed some brittle code which was assuming exactly one address rather than at least one.
2018-02-15 14:06:41 +00:00
Andras Slemmer
6a4f783106 Hack around database-with-observables issue 2018-02-14 17:30:32 +00:00
Katelyn Baker
5de1ca7127
CORDA-1032 - unnamed ctor param serialization issue (#2532) 2018-02-14 17:22:08 +00:00
Anthony Keenan
3e8d76334e
CORDA-939 Modify Api Scanner to check api for internal exposures (#2510)
* Update check api changes to look for internals

* Update several more uses of internal

* Make check-api-changes script filter out internal class usages

* Make CordaClock part of API

* Update api-current.txt

* Remove exclusion of nodeapi.internal

* Remove access to CordaPersistence from public api

* Don't expose DB Connection from StartedMockNode and remove unnecessary transaction from CustomVaultQueryTest

* Make internal tests that use need db access use InternalMockNetwork

* Make test certificates internal

* Address further review comments

* Revert some accidental changes to api-current.txt

* Address Shams' review comments

* Update Api Scanner to filter out CordaInternal attribute

* Update api-current.txt

* Remove superfluous brackets

* Add transaction to StartedMockNode

* More leaky transaction fixes
2018-02-14 16:42:56 +00:00
Clinton
174ed3c64b
CORDA-556: Added Cordapp Config and a sample (#2469)
* Added per-cordapp configuration 
* Added new API for Cordformation cordapp declarations to support per-cordapp configuration
* Added a cordapp configuration sample
2018-02-14 14:49:59 +00:00
Andras Slemmer
7924a5a834 Add RPC deduplication to client and server 2018-02-13 18:51:59 +00:00
Joel Dudley
ad1be79900
Reorders params to put non-default args first. Creates simpler default constructors. 2018-02-12 17:02:34 +00:00
Michele Sollecito
da591363fd
CORDA-990: Flows Draining Mode (#2483)
[CORDA-990]: Flows draining mode.
2018-02-12 16:13:43 +00:00
Patrick Kuo
ddf0d34147
CORDA-1008 Samples fail to run due to wrongly configured max transaction size in the network bootstrapper (#2509)
* [CORDA-1008] - Samples fail to run due to wrongly configured max transaction size in the network bootstrapper

* address PR issues
2018-02-12 15:33:22 +00:00
Michal Kit
d1627fed5b Backporting introduction of constants for the dev certs from enterprise (#2502) 2018-02-12 12:12:16 +00:00
Katelyn Baker
3c4212a3d6
CORDA-992 - Make the finger printer pluggable for serialization factory (#2479)
Facilitates easier testing
2018-02-12 10:07:25 +00:00
Andras Slemmer
d01b2cbe97 Address comments, fix test 2018-02-09 16:03:36 +00:00
Andras Slemmer
0a88b76e46 r3corda wire compatibility 2018-02-09 14:50:20 +00:00
Andrzej Cichocki
1902a4f11e
CORDA-973 Refactoring for serialization compression support (#2466)
* Use constant for empty byte array
* Less byte array copying
* Fix InputStreamSerializer trailing garbage
* More OO kryo streams
* Introduce SerializationMagic
* Introduce non-copying slice on ByteSequence
2018-02-09 11:54:07 +00:00
Katarzyna Streich
6acff3a7df
First approach to network parameters updates (#2412)
* Network parameters updates

Add two RPC methods networkParametersFeed and
acceptNewNetworkParameters. Implementation of client handling of network
parameters update event. Partial implementation of accepting new
parameters and installing them on the node as well as node startup with
updated parameters.

Move reading of network parameters on startup to separate
NetworkParametersReader class. Add tests.

Move NetworkParameters and NotaryInfo classes to core.

* Ignore evolvability test - to be fixed later

* Add documentation on update process
2018-02-08 14:31:43 +00:00
Katelyn Baker
95f062e8ff
CORDA-904 - Fix evolver to work with setter instantiated classses (#2463)
* CORDA-904 - Make evolver work with classes that use setters

* review comments

* review comments

* small fixs

* don't include systemTest in compiler.xml
2018-02-06 12:55:49 +00:00
Katelyn Baker
69c989478a
CORDA-979 - Make public Java setter accessible within Kotlin (#2464)
* CORDA-979 - Make public Java setter accessible within Kotlin

* Review comments
2018-02-05 16:54:58 +00:00
Katelyn Baker
429da85650
CORDA-946 - Fixes to fingerprinting breaks backward compatibility (#2453)
* CORDA-946 - Fixes to fingerprinting breaks backward compatibility

Demonstrated using the network map parameters signed form as that's
where the problem was first seen

* Review Comments
2018-02-05 12:07:02 +00:00
Katelyn Baker
a08d333d5b
CORDA-978 - Only consider getters that accpet zero parameters (#2462)
* CORDA-978 - Only take getters with zero parameters

* tidy up
2018-02-05 09:48:41 +00:00
Katelyn Baker
57ba9cdf06
CORDA-915 - Replace BEANS introspector with standard reflection (#2400)
* CORDA-915 - Replace BEANS introspector with standard reflection

Removes lib dependency and puts something in place we can better
control

* CORDA-915 - Review comment corrections

* Review Comments
2018-02-02 16:58:43 +00:00
Mike Hearn
38ccd0572c
Use Java reflection for determining if a type is a Kotlin singleton. (#2446)
Kotlin's own reflection has a habit of throwing weird errors and does not work for private objects - thus the unit test which tests this feature has actually never worked properly, but somehow works by accident. An attempt to upgrade to the latest Kotlin revealed the issue so it must have always been unstable.
2018-02-02 17:17:23 +01:00
Katelyn Baker
00b90a98fb CORDA-943 - Cope with multiple generics at str->type conversion in AMQP
Also fixes an odd bug where the inferred type of a getter wasn't
matching the constructor parameter type because that was still unbounded
and seen as T, looking at the raw type allows us to inspect this
properly
2018-02-01 12:19:32 +00:00
Katelyn Baker
222c5b9db8 CORDA-943 - Fix trader demo
This is a multi issue problem
1. Fingerprinting of generics treats <T> and <?> differently, forcing
the evolver to be used when not needed

2. However, the evolver is required sometimes as generics are not
guaranteed to fingerprinting bi-directionally (thanks to type erasure of
deeply nested generic types). However, with serialization now writing
properties in a specific order, we need to ensure they're read back in
that order before applying them to an evolved constructor so as to
not corrupt the object reference cache
2018-01-31 14:58:00 +00:00
Matthew Nesbit
ceff50d656
Refactor location of bridge code to allow out of process bridging (#2431)
Fix some issues Andras has seen
2018-01-30 16:29:59 +00:00
Matthew Nesbit
0ff9c9e2e3
Move to message based bridge control protocol (#2410)
Tidy up

Remove dead RPCSecurity logic from ArtemisMessageServer

Address PR comments

Address PR comments
2018-01-25 17:53:34 +00:00
Shams Asari
0fa6969d5d
Added various X509 utilities to remove some of the existing boilerplate. (#2416) 2018-01-24 18:07:29 +00:00
Shams Asari
61c7de22d6
Replaced KeyStoreWrapper with X509KeyStore, which is still a wrapper but assumes only X509 certs and has better APIs (#2411) 2018-01-24 07:51:55 +00:00
Michele Sollecito
142f52fa82
[CORDA:936]: Enable RPC layer to work with SSL 2018-01-23 16:23:37 +00:00
Anthony Keenan
70f1fdeb2b
CORDA-939 Make SerializationEnvironmentRule.env private so as not to expose internals. (#2404)
* Make SerializationEnvironment private so as not to expose internals.

* Only expose used parts of api

* Make properties lateinit

* Removing java calls to getEnv

* Initialise properties at declaration

* Tidy up imports
2018-01-23 14:42:30 +00:00
Michal Kit
4a3379ac8a
CORDA-937 adding node key pair to utility/testing methods (#2405) 2018-01-22 13:06:22 +00:00
Andrzej Cichocki
1fc646cfa8 CORDA-716 Move test-utils and node-driver to stable API section in docs (#2335)
* Move test-utils and node-driver to stable section.

* Move FlowStackSnapshotFactory to testing.services package & update docs

* Move SerializationTestHelpers to testing.core package

* Move TestConstants.kt to core namespace

* Move Expect.kt to core namespace

* Move CoreTestUtils to core.TestUtils - rename class and update imports

* Added some clarification to documents after re-reading them

* Added static imports

* Removing unused import

* Fix merge conflict

* Fixing merge conflict
2018-01-22 11:28:41 +00:00
Katelyn Baker
9df35ae5d3
Merge pull request #2383 from corda/kat/feature/deterministicSerilaizer
CORDA-914 - Deterministic property ordering for AMQP serialization
2018-01-18 10:29:57 +00:00
Andrzej Cichocki
bbcafca959
Retire DatabaseTransactionManager. (#2385) 2018-01-18 10:11:34 +00:00
Katelyn Baker
0e047d9263 CORDA-914 - Deterministic property ordering for AMQP serialization 2018-01-17 17:52:33 +00:00
Matthew Nesbit
6edf95506b
Rename the inbox (#2360)
Add changelog entry

Address review comments

Alternate solution to service queues

Fixup after merge
2018-01-17 16:06:31 +00:00
Andrzej Cichocki
ea57639a37
CORDA-924 Fix IntegrationTestingTutorial (#2349)
i.e. H2 startup bug. also:
* Fix poor connection pool discipline
* Log cleanup failures instead of replacing foreground failure
2018-01-17 14:23:13 +00:00
Andras Slemmer
91779276fc Use single thread per netty eventgroup during testing 2018-01-15 11:18:29 +00:00
Andrius Dagys
fb1d3087de Raft notaries can share a single key pair for the service identity (in contrast to a shared composite public key, and individual signing key pairs). This allows adjusting the cluster size on the fly. 2018-01-13 16:36:41 +00:00
Shams Asari
bbfbb08c43
CORDA-881: Signed network parameters has the network map cert attached to it instead of just the public key. (#2346)
Introduced DigitalSignatureWithCert and SignedDataWithCert as internal APIs, with the expectation that they will become public; renamed the network parameters end-point to network-parameters; updated the network-map.rst doc; and did some refactoring.
2018-01-12 07:59:08 +00:00
Katelyn Baker
97793447d5 CORDA-855 - Adding tests for wild card generics
Can't actually get something to go through the serializer with a
wild card in place as it seems that's an impossible situation

    * Review Changes
    * CORDA-855 - Review Comments
    * Review Comments
    * Review comments
2018-01-10 15:53:28 +00:00
Katelyn Baker
41220de816 CORDA-855 - Fix for fingerprinting generics in AMQP
* Undo refactor
2018-01-10 15:36:54 +00:00
Katelyn Baker
017f865fa3 CORDA-852 - Fix AMQP serialisation of nested generic 2018-01-10 15:35:47 +00:00
Katelyn Baker
cacdba872e
CORDA-908 - Support private properties in AMQP serialization (#2336)
CORDA-908 - Support private properties in AMQP serialization

* Review comments

* Fix tests

* Review Comments

* review comments

* review comments
2018-01-10 11:41:49 +00:00
Andrius Dagys
63e1bdaa94 Revert "Raft notaries can share a single key pair for the service identity (i… (#2269)"
This reverts commit 3e00676851.
2018-01-09 12:20:25 +00:00
Andrius Dagys
3e00676851
Raft notaries can share a single key pair for the service identity (i… (#2269)
* Raft notaries can share a single key pair for the service identity (in contrast to a shared composite public key, and individual signing key pairs). This allows adjusting the cluster size on the fly.
2018-01-09 08:17:59 +00:00
Rick Parker
c5149bab9f
Backport of ENT-1303 applied to 3.0-RC3 (#2332) 2018-01-08 12:11:55 +00:00
Katelyn Baker
3bf84ebbd4 Review Comments 2018-01-05 15:50:24 +00:00
Katelyn Baker
f230e2670b REVIEW COMMENTS 2018-01-05 15:50:24 +00:00
Katelyn Baker
f4ad8d3e70 CORDA-902 - AMQP Setter Construction when empty / no constructor 2018-01-05 15:50:24 +00:00
Anthony Keenan
1661cea816
CORDA-892: Make cordform test use new network bootstrapper logic (#2307)
* Make cordform test use new network bootstrapper logic

* Fixing review comments

* Fix issue with backwards compatibility

* Fix issue with setup not being called from CordformDefinitions

* Make sure node dir is created (as CordformDefinition uses it directly if setup is overridden
Make sure tmp dir is created

* Don't crash if node dir is already created

* Stop overwriting errors
2018-01-05 09:21:59 +00:00
Katelyn Baker
01e4880947 SPELLING: updae error message in tests 2018-01-04 15:49:55 +00:00
Katelyn Baker
6d485a3329 SPELLING ERROR FIX 2018-01-04 10:03:04 +00:00
Shams Asari
d84105b60e
Using X509Certificate consistently throughout, rather than BC's X509CertificateHolder. (#2305)
The later is now only used where needed. This has reduced the amount of converting we have to do back and forth.
2018-01-03 22:00:39 +00:00
Katelyn Baker
fb71a45be5 CORDA-882 - Better err messages when serializer encounters private property 2018-01-03 18:27:14 +00:00
Shams Asari
730fec2eb4
Internal driver now also does the registration for the notaries. (#2304)
Using the --just-generate-node-info flag for the notary nodes so that their identities can be submitted to the network map server, which does the network parameters generation.
2018-01-02 15:12:30 +00:00
Shams Asari
4a2f157118
Validating the entire cert path in node registration, rather just checking the root cert. (#2298)
Also reduced duplicate code when creating the node CA cert path for testing, and renamed IdentityGenerator to DevIdentityGenerator.
2017-12-29 14:38:30 +00:00
Shams Asari
39d25958e2
Fixed identity generation of single node notaries as used by the driver and MockNetwork. (#2296)
The identity cert generated used to be of type SERVICE_IDENTITY when it should have been a LEGAL_IDENTITY.
2017-12-28 15:32:09 +00:00
Anthony Keenan
1d66fe9296
[CORDA-879] Generate node directories as part of bootstrapping (#2285)
* Generate node directories as part of bootstrapping

* Include latest corda.jar in bootstrapper package
Remove SLF4J warnings on startup

* Changes post review

* More review changes

* Review changes

* Making docs clearer
2017-12-23 11:22:31 +00:00
Shams Asari
ce4a640835
CORDA-886: Removed the 60s timeout when generating node-info files in the network bootstrapper. Instead a warning is given. (#2290) 2017-12-22 15:15:21 +00:00
Shams Asari
e1e715ee81 Removed all remaining special treatment of the X500 common name.
With network parameters the CN is no longer needed to identify notaries. This frees it up to be used in the node's name alongside the other attributes.

Also, the identity generation logic has been simplified, removing the need to have magic string values for storing distributed identities in the keystore. Now there are just two alias prefixes: "identity" as it was previously, and "distributed-notary".
2017-12-18 21:39:11 +00:00
Ross Nicoll
21f0892deb
CORDA-831: Add roles to X509 certificates (#2180)
* Add roles to X509 certificates so that the identity service can always determine which certificate in a hierarchy is the well known identity
* Rename CLIENT_CA certificate type to NODE_CA
* Rename DOORMAN role to INTERMEDIATE_CA
* Correct issue in CashTests where instead of providing a well known identity to generateSpend(), a confidential identity was passed in and a confidential identity generated from it.
* Enforce role hierarchy in PKI
* Enforce that party certificates must be well known or confidential identities
* Add network map certificate role
2017-12-18 16:23:34 +00:00
Shams Asari
00a5e3db6b CORDA-830 Introducing the network bootstrapper
Copying of the node-info files moved out of Cordform and into NetworkParametersGenerator (which is now called NetworkBootstrapper). This class becomes an external tool to enable deployment of nodes in a test setup on a single filesystem.
2017-12-17 23:49:57 +00:00
Shams Asari
e9cead9055 CORDA-833: SignedNodeInfo object for holding a list of signatures, one for each identity in the NodeInfo. This forms part of the network map. 2017-12-17 19:45:58 +00:00
Andrzej Cichocki
8114a20abd
CORDA-716 Move non-API things to internal (#2256) 2017-12-17 18:44:35 +00:00
Andrzej Cichocki
2652ae111a
CORDA-716 Devrel feedback (#2266)
* * Document TestIdentity entropy and enforce that it actually works
* Ledger/transaction DSL default notary with fresh key
* MockServices default identity with fresh key
* makeTestIdentityService now takes vararg
* Require cordappPackages for MockServices
* DSL automatic serialization init
* Improve error when two MockNetworks used

* * Make cordappPackages required by MockNetwork
* Default identity service in MockServices
* Make notarySpecs Java-friendly
2017-12-15 19:18:31 +00:00
Matthew Nesbit
595d41af04
AMQP Bridging between nodes (#2181)
* Able to send hand coded messages to an Artemis node inbox

Get startup race condition fixed. Start cleanup work.

Fixup after rebase

Remove SASL hack for now

Minor tweaks. Enable AMQP mode manually.

Add configuration control

Slight clean up

Stop timeouts that don't work with AMQP

Rename class

Get TLS constants from :node-api

Primitive integration test

Put back commented line

Session per bridge to alow rollback on remote rejects.

Add more tests and handle multiple IP adddresses

Reduce logging

Fixup after rebase

Add a test to verify the remote end AMQP rejection logic works and does cause message replay.

Allow Artemis to duplicate after session rollback

Reduce number of threads

Move legacy bridge related code over to CoreBridgeManager

Shared threadpool for bridges

Add a test to confirm that no side effects when using a shared thread pool.

Address PR comments and remove dead lines

Rebase and add some comments

Remove a couple of blank lines

Ensure AMQP bridges are used in tests

Fixup after removal of testNodeConfiguration

Add a couple of doc comments

Add a couple of doc comments

Make things internal and use CordaFuture

Address some PR comments

Change comment type

* Use Artemis 2.2 to fix AMQP problems. Add explicit test of legacy core bridges, as marking the factory class private had silently broken them.

* Fix change due to using Artemis 2.2
2017-12-15 17:48:33 +00:00
Katarzyna Streich
02ad2b8b60
Fix LargeTransactionTest (#2265) 2017-12-15 16:53:57 +00:00
Katarzyna Streich
550469ea38
Wire part of network parameters (#2187)
* Take maximum message size from network parameters

* Add epoch handling

* Add handling of network parameters mismatch

Change NetworkMapClient and updater, add handle in
AbstractNode that results in node shutdown on parameters mismatch. Later
on we should implement proper handling of parameters updates.
Add tests of NetworkParameters wiring.

When node starts with compatibilityZone url configured it takes
networkParameters from the networkMap.

* Permit only one network parameters file

On node startup network parameters are read from node's base directory,
we permit only zero or one files to be there. If network map server is
configured the parameters can be downloaded at startup (if not present
in the directory already).

* Update docs on network map endpoints
2017-12-15 11:13:15 +00:00
Andrzej Cichocki
05bc05a936
CORDA-716 Retire withTestSerialization (#2240) 2017-12-14 12:42:18 +00:00
Katarzyna Streich
0df846148d
SignedNetworkMap verification fix (#2255)
* SignedNetworkMap verification fix

SignedNetworkMap verification should also include cert path validation,
which was probably moved away by accident, because docs say about the
exception CertPathValidatorException.
2017-12-14 12:06:44 +00:00
Shams Asari
2319bf396c Renamed TestIdentity.key to keyPair and pubkey to publicKey (#2249) 2017-12-14 11:30:55 +00:00
Shams Asari
e781d816a8 Removed remaining uses of KRYO_P2P_CONTEXT 2017-12-13 18:24:05 +00:00
Andrzej Cichocki
c3b9955344
CORDA-716 Fix split packages in testing (#2232) 2017-12-12 19:37:01 +00:00
Andrzej Cichocki
905c8252a6
CORDA-654 Remaining key constants (#2226) 2017-12-12 18:03:06 +00:00
Alberto Arri
2dc73ecf3b
Changed logic to check for initial certificate, now using the truststore instead of the .cer file (#2213) 2017-12-12 10:39:52 +00:00
Shams Asari
5b12c5177e Correct version strings 2017-12-11 21:11:29 +00:00
Shams Asari
6d6393d984 Merge branch 'feature-network-parameters' into shams-merge-feature-network-parameters 2017-12-11 21:10:34 +00:00
Katelyn Baker
1fb1d6fb72 CORDA-852 - Fix AMQP serialisation of nested generic 2017-12-11 20:12:32 +00:00
Katelyn Baker
4b5c60637c
Merge pull request #2017 from corda/kat/feature/enableAMQP
CORDA-780 - Enable AMQP for P2P and Storage Contexts
2017-12-11 11:37:16 +00:00
Shams Asari
e25158301f Merge branch 'master' into shams-master-merge-081217 2017-12-11 10:49:11 +00:00
Katelyn Baker
042cfee863
Merge pull request #2215 from corda/smallFixs2
Code Cleanup
2017-12-11 10:23:24 +00:00
Shams Asari
d6054e4b4f Merge branch 'master' into shams-master-merge-081217
# Conflicts:
#	node/src/main/kotlin/net/corda/node/services/config/NodeConfiguration.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/DriverDSLImpl.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/RPCDriver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/demorun/DemoRunner.kt
#	verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt
2017-12-11 10:23:16 +00:00
Katelyn Baker
c994a913a2
Merge pull request #2211 from corda/renameTransformTypes
Rename Tansform -> Transform in filename
2017-12-11 10:20:48 +00:00
igor nitto
da38e6f673
Configurable authorization/authentication data sources [CORDA-827] (#2145)
* Add support for external data source of access control data (RPC/Shell users credential and permissions), with optional in-memory caching.
* Support password encoded with Apache Shiro fully reversible Modular Crypt Format.
* Introduce 'security' field in Node configuration and related docsite page.
2017-12-11 08:39:09 +00:00
Katelyn Baker
89d452819f Rename Tansform -> Transform in filename 2017-12-08 17:31:14 +00:00
Katelyn Baker
2329254390 Additional comment corrections 2017-12-08 17:30:32 +00:00
Katelyn Baker
c66026e54b Code Cleanup 2017-12-08 17:30:32 +00:00
josecoll
4762569200
CORDA-822 - JMX Jolokia instrumentation (#2197)
* JMX Jolokia instrumentation WIP (driverDSL, webserver, cordformation, hibernate statistics, access policy config file hardening)

* Cordformation changes to support jolokia agent instrumentation at JVM startup.

* Minor updates to reflect usage of Jolokia 1.3.7 (which uses slightly different .war naming)

* Use relative path reference in -javaagent to prevent problem with long path names with spaces.

* Fixed incorrect regex pattern and added assertion to test.

* Enable JMX monitoring.

* Reporting of Hibernate JMX statistics is configurable (by default, only switched on in devMode)

* Make Artemis JMX enablement configurable.

* Re-instate banning of java serialization.

* Improve JUnit.

* Fixes following rebase from master.

* Re-instated correct regex for picking up Jolokia agent jar.

* Fixed broken integration test.

* Updated documentation

* Updated following PR review feedback.

* Fixed compilation error caused by change in DriverDSL argument type.

* Fixed compilation error caused by change in DriverDSL argument type.

* Fail fast if jolokia-agent-jvm.jar is not located.

* Applied changes in cordformation following review feedback from CA.
2017-12-08 16:27:12 +00:00
Shams Asari
65ff931f53 Merge branch 'master' into shams-master-merge-081217
# Conflicts:
#	node-api/src/main/kotlin/net/corda/nodeapi/internal/crypto/KeyStoreWrapper.kt
#	node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt
#	node/src/main/kotlin/net/corda/node/services/config/ConfigUtilities.kt
#	node/src/test/kotlin/net/corda/node/services/identity/InMemoryIdentityServiceTests.kt
#	node/src/test/kotlin/net/corda/node/services/identity/PersistentIdentityServiceTests.kt
#	samples/irs-demo/src/integration-test/kotlin/net/corda/test/spring/SpringDriver.kt
#	testing/node-driver/src/integration-test/kotlin/net/corda/testing/driver/DriverTests.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/DriverDSL.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/DriverDSLImpl.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/NodeBasedTest.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/RPCDriver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/demorun/DemoRunner.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/CoreTestUtils.kt
#	verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt
2017-12-08 16:03:16 +00:00
Katelyn Baker
75ea23d193
Merge pull request #2212 from corda/smallFixs
Code tidy up, auto reformat, IntelliJ suggestions
2017-12-08 15:44:06 +00:00
Katelyn Baker
c396842b0e CORDA-553 - Review comments 2017-12-08 14:37:41 +00:00
Katelyn Baker
afdf5fb717 Code tidy up, auto reformat, IntelliJ suggestions 2017-12-08 14:21:30 +00:00
Ross Nicoll
e6adbe7137
CORDA-831: Add confidential identity certificate type (#2198)
* Rename certificate types
* Create separate certificate type for confidential identities
* Add name constraints to dev node CA
* Move dev node CA into getTestPartyAndCertificate()
2017-12-08 13:17:29 +00:00
Katelyn Baker
8878fa99a0 CORDA-553 - Remove CordaCustomSerializer annotation
It isn't actually needed as we can scan the jar for classes implementing
the interface.
2017-12-07 21:15:33 +00:00
Katelyn Baker
fcec60e232 CORDA-786 - Use reflection to infer proxy and proxied types in CorDapp custom serializers
This removes any need for the user implement and override types from the
super class

    * CORDA-786 - Docs update
    * CORDA-786 - Remove unneeded second annotation on the proxy objects
    * Fix merge conflicts
2017-12-07 21:15:14 +00:00
Katelyn Baker
d25b7f560c CORDA-786 - Genericise the CorDapp Proxy 2017-12-07 21:15:14 +00:00
Katelyn Baker
6881350493 CORDA-786 - Add whitelist testing for external custom serializers
Update Docs
2017-12-07 21:14:45 +00:00
Katelyn Baker
81eb0c1898 CORDA-780 / CORDA-786 - Enable AMQP for P2P and Storage Contexts
Add plugable mechanism for CorDapps such that they can add their own
custom serializers
2017-12-07 21:13:59 +00:00
Andrzej Cichocki
c36bea3af5
CORDA-654 MockServices no longer has hard-coded identities (#2192)
* Resurrect a test
* Fix a broken test
* Pass in the initial identity
* Make IdentityService easier to mock
2017-12-07 11:55:18 +00:00
Shams Asari
4a677815ef Removing NetworkParametersGenerator as an interface 2017-12-07 10:42:52 +00:00
Shams Asari
cb11379d98 Addressing some of the technical debt 2017-12-06 22:01:41 +00:00
Shams Asari
89256a7f16 Moved the CZ URL and node registration logic of the driver to be more internal, not available through the standard driver call, as these are not testing features for an app dev.
Also cleanup up some of the related tests.
2017-12-06 12:32:41 +00:00
Andrzej Cichocki
b0ebf3d7e0
CORDA-654 Various MockServices refactorings (#2167)
* Remove MockServices.stateMachineRecordedTransactionMapping which does nothing
* Inline StateLoaderImpl
* Remove unused MockServices
* MockServices well-known identities not needed in a place
* A few things don't need a full-blown ServiceHub
2017-12-05 16:22:53 +00:00
Katelyn Baker
ae3a3444f2
Merge pull request #2154 from corda/kat/feature/enumEvolution2
Kat/feature/enum evolution2
2017-12-04 17:07:01 +00:00
Katelyn Baker
1ff0d881b3 CORDA-553 - Better tests for rule breaking changes to enum constants 2017-12-04 15:46:32 +00:00
Shams Asari
6a1aa59e3e Merge branch 'master' into shams-merge-master-041217
# Conflicts:
#	node/src/integration-test/kotlin/net/corda/node/services/DistributedServiceTests.kt
#	samples/bank-of-corda-demo/src/main/kotlin/net/corda/bank/BankOfCordaCordform.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/NodeTestUtils.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/NodeBasedTest.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNode.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/NotarySpec.kt
#	verifier/src/integration-test/kotlin/net/corda/verifier/VerifierDriver.kt
2017-12-04 13:39:32 +00:00
Alberto Arri
acd2281b20
ENT-1125 bootstrap root certificate (#2151)
* ENT-1125 make nodes check that the returned signed certificate from Doorman has the expected root
2017-12-04 12:53:22 +00:00
Katelyn Baker
e257872445 CORDA-553 - Review Comments 2017-12-04 09:39:16 +00:00
Shams Asari
5264072752 Renamed n.c.nodeapi.config to n.c.nodeapi.internal.config as that config code is not public API. For the same reason, also moved User into the same internal package. 2017-12-03 17:20:30 +00:00
Katelyn Baker
7e044e1124 CORDA-553 - Review comments 2017-12-01 19:15:14 +00:00
Katelyn Baker
32ebd2cc8b CORDA-553 - Review comments 2017-12-01 16:59:19 +00:00
Katarzyna Streich
6958cbbc44
Fix demobench as part of network parameters work (#2148)
* Fix demobench - network parameters

Demobench uses ServiceIdentityGenerator to pregenerate notary identity
for network parameters.
2017-12-01 16:14:03 +00:00
Shams Asari
c2731c6797 More merge fixes and moved NodesInfoFilesCopier into internal package 2017-11-30 16:46:32 +00:00
Katelyn Baker
541207738a CORDA-553 - Documentation 2017-11-30 13:31:33 +00:00
Katelyn Baker
6fc736a5f5 CORDA-553 - Enable Enum Evolution 2017-11-30 13:14:07 +00:00
Katelyn Baker
e8822ce391 CORDA-553 - Plumb the transform schema into the AMQP serialisation framework
This change doesn't enable anything, it just changes the code to pass
around both relevant schemas instead of a single one from the AMQP
envelope. The actual evolver will build ontop of this
2017-11-30 13:10:48 +00:00
Shams Asari
fdc31091a6 Merge branch 'feature-network-parameters' into shams-master-merge-291117
# Conflicts:
#	constants.properties
#	gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Cordform.kt
#	gradle-plugins/cordformation/src/main/kotlin/net/corda/plugins/Node.kt
2017-11-30 12:05:42 +00:00
Katarzyna Streich
c9f3e98795
Another approach to fixing deployNodes task and network parameters generation (#2066)
* Generate networkParameteres for Cordformation.

Fix deployNodes task in Cordformation to generate NetworkParameters before running the nodes.
Add TestNetworkParametersGenerator utility loaded after node infos generation step.

* Get rid of bouncy castle provider dependency
For cordform-common. It caused problems with loading our custom
X509EdDSAEngine for generation of network parameters in deployNodes
task.
2017-11-30 10:39:29 +00:00
Shams Asari
71763ff1d3 Merge branch 'master' into shams-master-merge-291117
# Conflicts:
#	node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt
#	node/src/main/kotlin/net/corda/node/services/network/PersistentNetworkMapCache.kt
#	node/src/test/kotlin/net/corda/node/services/messaging/ArtemisMessagingTests.kt
#	samples/notary-demo/src/main/kotlin/net/corda/notarydemo/BFTNotaryCordform.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/driver/Driver.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/internal/demorun/DemoRunner.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/MockNode.kt
2017-11-29 18:00:16 +00:00
Shams Asari
b638b30d2a Moved CordaPersistence and dependent classes into internal package in node-api. This is so that the doorman can make use of them without needing a compile dependency to node. 2017-11-29 17:14:05 +00:00
Patrick Kuo
572c4af40c
Use NetworkMap and SignedNetworkMap in NetworkMapClient, and enable signature verification. (#2054)
* new network map object for network map, and verify signature and root in Signed network map and node info

* fixup after rebase

* * added certificate and key to network map server
* move DigitalSignature.WithCert back to NetworkMap.kt, as its breaking API test, will raise another PR to move it back.
* Make DigitalSignature.WithCert not extend WithKey, as per PR discussion.
* various fixes after rebase.

* move Network map back to core/node, as its breaking API test

* revert unintended changes

* move network map objects to node-api
2017-11-29 15:55:13 +00:00
Katelyn Baker
c88c6202b9 CORDA-553 - Review comments 2017-11-28 17:27:53 +00:00
Katelyn Baker
4c2f0d7913 Fix broken unit test
At the moment the test just asserts we can't evolve enums, it's a
placeholder for the next phase of the changes
2017-11-28 10:03:01 +00:00
Katelyn Baker
f135d57820 CORDA-553 - Plumb the transform schema into the AMQP serialisation framework
This change doesn't enable anything, it just changes the code to pass
around both relevant schemas instead of a single one from the AMQP
envelope. The actual evolver will build ontop of this
2017-11-27 19:23:12 +00:00
Shams Asari
2ceb6283af Moved X509Utilities, and some other crypto utilities in node, into node-api so that they can be used by services outside of the node.
There's also some cleanup as well.
2017-11-27 15:49:33 +00:00
Shams Asari
1705df4d1f Made the database config option typesafe, rather than relying on String properties 2017-11-27 13:51:53 +00:00
Shams Asari
f7e51a9ae1 Various cleanups to AMQP and Kryo serialisation:
* PartyAndCertificate serialiser has been converted to deal with just CertPath
* Removed X500Name serialiser as we no longer use the BC implementation and have our own CordaX500Name
* Converted X509 cert serialiser to use Java certs and not BC X509 cert holder
* Added to test to AMQP serialisation to make sure c'tor is invoked on deserialisation
2017-11-21 14:01:03 +00:00
Andrzej Cichocki
f26aa33553
Introduce contextLogger (#2085)
* Revert with comment, probably lazy for a reason.
2017-11-20 11:31:08 +00:00
Andrzej Cichocki
039cacae76
CORDA-787 Remove unused class (#2049)
* and refactor a superclass that isn't really one
* move it to internal
* misc refactorings
2017-11-17 12:24:55 +00:00
Michele Sollecito
92c8861802
[CORDA-760]: Propagate invocation context across the codebase. (#2016) 2017-11-15 14:58:43 +00:00
Chris Rankin
2a961b8e2c
Separate server contexts from shared contexts. (#2044) 2017-11-13 21:23:23 +00:00
Andrzej Cichocki
052124bbe0
CORDA-716 Make serialization init less static (#1996) 2017-11-10 15:44:43 +00:00
Chris Burlinchon
39e2f6ad99 ENT-1031 AMQP serializer for ContractAttachment, evaluate lazy attachment and write out in full 2017-11-10 14:42:18 +00:00
Christian Sailer
2a83167d3b
Merge pull request #2024 from corda/christians_public-key-caching-hooks
Public key customization hooks
2017-11-10 13:37:37 +00:00
Christian Sailer
5354c777ce CORDA-781 code layout cleaned up 2017-11-10 11:54:03 +00:00
Christian Sailer
b0517954a0 CORDA-781 clean up imports 2017-11-10 11:10:06 +00:00
Christian Sailer
13001ee674 CORDA-781 code review: clean up AMQP scheme 2017-11-10 10:23:19 +00:00
cburlinchon
4c1d1733a5
Serialization of large contract attachments causes OOM exception (#1991)
* Don't serialize contract attachment, only hash and contract class name if we are checkpointing
2017-11-10 10:21:36 +00:00
Christian Sailer
26819bfd04 No public key serializer overriding for checkpointing 2017-11-09 15:23:12 +00:00
Christian Sailer
89b01ab342 Hooks for PublicKeySerializer customization 2017-11-09 15:12:52 +00:00
Christian Sailer
219433c3cd Hooks for PublicKeySerializer 2017-11-09 14:49:23 +00:00
Andrzej Cichocki
a036a6300c
Enforce serialization API for Java. (#2014) 2017-11-08 11:49:52 +00:00
Katarzyna Streich
deaba2887d
Some cleanup after network map removal (#2006) 2017-11-07 12:16:49 +00:00
Konstantinos Chalkias
7944fcde5c
Supported TLS cipher suites (#2005) 2017-11-07 10:05:51 +00:00
Shams Asari
d04e48740b Introducing network parameters.
network-parameters file read in by the node at startup, of which only the list of notaries is used. For now, the driver and MockNetwork have been updated to require notaries to be started first. This is so that the same set of network parameters can be defined for all the nodes.

CN in the legal name is not longer disallowed since it's no longer reserved for distributed notary names.

Single-node notaries now only have one identity, their main identity. Nodes part of a cluster continue to have two.

(Based off Kasia's work)
2017-11-03 09:46:10 +00:00
Katelyn Baker
d6adb83cd0 CORDA-756 - Refactor Kryo into sub module as per AMQP 2017-10-31 15:45:58 +00:00
Andrzej Cichocki
4b0b13dad4
CORDA-716 Retire TestDependencyInjectionBase (#1939) 2017-10-31 10:21:38 +00:00
Katelyn Baker
a74154a126
Merge pull request #1904 from corda/kat/feature/enumEvolver
CORDA-553 - First steps towards evolvability
2017-10-30 14:08:09 +00:00
Alberto Arri
9176fcb8e6
Remove for good network map service node (#1942)
* [CORDA-446] Kill network map registration and fix NodeBasedTest
2017-10-30 11:45:52 +00:00
Katelyn Baker
ecbb4330da CORDA-553 - Review comments 2017-10-30 11:15:05 +00:00
Katelyn Baker
3350605536 CORDA-553 - Cope with future transforms 2017-10-27 12:41:23 +01:00
Katelyn Baker
bc12f87a24 CORDA-553 - Review Comments 2017-10-27 12:41:13 +01:00
Katelyn Baker
3633624dc6 CORDA-553 - First steps towards evolvability
Define the two transforms that will be useful for enum evolvability (see
design document for more details).

Furthermore, define the generic mechanism by which transform annotations
on classes are encoded into the AMQP envelope

With nothing to check for these annotations at either end, this is
mostly a no op, but an important step toward getting evolvability in
place
2017-10-27 12:40:53 +01:00
bpaunescu
04d8260e0f CORDA-351: force update dependencies and suppress vulnerabilities not… (#1944)
* CORDA-351: force update dependencies and suppress vulnerabilities not affecting corda

* CORDA-351: force update dependencies and suppress vulnerabilities not affecting corda
2017-10-26 12:16:57 +01:00
Katelyn Baker
cbc4003032 Merge pull request #1905 from corda/kat/feature/addEnterpriseAMQPIdentifier
Corda-725 - Change AMQP identifier
2017-10-20 10:21:19 +01:00
Andrzej Cichocki
005ce349a7 * Retire MockServiceHubInternal (#1909)
* Introduce rigorousMock
* Add test-utils and node-driver to generated documentation
2017-10-20 10:06:53 +01:00
Katelyn Baker
e6de0aa406 Review Comments 2017-10-19 16:19:42 +01:00
Katelyn Baker
1e05f27bae CORDA-725 - Change AMQP identifier to officially assigned value
This does change our header format so pre-cached test files need
regenerating
2017-10-19 12:01:39 +01:00
Alberto Arri
b33b013284 [CORDA-442] let Driver run without network map (#1890)
* [CORDA-442] let Driver run without network map

- Nodes started by driver run without a networkMapNode.

- Driver does not take a networkMapStartStrategy anymore

- a new parameter in the configuration "noNetworkMapServiceMode" allows for a node not to be a networkMapNode nor to connect to one.

- Driver now waits for each node to write its own NodeInfo file to disk and then copies it into each other node.

- When driver starts a node N, it waits for every node to be have N nodes in their network map.

Note: the code to copy around the NodeInfo files was already in DemoBench, the NodeInfoFilesCopier class was just moved from DemoBench into core (I'm very open to core not being the best place, please advise)
2017-10-18 13:49:32 +01:00
Viktor Kolomeyko
cac3057877 CORDA-540: Make Verifier work in AMQP mode (#1870) 2017-10-17 10:44:27 +01:00
Andrzej Cichocki
38cf4a489e CORDA-676 Eager cordapp schemas (#1839)
* Retire customSchemas.
* Key cordapp-to-hash map by url as native equality too strict.
2017-10-16 11:35:29 +01:00
Matthew Nesbit
899f7f9d0d Change the serialization/deserialization code of SessionMessage data to add more validation.
Address PR comments

As pointed out by Shams the SessionInit must be well formed at this point.
2017-10-11 15:17:48 +01:00
Chris Rankin
9cec137a31 CORDA-702: Don't whitelist certain non-annotated types (#1864)
* Don't whitelist arrays of non-serialisable types for RPC.
* Don't whitelist enums which have not been annotated as serialisable.
2017-10-11 11:17:14 +01:00
Viktor Kolomeyko
ef0f0acc4a Make integration tests pass in AMQP mode, part 1 (#1855) 2017-10-11 11:13:46 +01:00
Andrzej Cichocki
4ee250a19b Retire setCordappPackages. (#1860) 2017-10-11 10:35:21 +01:00
Shams Asari
bd53a22efa Removed extraAdvertisedServiceIds config
The remaining use for it was the finance CorDapp for permissioning CCY issuers. Instead this is now taken from a custom config in node.conf.
2017-10-10 13:47:37 +01:00
Tommy Lillehagen
14f959b4af Code clean-up run 2017-10-09 15:26:40 +01:00
Tommy Lillehagen
f98942d7ad Reformat files in node-api 2017-10-09 15:26:39 +01:00
Chris Rankin
689758a71c CORDA-644: Only serialise Kotlin lambdas when checkpointing. (#1801)
* Remove local function because it is serialised as a lambda.
* Don't automatically whitelist Kotlin lambdas unless checkpointing.
* Add comment to @CordaSerializable, warning not to allow AnnotationTarget.EXPRESSION.
2017-10-09 13:02:40 +01:00
Viktor Kolomeyko
a9508b393c CORDA-540: AMQP Private key serializer (#1838) 2017-10-09 11:22:11 +01:00
Viktor Kolomeyko
a425f82c77 CORDA-540: Change how standard mutable whitelists structured (#1814) 2017-10-09 10:19:37 +01:00
Shams Asari
727cd0e55c Cleaned up notary configuration by introducing a notary config option.
extraAdvertisedServiceIds is no longer used for this.
2017-10-07 12:52:37 +01:00
Viktor Kolomeyko
33ba145149 CORDA-540: Add verification to ensure that private keys can only be serialized with specific contexts (#1800) 2017-10-05 17:42:16 +01:00
Ross Nicoll
46532ccbcb Don't repackage well known key types (#1545)
* Don't repackage well known key types when converting keys to a well known type
* Remove custom key serializers
* Remove duplicate serializer registration
2017-10-05 09:14:00 +01:00
Viktor Kolomeyko
e2bb14da8e CORDA-540: AMQP specific fixes in "node-api" project (#1765) 2017-10-03 15:07:34 +01:00
Shams Asari
6c488fd6e0 Merge pull request #1783 from corda/shams-remove-network-map-service-type
Removed the network map service type as it's no longer needed.
2017-10-03 12:15:31 +01:00
Viktor Kolomeyko
c87e1045eb CORDA-540: Perform schema verification (#1672) 2017-10-03 11:47:53 +01:00
Shams Asari
457f95f188 Removed the network map service type as it's no longer needed.
The absence or presence of the networkMapService config is what determines if a node is the network map or not.
2017-10-03 11:32:37 +01:00
Clinton
2d53859745 Fixes bugs with contract constraints (#1696)
* Added schedulable flows to cordapp scanning

Fixed a bug where the core flows are included in every cordapp. Added a test to prove the scheduled flows are loaded correctly. Added scheduled flow support to cordapp.

Renabled broken test.

Fixed test to prove cordapps aren't retreived from network.

Review fixes.

Fixed a test issue caused by gradle having slightly different paths to IntelliJ

* Fixed test for real this time.
2017-10-02 17:54:32 +01:00
Rick Parker
9a16011448 * Move CompositeSignaturesWithKeys into net.corda.core.crypto package.
* Rename and move CordaPluginRegistry to reflect its real purpose now.
* Docs: docsite improvements
* Remove discussion of webserver from 'writing a cordapp' page.
* Fixup some flow docs.
* Add a couple more package descriptions.
* Review comments - always apply default whitelist and no longer load it via ServiceLoader
* Added wording about renaming services resource file
2017-10-02 16:03:07 +01:00
Viktor Kolomeyko
383eb2bef8 CORDA-540: Fix to make IRS demo code pass in AMQP mode (#1769)
* CORDA-540: Do not use concrete instance of an ArrayList as wire representation of it may be different

* CORDA-540: Make data structures suitable for AMQP serialization

* CORDA-540: Use "name" instead of "toString()"

Classes like "net.corda.finance.contracts.DayCountBasisDay" override "toString()" which leads to error behaviour
2017-10-02 15:59:31 +01:00
Rick Parker
7787896cbb Hide SerializationContext from public API on TransactionBuilder (#1715) 2017-09-29 13:13:38 +01:00
Viktor Kolomeyko
bdc3389206 CORDA-540: Fix exception type thrown in AMQP mode (#1680) 2017-09-29 12:23:40 +01:00
Matthew Nesbit
5fa7381883 Custom exceptions in corda, should either derive from an appropriate closely related java exception, or CordaException, or CordaRuntimeException. They should not inherit just from Exception, or RuntimeException.
Handle PR comments

Add nicer constructors to CordaException and CordaRuntimeException

(cherry picked from commit 89478c8)

Fix ambiguous defaulted constructor

(cherry picked from commit ec9bafe)

Address PR comment

Update a few more custom exceptions
2017-09-29 09:37:22 +01:00
Katelyn Baker
cfcc5aad67 CORDA-601 - Review Comments
So...

On reflection, and adding a number of tests for static initialisation
with serialised types it looks like there is no chance that the
serializer factory will ever pass a non white-listed type through to the
carpenter in the first place.

As such leaving the plumbing in as it may be useful to pass a blacklist
at some point into the carpenter and the tests are always useful
(ignoring those that won't work without the white-list checking)
2017-09-27 21:53:15 +01:00
Katelyn Baker
f59b22ba98 CORDA-601 - Carpenter should respect whitelist
The class carpenter should refuse to carpent classes that are not
whitelisted or marked as CordaSerializable. This prevents any security
issue where a malicious message could indicate a class had a member of
some type that on construction did something bad. By respecting the
whitelist we avoid this.

As the carpeter annotates anythign it constructs as CordaSerializable,
it will always be able to carpent classes that contain memebrs that were
unknown, and thus unannotated, carpented classes
2017-09-27 21:26:15 +01:00
Katelyn Baker
5ed755d3fe CORDA-653 - Serialised enums should respect whitelist (#1692) 2017-09-27 18:02:35 +01:00
Andras Slemmer
2054827528 Merge pull request #1650 from corda/aslemmer-rpc-delay-arg-deserialisation
Delay RPC arguments deserialisation to allow routing of errors
2017-09-27 13:47:19 +01:00
Andrzej Cichocki
9874e1ff34 uncheckedCast crusade (#1667) 2017-09-27 12:58:48 +01:00
Viktor Kolomeyko
8a842d1d53 CORDA-540: Ensure that covariance of type is handled correctly when serializing with AMQP (#1631) 2017-09-27 09:19:25 +01:00
Michele Sollecito
63168c0299 [CORDA-481]: GH 965: Java 8 lambdas don't work properly in checkpointing (#1619) 2017-09-26 13:22:59 +01:00
Andras Slemmer
9d115a2111 Delay RPC arguments deserialisation to allow routing of errors 2017-09-26 11:18:11 +01:00
Shams Asari
4df8b427d2 Removed SSLConfiguration parameter from CordaRPCClient, thus removing SSL support.
The current use of SSL RPC relies on access to the node's keystore file, and further to that some uses where using the NODE_USER to login on the p2p port.
2017-09-26 10:41:43 +01:00
Viktor Kolomeyko
b4e674c2fe CORDA-540: Implementation of path in the serialization graph (#1484) 2017-09-26 10:31:37 +01:00
Mike Hearn
20a9892123 RPC: Report failures during deserialisation of method arguments to the client as an exception. 2017-09-26 11:15:29 +02:00
Katelyn Baker
7c63597937 Merge pull request #1622 from corda/feature/kat/carpenterRespectWhitelist
CORDA-601 - Start adding whitelist support to the carpenter
2017-09-26 09:39:07 +01:00
Chris Rankin
8cc091b3e1 Transform Kotlin's EmptyList, EmptySet and EmptyMap into Java classes (#1550)
* Transform Kotlin's EmptyList, EmptySet and EmptyMap into Java classes before serialising them.
* Transform Kotlin's EmptyList, EmptySet and EmptyMap to their unmodifiable Java equivalents.
2017-09-26 08:33:30 +01:00
Clinton
532bbb5cca Contract constraints (#1518)
* Contract constraints and attachment loading

Fix compiler warnings.

Fixed IdentitySyncFlowTests in confidential-identities.

Fixes.

Fix AttachmentClassLoaderTests.

Added a TODO.

Renamed cordapp service.

Fix compilation error in java code.

Fix RaftNotaryServiceTests

Fix AttachmentLoadingTest

Fix DistributedServiceTests and LargeTransactionTests.

Add cordapp packages to Verifier tests.

Refactor DummyContractBackdoor back out of internal package.

Resolve compiler warnings.

Consolidate excluding `isolated` project at top-level.

Fix contract attachment serialisation for remote verifier.

Fix integration tests for client:rpc.

Contract constraints and attachment loading

Fix compiler warnings.

Fixed IdentitySyncFlowTests in confidential-identities.

Fixes.

Fix AttachmentClassLoaderTests.

Added a TODO.

Renamed cordapp service.

Fix compilation error in java code.

Fix example compilation.

Fix RaftNotaryServiceTests

Fix AttachmentLoadingTest

Fix DistributedServiceTests and LargeTransactionTests.

Add cordapp packages to Verifier tests.

Refactor DummyContractBackdoor back out of internal package.

Resolve compiler warnings.

Consolidate excluding `isolated` project at top-level.

Fix integration tests for client:rpc.

Fixed issues with node driver and differing ZIPs.

Review changes.

Refactor GeneratedAttachment into node-api module.

Merge branch 'clint/hash-constraint' of https://github.com/corda/corda into clint/hash-constraint

Fixed compile error following rebase.

wip - test to check that app code isn't loaded from attachments sent over the wire.

Use Kotlin copyTo() rather than Apache's IOUtils.

Fixes

more fixes.

Removing unconstrained output.

More fixes.

Fixed another test.

Added missing plugin definition in net.corda.core.node.CordaPluginRegistry: net.corda.finance.contracts.isolated.IsolatedPlugin

Re-added missing magic string used in unit test.

Remove unused FlowSession variable.

* Review fixes.

* More review fixes.

* Moved Cordapp implementation to an internal package.

* More JVMOverloads.
2017-09-25 17:05:18 +01:00
Chris Rankin
798f851def Replace Object with Any to fix Kotlin compiler warnings. (#1626)
* Replace Object with Any to fix compiler warnings.

* Fix shadowed name warnings.
2017-09-25 15:08:52 +01:00
Katelyn Baker
5a66433266 CORDA-601 - Start adding whitelist support to the carpenter
Set things up so that the carpenter must be constructed with a Corda
white list object. Right now we don't do anything with it but this will
capture all the changes in the tests to make it "jsut work" as is before
getting into the meat of the change

Externally this is a "no op" as the serialiser factory already takes a
white list as a construction parameter and the carpenter should use that
anyway
2017-09-22 17:47:43 +01:00
Shams Asari
31229b900a Moved serialisation code in client-rpc into internal packages (#1604) 2017-09-22 17:38:40 +01:00
Rick Parker
94a92fe82e CORDA-205: Added some missing types to the whitelist and removed KeyPair. (#1603)
* Added some missing types to the whitelist and removed `KeyPair`.

* Add emptyList/Map/Set for Java.  Also check for duplicates.

* Remove java singleton collections since they are already added via kotlin listOf/mapOf/setOf.
2017-09-22 17:36:49 +01:00
Clinton Alexander
0de6994ef5 Base types and changes required for the Contract Constraints work. 2017-09-22 18:22:40 +02:00
Clinton Alexander
05e94e7425 Corrected isolated.jar excludes for all projects and corrected some test dependencies. 2017-09-22 18:19:07 +02:00
Shams Asari
21cb1bf6f3 Moved the RPC classes in node-api that are needed in client-rpc. (#1610)
Everything that now remains in node-api isn't needed as public API for app developers so we can mark this module as non-public and subject to change.
2017-09-22 16:03:24 +01:00
Shams Asari
a11577840c Moved ServiceInfo and ServiceType into internal package (#1599) 2017-09-22 10:15:03 +01:00
Ross Nicoll
c05e482c8f Change public constant values to Kotlin constants (#1588)
* Make string constants into Kotlin constants

* Add JvmName annotation to KeyStoreUtilities
2017-09-21 15:32:02 +01:00
Katarzyna Streich
fd57cf1c0c Remove advertised services from NodeInfo (#1521)
* Remove advertisedServices from NodeInfo.

Introduce notaryIdentities in NetworkMapCache, that will be filled in
later from NetworkParameters. Clean up NetworkMapCache API. Expose
notaryIdentities through RPC. For now we assume as temporary solution
that notaries in NetworkMap have to contain "notary" in name.

* Further clean up of NetworkMapCache API

Remve partyNodes. Introduce getAllNodeInfos function

* Remove notaryIdentity from ServiceHub

* Address Shams review comments

* Address Andrius review comments

* Add comments, cleanup

* Fixes

* Address comments

* Yet another commit with comments addressed

* Move ServiceType and ServiceInfo to node-api

Add changelog entry. Address rest of comments.

* Minor comments
2017-09-20 13:19:57 +01:00
Konstantinos Chalkias
6887947a4d CORDA-521: Backwards compatible Transactions using sub-Merkle trees (#1481)
* tx backwards compatibility + rebase

* SHA256d definition
2017-09-20 13:11:58 +01:00
Katarzyna Streich
495e870b74 NodeInfo remove main identity (#1284)
* Remove node's main identitiy from NodeInfo.

Preparation for getting rid of services + supporting multiple identities
on the node.
NodeInfo keeps multiple identities as a list. For now the first one is treated as a special one.
Introduced function chooseIdentity in CoreTestUtils as a preparation for proper handling of multiple identities in the future.
Remove legalIdentityKey from ServiceHub, add extension function - chooseIdentity on ServiceHub.
Add `me` field on FlowStateMachineImplemetation, flows should know what the calling identity is.
Remove SERVICES_PREFIX in artemis messaging layer.

* Address minor comments.

* Fixes after rebase.

Remove chooseIdentity from ServiceHub

* Rename me to ourIdentity on FlowLogic

* Fixes after rebase

* Address Ross comments, fixes

* Fix after rebase

* Fix services certificate paths

Apply Patrick's patch.
2017-09-15 14:39:34 +01:00
Ross Nicoll
3d577e5eed CORDA-499: Remove further Kt classes (#1489)
* Change how NetworkHostAndPort is parsed

Change from using a global extension function to parse
NetworkHostAndPort strings, into using a function on the companion
object. This is a lot easier for Java interop and matches the common
style used elsewhere both in Corda and in Java libraries.

* Move JAR extraction into new utils file

* Move path verification function to ArtemisUtils

Move path verification function "requireOnDefaultFileSystem()" to new
ArtemisUtils.kt file, as this makes more sense from a Java interop
perspective.

* Add JvmName to AMQPSchemaExtensions

* Add JvmName to AMQPSerializationScheme

* Revert "Move JAR extraction into new utils file"

This reverts commit 1f0f41909b68ff21cc24b5efd6a1a360393a0a14.

* Reformat code

* Run formatter on ArtemisUtils
2017-09-14 17:34:01 +01:00
Katelyn Baker
2fc83b00a3 CORDA-539 - Integrate enum carpentry into serializer factory (#1508)
* CORDA-539 - Integrate enum carpentry into serializer factory

* CORDA-539 - Review comments

Responding to comments about my comments, mostly fixing spelling and
punctuation errors
2017-09-14 16:27:20 +01:00
Shams Asari
573987d929 Removed X509CertificateHolder from public API, using java.security.X509Certificate instead (#1510) 2017-09-14 15:48:33 +01:00
Shams Asari
943e873ff0 Moved AttachmentsClassLoader out of core (#1504) 2017-09-14 15:40:39 +01:00
Katelyn Baker
094187cfa1 Merge pull request #1473 from corda/feature/kat/carpentEnum
CORDA-539 - Add enum support to the carpenter
2017-09-14 12:58:27 +01:00
Rick Parker
988e3e5007 Some additional serializers to fill in the blanks vs. our default whitelist (#1490) 2017-09-14 09:14:09 +01:00
Ross Nicoll
c8b1eb5a1e CORDA-499: Further Dokka cleanup (#1437)
* Add JvmName annotation to ConfigUtilities
* Merge Kryo.addToWhitelist into KryoSerializationCustomization
2017-09-13 17:06:39 +01:00
Katelyn Baker
a93bd94c44 CORDA-539 - Review comments 2017-09-13 10:48:13 +01:00
Katelyn Baker
ef409c4d65 CORDA-539 - Fix for attempting to create a primitive nullable field
Refactoring meant that the secondary constructor wasn't being called any
more and thus the check wasn't being made. Originally, we always
created copies of fields when constructing a schema which meant we always
called the secondary constructor, now we don't
2017-09-13 10:35:59 +01:00
Katelyn Baker
063771fac4 CORDA-539 - Code Cleanup
Applying IntelliJ's white space reformat as no doubt I didn't follow the
coding convention too closely.

Remove some IntelliJ warnings
2017-09-13 09:52:00 +01:00
Katelyn Baker
c48a37a080 CORDA-539 - Add enum support to the carpenter
If the serializer is going to support enumerated types then the class
carpenter also has to

Refactor the Carpenter schema and fields to add an enum type, add code
in the carpenter to generate enum's and of course add tests
2017-09-13 09:52:00 +01:00
Ross Nicoll
de3468f8a7 Replace X500Name with CordaX500Name (#1447)
Replace X500Name with CordaX500Name, which enforces the specific constraints Corda expects on legal/service identity names.
2017-09-12 01:03:10 +01:00
Viktor Kolomeyko
64963d587c CORDA-540: Expose and fix AMQP serialization problem with UniquenessException (#1470) 2017-09-11 18:43:26 +01:00
Clinton
bc6628a072 ContractState now references contract by class name (#1407)
* ContractState's contract type has been moved to TransactionState and is now a string representing the class name of the contract class to allow classloading of arbitrary contracts from custom classloaders.

* Upgraded isolated JAR to new version.
2017-09-11 16:44:18 +01:00
Shams Asari
4c3ac89d6b Try.Failure is no longer parameterised on Nothing, to avoid any issues with Java 2017-09-10 14:54:32 +01:00
Viktor Kolomeyko
0edaea81d2 CORDA-540: Add a property to make sending stacktraces optional in AMQP mode (#1458) 2017-09-08 17:25:42 +01:00
Viktor Kolomeyko
8710090887 CORDA-540: Fixes to make "node" tests pass in AMQP mode, part 1 (#1455) 2017-09-08 13:46:22 +01:00
Rick Parker
691d9ea0bc Correctly unwrap MissingAttachmentException. (#1454) 2017-09-08 13:41:53 +01:00
Rick Parker
79f1e1ae7f Introduce current context concept for serialization in preparation for WireTransaction changes (#1448) 2017-09-08 08:16:38 +01:00
Rick Parker
6bf2871819 Change descriptor name from string to symbol on the wire to adhere to section 1.5 of the AMQP 1.0 spec (#1423) 2017-09-07 17:05:39 +01:00
Patrick Kuo
57412d4498 Enforce X500Name format defined in design doc (#1427)
* Standardise X500Name format - WIP

* address PR issues

* failing test fix and replace X500Name with getX500Name

* gradle plugin fix

* Added country code validation
2017-09-07 14:47:42 +01:00
Viktor Kolomeyko
d9d17be284 CORDA-540: Small changes to make "finance" tests pass in AMQP mode (#1445) 2017-09-07 13:31:41 +01:00
Viktor Kolomeyko
50c51493c3 CORDA-540: AMQP-forge "example-code" (#1439) 2017-09-07 11:17:55 +01:00
Viktor Kolomeyko
999515db95 CORDA-540: Allow maps as roots of serialization graph (#1432) 2017-09-06 15:06:35 +01:00
Andrzej Cichocki
b2051952d2 Add kotlin throwables to whitelist (#1424) 2017-09-06 12:58:06 +01:00
Viktor Kolomeyko
349692f831 CORDA-540: Tighten-up the unit test to prevent concrete collection classes to be used 2017-09-05 16:50:04 +01:00
Viktor Kolomeyko
cac2465ea5 CORDA-540: Special provisions when artificial "AnyType" is used 2017-09-05 16:50:04 +01:00
Viktor Kolomeyko
a01f390515 CORDA-540: Upgrade version of "org.apache.qpid:proton-j" used and minor project files changes 2017-09-05 16:50:04 +01:00
Viktor Kolomeyko
cd912f8add CORDA-540: Allow lists as root object in AMQP serialization graph 2017-09-05 16:50:04 +01:00
Rick Parker
ead4d09011 Plumb in plugin whitelist additions to AMQP implementation. (#1415) 2017-09-05 08:35:26 +01:00
Ross Nicoll
0df93e6e50 Start cleaning up node API Dokka comments (#1397)
* Change RPCApi comments to inline from Dokka, as the existing comments are not API documentation,
and render simply as "The RPC protocol:" in several places, which is unhelpful.
* Rewrite RPCApi comments to no longer be in semi-Dokka format, but instead better reflect they are functional documentation.
* Add Dokka documentation around RPC API
* Change JvmStatics to const
2017-09-04 22:29:41 +01:00
Rick Parker
015483656a Fix bad merge bdb87e38ca (#1411) 2017-09-04 16:21:58 +01:00
Katelyn Baker
a829dfadaa Bring enum serializer into line with AMQP
AMQP doesn't define an enum type itself yet the old implementation
listed our snum type as that in the schema despite what we are actually
doing which is serialising the enum down as a list of a string and an
int accompanied by a list of AMQP choices that represent all of the enum
values

Review Comments

Use fingerprinting of the enum types to catch whenever they're changed,
include the enum constants in the fingerprint to avoid any collisions
2017-09-04 11:56:45 +01:00
Katelyn Baker
ed2b2b02ca Add support for serialising enum types - Part 1
Part 2 will address the carpenting of enum classes
2017-09-04 11:56:36 +01:00
Rick Parker
f0b2b0a566 Change the condition for what is stored in AMQP object history for object reference logic (#1404) 2017-09-04 11:23:13 +01:00
Rick Parker
fef8a997f2 Fix the ToStringSerializer so it interacts with reference counting co… (#1385)
* Fix the ToStringSerializer so it interacts with reference counting correctly, and stop ref counting byte arrays since they are invariable wrapped in an object we do reference count.

* Pull out object reference condition into a helper function shared by serialization and deserialization
2017-09-01 16:07:30 +01:00
Viktor Kolomeyko
954ed69102 CORDA-540: Introduce mandatory reason for "kryoSpecific" (#1386)
* CORDA-540: Introduce mandatory reason for "kryoSpecific"

... before we forget why they are ignored in such a way

* CORDA-540: Write a test that exposes list serialization problem in AMQP mode

* Revert "Remove CompositeSignaturesWithKeys"

This reverts commit 9b3cad3
2017-09-01 14:45:14 +01:00
Ross Nicoll
7e3dd4c12c Restructure net.corda.core.crypto package
* Rename KeyFactory to CompositeKeyFactory
* Move expandedCompositeKeys into TestDSL as the only place that uses it
* Move NullKeys out of their own package
* Move remaining crypto classes into superpackage
* Move utility classes out of crypto and into utilities package
2017-09-01 10:55:58 +01:00
Rick Parker
9a8e7294e7 Fix AMQP object graph alignment bug and an issue with private constru… (#1376)
* Fix AMQP object graph alignment bug and an issue with private constructors.
2017-08-31 18:15:56 +01:00
Rick Parker
35dec9abdc Make addToWhitelist vararg for compactness. (#1361) 2017-08-31 13:24:45 +01:00
Viktor Kolomeyko
4387be0c4b CORDA-540: Mark CompositeKeyTests which works with cyclic graphs as Kryo specific (#1354) 2017-08-30 11:41:04 +01:00
Viktor Kolomeyko
0176184a86 CORDA-540: Cater for repeated object references found in the AMQP serialization graph (#1326)
Also provide unit test that clearly exposes the problem
2017-08-29 17:59:03 +01:00
Katelyn Baker
414f2b4b40 Review Comments - give test methods a better name 2017-08-29 16:23:10 +01:00
Katelyn Baker
1e023fcf54 Add alt serialise method that returns the schema and the bytes
For future testing it would be nice, post serialisation, to have easy
access to the serialised objects schema so we can check how it was
serialised. Adding a helper function to return a data class that does
this in the same way we can for deserialize
2017-08-29 15:20:43 +01:00
Rick Parker
c61b036844 Some custom serializers, fixes to generics handling, some annotations and added NonEmptySet as a special case of Set. (#1330) 2017-08-25 15:09:43 +01:00
Katelyn Baker
dda9d22264 Review Comments
* Typos in comments
 * Refactor some one liners
2017-08-24 17:36:01 +01:00
Katelyn Baker
e4a2529de0 More Review Comments
Move more logic into the constructor factory for the evolver seraliser
rather than everytime we read
2017-08-24 17:36:01 +01:00
Katelyn Baker
cf9fbc715d Review Comments
Refactor small bits of the serialiser, move things out of the read
methods and into the make factory companion object
2017-08-24 17:36:01 +01:00
Katelyn Baker
299b8026c7 Add constructor annotation for evolve selection
Current implementation is such that if we find *a* constructor that
works for us we use that, this is of course rather non deterministic, it
also means we may not select the best constructor

for example

old versions had constructors that took

V1: A B
V2: A B C D

if current version, V3 is

V3: A B C D E

which provides secondary constructors for the above then there is a
chance we'd de-serialise objects that were serialised as V2 using the V1
constructor and thus throw away information we don't need to

Additional Changes:

Fixes following rebase onto master
2017-08-24 17:36:01 +01:00
Katelyn Baker
7894e723e8 Fix evolver to work on nested schema types
Dumb assumption in the initial implementation meant it could only
evolve a top level type in the schema
2017-08-24 17:36:01 +01:00
Katelyn Baker
6bcfb2eddf Add better test, add support for constructor determination 2017-08-24 17:36:01 +01:00
Katelyn Baker
1d131eced5 Add Evolvability to Serializer
If we attempt to deserialize a class and find that since it's
serialization the definition has changed we need to create a serializer
capable of evolving the serialised data and constructing an instance of
the new type

We currently cope with

* Removing members
* Adding nullable members
* Adding non nullable members if a constructor is provided that
  allows us to set the old arguments and defaults the new (mandatory)
  fields
* Reordering paramters
2017-08-24 17:35:03 +01:00
Rick Parker
db07d717e0 Make constructors always accessible to deserialization code. (#1320) 2017-08-24 17:33:09 +01:00
Viktor Kolomeyko
d6d7fb52b4 Make sure members of type Class correctly serialized using AMQP (#1314)
* Minor changes and expose the problem with class serialization
* Custom serializer for Class
* More changes to make TransactionEncumbranceTests pass in AMQP mode
2017-08-23 17:37:49 +01:00
Rick Parker
0458e5415a java.time.* custom AMQP serializers and tests. Excludes pure enums. (#1308)
* java.time.* custom AMQP serializers and tests.  Excludes pure enums.

* Register java.time.* serializers with scheme.

* Provide default implementation of `additionalSerializers`
2017-08-23 12:08:09 +01:00
Viktor Kolomeyko
86fdbb9f22 Make OpaqueBytesSubSequence AMQP serializable (#1303) 2017-08-23 08:40:09 +01:00
Viktor Kolomeyko
66e6f90140 Make WireTransaction @CordaSerializable (#1299)
And do everything necessary for AttachmentClassLoaderTests to be passing in AMQP mode

* Changes following code review by @fenryka and @rick-r3
2017-08-22 16:53:55 +01:00
Viktor Kolomeyko
970ecf1bae Extend unit test to cover SecureHash and Opaque bytes 2017-08-22 10:04:36 +01:00
Chris Rankin
b33e299e3a Refactor serialisation contexts into separate classes, according to their use-cases. (#1293)
* Refactor Kryo contexts into separate classes, according to their use-cases. This prevents Kotlin from trying to instantiate them all every time.
* Also refactor AMQP contexts accordingly.
* Expand comments to explain why these serialisation contexts have been separated.
2017-08-21 14:19:21 +01:00
josecoll
a2ede0fc73 Requery removal (#1276)
* Removed Requery object relational mapping usage (and associated schemas including node-schemas module)

* Fixed issues with NodeAttachmentService tests.
Cannot use JPA custom converters with Primary Key fields.
Hibernate entities require explicit call to flush() to persist to disk.

* Removed redundant requery converters (equivalents not even required in Hibernate).

* Removed remaining gradle requery dependency definitions.

* Fixed broken tests.

* Fixes for failing NodeVaultService tests:
- Dynamic SQL updates (in soft locking code)
- Explicit request by session to participate in transaction (causing "TransactionRequiredException" Executing an update/delete query)
- Explicit flush() required to persist to disk

* Updated changelog.
Fixed compiler warning.

* Fixed WHERE clause AND/OR condition.
Enforced immediate data visibility through transaction commit.

* Final fixes to address failing tests.

* Deferred all hibernate session/txn management to DatabaseTransactionManager.

* Fixed transaction boundaries in failing Cash tests.

* Fixes to address failing tests (transaction boundaries, merge detached object, config clean-up).

* Final adjustment to transaction boundaries in JUnit tests.

* Refactored AttachmentSchemaV1 into NodeAttachmentService itself and referenced from NodeServicesV1.

* Refactored HSQL UPDATE statements to use CriteriaUpdate API.

* Updated all criteria API getters to reference attribute names by type.

* Remove redundant VaultSchema entity name (required when previously using HSQL UPDATE syntax)

* Fix compiler warnings.

* Minor changes following rebase from master.

* Fixed suppress warning type.
2017-08-21 10:42:59 +01:00
Rick Parker
56a84882a7 AMQP fixes: Don't attempt to include non-serializable interfaces in schemas (#1281)
* Ignore interfaces that are not serializable

* Annotate so test still works.

* Make methods accessible to serializer.

* Make sure interfaces are annotated in the carpenter.  Expand tests to check whitelisting.  Object is now whitelisted by default since it has no fields.

* Prevented Object from being whitelisted but allow arrays of Objects (i.e. pretty much an untyped array)
2017-08-21 10:27:27 +01:00
Viktor Kolomeyko
06ad2ddd45 Eliminate warnings in Java and Kotlin code
Functionally this change is a NOP
2017-08-21 09:36:24 +01:00
Viktor Kolomeyko
ee76de0957 Resolve a problem when Exceptions with suppression passed through Kryo serialization (#1280)
Also added some unit tests that expose the problem
2017-08-18 15:58:35 +01:00
Andrzej Cichocki
2829faa01f Retire legalContractReference (#1188)
* Add LegalProseReference annotation
* Migrate code from autogenerated javascript to TypeScript source
* Add instructions to rebuild the web resources
* Make installWeb more reproducible
2017-08-18 13:30:39 +01:00
Viktor Kolomeyko
5864a22d05 Move dependency on "proton-j" library from "core" sub-project to "node-api" 2017-08-18 09:49:46 +01:00
Viktor Kolomeyko
51ed943272 Remove SerializationFactory parameter from the places where it is not needed
Also minor improvements to the looping/if-branching code and documentation changes

Functionally, this change is a NOP
2017-08-17 17:53:40 +01:00
Viktor Kolomeyko
4a3848cc2a Delete KryoAMQPSerializer and its registration
As discussed with @rick-r3 this class is no longer fit for purpose because it may break reference equality if part of the graph been serialized with Kryo and part with AMQP
2017-08-17 17:52:47 +01:00
Katelyn Baker
e6e6644fc9 Fixes to bring into line with changes API
Can't have default factories now, they need building with whitelist and
classloader.

Also remove completely spurious import that broke everything, have a
feeling that was something IntelliJ pulled in "to be helpful"
2017-08-17 14:17:59 +01:00
Katelyn Baker
6076d39ee4 Remove spurious printlns 2017-08-17 13:53:35 +01:00
Katelyn Baker
c72ac2a102 Add WeakHashMap to the blacklist 2017-08-17 13:53:35 +01:00
Katelyn Baker
8bebd6ea0b Rework To better deal with types we won't serialise
* Add depricated jvm types to the blacklist
* Add concrete types for user convenience
* Add better "We won't serialise this because" error handling
2017-08-17 13:53:35 +01:00
Katelyn Baker
d2933ca8a3 Finalise which map containers to serialize 2017-08-17 13:53:35 +01:00
Katelyn Baker
de05a11511 Move toward allowing serialisation of concrete types 2017-08-17 13:53:35 +01:00
Katelyn Baker
4b8d6e32c3 Merge pull request #1269 from corda/bugfix/kat/missingFactory
Re-re-move Java test to the correct location, fix compile issue
2017-08-17 13:25:30 +01:00
Viktor Kolomeyko
4286065872 Eliminate explicit Kryo configuration to allow flexibility for AMQP 2017-08-17 12:01:27 +01:00
Chris Rankin
1672b4aa0a Simple deserialisation fixes. (#1243)
* Fix typo: prefered -> preferred
* Simplify KryoVerifierSerializationScheme and resolve warning.
* Add a custom serialiser for PrivacySeed so that we can avoid invoking RNG.
2017-08-17 11:15:04 +01:00
Katelyn Baker
f38954e550 Re-re-move Java test to the correct location, fix compile issue
Somehow this slipped past Gradle that I hadn't changed the serializer
factory here to take the needed argument now it's no longer defaulted
2017-08-17 11:04:30 +01:00
Katelyn Baker
2dc362a409 Merge pull request #1252 from corda/feature/kat/moveAMQPSerialiserTowardCommonInterface
Move AMQP serialiser toward common interface
2017-08-17 09:43:30 +01:00
Shams Asari
dc8d232480 Creating a PartyAndCertificate only requires a CertPath 2017-08-16 16:36:03 +01:00
Katelyn Baker
4d54d1a8dc Review Comments
Removing unused default method on the factory, it was added for testing
although given there are easier ways to build factories for the tests it
was never used and doesn't need leaving in
2017-08-16 11:39:07 +01:00
Katelyn Baker
49c23a58d1 Final changes integrating tests into the new API
Fix some rebase issues
Ensure tests are using the correct versions of the factories
2017-08-15 15:11:26 +01:00
Katelyn Baker
825908cf15 Refactoring changes to work with interface changes
Specifically we don't need the factory factory as that functionality
lives in the global defaults
2017-08-15 15:11:26 +01:00
Katelyn Baker
139eef2ccb Move AMQP serializer toward the new common abstract itnerface
Allow unique serializer factories to be created per unique set of
WhiteList / Class Loader pair. Remove default consruction of the
SerializerFactory to force use of the FactoryFactory to get the generic
factory and thus access to it's ClassLoader
2017-08-15 15:11:20 +01:00
Katelyn Baker
ae72d4d788 Review comments
Rename rtn to serializer
Some whatspace reformatting
2017-08-14 17:35:36 +01:00
Katelyn Baker
2d28cb01d5 Optimise by caching class when serialising
This removed the need to calculate anything on de-serialisation if using
the same factory
2017-08-14 17:35:36 +01:00
Rick Parker
2f08425c43 Refactor KryoAMQPSerializer to go through generic APIs to access AMQP serialization (#1225) 2017-08-14 17:24:04 +01:00
Rick Parker
31df43bd76 Some preparation work for AMQP serialization integration & a refactor fix (#1214) 2017-08-11 13:23:00 +01:00
Matthew Nesbit
af13371510 Move certificate builder code from core to node utilities.
Address PR comments

Fixup dead reference
2017-08-11 12:02:38 +01:00
Katelyn Baker
52aa145c91 Ensure deserialised obj isn't cached serialised version
if it is (it's not) then we wouldn't be testing the carpetner
2017-08-10 12:17:10 +01:00
Katelyn Baker
4d6230f22c Post rebase fixes
- Add missing import
- Deal with files that need to move from core to nodeapi.internal
- Fix up the imports
2017-08-09 16:39:28 +01:00
Katelyn Baker
1f9c04544d Make the carpenter a member of the serialiser factory
If it's not then the caroenter's class loader isn't persistent and thus
we will be constantly recarpenting objects
2017-08-09 15:25:17 +01:00
Katelyn Baker
36cbcae99c Review Comments 2017-08-09 15:09:59 +01:00
Katelyn Baker
45ed78b1a8 Serialiser / Synthesiser work and cleanup
- Adding test case that shows it should work
      AS it works with concrete classes, not if we carpent up the back end
    - WIP
    - The current test fails because the carpenter is creating the map (for
      some reason) as a linked hash map and not a normal map that we can't
      serialise. Added a test to confirm that it's not the carpenter here.

      Two questions really, why are we creating it as a linked has map, AFAIK
      the carpenter should just be whipping up what it's told to and it's not
      being given a linked map

      Secondly, should we support serialisation of these objects

    - Remove debug
    - Remove yet more debug
2017-08-09 15:09:59 +01:00
Katelyn Baker
92ba0c33e1 Adding more / better tests, splitting existing tests up
Squashed commit messages
    - Split up the serialiser/synthesiser tests into more manageable sizes
    - WIP - found test which breaks deserialiser
      Looks to be soemthign to do with synthesising a class with a container
      of Interfaces
2017-08-09 15:09:59 +01:00
Katelyn Baker
ae70d73e56 Synthesiser / Serializer integration working 2017-08-09 15:09:59 +01:00
Katelyn Baker
0541d128e4 Fixes for nullable Prim Types
Commit messages from Squashed Commits
    - Carpenter doesn't work with nullable prim types
    - Fix to get Cherry picks up to date with Master
2017-08-09 15:06:48 +01:00
Katelyn Baker
a5106d74a8 Integration of the serialiser and carpenter working
Tests added
2017-08-09 15:05:56 +01:00
Katelyn Baker
4cfa376d7d Add the carpenter into the deserializer
Deseializing any blob that contains a type unknown to the classloader
will cause a class object to be carpented up and a suitable object
returned
2017-08-09 15:04:50 +01:00
Rick Parker
28610868c4 Remove Kryo from core module completely, including gradle dependencies (#1161) 2017-08-09 14:53:46 +01:00
Andrzej Cichocki
3a3ead2dfe Remove ListenableFuture from core/main (#1030) 2017-08-07 14:31:24 +01:00
Patrick Kuo
3a63f0c606 * remove x500 name validation when loading config file (#1137)
* added x500 name validation in Network registration.
* fix for github issue #1130
2017-07-28 16:18:49 +01:00
Shams Asari
407b467f67 Moved the majority of the contents of Utils.kt into either InternalUtils.kt or KotlinUtils.kt.
What remains is being dealt with in another PR.
2017-07-24 19:25:56 +01:00
Rick Parker
fe9db6f1f7 Remove links to Kryo from serialization "clients" (#1079) 2017-07-21 14:23:05 +01:00
Clinton
0ccfae252f POMs generated by publishing are now correct. (#1055)
* POMs generated by publishing are now correct. The publish extension now requires an explicit call to configure the publishing instead of waiting until after evaluation. This prevents evaluation order issues with the artifact renaming code that causes the POM to have the original, incorrect, artifact names.

* Fixed new test compile issues caused by removal of some dependencies in test utils that caused webserver code to be automatically included in any project also compiling test utils.
2017-07-18 12:34:56 +01:00
Shams Asari
195189070a Moved the Path extension methods that were in Utils.kt into the internal package 2017-07-17 16:01:19 +01:00
Shams Asari
7caee508ec Refactored ErrorOr into Try, with Success and Failure data sub-classes, and moved it into core.utilities 2017-07-11 12:10:38 +01:00
Patrick Kuo
7e8de79848 Legal name validation for X500Name (#983)
* * Legal name validation for X500Name while loading from config file.

* * Removed unintended changes.
2017-07-11 12:09:30 +01:00
Shams Asari
f718acb939 Moved CordaException.kt to base core package 2017-07-10 10:36:59 +01:00
Andrzej Cichocki
cefa14507a Retire HostAndPort (#962)
* Don't attempt to parse a resolved InetSocketAddress toString
* A mock node isn't reachable via an address
2017-07-07 15:11:07 +01:00
Clinton Alexander
b4e7d7ca1b Can now publish to artifactory. 2017-07-03 18:12:56 +01:00
Katarzyna Streich
58da76c052 Network map redesign: Change field types in NodeInfo, move away messaging data from NodeInfo (#921)
* First stage of changing fields in NodeInfo.

Part of work related to NetworkMapService upgrade. Create slots for
multiple IP addresses and legalIdentities per node.

* NodeInfo stores HostAndPort.

Move information specific to messaging layer away from NodeInfo.
Only HostAndPort addresses are stored. Add peer name - peer handle
mapping to MockNetwork to reflect that change.
2017-06-27 18:14:51 +01:00
Andrius Dagys
aaf7de0d02 RPC server: buffer response messages until the client queue is fully set up.
The issue arises when the server restarts, and the client is sometimes
not able to recreate its queue in time, so the server is unable to send
back a response message and just drops it, causing the client to hang.
2017-06-22 11:26:04 +01:00
Clinton
08cbcac40c Corda publications and JARs now have cord or corda at the start. (#749)
Core corda publications and JARs now have cord or corda at the start (excluding gradle plugins). Removed an unnecessary dependency on test-utils in node-schemas to prevent an evaluation order bug in gradle.
2017-06-06 15:05:47 +01:00