Commit Graph

630 Commits

Author SHA1 Message Date
James Higgs
adbe030a2c Merge branch 'release/os/4.5' into jamesh/error-reporting-sync-29-04-20
# Conflicts:
#	node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt
2020-04-29 11:47:14 +01:00
James Higgs
ab95aa57a2
[EG-440] Add some error codes and the error resource generation tool (#6192)
* [EG-438] First commit of error code interface

* [EG-438] Implement error reporter and a few error codes

* [EG-438] Add unit tests and default properties files

* [EG-438] Add the error table builder

* [EG-438] Update initial properties files

* [EG-438] Add some Irish tests and the build.gradle

* [EG-438] Fall back for aliases and use different resource strategy

* [EG-438] Define the URL using a project-specific context

* [EG-438] Tidy up initialization code

* [EG-438] Add testing to generator and tidy up

* [EG-438] Remove direct dependency on core and add own logging config

* [EG-438] Fix compiler warnings and tidy up logging

* [EG-438] Fix detekt warnings

* [EG-438] Improve error messages

* [EG-438] Address first set of review comments

* [EG-438] Use enums and a builder for the reporter

* [EG-438] Address first set of review comments

* [EG-438] Use enums and a builder for the reporter

* [EG-438] Add kdocs for error resource static methods

* [EG-440] Add error code for duplicate CorDapp loading

* [EG-438] Handle enums defined with underscores

* [EG-440] Add errors for some CorDapp loading scenarios

* [EG-440] Finish adding errors for CorDapp loading

* [EG-440] Fix up errors in properties files

* [EG-440] Start change to error code definition

* [EG-440] Update error code definition and add resource generation tool

* [EG-440] Tidy up error resource generation tool frontend

* [EG-440] Small refactorings and add kdocs

* [EG-440] Generate all missing resources

* [EG-440] Some refactoring and start writing a test

* [EG-440] Update unit test for resource generator

* [EG-440] Renaming of various parts of the error tool

* [EG-440] Add testing for errors and fix an issue in resource generation

* [EG-440] Add a kdoc for context provider API

* [EG-440] Remove old code from repository

* [EG-440] Address some review comments
2020-04-29 11:21:50 +01:00
James Higgs
ab43238420
[EG-438] Error Reporting Framework (#6125)
* [EG-438] First commit of error code interface

* [EG-438] Implement error reporter and a few error codes

* [EG-438] Add unit tests and default properties files

* [EG-438] Add the error table builder

* [EG-438] Update initial properties files

* [EG-438] Add some Irish tests and the build.gradle

* [EG-438] Fall back for aliases and use different resource strategy

* [EG-438] Define the URL using a project-specific context

* [EG-438] Tidy up initialization code

* [EG-438] Add testing to generator and tidy up

* [EG-438] Remove direct dependency on core and add own logging config

* [EG-438] Fix compiler warnings and tidy up logging

* [EG-438] Fix detekt warnings

* [EG-438] Improve error messages

* [EG-438] Address first set of review comments

* [EG-438] Use enums and a builder for the reporter

* [EG-438] Add kdocs for error resource static methods

* [EG-438] Handle enums defined with underscores

* [EG-438] Slight refactoring of startup code

* [EG-438] Port changes to error reporting code from future branch

* [EG-438] Also port test changes

* [EG-438] Suppress a deliberately unused parameter
2020-04-28 14:07:50 +01:00
Chris Rankin
be3e7969f7
CORDA-3688: Apply @Named annotation to CRaSH commands to fix usage messages. (#6124) 2020-04-03 08:34:22 +01:00
Dimos Raptis
963de40902
[NOTICK] - Enable check in detekt for unused imports (#6106)
* [NOTICK] - Enable check in detekt for unused imports

* Put back accidental removal of used import

* Some more accidental removals
2020-03-26 15:46:33 +00:00
Stefano Franz
c3a59f5293
EG-464 Corda returns incorrect exit code in case if node is started with unknown/missing option (#6010)
* EG-464

Corda returns incorrect exit code in case if node is started with unknown/missing option

* fixed empty else block

* We should not use the parent's exception handler as it will quit and we have our own one

* SampleCordaCliWrapper implemented and tests to verify error handling.

* addressing code review comments
2020-03-05 15:38:56 +00:00
Christian Sailer
e38cd9ec63
ENT-5043 separate out test utils (#5998)
* Remove unused dependencies from test-common

* Explicit imports and formatting

* Add core-test-utils project

* Add dependency

* Move Kryo serialization context to node-api (not serialization as we do not want to pull kryo into the serialization lib)

* Move AMQP server serialization scheme to node api

* Move serialization tests to node-api

* Move internal test helpers without further dependencies.

* Move out some types from RPCClientProxyHandler to node-api in preparation for moving the AMQP scheme

* Move client AMQP context to node-api so we can move the test serialization rule out.

* Move InternalSerializationTestHelpers to core-test-utils

* Moved testing.core to core-test-utils

* Make detekt happy

* Add api-scanner to core-test-utils

* Remove inlined package names introduced by IntelliJ refactoring

* Update api-current.txt to account for reordering.

* Add core-test-utils to list of published artifacts.

* Add missing import

* Location of things in api text has moved again (publish name of artefact?)

* Revert all additions to the API, leaving just the reordering

* Code review: fix up core-test-utils build.gradle and introduce kryo version constant.

* Remove OpenSsl flag from ssl config stub (can't be used from node-api)

* Suppress detekt warning

* Move core test util tests to the right module

* Expose kotlin test as a transient dependency - projects have come to rely on that.

* Fix typo in package name
2020-03-03 15:55:17 +00:00
jakubbielawa
da3adb40b4
ENT-5039 Improved help text for commands (#6006)
* Improved help text for commands

* Address feedback
2020-03-02 11:14:55 +00:00
pnemeth
d037dc0d06
EG-466 - Fix bug: (#5999)
'shutdown' command is repeated twice in the list of available shell commands.
2020-02-28 12:16:53 +00:00
Walter Oggioni
92a437f333
EG-69 - fixed bug with picocli that was causing uncaught exception's stacktrace to always be printed on stderr (#5985)
calling `picocli.CommandLine.AbstractHandler#andExit` causes the exception handler to forcefully terminate the program execution (calling `java.lang.System#exit`) at all costs, even in case of `ExecutionException` being throw by `picocli.CommandLine#parseWithHandlers(picocli.CommandLine.IParseResultHandler2<R>, picocli.CommandLine.IExceptionHandler2<R>, java.lang.String...)`, this was causing the program to always print the exception stack trace on the `stderr` and terminating even before entering the `catch` block from lines 85 to 93
2020-02-26 09:49:14 +00:00
nargas-ritu
dc92786d17
Merge pull request #5974 from corda/CORDA-3593-shell-exits-after-shutdown-cmd
CORDA-3593: exit the InteractiveShell on shutdown command
2020-02-18 11:10:54 +00:00
Ryan Fowler
9b5080251d CORDA-3593: exit the InteractiveShell on shutdown command 2020-02-17 13:27:00 +00:00
James Higgs
3547b629c3
[NOTICK] Add a detekt rule to catch tests with no timeout (#5959)
* [NOTICK] Add a custom detekt rule for tests with no timeout, and fix remaining missing timeouts

* [NOTICK] Add a test for custom detekt rules and tidying

* add timeout annotation to new test

Co-authored-by: Stefano Franz <roastario@gmail.com>
2020-02-14 17:31:02 +00:00
Denis Rekalov
ba002a82ec
CORDA-3587: hashLookup command help misspelling (#5936) 2020-02-11 15:13:34 +00:00
Stefano Franz
b23af5f0d2
add timeouts to all tests (#5875) 2020-02-11 10:14:05 +00:00
Viktor Kolomeyko
ae3ce82e60 CORDA-3559: Remove reference to man run
`man` shell command is deemed to be unsafe.
2020-01-27 15:01:40 +00:00
Denis Rekalov
b512a2981d ENT-3828: Remove ability to SSH into standalone shell (#5876) 2020-01-24 10:44:25 +00:00
Denis Rekalov
6a2249e697 CORDA-3520, CORDA-3550: SSH memory leak and security (#5873)
* CORDA-3520: Closing RPC connection on SSH disconnect
CORDA-3550: Remove support for outdated ciphers and algorithms from SSH

* CORDA-3550: Remove support for outdated ciphers and algorithms from SSH
2020-01-22 14:40:25 +00:00
Dan Newton
4bae045a58 ENT-4601 Public API to run external operations from a flow (#5833)
Deprecate FlowAsyncOperation and reimplement public versions FlowExternalOperation and FlowExternalAsyncOperation.

await added to FlowLogic to allow easy calling from both Java and Kotlin. There are two overrides of await (one for FlowExternalOperation and FlowExternalAsyncOperation).

Implementations of FlowExternalOperation return a result (written as blocking code) from their execute function. This operation will then be executed using a thread provided by the externalOperationExecutor.

Implementations of FlowExternalAsyncOperation return a future from their execute function. This operation must be executed on a newly spawned thread or one provided by a thread pool. It is up to developers to handle threading in this scenario.

The default thread pool (externalOperationExecutor) can be configured through the flowExternalOperationThreadPoolSize node config.

The current implementation leaves FlowAsyncOperation alone, meaning that any developers that have used it (even though it is internal) won't need to change their apps. If this was not concern I would delete it completely and replumb the state machine code. Instead, it has been marked with @DoNotImplement and executeAsync is annotated with @Deprecated
2020-01-22 09:27:17 +00:00
Nick Dunstone
e6f9b46584 https://r3-cev.atlassian.net/browse/ENT-3829 (#5763)
Open Source
2019-12-03 10:28:00 +00:00
Amol Pednekar
f7328f18f4 [Issue #5746] Update cities.txt (#5747) 2019-11-27 17:55:32 +00:00
Dimos Raptis
10e9340871 [ENT-4483] - Make shell welcome message generic (#5758) 2019-11-25 17:09:47 +00:00
Jonathan Locke
10c891c0be
CORDA-3406: Modify DemoBench to make using the DJVM obvious and optional (#5687)
CORDA-3406: Modify DemoBench to make using the DJVM obvious and optional (#5687)
2019-11-08 14:27:41 +00:00
Ivan Schasny
34db285ac3 CORDA-3396 fixed NPE in BlobInspector. Added verbose message in the case of error. 2019-11-07 16:50:43 +00:00
Chris Rankin
6380feee41 CORDA-3406: Modify DemoBench to make using the DJVM obvious and optional. 2019-11-07 12:22:40 +00:00
stefano
6a3a9eded3 Merge remote-tracking branch 'origin/release/os/4.3' into my_merge_branch
# Conflicts:
#	core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt
#	node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcExceptionHandlingTest.kt
#	testing/node-driver/src/main/kotlin/net/corda/testing/node/internal/DriverDSLImpl.kt
2019-11-05 17:19:18 +00:00
Chris Rankin
f226ddc4f2 CORDA-2876: Integrate the DJVM with the Corda Node. (#5633)
* * CORDA-2876: Migrate DJVM serialization modules into Corda.
* Pre-generate Corda classes for DJVM sandbox when node boots in production mode.
* Ensure that all DJVM test contract CorDapps are signed.
* Test examining attachments within DJVM sandbox.
* Test Contract.verify() using cryptographic verify function.
* Add test cases for more non-determinism in Contract.verify().
* Update node-driver to support testing nodes with DJVM support.
* Modify Node to allow alternative DJVM configurations for testing.
* Refactor DeterministicVerifierFactoryService for default use-case.
* Small whitespace and code-style refactors.
* Create and activate a DJVM execution profile for the Node.
* Revert making Verifier implement AutoCloseable.
* Allow the node to cache sandboxed Corda byte-code for reuse.
* Use updated Quasar agent that knows not to touch DJVM classloaders.
* Fix Quasar's package exclusions globs for DJVM.
* Deserialise LedgerTransaction into the sandbox for Contract.verify().
* Add the DJVM's serialisation modules to the Corda node.
* Update the node for the latest DJVM API, and preserve the ConstructorForDeserialization annotation on user contract classes.
* Add corda-dev to repositories while DJVM is SNAPSHOT.
* Migrate DJVM specialisation into AbstractNode's ServiceHubInternalImpl.
* Exclude sandbox.** and shaded djvm.** classes from Quasar agent.
* Add the corda-dev repository to :node for the deterministic runtime.
* Turn Verifier into an abstract base class that is specialised by BasicVerifier and DeterministicVerifier.
* Add the Corda deterministic libraries to the Node, and split the DJVM sandbox across two SandboxClassLoader instances.
* Add DJVM to contract verification path inside Corda Node.
* Minor lambda simplifications and removing unused import.
* CORDA-2871: Remove @CordaSerializable from LedgerTransaction.
* CORDA-2871: Add a callback to ServicesForResolution to allow the Node to modify a LedgerTransaction object.
* CORDA-2871: Refactor the contract verification code into a separate class,
 and allow LedgerTransaction to choose different Verifier objects.
* Update DJVM to use Corda 4.4-SNAPSHOT. (#95)
* CORDA-3330: Allow DJVM to preload / pregenerate classes from selected jars. (#92)
* Add support for SourceClassLoader.getResources() to DJVM.
* Allow a SandboxConfiguration to preload sandbox byte-code for all classes inside jars containing META-INF/DJVM-preload.
* CORDA-3309: Remove explicit try-catch in favour of UncaughtExceptionHandler. (#91)
* CORDA-3309: Install UncaughtExceptionHandler for DJVM tasks. (#88)
* Fix tests broken by Windows line endings. (#82)
* CORDA-3292: Reimplement ExecutionProfile as a data class. (#80)
* CORDA-2877: Refactor how we create child SandboxConfiguration objects. (#76)
* CORDA-2877: Load bytecode from a persistent cache to prevent repeated rewriting. (#75)
* Refactor byte-code cache to SandboxConfiguration instead of AnalysisConfiguration. We cannot "mix and match" byte-code generated by different sets of rules.
* CORDA-3137: Enhance annotation handling so that we can allow some annotations to be mapped into the sandbox without also needing to be stitched. (#72)
* CORDA-2871: Minor cosmetic fixes. (#69)
* CORDA-3218: Align DJVM with internal Corda Serialisation API. (#68)
* Ensure we get the latest SNAPSHOT of the serialisation code.
* CORDA-2871: Refactor SourceClassLoader to define source classes. (#66)
* Rewrite SourceClassLoader to support parent/child relationships.
* Revert catching TypNotPresebtException - it was a symptom of a bigger problem.
* Remove AutoCloseable from AnalysisConfiguration and SourceClassLoader.
* SourceClassLoader.getResource() must delegate to its parent first.
* CORDA-2871: Ensure ClassLoader.loadClass() throws ClassNotFoundException for all cases where the class cannot be found. (#64)
* CORDA-2871: Modify sandbox tasks to implement both java.Function and sandbox.Function (#62)
* Make TaskExecutors implement BiFunction to make them composable.
* Create ImportTask to wrap a java.Function inside a sandbox.Function.
* Add createExecutor() and createRawExecutor() APIs to SandboxClassLoader.
* Update serialization to use SandboxClassLoader.toSandboxClass().
* Remove a layer of lambdas from the serialisation code.
* Update SandboxExecutor and SandboxRawExecutor.
* Rename Executor to TaskFactory.
* Rename dangling executor -> taskFactory.
* CORDA-2871: Sanity fixes! (#63)
* Improve message for SandboxClassLoadingException.
* Fix serialisation API for using sandboxed environment.
* CORDA-3174: Extend serialisation to include InputStream and OpaqueBytesSubSequence. (#60)
* Update DJVM Example project for serialisation.
* Add serializers for InputStream and OpaqueBytesSubSequence.
* Support ZIP Inflater and CRC32 inside the sandbox.
* Allow the DJVM to wrap java.io.InputStream as sandbox.java.io.InputStream.
* Configure tests also to preserve @DeprecatedConstructorForDeserialization.
* CORDA-3174: Implement Corda serialization modules. (#59)
* Create DJVM serialization modules.
* Create test cases for Array<T>, List<T> and List<Array<T>>.
* Refactor SandboxPrimiveSerializer for all primitive types.
* Implement SandboxCollectionSerializer to support Collection types.
* Implement SandboxMapSerializer to support Map types.
* Attempt to fix infinite loop when computing Collection and Map fingerprints.
* Apply special handling when deserialising sandbox.java.lang.Character.
* Remap Java primitive types to sandbox Java object types to deter evolution.
* Use Class.getPackage().getName() to determine sandbox package name.
* Implement SandboxEnumSerializer to support Enum types.
* Implement SandboxPublicKeySerializer to support Java security keys.
* Add serialization projects to the composite example project.
* Implement serializers for BigInteger, BigDecimal, Currency and StringBuffer.
* Test that deserialising does not instantiate the untrusted user classes.
* Implement serializers for java.time.* types.
* Add serialiser for BitSet - currently disabled until BitSet itself is supported.
* Add serialisers for EnumSet and Class.
* Include support for EnumMap in the SandboxMapSerializer.
* Ensure the DJVM Example project's tests preserve @CordaSerializable.
* Add support for UUID as a primitive type.
* Use common abortReadOnly() method for declaring serialization as unsupported.
* Streamline the API for deserialising into the sandbox.
* Add preliminary support for deserialising X.509 certificates.
* Implement serializer for java.util.Optional.
* Refactor configuration of the sandbox serialization scheme.
* Add tests for deserialising arrays of basic types.
* Include method annotations in annotation stitching. This ensures that `@ConstructorForDeserialization` is not dropped.
* Enable test for SandboxBitSetSerializer.
* Enable tests for X.509 serializers.
* Implement serializers for ProtonJ primitive types.
* Serialize java.util.Date as a primitive type.
* Add the bintray Gradle plugin to the serialisation modules.
* Do not publish serialisation modules - they will become part of Corda itself.

* CORDA-2876: Only apply DJVM sources to Node Driver when devMode=true.

* Resolve DeteKT warnings.

* Require Node's JVM to set -Dnet.corda.djvm=true in order to enable DJVM.

* Enable DJVM for DemoBench nodes.

* Disable Quasar instrumentation verification for DemoBench nodes.

* Upgrade to DJVM 1.0-RC01.

* Try to modify DriverParameters in a more "ABI friendly" way.

* Refactor and simplify sandbox deserialisation of primitive objects.

* Review fixes.

* Update EvolutionSerializerFactory to handle sandboxed primitive boxed types.
2019-11-05 13:44:18 +00:00
Christian Sailer
119f939ee1 Fix and or suppress detekt warnings 2019-11-01 11:48:07 +00:00
Dimos Raptis
79c22bd77a Constrain the cordapps loaded from driver tests to the minimum required (#5653) 2019-10-31 11:26:05 +00:00
stefano
8fd3e867f3 Merge remote-tracking branch 'origin/release/os/4.3' into my_merge_branch 2019-10-29 16:24:08 +00:00
Anthony Keenan
444881d536
Merge pull request #5624 from corda/anthony/merge-20191021
OS 4.3->OS 4.4 Merge 21-10-2019
2019-10-22 11:32:38 +01:00
szymonsztuka
b524c6368b CORDA-3335 Corda Shell flow kill - better warning for misformatted flow ID (#5601)
* CORDA-3081 warn that flow ID passed to flow kill is malformed as due to JDK8 doesn't fully validate it (JDK8 bug https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8159339)

* CORDA-3335 Corda Shell flow kill - better warning for misformatted flow ID - exit earlier and don't RPC to node, refactoring for detekt
2019-10-22 11:32:17 +01:00
Ryan Fowler
5da114caa3 CORDA-3281: Drop some errors to warnings and clean up logic around (#5605)
shell "gracefulShutdown" command.
2019-10-22 11:02:04 +01:00
Chris Rankin
51ffd3d032 CORDA-3346: Replace JitPack dependency on JediTerm with 2.22 from Maven Central. (#5619) 2019-10-21 15:16:36 +01:00
Dimos Raptis
bb7c06fa45 [CORDA-3342] - Show proper error message and adjust indentation in shell (#5612) 2019-10-21 13:21:12 +01:00
Dimos Raptis
608fdb82f7 [ENT-4119] Make welcome message generic 2019-10-16 15:08:34 +01:00
Stefan Iliev
48fd78d059 CORDA-3236 fix observables not being tagged with notUsed() (#5557)
* Fixed not utilising the observables being returned by stateMachines added response with a notUsed(). Opening a ticket for implementation investigation.

* stateMachinesFeed will unsubscribe on interrupt rather than remaining infinitely subscribed.

* Fixed reported detekt issues on the InteractiveShell.

* Changes according to PR review.
2019-10-10 14:24:32 +01:00
josecoll
22a8108099
ISSUE-246 deployNodes doesn't use right version of Java (#5571)
* ISSUE-246 deployNodes doesn't use right version of Java
Ensure the network bootstrapper process is executed using the same version of JAVA as the calling process.

* Apply same fix to NotaryCopier (used in network builder tool).
2019-10-09 19:32:17 +01:00
Tudor Malene
0433d026b7 CORDA-3306 Fix infinite loop. (#5570) 2019-10-09 15:04:08 +01:00
josecoll
246ec8766e
CORDA-3224 JDK11 built and published artifacts to include classifier. (#5488)
* JDK11 built and published artifacts to include classifier.

* Added additional non-intuitive gradle dust sprinkled recommended by CR.

* Added additional non-intuitive gradle dust sprinkled recommended by CR.

* Bump corda gradle plugins version.

* Incorporating PR review feedback.

* jdk11Classifier
2019-10-08 10:45:10 +01:00
josecoll
42e104ca4f
Publish checkpoint agent jar and allow for inclusion of version id in jar upon run-time execution. (#5553) 2019-10-04 14:28:42 +01:00
Ryan Fowler
6ca4b589e2 CORDA-3091: Move executor thread management into CordaRPCConnection (#5491) 2019-09-26 17:48:07 +01:00
Ryan Fowler
be6824dac4 ENT-4090: move startFlow into try block so exception is caught and managed (#5519) 2019-09-26 17:37:36 +01:00
Tudor Malene
298d8ba69c CORDA-3024 Rename the webserver (#5489) 2019-09-26 10:20:49 +01:00
josecoll
3fafbe551c
CORDA-2050 Upgrade Corda to Java 11 (compatibility mode) (#5356)
Upgrade Corda to run with Java 11 (compatibility mode) - see https://github.com/corda/corda/pull/5356
2019-09-18 10:26:26 +01:00
Ryan Fowler
75e66f9db9 CORDA-3141: Add GracefulReconnect callbacks which allow logic to be performed when RPC disconnects unexpectedly (#5430)
Also removed potential for growing stack trace on reconnects.
2019-09-17 10:00:27 +01:00
Schife
3b1a49a2cf TM-20 rebasing the detekt changes to be able to merge into OS 4.3. The changes include: detekt integration, rule configurations, baseline of the current issues that exist in 4.3 and a MaxLineLength rule violation fix to ANSIProgress test since it was causing the baseline to fail to load due to the special characters in the test (#5464) 2019-09-12 14:08:50 +01:00
Stefan Iliev
3b941af607 [CORDA-3151] Fixed bug where observable leaks on ctrl+c interrupt while waiting in stateMachinesFeed. (#5458) 2019-09-12 10:26:28 +01:00
Zoltan Kiss
f171de7b69 TM-23 Fail build on compiler warnings (#5453)
* java compile respects compilation.allWarningsAsErrors

* suppress or cleanup warnings

* suppress warning

* use non-deprecated kotlin dependency

* rename property

* handle property existence check

* Deal with warnings
2019-09-11 16:34:51 +01:00
Dan Newton
4cbe22949d CORDA-3018 Whitelisting attachments by public key - phase two tooling (#5386)
Allow node operators to blacklist signing keys (using blacklistedAttachmentSigningKeys config option). These blacklisted keys prevent attachments that are received over the network from being trusted. The docs have been updated to detail how to generate the key hashes that the config requires.

A new shell command attachments trustRoots has been added to see what attachments exist on the node along with information about their trust and where it comes from.

run dumpCheckpoints has been replaced by checkpoints dump as InternalCordaRPCOps needed to change to prevent a function that is meant to be internal from being visible on the shell.
2019-09-10 12:16:34 +01:00
Stefano Franz
e35c0c1df7
CORDA-3009 - Migrate identity service to use to string short (#5217)
* migrate PersistentIdentityService to use key.toShortString()
update definition of PublicKeyToExternalId mapping to allow fast lookup by externalId/publicKey

* fix misspelled table name

* add test of migration script

* add design document for proposal to move IdentityService to using the correct PK.toStringShort() method for hashing a publickey

* add enterprise testing considerations to design

* address review comments

* fix compilation errors

* modify PublicKeyToOwningIdentityCache to use toStringShort() as it's lookup key

* address syzmon's code review comments
2019-08-28 14:16:18 +00:00
Jonathan Locke
35d0170b0a Merge branch 'master' into jlocke/merge_4.1_20190827 2019-08-27 15:21:21 +01:00
Jonathan Locke
e5f314ffbf Merge branch 'release/4' into jlocke/merge_4.1_20190827
Merged release/4 (Corda OS version 4.1) into a branch created from master (Corda OS version 4.3)

Conflicts:
	build.gradle
	client/rpc/src/main/kotlin/net/corda/client/rpc/internal/ReconnectingCordaRPCOps.kt
	common/logging/build.gradle
	common/logging/src/main/kotlin/net/corda/common/logging/CordaVersion.kt
	constants.properties
	core-tests/src/test/kotlin/net/corda/coretests/utilities/ProgressTrackerTest.kt
	core/src/main/kotlin/net/corda/core/transactions/TransactionBuilder.kt
	docs/source/api-contract-constraints.rst
	docs/source/api-stability-guarantees.rst
	docs/source/app-upgrade-notes.rst
	docs/source/changelog.rst
	docs/source/clientrpc.rst
	docs/source/conf.py
	docs/source/corda-network/UAT.md
	docs/source/getting-set-up.rst
	docs/source/network-builder.rst
	docs/source/upgrading-cordapps.rst
	docs/source/versioning.rst
	node/src/integration-test/kotlin/net/corda/node/services/rpc/RpcReconnectTests.kt
	serialization/src/main/kotlin/net/corda/serialization/internal/amqp/PropertyDescriptor.kt
	serialization/src/main/kotlin/net/corda/serialization/internal/model/LocalTypeInformationBuilder.kt
	tools/network-builder/src/main/resources/node-Dockerfile
	tools/network-builder/src/main/resources/notary-Dockerfile
2019-08-27 14:51:22 +01:00
Shams Asari
90284a6143
CORDA-2919: JacksonSupport, for CordaSerializable classes, improved to only uses those properties that are part of Corda serialisation (#5397) 2019-08-27 13:06:28 +01:00
Florian Friemel
76e2c696f2 [ENT-3809] Move purejavacomm dependency to libs. (#5269) 2019-08-19 10:19:54 +01:00
szymonsztuka
4c7604b5c3 ENT-3965 Improved welcome message for Standalone Shell - bye command to exit shell only, docs clarifications gracefulShutdown/shutdown needs 'run' as other commands (#5363) 2019-08-12 13:22:15 +01:00
josecoll
99e802c5c5 CORDA-3071 - Checkpoint agent tool (#5295)
* Initial commit based on experimental kryo hook agent.

* WIP

* Added documentation.

* Additional improvements and documentation following more testing.

* Added field level instrumentation + basic type handlers for String, byteArray, charArray, primitive types.

* Working version (without array type handling)

* Missing build.gradle file.

* Handle display of Arrays and String.
Pruning output to avoid repetition (by loop depth, object count).

* Added configurable StackDepth (for display purposes) and filter out ProgressTracker stacks.

* Further array handling (Object arrays, 2D, 3D), improved display and general code cleanup.

* Various fixes and improvements following demo to RP.

* Clean-up

* Further clean-up

* Set checkpoint id before deserialization.

* Update documentation

* Final clean-up.

* Minor documentation fixes.

* Updates following PR review feedback.

* Add changelog entry.
2019-08-01 09:40:52 +01:00
Dimos Raptis
8962d930d4 [CORDA-2923] - Make the RPC client reconnect with gracefulReconnect param (#5244)
When set to true the RPC client will:

* automatically reconnect when the connection is broken
* simple RPC calls will block until connection is established
* Observables returned from RPC will automatically resubscribe on reconnect so the client continues to receive events. This doesn't guarantee that events will not be lost during the reconnect.
2019-07-16 11:29:21 +01:00
szymonsztuka
c6262b6ff9 Backport of CORDA-2998 fix network builder (#5265) (#5270)
* CORDA-2998 fix network builder (#5265)

CORDA-2998 fix network builder

(cherry picked from commit f89008c070)

* Network-builder - update to https://hub.docker.com/r/corda/corda-zulu-4.1

* Network-builder - update docs to correct 4.1 docker image version.
2019-07-09 12:25:20 +01:00
Rick Parker
306df8e219
CORDA-3053 Validation should pass with systemProperties defined in config (#5276)
* CORDA-3053 Validation should pass with systemProperties defined in config

* CORDA-3053 Fix failing test and add new one
2019-07-05 17:20:57 +01:00
Stefano Franz
88894bc592
add a shared memory port allocator to allow multiple processes to sha… (#5223)
* add a shared memory port allocator to allow multiple processes to share a single allocation pool

* remove dangerous reset function on port allocator

* set forkCount = 2 in node integration test

* only allow one build of a cordapp at any given time for Driver tests

* make all portallocation requests use same starting point

* globally set forks to 6

* tweak forking parameters to allow parallel builds

* tweak unit test parallelism

* 2 workers for integrationTest

* some more tweaks for parallel builds

* some more tweaks for parallel builds

* seems that 49K is not the start of ephemeral ports on all kernels

* tweak parallel settings

* try fix RPC shutdown test in parallel env

* add some logging for RPC shutdown test

* added some logging around PortAllocation tests - try figure out where they are getting stuck

* added some logging around PortAllocation tests - try figure out where they are getting stuck

* fix api-scanner tests

* minimize api changes

* revert to complying with existing API

* add the AtomicInteger for api compatibility reasons

* make sizing script executable

* address review comments pt1

* address review comments pt2

* fix compile errors after review comments

* return to using home dir as temp dir seemed to interact badly with gradle
2019-07-02 18:38:33 +00:00
szymonsztuka
f89008c070 CORDA-2998 fix network builder (#5265)
CORDA-2998 fix network builder
2019-07-02 11:32:48 +01:00
Stefano Franz
6c05197954 NOTICK - fix network builder for v4 (#5205)
make builder more parallel by making docker node building async
2019-06-26 18:53:32 +01:00
Shams Asari
2e02968c63
ENT-3496: dumpCheckpoints shell command (#5171)
Dumps all the node's checkpoints as JSON into a single zip file in the node's directory. The output contains:

* All the fields for the top-level flow
* The current sub-flow call stack, along with the current progress tracker step for each sub-flow
* The event that suspended the flow, which if it's a send or sendAndReceive will show the payload that was sent
* Low level information on the active sessions with other peers
2019-06-26 15:31:02 +01:00
Shams Asari
4e835d5483
CORDA-2333: Updated the majority of the dependencies that were out of date (#5235)
Some where not touched, including the crypto ones, libraries related to messaging and Kotlin.
2019-06-20 16:19:16 +01:00
LankyDan
afc36615d0 ENT-3496 Address pr comments 2019-06-17 16:04:05 +01:00
Shams Asari
2152961d46
CORDA-2333: Dependency update pass for tests and demos (#5211) 2019-06-13 10:15:13 +01:00
LankyDan
b2148354a5 ENT-3496 Improve test to check for zip and json file existence 2019-06-12 10:31:15 +01:00
LankyDan
31a0c077b8 ENT-3496 Move dumpCheckpoints to the new InternalCordaRPCOps interface
To prevent making `dumpCheckpoints` part of the public API a new
interface, `InternalCordaRPCOps` has been created and the function
has been moved there. `InternalCordaRPCOps` inherits from
`CordaRPCOps`.

`CordaRPCOpsImpl` now implements `InternalCordaRPCOps`.

`RunShellCommand` and `StringToMethodCallParser` required additional
changes due to issues handling inherited functions. This has only been
raised now due to `InternalCordaRPCOps` inheriting from `CordaRPCOps`.

Many classes have had references to `CordaRPCOps` changed to
`InternalCordaRPCOps`.
2019-06-10 16:15:03 +01:00
Ryan Fowler
e1853f50d4 CORDA-2945: Catch IllegalArgumentException to avoid shutdown of NodeExplorer 2019-06-04 10:03:53 +02:00
Tudor Malene
5edd732615 Revert "CORDA-2773: Support for custom Jackson serializers (#5025)" (#5167)
This reverts commit f7bf1b41
2019-05-24 13:40:13 +01:00
Shams Asari
71c316ca5a
CORDA-2954: Upgrade to common-lang3 (#5152)
Utilised Fields.getAllFieldsList where we were doing the equivalent
2019-05-21 17:48:32 +01:00
josecoll
0263650a5f
Revert "Merge pull request #5145 from corda/jdk11-migration-gradle5-upgrade" (#5146)
This reverts commit f46377556c, reversing
changes made to ba675e73b9.
2019-05-20 16:16:49 +01:00
josecoll
38e84d46b4 Include JavaFX plugin (specify dependent JavaFX modules) and apply changes to relevant modules (explorer, demobench, client/jfx). 2019-05-20 15:08:27 +01:00
josecoll
ba675e73b9
CORDA-2893 Upgrade Corda to use Gradle 5.4.1 (Take 2) (#5137)
Upgrade Corda to use Gradle 5.4.1
2019-05-20 14:26:42 +01:00
Chris Rankin
b9f7c1a08a CORDA-2893, ENT-3422: Tweak JUnit 5 configurations to keep vintage engine off compile classpaths. (#5138)
* Tweak JUnit 5 configurations to keep vintage engine off compile classpaths.

* Configure Gradle tests to use JUnit 5.
2019-05-20 11:57:56 +01:00
josecoll
0eab42b63e
Revert "CORDA-2893 Upgrade Corda to use Gradle 5.x (#5063)" (#5135)
This reverts commit 88babefd89.
2019-05-17 11:11:05 +01:00
josecoll
88babefd89
CORDA-2893 Upgrade Corda to use Gradle 5.x (#5063)
* Upgrade gradle wrapper to Gradle 5.0

* Upgrade to use locally deployed version of Capsule plugin (using Gradle 5.0)

* Upgrade to use Corda Gradle Plugins 5.x (inclusive of Gradle 5.0 compatibility fixes)

* Fix compile-time problems resolving log4j packages.

* Update to use Artifactory deployed version of Capsule plugin (using Gradle 5.0)

* Upgrade to use Gradle 4.2.1 (excluding default memory setting change: command line client now starts with 64MB of heap instead of 1GB.)

* Added explicit compile-time dependency on 'de.jensd:fontawesomefx-commons:8.13' (compile-time error in tools:explorer without)

* Update "wrapper" gradleVersion to 5.4.1

* Update Capsule plugin version label to reference R3 forked build.

* Commit all gradle upgrade changes following: ./gradlew wrapper --gradle-version 5.4.1

* Increase maximum heap memory for Test tasks to 1GB, and upgrade build-scan plugin to 2.2.1.

* Increase Test tasks' maximum memory to 1.5GB - what could go wrong?

* Up maxHeapSize to 2g for gradle test runner (global setting).

* Added explicit compile-time dependency on 'de.jensd:fontawesomefx-commons:8.13' (compile-time error in tools:demobench without)

* Added forkEvery for node Unit tests.

* Up :node test task 'forkEvery' to 10.

* TC test execution tuning (:core, :node => forkEvery 10, default JVM heap size)

* TC test execution tuning (bump JVM heap size up to 1g for :node)

* TC test execution tuning (bump JVM heap size up to 1.5g for :node)

* TC test execution tuning (re-instate global JVM heap size of 1Gb)

* TC test execution tuning (re-instate JVM heap size of 2Gb for :node)

* Update Corda Gradle plugins to 5.0.0

* Updated plugin resolution order + renamed artifactory URL to use "software.r3.com"

* Reorder plugin resolution such that mavenlocal() is always queried first.
2019-05-17 10:36:21 +01:00
Dominic Fox
0b63157a4b ENT-3422 Add JUnit 5 dependencies to all projects (#5084)
* ENT-3422 Add JUnit 5 dependencies to all projects

* Remove explicit junit 4 imports where not needed

* Minor PR fixes

* Limit import scope
2019-05-15 16:40:12 +01:00
rui-r3
9e3a0a64ac CORDA-2491: Ability to specify Java package namespace from Cordform (#5075)
Add entry point with generic extra configuration options. Move configuration verification code to avoid circular dependencies.
2019-05-09 17:25:21 +01:00
Stefan Iliev
1802e48963 CORDA-2586 - explorer exception handling (#4957)
* Initial version of new(old) dialog that won't print a stacktrace for rpc exceptions.

* Decoupled CordaVersionProvider. Moved common files to common-logging to lower dependencies on the node explorer.

* Removed unused import and duplicate documentation comment.

* Moved error code rewrite policy in the new common/logging module according to PR review.

* Removed extra line.

* Updated log4j configurations with new package name where logging policies will be contained.

* Included common-logging module with cliutils.
2019-05-01 13:50:50 +01:00
Stefan Iliev
d67968fa88 CORDA-2632 - Handle exceptions when file does not exist. (#4967)
* corda-2632 Added catch clause to handle argument exceptions and display the proper error.

* Created specific exception for when the file is missing instead of the general catch all exception.

* Changes according to code review.
2019-05-01 12:18:40 +01:00
Tudor Malene
f7bf1b41e0 CORDA-2773: Support for custom Jackson serializers (#5025) 2019-04-26 15:34:41 +01:00
Stefan Iliev
4f382a65a3 CORDA-2632 Handle exceptions when file does not exist. (#4967)
* corda-2632 Added catch clause to handle argument exceptions and display the proper error.

* Created specific exception for when the file is missing instead of the general catch all exception.

* Changes according to code review.
2019-04-25 16:23:11 +00:00
Tudor Malene
4a1f149b49 CORDA-2858: Wire-up Corda components with better RPC reconnect logic (#4933)
Implemented the ReconnectingRPC into the WebServer, Standalone Shell, Explorer and BankOfCordaClientApi
2019-04-15 11:26:53 +01:00
Adel El-Beik
374ae80ab1 ENT-3322: Improved error reporting in interactive shell when an error occurs after a ctor is matched. (#4969)
* ENT-3322: Improved error reporting when an error occurs in type construction, after the ctor has been found.

* ENT-3322: FlowA in this test violated a restriction of StringToMethodCallParser that parameters with the same name but different types cannot be overloaded.
Fixed up FlowA to not have overloaded operation.

* ENT-3322: Simplified code following review comments.

* ENT-3322: Few updates following PR review comments.
2019-04-12 11:13:53 +01:00
Stefan Iliev
e4615f7f47 CORDA-2586 explorer exception handling (#4957)
* Initial version of new(old) dialog that won't print a stacktrace for rpc exceptions.

* Decoupled CordaVersionProvider. Moved common files to common-logging to lower dependencies on the node explorer.

* Removed unused import and duplicate documentation comment.

* Moved error code rewrite policy in the new common/logging module according to PR review.

* Removed extra line.

* Updated log4j configurations with new package name where logging policies will be contained.

* Included common-logging module with cliutils.
2019-04-09 19:14:37 +00:00
cburlinchon
c33ccc1e1b Dont add cliutils to non cli app, remove addition of log4j2 from config/dev 2019-03-22 14:54:17 +01:00
cburlinchon
bc74ba4be4 Add missing cliutils dependency to explorer 2019-03-22 14:54:17 +01:00
Jonathan Locke
eabd056511 ENT-3333: Return error code for invalid cmdline options (#4910)
If an invalid command line option is specified and the parser is unable to parse the input, return an error code to the caller. This is useful in scripting scenarios where it might be important to detect that Corda failed to start due to invalid command line parameters
2019-03-21 11:15:32 +00:00
JamesHR3
a90f394d43 [CORDA-2738] Allow the ProgressTracker to cope with child trackers with the same steps (#4894) 2019-03-18 13:50:29 +00:00
Jonathan Locke
82c45c6f83 CORDA-2506: Better handling of invalid log path (#4895)
Test if we have access to the logging path (baseDirectory/logs) before attempting to write to them. This allows us to shut down gracefully with an easily understandable error message.
Without doing this, the log4j2 will attempt to access the logPath when it first uses the logger in the call() function.
2019-03-15 09:54:53 +00:00
JamesHR3
76dc981b91 [CORDA-2737] Buffer events from observables in ProgressTracker until subscribed to (#4882) 2019-03-13 16:33:29 +00:00
Chris Rankin
ea263b3e54 CORDA-2569: Add "flow kill <ID>" command to Corda's shell. (#4861)
* CORDA-2569: Add "flow kill <ID>" command to Corda's shell.

* Add testing and documentation for RPC killFlow operation.
2019-03-08 16:39:22 +00:00
Chris Rankin
b9e4804388 ENT-3128: Update documentation for Node Explorer. (#4817) 2019-02-27 14:32:39 +00:00
Chris Rankin
04ba77732b ENT-3128: Tidy up DemoBench's "built-in CorDapp" management. (#4814) 2019-02-25 18:11:21 +00:00
Chris Rankin
111acc5d6e CORDA-2671: Remove broken ExplorerSimulator from Node Explorer. (#4811)
* CORDA-2671: Remove broken ExplorerSimulator from Node Explorer.

* CORDA-2671: Document that Node Explorer is included with DemoBench.
2019-02-25 18:11:06 +00:00
Tommy Lillehagen
8fb3d4dc01
CORDA-2669 - Reintroduce pendingFlowsCount (#4806)
* CORDA-2669 - pendingFlowsCount not in public API

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

* CORDA-2669 - Add pendingFlowsCount to api-current.txt
2019-02-23 17:10:32 +00:00
Mike Hearn
1ed5fce6a6 Backwards compat: Put the confidential-identities module back in the node classpath by default. Separating it out into a standalone "app" needs more thought and design work, if we do it at all. 2019-02-18 14:02:36 +01:00
Tommy Lillehagen
4434a005dd
CORDA-2622 - Fix shell extensions (#4774)
* CORDA-2622 - Fix shell extensions

* CORDA-2622 - Only add auto-completion stuff if enabled
2019-02-17 17:16:57 +00:00