Commit Graph

2360 Commits

Author SHA1 Message Date
Katarzyna Streich
f729453fee CORDA-2334 - Net Params non-downgrade verification in transaction resolution / building. (#4351)
* Add FetchParametersFlow

* No downgrade parameters in ResolveTransactionsFlow

Make sure that parameters in the transaction
graph are ordered (this is to prevent the downgrade attack, when the
malicious notary and participants sign transaction that shouldn't be
notarised otherwise). We ensure that by checking that epochs of network
parameters in the transaction chain are ordered.

* Addressed some minor items from RP review feedback.

* Refactoring following rebase from master.

* Address RP PR review comments (round 2)

* Addressed a couple of minor PR review points.

* Renaming of unit tests and cleanup.

* Changes discusses with RP to ensure Network Param checking is applied at txn verify time + resolve order checking gated on existence of tagged NPs in txn and associated minimum platform version.

* Do not fail on missing ServiceHub impl + return nothing if txn not NP tagged.

* Unify HistoricNetworkParametersStorage and
NetworkParametersStorageInternal

* SignedDataWithCert implements NamedByHash

* Cleanup

* Move parameters ordering check to signed transaction resolution

* Fixes after merge, address comments

* Address Andrius comments
2019-02-08 15:29:32 +00:00
Shams Asari
c667df9bec
Port over ENT changes (#4706)
Port of commit 9b55ad2680
2019-02-01 18:10:10 +00:00
Shams Asari
c39c61ecab
CORDA-2467: Moved non-contract things out of finance-contracts and into finance-workflows (#4700)
This includes all of the cash selection logic, JSON support using jackson and a bunch of utilities which are not relevant to contract verification. The exception to this are Interpolator which has been moved to the IRS demo, and PhysicalLocationStructures.kt which is now in explorer.
2019-02-01 17:31:12 +00:00
josecoll
099a747ebf
CORDA-2526 Allow for duplicate signed attachments in devMode (#4691)
* Allow for duplicate (contract class, version) signed attachments in devMode.

* Code clean-up.

* Fix compilation error in test code.

* Additional gating/warning and added Unit test for development mode behaviour.
2019-01-31 14:41:23 +00:00
Christian Sailer
deba96dce9 ENT-2991 Deadlock between AppendOnlyPersistentMap and underlying database (#4676)
* Remove locks around database access in AppendOnlyPersistentMap and introduce
a unit test that checks that known deadlock scenarios of the old version
are avoided.

* Fix Deadlock unit test

* Add some extra latching to try and make timing less fragile.  Can never be perfect though.

* Review feedback, and some thread safety fixes.
2019-01-30 18:20:53 +00:00
Roger Willis
365471d9f4
CORDA-2531 State mappings are now also updated for new reference states. (#4681)
* State mappings are now also updated for new reference states.
Added a test to prove the above works.

* Addressed Rick's review comments.
2019-01-30 10:42:43 +00:00
Rick Parker
7dc7313fb7
ENT-3000 Start pooling classpath scanning and related fixes (#4664)
* Start pooling classpath scanning

Quickly patch synchronisation of attachment class loader cache.  Needs a revisit but more complicated due to DJVM.

Annotate away for DJVM

Take ClassGraph utils into their own file so we can exclude for DJVM

Clean up a little

* Daemonize the threads

* Seems to be some concurrency problems with use of ClassGraph.  Using a mutex for now to work around.
2019-01-30 10:35:20 +00:00
Andrius Dagys
9ade410109 Minor: remove redundant Raft migration script 2019-01-30 10:50:17 +01:00
Katarzyna Streich
6efd54fce1
CORDA-2520: Add FetchParametersFlow (#4674)
* CORDA-2520: Add FetchParametersFlow

* Address comments, add test
2019-01-29 18:16:37 +00:00
Shams Asari
88e4b85537
CORDA-2521: Checkpoint verifier no longer cares about the CorDapp jar name (#4669)
The check on the CorDapp hash is sufficient.
2019-01-29 16:32:07 +00:00
Tudor Malene
262a7ad1b7
Backport merge fixes added to ENT (#4618)
Fix test and address code review comments.
2019-01-29 13:45:04 +00:00
Andrius Dagys
cfa06853c0 CORDA-2524: Minor – reduce notary service logging noise 2019-01-29 10:23:55 +01:00
JamesHR3
22462cc1e8
[CORDA-1596] Improve error message when CorDapp schema changes (#4506)
* Raise schema exceptions with better error

* Add test and use new exceptions
2019-01-29 08:17:05 +00:00
Shams Asari
2262d05d5c
Made NetworkMapTest leaner (#4645)
Merged three tests into one to avoid repeating the same node startups. The assertions the original tests made can be done in one test without any contamination.
2019-01-28 17:50:26 +00:00
Shams Asari
e20278fbfd
Made FlowCheckpointVersionNodeStartupCheckTest leaner (#4640)
* Removed `restart node successfully with suspended flow` as it duplicates `TraderDemoTest#Test restart node during flow works properly`
* Removed the need for a notary
2019-01-28 14:08:54 +00:00
Shams Asari
49e23bca82
Removed AsymmetricCorDappsTests (#4642)
This is only testing the internal cordappForClasses method which is used for internal testing. This method is covered by other unit and integration tests.
2019-01-28 13:59:38 +00:00
Shams Asari
fc7428a40d
CORDA-2503: Added installCordaService to UnstartedMockNode to allow tests with custom test-only services (#4655) 2019-01-28 13:49:01 +00:00
Shams Asari
3db35d8911
Made NodeRegistrationTest leaner (#4644) 2019-01-28 10:54:30 +00:00
Roger Willis
0e1c20a883
CORDA-2497 fix (#4630)
CORDA-2497 fix
* Added test to show the fix working.
* Now backwards compatible.
* Refactored out some duped code.
* Added better explanations for what's going on.
* Fixed test which was failing due to the serializationEnvRule problem.
* Addressed Tudor's review comments.
2019-01-24 20:36:33 +00:00
szymonsztuka
9f4c8bcea5
CORDA-2490 Attachment in the directory fails to correctly upload (#4627)
The column 'uploader' was marked as not updatable entity so any update wasn't propagated to the database when the attachment was uploaded again and the uploader field was changed to a trusted one. Also 'saveOrUpdate' removed, the entity is already managed, saveOrUpdate is for detached/new entity.
2019-01-23 20:29:16 +00:00
Shams Asari
5bb5244e55
CORDA-2228: Exceptions emanating from ReceiveFinalityFlow are sent to the flow hospital (#4621) 2019-01-23 16:24:49 +00:00
josecoll
100a6fcb56
CORDA-2475 Adjust attachments query logic to return correct results (#4612)
* CORDA-2475 Adjust attachments query logic to return correct results sets for signed/unsigned jars.

* Updates following PR review feedback by RP.
2019-01-22 22:57:43 +00:00
Anthony Keenan
ee4f4f5702
Fix issue with devModeOptions.allowCompatabilityZone not working (#4613) 2019-01-22 10:23:14 +00:00
Shams Asari
c6a7d14f4f
Reducing the size of the CorDapp jars used in tests (#4600)
The helper method enclosedCordapp is a replacement to scanning the current package (which pulls in a lot more into the jar than intended).
2019-01-21 13:54:26 +00:00
szymonsztuka
26cfea202b
CORDA-2450 Creating attachment version from whitelisted JARs fails for node upgrade (#4593)
Upgrade from node 3.0 to 4.0 fails to create versions of whitelisted JARs from networkParameters - read parameters from file at first as in Corda 3.0 there no relevant table, then try from the table.
As this is migration, the code will run only once on each node, she increased log level to info for messages. Tested using https://r3-cev.atlassian.net/browse/R3T-1549
2019-01-17 17:26:24 +00:00
JamesHR3
6b149f8aad CORDA-2432 - Update documentation for filtering by state relevancy in vault queries (#4577)
* Update changelog with changes to vault queries

* Move choice of relevancy state to QueryCriteria

* Ensure relevancy default is correct for all query types

* Remove superfluous imports

* Update documentation for queries using state relevancy

* Fix merge damage

* Revert change to use RELEVANT as the default and update docs

* Revert missed instance of relevancy change

* Rewrite of upgrade notes for vault state query updates

* Address review comments
2019-01-16 19:53:49 +00:00
Tudor Malene
03cff6bd00
Fix flaky test. (#4586)
* Fix flaky test.

* Address code review comments.
2019-01-16 12:02:40 +00:00
Wawrzyniec 'Wawrzek' Niewodniczanski
78a70d2355
Merge pull request #4525 from corda/wn-redo-node-conf-docs
Redo Corda Operation docs [CORDA-2251]
2019-01-15 16:09:27 +00:00
Shams Asari
f592025273 Regen isolated jar to fix failing test(s) (#4583)
https://github.com/corda/corda/pull/4541 removed TransactionBuilder c'tor (which was introduced post-V3) which the frozen isolated jar was using
2019-01-15 14:56:57 +00:00
Dimos Raptis
fbb00bff9c
[CORDA-2431] - Small refactorings following-up on PR-4551 (#4564)
* Small refactorings following-up on PR-4551

* Adjust thread context class loader

* Address Shams' comments
2019-01-15 14:34:11 +00:00
Michele Sollecito
05ffb3d101
CORDA-2403: Flagged API issues between 4.0 and 3.3. (#4541) 2019-01-15 14:27:29 +00:00
Tudor Malene
44733da8b6
Increase timeout (#4579) 2019-01-15 10:20:56 +00:00
Wawrzyniec 'Wawrzek' Niewodniczanski
e003eedd38
Merge branch 'master' into wn-redo-node-conf-docs 2019-01-15 10:05:00 +00:00
Shams Asari
24a7821dce
CORDA-2434: CordaRPCClient now only has c'tors rather a mix of c'tors and factory methods (#4569) 2019-01-14 16:07:56 +00:00
Wawrzyniec 'Wawrzek' Niewodniczanski
2f18ce9440
Merge branch 'master' into wn-redo-node-conf-docs 2019-01-14 15:31:32 +00:00
Shams Asari
3b8347e150
Fixed AttachmentLoadingTests (#4565)
There were two issues:
* The original "sealing violation: can't seal package net.corda.nodeapi" issue was due to the isolated CorDapp containing some code in the net.corda.nodeapi namespace. This has been moved to the isolated namespace.
* The test was not correctly creating the second transaction with the dummy command
2019-01-14 14:32:14 +00:00
Dimos Raptis
5b34020e59 [CORDA-2390] - Add whitelists and custom serializers from cordapps to serialization … (#4551)
* Add whitelists and custom serializers from cordapps to serialization context

* Remove changes in TransactionBuilder, add caching

* Add whitelists and custom serializers from cordapps to serialization context

* Remove changes in TransactionBuilder, add caching

* Address comments

* Increase node memory for SIMM integration test

* Cache only serialization context

* Increase integ test timeout

* Fix API breakage

* Increase max heap size for web server integ test

* Move classloading utils from separate module to core.internal

* Adjust heap size for more integ tests

* Increase time window for IRS demo transactions

* Fix determinator

* Add parameter in core-deterministic

* Stub out class-loading method for DJVM
2019-01-13 20:15:05 +00:00
JamesHR3
36cd9b9791
[CORDA-2402] Ensure out of order transactions result in correct vault state (#4559)
* Pass states to record through to transaction resolution

* Add a test case

* Add comment indicating why states are always added in tx resolution

* Update observer node documentation
2019-01-13 15:03:53 +00:00
szymonsztuka
7a4b6b3e44
CORDA-2405 Update versions of whitelisted attachments (#4549)
The version of contract attachments that are whitelisted should be read from NetworkParameters.whitelistedContractImplementations.
It use the lattes network map from db with the highest epoch.
2019-01-13 11:38:19 +00:00
Roger Willis
084b3a1a1d
CORDA-2426 Fixed bug in state pointer search. (#4561)
* Fixed bug in state pointer search and added tests.

* Blacklisted problematic package.

* Addressed Shams' comments.

* Addressed round two of comments.

* Fixed another bug whereby the DFS gets stuck in an infinite loop.
2019-01-13 08:58:52 +00:00
Shams Asari
caad18f6db
CORDA-2347: Added backwards compatibility to SwapIdentitiesFlow (#4548)
The API has been reverted to be completely ABI compatible with V3, and the small changes that were made to the wire format in https://github.com/corda/corda/pull/4260 have also been reverted.
2019-01-12 14:23:20 +00:00
JamesHR3
0832587096
[CORDA-1897] Improve exception handling on startup (#4452)
* Select a console logger based on logging level

* Ensure consistent formatting

* Ensure stack traces only printed when console logging enabled
2019-01-11 17:40:32 +00:00
Andrius Dagys
4004e9473d Exclude BFT smart tests from the build (#4557) 2019-01-11 16:03:54 +00:00
szymonsztuka
9b8fda0d6d
CORDA-2375 Ensure node has unique attachment contract classname/version from signed JARs (#4535)
Corda Node ensures a given contract class and version can be sourced from only one signed and trusted Attachment (JAR).
An attempt to import a signed JAR as a trusted uploader (or promote to be trusted) with a class and version already present in the other trusted Attachment will raise DuplicateContractClassException.

Minor fixes to Hibernate Attachment Query parser (original query to select attachment without signers would always return no attachments)
2019-01-10 14:13:00 +00:00
Christian Sailer
b5fc095288
Use FlowTimeOut exception rather than SQL deadlock in unit tests to avoid hitting the exponential back-off. (#4527) 2019-01-10 09:59:21 +00:00
Andrius Dagys
fa025dedeb
ENT-2822: Move experimental raft and bft-smart notaries back into node, fix reference state support (#4509)
Move Raft and BFT-Smart notaries back into node to preserve backwards compatibility.

* Allow overriding full node config when using internal mock network parameters.

* Make BFT-Smart notary start up in prod mode as well

* Move raft & bftsmart notaries to net.corda.notary.experimental package

* Make sure Raft notary handles reference state edge cases correctly.

* Make sure BFT-Smart notary handles reference state edge cases correctly.

* Include notary schemas in node internal schemas

* Undo Raft notary table schema changes to maintain compatibility.
2019-01-09 15:52:42 +00:00
josecoll
4530a5e982
CORDA-2395 Add cordapp code signing dev key to production blacklist. (#4519)
* Add cordapp code signing dev key to production blacklist.

* Remove code used to generate the actual PK hash (it is now attached to the JIRA story)

* Remove wiki page reference.

* Remove the non redundant cash transfer.
2019-01-09 15:41:24 +00:00
Tudor Malene
d33cb16c5e
ENT-2923 - remove db access code from the verification thread pool (#4504)
* ENT-2923 - remove db access code from the verification thread pool

* Remove worker pool for tx verification and disable db access.

* Address code review comments
2019-01-08 14:37:26 +00:00
Rick Parker
ce250cfafd
ENT-2924 Fix performance of identity checking. (#4515)
* Concentrate accesses to the identity cache.

* Fix tests to reflect change in semantics / method name.

* Delete unused method and tests.
2019-01-08 14:35:32 +00:00
Matthew Nesbit
93d256649f
Reduce the operation of ip autodetect to nodes specifying localhost (#4435)
* Reduce the operation of ip autodetect to nodes specifying localhost, rather than any node with a 192.168.x.x or 10.x.x.x address. Also, catch the common user error of specifying 0.0.0.0 in p2pAddress.

* Fix test that uses invalid config
2019-01-08 09:55:16 +00:00
Tudor Malene
57a70fa1e8
Attempt to fix master (#4517)
* Attempt to fix master

* Attempt to fix master

* Attempt to fix master

* Attempt to fix master

* Ignore failing test

* Ignore failing test
2019-01-08 08:02:38 +00:00
Tudor Malene
b13e92cb24 Fix tests (#4513) 2019-01-07 09:25:05 +00:00
Stefano Franz
c507326ed1 fix breakages due to package movement of the Finance dummy schemas 2019-01-04 17:58:43 +00:00
Stefano Franz
fba47256d4 add magic words to publish the test-contracts jar 2019-01-04 17:58:43 +00:00
Stefano Franz
5081fcc9a8 break out the FungibleAsset testing schemas into module to prevent having to publish a test-jar. 2019-01-04 17:58:43 +00:00
Tudor Malene
24d91c5f89
CORDA-2384 - Fix driver classpath (#4472)
* Fix driver classpath

* Fix tests

* Fix classloader bug.

* Fix tests

* Fix tests

* Fix api

* Disable failing irs test.

* Address code review comments

* Remove @Ignore from test

* Remove @Ignore from tests

* Address code review comments.

* Attempt to fix simm valuation test

* Attempt to fix simm valuation test

* Comment failing functionality.
2019-01-03 20:06:35 +00:00
Michele Sollecito
5d3b24dcfa
[CORDA-2387]: Seeing warnings for "Double insert in net.corda.node.utilities.AppendOnlyPersistentMap" (fixed) (#4499)
* [CORDA-2387]: Reproduced the issue in a test.

* [CORDA-2387]: Fixed.

* [CORDA-2387]: Fixed.
2019-01-03 17:59:34 +00:00
Shams Asari
f590300cdf
CORDA-2345: Updated docs to use the new TestCordapp API, rather than the old scan cordapp packages (#4491)
Also made some improvements to the API, especially for Java users.
2019-01-03 17:57:28 +00:00
Shams Asari
055beefd02
CORDA-2391: Revert behaviour of Try.on to V3 (#4497)
Apps may depend on the previous behaviour of catching Throwable rather than just Exception. Better to not risk this break and instead provide a helper to throw Errors.

Also using Consumer to avoid ugly usage in Java for doOnSuccess and doOnFailure.
2019-01-03 16:48:42 +00:00
JamesHR3
17c654803d
[CORDA-2298] Update trackBy documentation (#4496)
* Update the documentation for trackBy to better indicate that updates are not filtered according to the query criteria
* Add a test that shows the behaviour, which is skipped for now until a solution is implemented.
2019-01-03 16:23:54 +00:00
Tudor Malene
97e02cd9ca
Remove whitelist constraint warnings. (#4488) 2019-01-03 11:53:29 +00:00
Shams Asari
2622c8fe51
CORDA-1942: Renamed NetworkParametersStorage to NetworkParametersService to match its public usage (#4487)
As a public API it's not a true storage - CorDapps can't add network parameters.
2019-01-03 08:52:39 +00:00
Michele Sollecito
30b138a847
[CORDA-2376]: Unable to make contract attachment trusted if it was received via network (fixed). (#4474)
* [CORDA-2376]: Unable to make contract attachment trusted if it was received via network (fixed).

* [CORDA-2376]: Wrote some tests.

* [CORDA-2376]: Wrote some tests.

* [CORDA-2376]: Code review changes.

* [CORDA-2376]: Code review changes.
2019-01-02 18:11:53 +00:00
Tudor Malene
ee9251bd25
CORDA-2327 add attachments for missing dependencies (#4456)
* CORDA-2327 first draft - add attachments for missing dependencies

* CORDA-2327 draft - fix unit tests

* CORDA-2327 draft - some cleanup.

* CORDA-2327 fix test

* CORDA-2327 fix test

* CORDA-2327 fix test

* CORDA-2327 Address code review comments

* CORDA-2327 fix api

* Address code review comments

* CORDA-2327 Address code review comments

* CORDA-2327 Address code review comments

* Fix merge

* Address code review comments
2019-01-02 16:16:53 +00:00
Shams Asari
9a484998bb No longer using deprecated MockNetwork c'tor (#4481) 2019-01-02 09:51:51 +00:00
Viktor Kolomeyko
5e16961fee
ENT-2847: Ent port: Make logging pluggable in NetworkRegistrationHelper. (#4477) 2019-01-01 20:42:43 +00:00
Shams Asari
b4c3fa1948
Fixed incorrect attachment loading integration test (#4453)
* Fixed incorrect attachment loading integration test

`AttachmentLoadingTests.test that attachments retrieved over the network are not used for code` was a false-positive - it was incorrect on multiple levels. Fixing it required updating the finance:isolated CorDapp, at which point it was given the new MANIFEST metadata for V4, and moved out of the net.corda.finance namespace to avoid package sealing issues.

The new test exposed a bug in the LedgerTransaction verification logic. This was cleaned up as it was too easy to verify on the wrong instance.
2018-12-31 15:02:11 +00:00
Shams Asari
33670d62b1
Closing the app class loader on node shutdown (#4479) 2018-12-31 13:15:29 +00:00
Viktor Kolomeyko
cd842274ab
ENT-2913: Port from Ent: Add deprecated annotation for compatibilityZoneURL (#4475) 2018-12-28 17:51:26 +00:00
Wawrzyniec Niewodniczański
718d4b3630 Reorder Ops docs
- reorder Ops docs page to make it easier to follow
- reorder content of node.conf fields
- fix docker-image hierarchy
2018-12-28 17:19:07 +00:00
Shams Asari
c08f65a92c
CORDA-2128: Moved all the helper methods added to NetworkParameters.kt into internal (#4466) 2018-12-27 14:21:37 +00:00
Shams Asari
00672f97fa
CORDA-2128: Moved constraints and attachments stuff out of the public API that shouldn't be there (#4460) 2018-12-24 15:09:38 +00:00
Shams Asari
60d215aaa8
Fixed incorrect usages of assertFailsWith (#4458)
The overload that takes in a String does NOT check that the exception thrown has that message, which is what these tests are assuming. Rather it's the assertion message when the test fails.
2018-12-24 09:44:48 +00:00
josecoll
6f9f6fd870 CORDA-2366 - Adjust assertions to cater for any ordering of results. (#4455) 2018-12-23 16:53:01 +00:00
Andrius Dagys
6f0bc42098 ENT-2813: Fix uniqueness provider double insertion issue
Fix an issue where a transction id is committed twice if a
reference-only transaction gets re-notarised.

Added more tests.

add fix
2018-12-21 22:29:16 +00:00
Dimos Raptis
8ac32f52f6 CORDA-1839 - Remove race condition between trackBy and notifyAll (#4412)
* CORDA-1839 - Remove race condition between trackBy and notifyAll

* Fix null check

* Improve filtering

* Switch equality test to refs

* Refine filtering of seen updates

* Add entry in the changelog

* Address comments
2018-12-21 09:40:07 +00:00
JamesHR3
39e5dc5749
[CORDA-1828] Documentation update for observer nodes (#4443)
CORDA-1828 Documentation update for observer nodes

* Update observer node documentation

* Added test to catch original issue if seen again
2018-12-21 08:18:14 +00:00
Tudor Malene
3c13c07c09
CORDA-2344 Set contextClassloader on the flow threads. (#4437)
* CORDA-2344 Set contextClassloader on the flow threads.

* CORDA-2344 Set contextClassloader on the flow threads.
2018-12-20 15:04:16 +00:00
Rick Parker
3efbad34cc
ENT-2848 remove need for generated IDs on some frequently used tables (#4446)
* Working version

* api-current.txt change to remove diff due to inheritance hierarchy change.

* api-current.txt change to remove warnings of abstract methods in new interfaces.

* Fix indent
2018-12-20 13:06:21 +00:00
Shams Asari
830959c9f7
CORDA-2345: Simplified TestCordapp to make it inline with the recent CorDapp versioning changes (#4434)
TestCordapp has now two implementations to clearly separate the two use cases it has in the Corda repo:

* TestCordappImpl which implements the revised public API of TestCordapp; namely that a TestCordapp instance references a real CorDapp jar on the classpath. This is either an external dependency jar in which case it’s taken as is and given to the node, or it’s a local gradle project in which case it’s compiled using the gradle “jar” task to generate the CorDapp jar. This approach means the jar has all the original CorDapp versioning information, which is important that it’s correct when testing. To this end, TestCordapp only needs to expose the ability to specify the app’s config. All the remaining properties have moved to CustomCordapp.

* CustomCordapp for creating arbitrary custom CorDapps, including specifying the jar’s MANIFEST values. This is internal API and only used for testing the platform. Technically this shouldn’t implement TestCordapp but does so to reduce the complexity of the driver and mock network.
2018-12-20 09:49:58 +00:00
szymonsztuka
4aaefb4fe9 CORDA-2331 Split Workflow and contracts of Finance App into separate Cordapps (#4422)
* Split Workflow and contracts of Finance App into separate Cordapps, part 1 - content which is different between OS and ENT is still in contract Cordapp.

* Move CashSelection implementations to workflow module.

* Move CashSelection implmentations to workflow module.

* Move finance module to finance-flows, top level finance module is empty.

* Move finance module to finance-flows, top level finance module is empty.

* Updated build comment.

* Revert publication of combined (contracts and flows) corda-finance.jar (to maintain backwards compatibility with 3rd party cordapps dependent on finance)

* Added backwards compatibility clarification comment.

* Re-instate new cordapp metadata.

* Global rename of `finance-flows` to `finance-workflows` to follow adopted naming conventions.

* Addressed final review comments.

* Rename application to "Corda Finance Demo"

* Generation of original corda-finance jar from new sub-modules.

* Fixed and tested demobench with new split finance contract and workflow jars.

* Renamed finance sub-modules to contracts and workflows.

* Remove Michele!!!

* Minor fix to filtering logic.

* Align CorDapp configuration filename with workflows jar.

* Fix breaks caused by finance module naming changes.

* Final alignment between OS/ENT of finance contract code.
2018-12-19 18:02:51 +00:00
Rick Parker
a4037b374d
ENT-2848 More contract attachment caching to avoid database queries slowing the node down (#4433) 2018-12-19 17:53:48 +00:00
Christian Sailer
e8a467cab8
CORDA-2304 Never give up on notarisations (#4420)
* Make TimedFlows retry forever, and cap the growth of the time out interval.

* Only time flows for restart if that is sensible (i.e. notary flows that actually have an alternative node to talk to).

* Move check for multi node notary into getter so it the `canBeRestarted` attribute can't be set too late.

* Make restartable timed flow a concept on SubFlow metadata and the relevant events so we can handle it properly for subflows based on their metadata.

* Addressing review comments.

* Consistent naming

* Update documentation

* Addressing documentation comments.
2018-12-18 09:18:12 +00:00
Rick Parker
20e5bbf56f
ENT-2848 Add caching to contract attachment versions (#4410)
* Refactor into attachment service

Fix up mock service

First caching version, but with no invalidation currently

Set cache size

Fix up after rebase

Cache invalidation

Formatting tidy up

Sort out some nullability

Add kdocs.

Unit tests

More unit tests

Fix TODO

Unit test fixes

Unit test fixes

Fixed concurrent invalidating transaction support.

* Correct some transaction concurrency bug, including unit test.

* Added some unit tests for the method I added to persistence.

* Remove some blank lines

* Review feedback

* Fix imports
2018-12-17 15:14:14 +00:00
Thomas Schroeter
fe3182d22f
Remove safe cast at initial registration attempt (#4427) 2018-12-17 14:11:43 +00:00
Shams Asari
9d7be5cf21
Renamed CordappInfoResolver to CordappResolver (#4419) 2018-12-14 19:17:06 +00:00
Shams Asari
1a065ef13d
CORDA-1942: Moved minimumPlatformVersion and targetPlatformVersion to Cordapp (#4416)
Otherwise ContractAndWorkflow ends up having these two duplicated three times.
2018-12-14 15:48:01 +00:00
josecoll
9cdda3bd77
CORDA-2149 CorDapp Contract and Workflow version identifiers (#4363)
* Implementation of Contract and Workflow attribute identifiers.

* Fixes following rebase from master.

* Fix broken JUnit test.

* Fix broken JUnit test.

* Fix broken JUnit test.

* Added missing constants.

* Further clean-up.

* Updated documentation.

* Added changelog entry.

* Updated all samples (using new Gradle Plugin 4.0.37 functionality)

* Temporarily resolve gradle plugins from latest published snapshot.

* Temporarily resolve gradle plugins from latest published snapshot.

* Updates following feedback from PR review.

* Move constants into CordappInfo companion object.

* Contract and Workflow attribute `version` to `versionId` (as version is a reserved gradle variable)

* Clarified warning message on incorrect version identifier.

* Align version identifier processing logic with gradle cordapp plugin.

* Updated comment.

* Minor fixes following rebase from master.

* Fixed broken unit test.

* Improved exception reporting.

* Update to use 4.0.37 of Gradle Plugins.

* Added support for combined Contract and Workflow CorDapp info.

* Updated following discussions with Shams + cleanup.

* Updated following Shams PR review.

* Minor API improvements.

* Added missing cordapp info causing deployNodes to fail.
2018-12-14 09:39:23 +00:00
Matthew Nesbit
767e37a34e
Apply some protective measures to prevent the reconnection test failing when rogue RPC clients on the team city server connect. (#4413) 2018-12-14 09:28:26 +00:00
Christian Sailer
32041930f4
CORDA-2306 backoff on flow retries (#4383)
* Exponential back off for retries

* Log back-off

* Jitter back off timing

* Set the minimum back-off to 10s

* Refactor code to be only called when required.

* Spelling

* Make condition purely based on `Chronic` interface

* Make timer a daemon thread
2018-12-13 13:52:30 +00:00
Remo
eb4a33e438 Corda-3941: initialiseSchema property couples corda node and cordapp ddl handling (#4277)
New property database.initialiseAppSchema introduced that allows to turn-off Hibernate DDL generation while leaving Node-specific Liquibase handling enabled.
2018-12-13 14:34:58 +01:00
Rick Parker
b70740cf2e
ENT-2785 Create clearer separation between RPC and P2P classes to make it easier to adjust logging levels independently. (P2P remained as is, some internal node RPC classes moved to existing node RPC package from generic messaging package, which is now just for P2P). (#4401) 2018-12-12 17:36:44 +00:00
szymonsztuka
4b14c47319
CORDA-2134 - re-enabling ignored tests due to signature constrains non-downgrade rule (#4398)
1) TwoPartyTradeFlowTests - restructured - saving transaction just after creating a state, as it's needed for the next TransactionState to be verified (for non-downgrade rule), enable more tests which were set as @Ignored, left 3 TODOs as 2 tests were slightly modified, need further investigation
2) MockService method loadContractAttachment always returns a dummy Attachment which means it has a default Contract Class Version number 1 used for signature constraints non-downgrade rule.
3) TransactionSerializationTests - added a fake transaction which created fake stated used as input state and using real (not mocked one) implementation of loadContractAttachment
2018-12-12 15:10:08 +00:00
Michele Sollecito
ccaf9dfbfa
[CORDA-2323]: Make detectPublicIp disabled by default. (#4404) 2018-12-12 13:38:57 +00:00
Emanuel Russo
5045f8fb7f Modify toString of DBCheckPoint (#4338)
* Modify toString of DBCheckPoint

Fix toString of object DBCheckPoint  to remove printing of array in DEBUG log

* Update DBCheckpointStorage.kt

Fix for Code Style Guideline
2018-12-12 09:43:16 +00:00
szymonsztuka
6d16e2d146
CORDA-2262 Align ID -> pubKey mapping between BasicHSMKeyManagementService and PersistentKeyManagementService (#4400)
There was a parallel work done on PersistentKeyManagementService (new table added) while this service has been superseded by BasicHSMKeyManagementService.
Move new table change for the former class to the later one and did some minor cleanup.
2018-12-11 19:50:30 +00:00
szymonsztuka
4799df9b80
CORDA-2150 signature constraints non-downgrade rule (#4262)
Contract class version non-downgrade rule is check by LedgerTransaction.verify().
TransactionBuilder.toWireTransaction(services: ServicesForResolution) selects attachments for the transaction which obey non downgrade rule.
New ServiceHub method loadAttachmentConstraint(stateRef: StateRef, forContractClassName: ContractClassName? = null) retrieves the attachment contract related to transaction output states of given contract class name.
2018-12-11 10:23:07 +00:00
Michele Sollecito
58ef83a67e
[CORDA-2007]: Fixed problematic max page size. (#4392) 2018-12-10 13:57:43 +00:00
Viktor Kolomeyko
1f8582e99f
CORDA-2115: Straighten-up @Before invocation chain. (#4379)
Note: similar sort of changes already made in Ent codebase that fix execution against external DBs.
it will make sense to backport those change to OS to avoid merge conflicts in the future.
2018-12-07 11:24:44 +00:00
Michele Sollecito
e2ea97bae7
[CORDA-2265]: Nodes hangs when using AppServiceHub to start a flow in a blocking way (fix) (#4376) 2018-12-06 15:13:32 +00:00
Florian Friemel
c46fde1133 Backport [ENT-2817] (#4364) 2018-12-06 15:04:49 +00:00
Florian Friemel
af1202ba79
[CORDA-2296] Improve initialization of criteriaBuilder in NodeVaultService. (#4374) 2018-12-06 15:02:38 +00:00
szymonsztuka
d2d13c1dfc
Attachment query with contract version, related to CORDA-2150, CORDA-2157 (#4357)
TransactionBuilder loads attachment using attachment storage instead of CordappLoader,
contract class version is now Integer (format and stored in db as Integer).
2018-12-06 11:28:53 +00:00
Michele Sollecito
ad48301149
[CORDA-2247]: Fixed a bug causing Hibernate to produce cross joins. (#4366) 2018-12-06 10:50:47 +00:00
Rick Parker
bac693a6f3
CORDA-2293 fix append only map getIfCached when Missing (#4355) 2018-12-05 08:39:42 +00:00
josecoll
63e326aedb
CORDA-2157 - Hash to Signature constraints migration V2 (#4261)
* Hash to signature constraints migration #1

* After rebase from Attachments Classloader commit.

* Simplified implementation without CZ whitelisting and relaxing the no-overlap rule slightly.

* Further simplification.

* Detailed implementation.

* Use fully loaded Cash contract jar for hash to signature constraints migration test.
Additional debug logging.

* Minor cleanup.

* Address PR review feedback.

* Minor fix.

* Fixes following rebase from master.

* Implemented `calculateEntriesHashes` to improve classloader validation performance.

* Address minor PR review comments.

* Added integration tests and some minor fixes.

* Minor fixes following rebase from master.

* Updates and fixes following integration testing.

* Added changelog entry.

* Fix broken unit tests.

* Fix compilation errors in DriverDSL tests after rebase from master.

* Minor fix to test cordapp jar signing using explicit keystore.

* Run hash-to-signature constraints integration test out of process using a non-validating notary.

* Address PR review feedback: contract version from database + other minor changes.

* Address final PR review feedback: remove signed attachment field from attachmentWithContext

* Resolve conflicts following rebase from master.

* Fix failing junit test.

* Fix Kryo serialization error (forgot to write new `version` identifier field)

* Removed redundant query carried over from previous commit.

* Added documentation.

* Fix test case where explicit Hash Constraint input and Signature Constraint output explicitly configured.

* Addressing PR review comments from SA.

* AttachmentQueryCriteria API: added wither methods and Java Unit tests.

* Fixed compilation error caused by Unit tests being in wrong module.

* Added @CordaInternal to canBeTransitionedFrom function.

* Minimized AttachmentClassloader overlap duplicates checking.

* Moved JarSignatureTestUtils and ContractJarTestUtils to internal pending clean-up and documentation before public release.

* Minor fix following rebase from master.

* Removed redundant checkNotNull(networkParameters) checks now that these are always passed into the main (non-deprecated) constructor.

* Remove capitalization.
2018-12-04 18:45:29 +00:00
Florian Friemel
382e3b651f
[ENT-2821] Make the default schemes for TLS and identity available from the CryptoService interface (#4354)
* Make the default schemes for TLS and identity available from the CryptoService interface.

* Change CryptoService.generateKeyPair to accept SignatureScheme instead of Int.
2018-12-04 17:06:12 +00:00
Andrius Dagys
838c99c6e4 CORDA-2115: Notary whitelist verification changes (#4293)
* CORDA-2115: Notary whitelist verification changes

- For regular and contract upgrade transactions: check that the notary is in the network parameter whitelist
- For notary change transactions: check the the new notary is in the network parameter whitelist. This enabled support for network merging: the old notary doesn't have to be in the current network's notary whitelist for re-pointing old states to another notary.

These checks are done during transaction construction/verification and also by the non-validating notary.

* Address comments

* Remove stale todo

* Use notary whitelist of current network parameters for platform versoin 3

* Cleanup test

* Move `getHistoricNotary` to `HistoricNetworkParameterStorage` in `core.internal`

* Require `newNotary` to be notary on the network map during notary change
2018-12-04 13:54:24 +00:00
Andrius Dagys
0925008f9e ENT-2666: Don't check for network parameter currentness for now (#4322)
* ENT-2666: Don't check for network parameter currentness for now

* Add check for parameters null when version >= 4

* Add check that parameters are known to the node/network

* Add test
2018-12-03 10:22:11 +00:00
Anthony Keenan
fab09c74d5
Node startup minor refactor (#4342)
* Slight refactor

* Move side effect out of method
2018-12-03 09:42:16 +00:00
Thomas Schroeter
27a80900bd
Shorten table name (#4331) 2018-11-30 14:36:27 +00:00
Michele Sollecito
a9ff8a0818
[CORDA-2278]: KillFlow RPC operation is not releasing soft locks. (#4332)
* [CORDA-2278]: Seems to be working. Leaving the test to ensure no future regressions.

* [CORDA-2278]: Seems to be working. Leaving the test to ensure no future regressions.

* [CORDA-2278]: Seems to be working. Leaving the test to ensure no future regressions.

* [CORDA-2278]: Seems to be working. Leaving the test to ensure no future regressions.
2018-11-30 13:10:19 +00:00
Patrick Kuo
4f41dff6cd Stop messaging services before node dies, to prevent port hogging when using in process node (#1620)
(cherry picked from commit 15c11d964f)
2018-11-30 10:33:31 +00:00
Tudor Malene
66e097b58d
CORDA-2147 Use serialization strict mode during transaction verification. (#4312)
* CORDA-2147 Use serialization strict mode during transaction verification.

* CORDA-2147 Address code review comments.

* CORDA-2147 Fix compilation error.
2018-11-30 09:44:41 +00:00
Anthony Keenan
559932a581
[CORDA-2275] Fix DriverTests for windows (#4325)
* Make enforceSingleNodeIsRunning internal for test purposes.

* Test that the file is deleted or the file lock is released to be sure that the node has stopped.

* Additional test for enforceSingleNodeIsRunnin
2018-11-30 09:41:50 +00:00
Katarzyna Streich
3f99d336b3
Add liquibase scripts for network parameters storage (#4324) 2018-11-30 09:39:07 +00:00
Michele Sollecito
4906358aa8
[CORDA-2276]: FlowMonitor repeatedly / indefinitely logs flows in the flow hospital. (fix) (#4327) 2018-11-30 09:31:46 +00:00
Michele Sollecito
628aa0b799
Fixed Thread.sleep() issue inside Fiber. (#4326) 2018-11-29 16:41:16 +00:00
Shams Asari
9100636b8c
CORDA-2269: Removed DriverParameters.initialiseSerialization as it's not needed (#4321) 2018-11-29 13:53:22 +00:00
Michele Sollecito
5d1652bacb
[CORDA-2272]: Recovering from StackOverflowErrors and given time to async logger to flush. (#4323) 2018-11-29 13:20:28 +00:00
Shams Asari
36fdb858c6 CORDA-2239: DriverDSL.startNode overload cleanup (#4252)
The overload that takes in a bunch of the node parameters with default values has been fixed to the V3 version. New node parameters since V3 now only exist in NodeParameters.

The reason for this is otherwise each new release of Corda that introduces new node parameters will force a new startNode overload to be added to DriverDSL to preserve backwards compatibility.

NodeParameters has been moved to its own file and logLevel is removed as it doesn't do anything.
2018-11-28 14:36:26 +00:00
Michele Sollecito
dc1f5f0ccd
[CORDA-2257]: Enabling optional global test port allocation (#4310) 2018-11-27 16:40:30 +00:00
Tudor Malene
06ebb97a31
Fix cache races. (#4311) 2018-11-27 16:36:02 +00:00
Katarzyna Streich
5d2ad46553
CORDA-2089 - network parameters tags - part (#4228)
* CORDA-2089 - network parameters tags - part

Data structures changes, storage and notarisation.

Tag transactions with network parameters hash that was in force when tx
was created. Add component group on all core transactions and resolved
parameters on full transactions. The hash should be always visible on
the filtered versions of transactions. Add
notarisation check that the parameters are current.
Implement network parameters storage on services for resolution.

This is only part of the work, next PR will include changes to
ResolveTransactionsFlow to make sure that parameters in the transaction
graph are ordered (this is to prevent the downgrade attack, when the
malicious notary and participants sign transaction that shouldn't be
notarised otherwise).
Probably on network services side we need the default parameters
endpoint for the
transactions that were created before this change - for now it's default
to the current ones.

* Make parameters storage agnostic to cert hierarchy

Test fixes

* Address most PR comments

* Fixes after rebase

* Fixes. Add epoch column to parameters storage.

* Address part of review comments

* Some more comments

* Hopefully fixing what I broke doing rebse

* Address Kostas comments

* Further fixes

* Save all parameters from updates to storage

* Fix integration test

* Address comments

* Fixes after rebase

* Fix test

* Fixes

* Add wrapper for filtering around parameters hash

* API stability fixes

* Add NetworkParametersStorageInternal

* Rename
2018-11-27 15:48:32 +00:00
Thomas Schroeter
b881fbd330
Throughput is private in PersistentUniquenessProvider (#4302) 2018-11-26 19:15:06 +00:00
Anthony Keenan
b7d04b1c6e
[CORDA-2235]: Add overrides for network parameters via command line and file (#4279)
* Temp commit

* Print the error message first by default, makes error output more natural.

* Polishing

* Further modifications after testing

* Documentation updates

* Couple of fixes after review

* Removing unnecessary tests

* Fix broken test

* Add interface to bootstrapper for testign

* Added unit tests

* Remove unused class

* Fix up bootstrapper unit tests and add a couple more

* Refactor the tests slightly

* Review comments

* Couple of minor tweaks
2018-11-26 17:11:05 +00:00
szymonsztuka
d399e3c242
CORDA-2232 external id to pub key mapping - fixes
Fixes in PersistentKeyManagementService.kt, VaultSchema.kt, and vault-schema.changelog-v8.xml. (#4295)
2018-11-26 16:03:06 +00:00
Shams Asari
3b8a74fe44
CORDA-2114: SwapIdentitiesFlow is now inlined (#4260)
This is to fix the security issue whereby any counterparty is able to generate anonymous identities with a node at will without checks.
2018-11-26 09:41:14 +00:00
Thomas Schroeter
4e55694216 ENT-2356 NotaryServiceFlow backpressure (#4242) 2018-11-23 17:45:36 +00:00
Michele Sollecito
a5fb1a82f1
[CORDA-2244]: Allow map and mapValid on entire lists wrt configuration parsing (#4280) 2018-11-23 15:11:59 +00:00
Thomas Schroeter
8f15cfaa28
[ENT-2769] Handle reference states in the PersistentUniquenessProvider (#4275)
* Handle reference states in the PresistentUniquenessProvider

* Complete test

* Re-notarise outside time window without input states

* Address comments

* Add missing column name
2018-11-23 11:52:41 +00:00
Shams Asari
49d1cee6d4
Removed crypto service config (#4284) 2018-11-22 20:30:37 +00:00
Tudor Malene
4c8dabc288
ENT-2506 restore the attachment party signers (#4255)
* ENT-2506 restore the attachment party signers

* ENT-2506 restore the attachment party signers

* ENT-2506 restore the attachment party signers

* ENT-2675 Address code review changes.

* ENT-2675 Address code review changes.
2018-11-22 18:35:30 +00:00
Roger Willis
c41960520c
CORDA-2232: external id to pubkey mapping (#4210)
* First pass
Update test.
Address review comments.
Added docs and kdocs.
Clean-up.

* Addressed review comments.

Changes to docsite.

* First pass at account service.
Added new hibernate schemas and liquibase scripts.
Added indexes to new tables.
Removed mock network.
Removed fresh key for external id from key management service.
Removed some redundant changes.
Rebase to master.

* Clean up.

* Added try/catch block as recommended by Andras.

* Removed accounts test to another branch.
Removed element collections from fungible states and linear states table.
Added a new state_parties table which stores x500 names and public key hashes.
Added a view which can be used to query by external ID.

* Removed try catch block. It's not required as the checkpoint serialiser deals with this.
Re-used existing DB session instead of creating a new session.
Entity manager auto flushes.

* Added java friendly api.

*  This is a combination of 10 commits.
 This is the 1st commit message:

Shortened table name.

 This is the commit message #2:

Minor changes.

 This is the commit message #3:

Common criteria parser now returns a predicate set which is concatenated to the predicate sets of sub-class criteria.

 This is the commit message #4:

Fixed api compatibility issue.
Reverted some changes to reduce size of PR.

 This is the commit message #5:

Multiple states can now be mapped to the same externalId.
Multiple externalIds can now be mapped to the same state.

 This is the commit message #6:

Relaxed upper bound type constraint in some of the vault types.

 This is the commit message #7:

Added comment to test.

 This is the commit message #8:

Changed name of external id to public key join table.
Removed some comments/TODOs.

 This is the commit message #9:

Added docs.
General clean up.

 This is the commit message #10:

Fixed participants query bug and updated unit test.

* Removed unused code.
2018-11-22 14:31:34 +00:00
James Brown
98a495fa84
CORDA-2199 NetworkParameters certificate role (#4278) 2018-11-22 10:49:18 +00:00
Tudor Malene
504f650022
ENT-2763 - Change packageOwnership type (#4273)
* ENT-2763 - Change packageOwnership type

* ENT-2763 - Address code review comment.

* ENT-2673 Address code review comments.

* ENT-2673 Address code review comments.

* ENT-2673 Fix test

* ENT-2673 Address code review comments.
2018-11-21 20:41:56 +00:00
Thomas Schroeter
489e719b54
[CORDA-2243] Notary client should sign over NotarisationRequest serialised with object referencing turned off (#4264)
* Sign later to make sure the notary service constructs the same serialized bytes

* Add non validating notary tests

* Revert "Sign later to make sure the notary service constructs the same serialized bytes"

This reverts commit cefba5c350.

* Dereference SecureHashes before creating the notarisation request signature

* Update comment

* Address comments

* Undo accidental renaming
2018-11-21 16:50:32 +00:00
Andrius Dagys
6c69d9ae0a Address util tests: remove invalid test case (#4269)
Local host address can also be public
2018-11-21 12:13:04 +00:00
Viktor Kolomeyko
0fe7f513e2
ENT-2653: Introducing CommonCliConstants (#4265) 2018-11-20 17:15:48 +00:00
Andrius Dagys
f64eae8fdb Add omitted flow async operation test 2018-11-20 14:34:04 +00:00
Konstantinos Chalkias
e14ade58e3
[CORDA-2218] CryptoService signingCertificateStore alias match (#4227) 2018-11-20 13:52:10 +00:00
Oliver Knowles
373d99435c
CORDA-1965 Auto-accept network parameter changes (#4222)
* add auto acceptance of certain network parameters

* Remove incorrect nullification of newNetworkParameters object within NetworkMapUpdater

* Automatically update network parameters if update accepted and flag day occured

* Comment cleanup

* Add node configuration for auto accepting network parameter changes

* Remove hot swapping of network parameters

* Add docs for auto accept config flag

* Minor change to log line

* Remove unrelated fix that was corrected on master

* Minor name change within NetworkParameters class

* Minor doc rewording

* Fix typo in docs

* Address PR comments

* Add node config option to turn off network param auto-accept on a per param basis

* Address PR comments

* Fix failing Network Map update integration test
2018-11-20 09:50:42 +00:00
Michele Sollecito
2762c34ebe
[CORDA-1877]: Ensured Driver fails to start when Notary tried to bind an already bound port. (#4246) 2018-11-19 18:06:27 +00:00
Michele Sollecito
b9f2401123 Removed errorCode for raw configuration parsing errors. 2018-11-19 16:47:57 +00:00
Tudor Malene
2d043828a0
CORDA-2083 verify transaction in AttachmentsClassloader (#4188)
CORDA-2083 fix tests

CORDA-2083 fix tests

CORDA-2083 fix tests

CORDA-2083 fix tests

CORDA-2083 fix tests

CORDA-2083 fix tests

CORDA-2083 fix tests

CORDA-2083 add support for explicit upgrade transactions

CORDA-2083 cleanup

CORDA-2083 cleanup

CORDA-2083 More cleanup

CORDA-2083 More cleanup

CORDA-2083 Clean up tests

CORDA-2083 Address code review comments

CORDA-2083 Fix merge

CORDA-2083 Fix merge

CORDA-2083 Address code review comments

revert file

CORDA-2083 Fix test

CORDA-2083 Add test

CORDA-2083 cleanup

CORDA-2083 Fix test

CORDA-2083 Address code review comments.

CORDA-2083 Remove unused functions.

CORDA-2083 Address code review comments.

CORDA-2083 Address code review comments.

CORDA-2083 Address code review comments.

CORDA-2083 Address code review comments.

CORDA-2083 Address code review comments.
2018-11-19 13:42:12 +00:00
Stefano Franz
828892a3d9
write nodeInfo to additional-node-info folder as well as baseDirectory (#4247)
* write nodeInfo to additional-node-info folder as well as baseDirectory

* fix broken network map tests
2018-11-19 11:26:42 +00:00
Stefano Franz
8f463c46a9 Add message to uses of require(...) (#4192) 2018-11-16 17:13:55 +00:00
Andrius Dagys
e1e5d13941
CORDA-2221: Fix clustered notary identity generation (#4230)
- Don't generate a composite key certificate for CFT notaries
- Don't require a composite key certificate for CFT notaries on startup
2018-11-14 18:15:05 +00:00
Shams Asari
e8b6f5f2f2
CORDA-2005: FinalityFlow has been made into an inlined flow to resolve issue with FinalityHandler (#4050)
FinalityHandler is insecure in that it is open to receive any transaction from any party.

Any CorDapp targeting platform version 4 or above is required use the new c'tors which take in FlowSession objects to the counterpart flow. This flow must subcall ReceiveFinalityFlow to receive and record the finalised transaction.

Old CorDapps (with target platform version < 4) will continue to work as previously. However if there are no old CorDapps loaded then the node will disable FinalityHandler.
2018-11-14 14:16:22 +00:00
tudor.malene@gmail.com
1e27f0cbe0 Merge remote-tracking branch 'private/master' into feature/tudor_constraints
# Conflicts:
#	core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt
#	core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt
#	core/src/main/kotlin/net/corda/core/utilities/KotlinUtils.kt
#	node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt
2018-11-14 11:50:19 +00:00
Michele Sollecito
8aaf120881
[CORDA-2224]: Removed field value from Validated. Renamed function orThrow() to value(). (#4231) 2018-11-14 11:19:38 +00:00
Michele Sollecito
aa0ccecfde
[CORDA-2172]: Add link to error-codes-webapp in Corda. (#4224) 2018-11-13 15:46:21 +00:00
Konstantinos Chalkias
71117ebdad
[CORDA-2212] Better error on empty Party name fuzzy matching (#4220)
* typo - no matching
2018-11-12 19:34:21 +00:00
Shams Asari
1c012f6403
Back porting clean up of FlowFrameworkTests.kt made in ENT (#4218) 2018-11-12 18:38:47 +00:00
Anthony Keenan
369f23e306
CORDA-1817: Fix issue with misleading capsule error messages (#4215)
* Make caplet respect all acceptable combinations of cmd line parameters

* If cordapp dir fails to create, still run corda.jar and let it fail gracefully

* Don't parse additional options as the parameter for the previous one.

* Remove commented lines
2018-11-12 17:22:22 +00:00
Michele Sollecito
dc62b20c5d
[CORDA-1879]: Ensure Node dies on unrecoverable errors. (#4213) 2018-11-12 15:56:04 +00:00
Michele Sollecito
ac23fcdf24
[CORDA-2208]: NodeHandles hashcode attemps an RPC invocation. (#4217) 2018-11-12 13:50:10 +00:00
Konstantinos Chalkias
23907c40d9
[CORDA-2210] Add matching party on the first X500 attribute match (#4211) 2018-11-12 11:59:04 +00:00
Konstantinos Chalkias
81418ca7e7
[CORDA-2200][CORDA-2202] More tests for BCCryptoService and CryptoServiceException (#4190) 2018-11-12 09:38:06 +00:00
Roger Willis
4684259970
Expose JPA to flows (#4140)
* First pass
* Update test.
* Address review comments.
* Added docs and kdocs.
* Clean-up.
* Add extra test.
* Changes to docsite.
* Added try/catch block as recommended by Andras.
* Removed try catch block. It's not required as the checkpoint serialiser deals with this.
* Re-used existing DB session instead of creating a new session.
* Entity manager auto flushes.
* Added java friendly api.
* Addressed review comments.
2018-11-09 17:47:36 +00:00
Andrius Dagys
336185de23
CORDA-2190: Improve notary service flow exception handling (#4200)
* CORDA-2190: Improve notary service flow exception handling

- Refactored notary flows to reduce validation code duplication
- Improved notarisation error handling to provide more helpful responses to the client
2018-11-09 14:00:40 +00:00
Michal Kit
2f644039b5
CORDA-2205 Fixing CRL issuer store lookup (#4205) 2018-11-09 13:45:23 +00:00
Shams Asari
d4474e87e1
CORDA-2129: Attempts to initiate a flow that's unknown is paused and instead sent to the flow hospital (#4181)
This allows for the case of a missing CorDapp to be installed on node restart and recover the original flow initiate request.
2018-11-08 17:03:17 +00:00
Michele Sollecito
6c749889d0
[CORDA-1993]: Replace reflection-based NodeConfiguration parsing with versioned property-based parsing mechanism. (#4132) 2018-11-08 15:56:00 +00:00
Rick Parker
9277042db8
ENT-2695 Restore async logging (#4195)
* Replace error code generation technique with custom event re-writer.
Switch to RandomAccessFile appenders because they supposedly give higher throughput.

* Review feedback
2018-11-08 14:33:45 +00:00
Dominic Fox
f3b372d31d
CORDA-2099 make serializer factory interface (#4137)
* Separate SerializerFactory construction from concrete implementation

* Fewer build methods

* Method naming that doesn't fatally confuse determinisation

* Extract SerializerFactory interface

* Reset to master's version of compiler.xml

* Un-ignore flickering test

* Remove unnecessary build method

* Whitespace

* Unused import

* Change build method

* Formatting fixes

* Fix test
2018-11-07 13:48:45 +00:00
Michal Kit
6f005605aa
CORDA-2187 & CORDA-2038: reverting maxTransactionSize <= maxMessageSize (#4166)
* CORDA-2187 reverting maxTransactionSize <= maxMessageSize

* Addressing review comments

* Increasing the maxTransactionSize for the Bootstrapper

* Updating the testNetworkParameters
2018-11-07 09:28:27 +00:00
Anthony Keenan
6fd724338a
CORDA-2183: Show root cause of error in console to aid with debugging (#4178)
* Show root cause of error in console

* Add more explicit logical separator between message and root error

* Add default if e.cause is null
2018-11-06 22:15:22 +00:00
Konstantinos Chalkias
106eb9df4a
[CORDA-2011] [CORDA-2057] CryptoService interface and BC HSM simulation (#4099) 2018-11-06 12:57:13 +00:00
Christian Sailer
1f5436dcfc
CORDA-2175 Fix attachment service tests on Windows (#4168)
* Switch to directory per test and suppress deletion exception on windows
to deal with the fact that NTFS keeps files locked to the running process
once opened.

* Closing files when we're done makes all the file locking issues go away.
2018-11-06 11:31:23 +00:00
josecoll
015a36dad6
CORDA 2131 - Extend Network Bootstrapper to enable registration of Java Package Namespaces. (#4116)
* Package Ownership Network Parameters: add register / unregister CLI options to network bootstrapper.

* Fix 2 failing unit tests.

* Fix failing unit tests.

* Added changelog, documentation and cosmetic changes.

* Fixed exception message.

* Address PR review feedback.

* Fix typo.

* Resolve conflicts.

* Rebase, resolve conflicts and remove PackageOwner class.

* Address latest PR review feedback.

* Fix incorrect imports.

* Fix broken JUnit

* Add support for key store passwords including delimiter characters.

* Updated and improved documentation.

* Minor doc update.

* Documentation changes following PR review feedback

* Replace Bank Of Corda with Example CorDapp.
Remove references to locally built network bootstrapper.
2018-11-06 09:28:55 +00:00
Roger Willis
80591bc6fd
StatePointer (#4074)
* Introducing linear pointer.

* Added design document.
Added StatePointer interface.
Updated design document.
Updated StatePointer implementation.
Added doc section for state pointer.

* Updated design document.
Added API for StatePointer.

* Update core/src/main/kotlin/net/corda/core/contracts/Structures.kt

Co-Authored-By: roger3cev <roger.willis@r3cev.com>

* Update core/src/main/kotlin/net/corda/core/contracts/Structures.kt

Co-Authored-By: roger3cev <roger.willis@r3cev.com>

* Update core/src/main/kotlin/net/corda/core/contracts/Structures.kt

Co-Authored-By: roger3cev <roger.willis@r3cev.com>

* Update docs/source/design/linear-pointer/design.md

Co-Authored-By: roger3cev <roger.willis@r3cev.com>

* Update docs/source/design/linear-pointer/design.md

Co-Authored-By: roger3cev <roger.willis@r3cev.com>

* Resolve pointers
Added test to check pointers are resolved.
Updated docs and kdocs.
Reverted changes to api-current.txt
Revert "Reverted changes to api-current.txt"
This reverts commit dc1cece91a595a4e772f63917b830c7e1fd0586d.
Fix CI bug.
Made StatePointers type safe.
Resolving StatePointers is now optionally recursive
Addressed review comments.

Fixed compile error.

Addressed review comments.

Fixed bug in state pointer search.
Improved efficiency of state pointer search.

Removed whitespace.

TxBuilder logs warning when no service hub is supplied for resolving pointers as opposed to throwing an exception.

* Addressed review comments.
2018-11-05 10:33:26 +00:00
Christian Sailer
3260d9f2c4
CORDA-1489 Exposure of node internals in mock network (#4130)
* Introduce public subset of config to tweak config via mock net work without exposing internal node config.

* Removal of functions exposing (internal) NodeConfiguration from the public test API

* Code review fixes

* Blank lines removed

* Documented mock network API change in upgrade notes.

* Updated documentation and API doc.

* More documentation/API doc
2018-11-05 09:29:05 +00:00
Andrius Dagys
460cf3480f ENT-1858: Minor fix for a uniqueness provider test 2018-11-02 16:06:55 +00:00
Michele Sollecito
24e9ceac48
[ENT-2678] PluginRegistrationTest is failing (fix) (OS part) (#4153) 2018-11-02 11:36:28 +00:00
Andrius Dagys
66116e8d20
ENT-1858: Notary cleanup (#4134)
* Migrated all non-BFT notary implementations to use async commits.

* Mock network: await for async operation completion. When calling runNetwork()
it keeps "pumping" messages between participants until no more messages are generated.
The problem comes in when a flow suspends on an async operation: the mock network
thinks the flow finished the work for the current step, and since no more messages
are generated, completes the runNetwork() function. The message that the flow
generates once it resumes after async operation completion never gets processed.
This change makes runNetwork() wait until all flow async operations finish,
and only then check whether no more messages can be transferred.
2018-11-01 19:03:43 +00:00
Tudor Malene
4e0a956e20
CORDA-2083 Deserialize component groups lazily (#4122)
CORDA-2083 Deserialize component groups lazily
2018-11-01 16:54:31 +00:00
szymonsztuka
fcea655bf1
Align with ENT repo - explicit node names in the FlowOverrideTests integration test. (#4146) 2018-11-01 09:59:47 +00:00
josecoll
e064800173
CORDA-2112 Update the uploader field for Attachments loaded upon Node CorDapp startup (#4127)
* CORDA-2112 Update the `uploader` field upon Node startup for CorDapps where an Attachment is already in a nodes attachment store (from an untrusted source).

* Removed incorrect assertion.

* Fix broken unit test.

* Reverted back throw FileAlreadyExistsException API semantics on public API.

* De-duplicate DuplicateAttachmentException

* Revert original Exception handling logic.
2018-10-30 15:44:29 +00:00
Rick Parker
13815d252e
ENT-2659 Eliminate lots of contention in serialization (#4120)
* Remove most contentious bit of mutex in the codebase
Fix up SerializerFactory
Make getSerializerFactory() non-blocking
Workaround for DJVM issues

* Some clean up and also de-contend the RPC client.

* Fix up attachment class loader code.

* Bug fix
2018-10-30 15:26:46 +00:00
Anthony Keenan
30fedec343
CORDA-1838: A few misc fixes (#4126)
* Remove unused code

* Make comment readable

* Remove joptsimple from node/shell

* tabs vs whitespace
2018-10-30 14:01:20 +00:00
szymonsztuka
1de56550b0
Optionally allow the node in production mode to accept Cordapps signed by dev Key (CORDA-1915) (#4133)
By default Cordaps build by corda-gradle-plugins are signed by Corda development key.
In dev mode any key can be used to sign Cordapp JAR .
In production node Corda dev keys were forbidden. This code change allows to opt-out by setting node option cordappSignerKeyFingerprintBlacklist=[] or specify more public keys to blacklist.
The option is used in production only mode.
2018-10-30 13:53:01 +00:00
Tommy Lillehagen
199a20398c
CORDA-1633 - Check Java version before launch (#4128) 2018-10-29 16:52:57 +00:00
Michele Sollecito
6022cecca5
[CORDA-1763]: Add node CLI option for validating configuration. (#4121) 2018-10-29 13:33:43 +00:00
Dan Newton
671a9d232c Add tests for CordaRPCOps.uploadAttachmentWithMetadata (#4125)
There were no tests around `CordaRPCOps.uploadAttachmentWithMetadata`
therefore tests have been added to verify that the function works
and saves the correct metadata to the vault
2018-10-29 11:04:06 +00:00
Anthony Keenan
953da9ef5e
Backport ENT node changes to O/S (#4117) 2018-10-26 10:02:57 +01:00
Tudor Malene
469ffe473f Fix merge
Fix merge

Fix merge
2018-10-25 10:44:10 +01:00
tudor.malene@gmail.com
29a8c153ed Merge branch 'master' into tudor_merge_os_24_10
# Conflicts:
#	core/src/main/kotlin/net/corda/core/internal/JarSignatureCollector.kt
#	core/src/main/kotlin/net/corda/core/transactions/LedgerTransaction.kt
#	core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt
#	core/src/main/kotlin/net/corda/core/utilities/KotlinUtils.kt
#	core/src/test/kotlin/net/corda/core/contracts/PackageOwnershipVerificationTests.kt
#	core/src/test/kotlin/net/corda/core/internal/JarSignatureCollectorTest.kt
#	node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt
#	node/src/test/kotlin/net/corda/node/services/persistence/NodeAttachmentServiceTest.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/dsl/TestDSL.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/dsl/TransactionDSLInterpreter.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/internal/MockCordappProvider.kt
2018-10-24 17:09:30 +01:00
Anthony Keenan
0ab644783e CORDA-1838: Add subcommands to node (#4091)
* Tidy up

* Add install-shell-extensions command

* Make cli tests use same version of picocli as everything else

* Remove initLogging from NodeStartup, it is ran earlier by CordaCLIWrapper

* Use picocli snapshot for testing

* Use RunLast() parser to invoke correct subcommands

* Deprecate old clear-network-map-cache parameter

* Restructure NodeStartup for commands

* Get rid of -c option since the flag method has been deprecated and that didn't exist in last release

* Update documentation

* Update backwards compatibility test

* Get all subcommands working

* Refactor sub commands into seperate classes

* Update docs and fix some tests

* Docs changes

* Fix merge conflicts with master

* Fix renamed parameters

* Fix test failure

* Fix compatibility tests

* Add missing compatibility test for blob inspector

* Remove blob inspector compatibility test as there are import conflicts

* Assorted doc fixes

* Addressing review comments

* More review comments

* Couple more bits

* Fix broken tests

* Fix compilation error

* More merge conflicts

* Make startup logging function a bit more sensible

* Fix broken shell extensions

* Make shell extensions work with subcommands

* Make sure parameters for deprecated options are carried through

* More review comments

* Adding some s's

* One last go

* Fix compilation error on Windows

* Revert logging changes

* Revert docs back to their original imperatively moody state
2018-10-24 13:58:19 +01:00
szymonsztuka
7e3aa7f30c
CORDA-1915 node rejects CorDapps signed by our dev keys in prod mode (#4041)
Related to CORDA-1915 Signing CorDapp JARs - Corda node rejects CorDapps signed by our development keys when running in production mode. This prevents Cordapps signed by our dev key (by default) running in production (node devMode=false).
2018-10-24 10:53:39 +01:00
Stefano Franz
0919b01271
ENT-2509 - Make @InitiatedBy flows overridable via node config (#3960)
* first attempt at a flowManager

fix test breakages

add testing around registering subclasses

make flowManager a param of MockNode

extract interface
rename methods

more work around overriding flows

more test fixes

add sample project showing how to use flowOverrides

rebase

* make smallest possible changes to AttachmentSerializationTest and ReceiveAllFlowTests

* add some comments about how flow manager weights flows

* address review comments
add documentation

* address more review comments
2018-10-23 16:45:07 +01:00
Rick Parker
b9aa23d3ac
ENT-2431 Move some changes from enterprise to OS (#4101) 2018-10-23 11:12:29 +01:00
Shams Asari
d3c5479826
CORDA-1621: The finance CorDapp uses the app config feature rather than the node's config (#4100) 2018-10-22 18:56:30 +01:00
Tudor Malene
391c6bf66f
Feature/corda 1947/add package ownership (#4097)
* Upgrade hibernate and fix tests

CORDA-1947 Address code review changes

CORDA-1947 Address code review changes

(cherry picked from commit ab98c03d1a)

* ENT-2506 Changes signers field type

ENT-2506 Clean up some docs

ENT-2506 Fix tests and api

ENT-2506 Fix compilation error

ENT-2506 Fix compilation error

(cherry picked from commit 32f279a243)

* CORDA-1947 added packageOwnership parameter

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

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

CORDA-1947 add tests

CORDA-1947 fix comment

CORDA-1947 Fix test

CORDA-1947 fix serialiser

CORDA-1947 fix tests

CORDA-1947 fix tests

CORDA-1947 fix serialiser

CORDA-1947 Address code review changes

CORDA-1947 Address code review changes

CORDA-1947 Revert test fixes

CORDA-1947 address code review comments

CORDA-1947 move verification logic to LedgerTransaction.verify

CORDA-1947 fix test

CORDA-1947 fix tests

CORDA-1947 fix tests

CORDA-1947 address code review comments

CORDA-1947 address code review comments

(cherry picked from commit 86bc0d9606)

CORDA-1947 fix merge
2018-10-22 15:00:08 +01:00
Viktor Kolomeyko
ba7727a4e1
ENT-2610: Resolve conflicted changes (#4102) 2018-10-22 12:24:05 +01:00
Andrius Dagys
e0d8ea8a58
CORDA-535: Move implementation specific configuration values out of n… (#4058)
The configuration objects for specific notary implementations have been replaced
by a single untyped "extraConfig" Config object that is left to the notary service
itself to parse.

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

* Remove pre-generated identity config value.

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

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

* Update docs

* Add upgrade notes

* Fix rebase issue

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

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

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

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

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

* ENT-2610: Address PR input from @kchalkias

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

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

In the implementation of `CertificateStoreSupplier`
2018-10-22 07:11:27 +01:00
Roger Willis
dd60ae27f2
FungibleState and design document for tokens (#4049) 2018-10-20 10:52:24 +01:00
Konstantinos Chalkias
72cab90577
[CORDA-738] Ensure encumbrances are bi-directional (#4089) 2018-10-19 18:34:32 +01:00
Tudor Malene
86bc0d9606 CORDA-1947 added packageOwnership parameter
CORDA-1947 add signers field to DbAttachment. Add check when importing attachments

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

CORDA-1947 add tests

CORDA-1947 fix comment

CORDA-1947 Fix test

CORDA-1947 fix serialiser

CORDA-1947 fix tests

CORDA-1947 fix tests

CORDA-1947 fix serialiser

CORDA-1947 Address code review changes

CORDA-1947 Address code review changes

CORDA-1947 Revert test fixes

CORDA-1947 address code review comments

CORDA-1947 move verification logic to LedgerTransaction.verify

CORDA-1947 fix test

CORDA-1947 fix tests

CORDA-1947 fix tests

CORDA-1947 address code review comments

CORDA-1947 address code review comments
2018-10-19 12:12:34 +01:00
Thomas Schroeter
f685df46b5
[ENT-1774] FlowAsyncOperation deduplication ID (#4068) 2018-10-19 11:40:59 +01:00
Andrius Dagys
e99fa975f7
CORDA-535: Allow notary implementations to specify a serialization filter (#4054)
Only allow custom serialization filters in dev mode.
2018-10-19 11:17:20 +01:00
Katelyn Baker
7cfd44e383
CORDA-2113 - Include PNM ID in CSR (#4086)
* CORDA-2113 - Include PNM ID in CSR

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

* fix broken test
2018-10-18 15:39:42 +01:00
Rick Parker
55731ef816
ENT-2431 Tidy up buildNamed and CacheFactory 2018-10-18 10:38:43 +01:00
Stefano Franz
456c9a85e1
remove requirement to override default progress tracker for interacti… (#3985)
* remove requirement to override default progress tracker for interactive shell - this is no longer needed

* fix failing tests
2018-10-17 11:27:14 +01:00
Andrius Dagys
715c38766d CORDA-2109: Fix a bug that prevents consecutive multiparty contract upgrades
The contract upgrade handler assumes that the state to be upgraded is
created by a WireTransaction. This breaks the upgrade process if it was
in fact issued by a ContractUpgradeWireTransactions or a NotaryChangeWireTransaction.
2018-10-17 10:20:27 +01:00
Rick Parker
38517af8f3
CORDA-1707 Tests to prove bug doesn't exist. (#4075) 2018-10-16 10:00:32 +01:00
Chris Rankin
2248f54f9f
CORDA-2096: Migrate finance test classes into .test sub-packages. (#4079) 2018-10-15 19:51:28 +01:00
Shams Asari
6d4bdb84b9
Code cleanup, mostly shortening long lines (#4070) 2018-10-15 12:01:15 +01:00
Shams Asari
2c9a942e1a
CORDA-2088: Simplified the TestCordapp public API (#4064)
The entry point to the API has been simplified to just requireing a list of packages to scan, with sensible defaults provided for the metadata. Because of the wither methods, having parameters for the metadata (with default values) seems unnecessary. Also the ability to scan just individual classes has been made internal, as it seems unlikely app developers would need that level of control when testing their apps.

TestCordappImpl is a data class and thus acts as a natural key for the Jar caching, where previously the key was the package names. This fixes an issue where it was not possible to create two CorDapp Jars of the same package but different metadata.
2018-10-15 10:11:18 +01:00
Shams Asari
aced03df54
CORDA-1274: Migrated usage of FastClasspathScanner to ClassGraph (#4060)
FastClasspathScanner was renamed to ClassGraph for the version 4 release
2018-10-11 19:50:26 +01:00
Andrius Dagys
8c41ae208d CORDA-535: Remove BFT-Smart related migration parts 2018-10-11 17:54:00 +01:00
Andrius Dagys
b8b2cc772d CORDA-535: Remove the old mechanism for loading custom notary service implementations.
All notary service implementations are now assumed to be loaded from CorDapps.
2018-10-10 17:16:57 +01:00
Andrius Dagys
9ebeac1ad8
CORDA-535: Extract notary implementations into CorDapps (#3978)
* Move Raft and BFT notaries into separate modules

* Move schemas

* Fix tests & demos

* Modified logic for creating notary services:

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

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

* Move test namedcache factory to test utils
2018-10-10 10:04:22 +01:00
Dominic Fox
b6f2532ce6
Corda 1922 serialize states with calculated values (#3938)
* Introduce SerializeForCarpenter annotation

* Apply SerializableComputedProperty annotation to Cash.exitKeys, fix bugs

* info -> trace

* Remove annotation from FungibleAsset, as we do not know whether all implementing classes will provide the property as a calculated value

* Remove redundant import

* Explicit lambda params

* Restore explicit import for Enum valueOf

* Moving and rescoping

* More meaningful error message

* Add java test and documentation

* Fix accidentally broken unit test

* Ignore superclass annotation if property not calculated in implementing class

* Exclude calculated properties from Jackson serialisation

* Fix broken test
2018-10-09 14:54:31 +01:00
Dominic Fox
d9ea19855f
CORDA-2006: Simplify checkpoint serialization (#4042)
* CORDA-2006: Simplify checkpoint serialization

* Supply rule to KryoTest
2018-10-08 13:39:28 +01:00
Shams Asari
bffac331a3
Moved the PLATFORM_VERSION constant to core and added some missing usages (#4026) 2018-10-05 09:28:00 +01:00
Shams Asari
85d2a85e85
Safe parsing of min platform version and target version from CorDapp MANIFEST files (#4031)
Also includes some cleanup
2018-10-04 16:00:07 +01:00
Michele Sollecito
8629316dd1
[CORDA-2021]: Error message in log when keyStorePassword is incorrect is not accurately describing the problem (fixed). (#4022) 2018-10-03 17:27:04 +02:00
Michele Sollecito
6f241b69fc
[CORDA-2064]: Add "extraNetworkMapKeys" to node startup log. (#4021) 2018-10-03 17:24:03 +02:00
josecoll
7edc18f85d
CORDA-1997 Added constraint type information to vault states table. (#3975)
* Added constraint type information to vault states table.

* Added Vault Query criteria support for constraint data.

* Added documentation and changelog entry.

* Added missing @CordaSerializable.

* Fix minor bug in test setup and parsing code.

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

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

* Addressing PR review feedback.

* Query by constraints type and data.

* Revert back accidentally removed code for contractStateType filtering.

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

* Make sure constraintInfo is class evolution friendly.
2018-10-03 13:41:25 +01:00
Michele Sollecito
beb4dc008f
[ENT-2545]: Fixed broken unit test. (#4019) 2018-10-03 12:31:20 +02:00
Michele Sollecito
ff9bf68e37
[ENT-2545]: Failing flow sent to Hospital does not log any ERROR's (fixed). (#4015) 2018-10-03 11:18:28 +02:00
tudor.malene@gmail.com
40825fef99 Merge branch 'tudor_merge_os_master' into feature/ENT-2222/constraints_propagation_private
# Conflicts:
#	node/src/main/kotlin/net/corda/node/internal/cordapp/JarScanningCordappLoader.kt
#	testing/test-utils/src/main/kotlin/net/corda/testing/internal/MockCordappProvider.kt
2018-10-02 16:10:19 +01:00
tudor.malene@gmail.com
063efe0c6d Merge branch 'master' into tudor_merge_os_master 2018-10-02 15:50:20 +01:00
Christian Sailer
92d2e4ae38
Corda-1931 Asynchronous logging (#3989)
* Provide AsyncLoggingContextSelector that inhibits use of thread local storage

* Turn on async logging via log4j properties file

* Mention async logging in the documentation and also explain how to turn it off when required.

* Formatting

* Typo

* Add shutdown hook to flush loggers.

* code review rework

* Ring buffer size to 256kB

* Set maximal log file size to 100MB - should slow down the rolling of log files and give us a bit more history on the cluster.
The old limit of max 10GB of compressed log files still stands.
2018-10-02 10:33:17 +01:00
Tudor Malene
f96a59932c ENT-2222 Constraints propagation
ENT-2222 Fix tests

ENT-2222 Fix tests

ENT-2222 Add ledger transaction verification logic

ENT-2222 Fixed IRS test

ENT-2222 Fixed IRS test

ENT-2222 Fixed unit test

ENT-2222 Better kdocs

ENT-2222 Support for reference states

ENT-2222 Fix support for reference states

ENT-2222 Revert wrong change

ENT-2222 Fix Kdoc

ENT-2222 Fix Kdoc

ENT-2222 Better docs

ENT-2222 Address code review comments

ENT-2222 Fix test

ENT-2222 Fix rebase

ENT-2222 Add documentation around constraint propagation

ENT-2222 Add tests for contract propagation

ENT-2222 Add Signature Constraints propagation - first draft

ENT-2222 fix tests

ENT-2222 more tests

ENT-2222 unseal the TransactionVerificationException

ENT-2222 unseal the TransactionVerificationException

ENT-2222 more docs

ENT-2222 address code review comments

ENT-2222 address code review comments

ENT-2222 re-implement transition logic

ENT-2222 better comments and checks

ENT-2222 Fix tests

ENT-2222 merge fixes
2018-09-28 13:38:35 +01:00
Tudor Malene
ab98c03d1a Upgrade hibernate and fix tests
CORDA-1947 Address code review changes

CORDA-1947 Address code review changes
2018-09-28 11:58:44 +01:00
Florian Friemel
842eac5c43
[CORDA-1926] Implement target version and min platform version (#3899)
https://r3-cev.atlassian.net/browse/CORDA-1926
2018-09-28 09:46:06 +01:00
szymonsztuka
06150371ad CORDA-1726 Make sure test frameworks and nodes refuse to start on any… (#3993)
* CORDA-1726 Make sure test frameworks and nodes refuse to start on anything except the right Java versions

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

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

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

* Addressing PR comments.
2018-09-27 19:01:01 +01:00
Konstantinos Chalkias
e92ad538cf
CORDA-2031 put "AlgorithmParameters.SHA256WITHECDSA" to BC (#3997) 2018-09-27 15:21:12 +01:00
Christian Sailer
878bd4da8c Remove TLS_DHE_RSA cipher family (#3987) 2018-09-25 22:58:47 +01:00
Michal Kit
73a1b8461a
CORDA-2012 Copying all certificates from the network-turst-store (#3983)
* CORDA-2012 Copying all certificates from the network-turst-store to the node's trust store

* Addressing review comments
2018-09-25 15:38:08 +01:00
Rick Parker
05fe50d9f8
ENT-2431: Expose cache factory further down the class hierarchy of AsbtractNode. (#3984) 2018-09-24 15:01:47 +01:00
Rick Parker
965f9ce528
ENT-2431 Lay foundations for caching metrics (#3955) 2018-09-24 09:55:56 +01:00
szymonsztuka
4639f14383
Ensure distinct node names in AssymetrictCorDappsTests and BootTests integration tests - align with Enterprise repo. (#3976) 2018-09-20 13:16:24 +01:00
Dan Newton
6775ffa2e6 Check java version is above 1.8.0_171 on node startup (#3870) 2018-09-19 16:34:03 +01:00
Roger Willis
c4d86b1b26
CORDA-1999 Changed isRelevant to relevancyStatus. (#3966)
* Changed isRelevant to relevancyStatus.

* Fix cash selection from breaking.

* Fixed non-backwards compatible API change.

* Updated schema migration changelog.

* Updated comment.
2018-09-19 15:50:39 +01:00
Dominic Fox
98c92ef16f
CORDA-1391: Separate out Checkpoint serialization (#3922)
* Separate out Checkpoint serialization

* Update kdocs

* Rename checkpoint serialization extension methods

* Fix bungled rename

* Limit API changes

* Simplify CheckpointSerializationFactory

* Add CheckpointSerializationScheme to API checker

* CheckpointSerializationScheme should not be implemented

* Move checkpoint serialisation to internal package

* Remove CheckpointSerializationScheme from api-current

* Quarantine internal classes

* Remove checkpoint context from public API

* Remove checkpoint context from public API

* Fix test failures

* Completely decouple SerializationTestHelpers and CheckpointSerializationTestHelpers

* Remove CHECKPOINT use case

* Remove stray reference to checkpoint use case

* Fix broken test
2018-09-19 14:23:29 +01:00
Michele Sollecito
19b8f70117
[CORDA-1996]: Apply error code to exceptions that do not propagate to NodeStartup. (#3964) 2018-09-19 14:24:21 +02:00
Konstantinos Chalkias
7b4c4803b9
isRelevant didn't work for composite ownership, it's now fixed (under certain assumptions). (#3967) 2018-09-19 10:03:16 +01:00
Shams Asari
c9bce39696
Fixed parsing of --network-root-truststore so that it defaults to the base dir correctly (#3958) 2018-09-18 17:38:36 +01:00
Michele Sollecito
b264d4cc20
[CORDA-1971]: Improve error code derivation (#3956) 2018-09-18 13:04:59 +02:00
Michele Sollecito
5113f4c8c1
[CORDA-1941]: Server-side draining node shutdown. (#3909) 2018-09-18 13:04:26 +02:00
Shams Asari
1c4294f42d
CORDA-1982: Convert the --base-directory to an absolute path to avoid issues on start up (#3952)
Also the --network-root-truststore default value has been corrected to be relative to the base dir.

The cliutils has been updated to always convert Path cmd line params to be absolute
2018-09-17 17:38:28 +01:00
Shams Asari
c79dd8017d
CORDA-1264: Mask internal errors if devMode is false (#3942) 2018-09-17 15:44:51 +01:00
Konstantinos Chalkias
137f7664c1
CORDA-1986 Ensure key alias format is supported by the major HSM vendors (#3950) 2018-09-17 10:19:34 +01:00
Konstantinos Chalkias
0b2e0b04ec
CORDA-1979 Cleanup NodeStartup for better readability (#3946) 2018-09-15 23:17:10 +01:00
Konstantinos Chalkias
356bddb2d4
check for empty rpc keystore/trustore passwords + extract method refactoring. (#3944) 2018-09-14 15:32:24 +01:00
Stefano Franz
5be7d5c4f1
CORDA-1959 - Enforce backwards compatibility of new CLI's (#3939)
* enforce backwards compatibility of new CLI's

* move Shell yml
2018-09-14 14:37:52 +01:00