Change conversion to toStringShort() instead of toBase58String() - as done for H2 Cash Selection.
Fix withIssuerRefs case - iterate via list of IssuerRefs and setBytes instead of setArray of BYTEA.
Add test for Cash Selection with issuerRef.
Since we are running web-server and different handling methods will be called from
different threads, it is more appropriate to use concurrent data structures
for exchanging information between threads.
Prior to this change I observed the following exception which is likely to be due `certPaths` not synchronized between threads:
```
Caused by: kotlin.KotlinNullPointerException
at net.corda.node.utilities.registration.RegistrationHandler$reply$1.invoke(NodeRegistrationTest.kt:151) ~[integrationTest/:?]
at net.corda.node.utilities.registration.RegistrationHandler$reply$1.invoke(NodeRegistrationTest.kt:122) ~[integrationTest/:?]
at net.corda.core.internal.InternalUtils.logElapsedTime(InternalUtils.kt:221) ~[corda-core-corda-4.0-snapshot.jar:?]
at net.corda.core.internal.InternalUtils.logElapsedTime(InternalUtils.kt:213) ~[corda-core-corda-4.0-snapshot.jar:?]
at net.corda.node.utilities.registration.RegistrationHandler.reply(NodeRegistrationTest.kt:149) ~[integrationTest/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_161]
```
Packages re-jig was meant to reduce the size of the jars that are being produced by the
node driver. E.g. previously `MessageState` was in package `net.corda` which resulted in jar file
of around 2MB to be created. Same for `NodeStatePersistenceTests` which was in `net.corda.node`
* Improve logging for NetworkMap requests
* Allow interrupt in polling if the process started successfully
* Put `advertiseNewParameters` back
* Additional log line to indicate when all the nodes are started
* Improve logging and use concurrent map since it is updated from multiple threads
* Change NetworkMap response validity duration and rename parameter accordingly
* Changes following code review from @shamsasari
* Making Corda's JPA classes non-final and Serializable.
* Making Corda's JPA classes non-final and Serializable.
* Making Corda's JPA classes non-final and Serializable.
* Making Corda's JPA classes non-final and Serializable.
* CORDA-1208: Notary service should persist the notarisation request signature along with the committed input states.
This required modifying the uniqueness provider interface to accept the signature in addition to input states.
Until now the committed state log used to be stored as a map of (state reference -> (tranasction id, consuming party)).
Adding the serialized signature would mean inflating each state entry by around 700 bytes, which would be grossly inefficient.
Instead, two tables are now used: one for storing (state referece -> transaction id) map, and another for storing the notarisation
request details (transaction id, consuming party, date, signature).
* Update api - all of these changes are only related to custom notaries
Old code failed with:
```
11:34:01.536 [main] ERROR net.corda.node.internal.Node - Exception during node startup
java.nio.file.InvalidPathException: Illegal char <:> at index 2: /C:/Program%20Files/JetBrains/IntelliJ%20IDEA%20Community%20Edition%202017.3.1/lib/idea_rt.jar
at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182) ~[?:1.8.0_144]
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153) ~[?:1.8.0_144]
at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77) ~[?:1.8.0_144]
at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94) ~[?:1.8.0_144]
at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255) ~[?:1.8.0_144]
at java.nio.file.Paths.get(Paths.java:84) ~[?:1.8.0_144]
at net.corda.node.utilities.JVMAgentRegistry.resolveAgentJar(JVMAgentRegistry.kt:46) ~[classes/:?]
at net.corda.node.internal.AbstractNode.initialiseJVMAgents(AbstractNode.kt:785) ~[classes/:?]
at net.corda.node.internal.AbstractNode.start(AbstractNode.kt:199) ~[classes/:?]
at net.corda.node.internal.Node.start(Node.kt:335) ~[classes/:?]
at net.corda.node.internal.NodeStartup.startNode(NodeStartup.kt:146) ~[classes/:?]
at net.corda.node.internal.NodeStartup.run(NodeStartup.kt:120) [classes/:?]
at net.corda.node.Corda.main(Corda.kt:16) [classes/:?]
```
The problem with the previous implementation is that the transaction would be deserialized with the schema specified
in the serialized form, but the calculation of the id would involve re-serializing properties using a local serialization context
which might produce a different result.
- Existing embedded Shell connects via RPC including checking RPC user credentials (before was a direct use of CordaRPCOps): in dev mode when console terminal is enabled, node created `shell` user.
- New Standalone Shell app with the same functionalities as Shell: connects to a node via RPC Client, can use SSL and run SSH server.
* Fix another non-serializable exception, add docs, fix a possible security issue.
* Update API definition to reflect methods added to make more exceptions serializable
This was achieved by having the hash in the node-info file to be just of the node's X.500 name. This also solves existing duplicate node-info file issues that we've been having.
Also updated the docsite.
* CORDA-1122 Switch AMQP bridge to use auto-commit sends and acks
* CORDA-1122 Codereview: Add comment for extra commit to rollback and add better message sequence logging to tricky test
* CORDA-986 and CORDA-985 CompositeKey and Signature verification performance fixes (#2467)
* CORDA-696: Create separate transaction types for contract upgrade transactions.
Add rationale around upgrade transactions
Move contract upgrade transaction resolution logic into internal until it's stabilised.
Throw a better exception when contract attachment not found
Default legacy contract constraint to always accepting - needs to be changed to whitelist constraint before merging
Introduce a new upgraded contract interface that allows specifying the legacy constraint.
Remove StateLoader, make all tx resolution functions take in ServicesForResolution
Contract upgrade transactions can handle whitelist by zone constraints
When creating a contract upgrade transaction, make sure the attachment of the old cordapp gets attached when using hash constraints.
Attachment lookup for a given contract class name only scans currently loaded cordapps, and we don't load old versions of cordapps.
CORDA-696: Update upgrade docs
* CORDA-1096 - Performance when loading multiple states from the vault (#2609)
* Provide efficient `loadStates()` implementation
* Replace loops using `loadState` with calls to `loadStates`
* Replace `map`/`flatMap` with just a single `flatMap`
* ENT-1443 Add cert role to CSR and doorman issue cert according to the cert role (#431)
* Doorman and HSM create certificate base on requested cert role specified in the certificate signing request.
(cherry picked from commit 94f7392)
* remove R3 corda code
CORDA-1010: Notary flow - clients now send a signature over a notarisation
request in addition to the transaction. This will be logged by the notary
to be able to prove that a particular party has requested the consumption
of a particular state.
* Jolokia agents are loaded dynamically if configured
* Renamed exportJmxTo (never used) to jmxMonitoringHttpPort and take it from config
* Updated documentation and tests
Further, the look up of the node's own node-info from its database has been tightened to ensure there isn't more than one.
Also fixed some brittle code which was assuming exactly one address rather than at least one.
* Update check api changes to look for internals
* Update several more uses of internal
* Make check-api-changes script filter out internal class usages
* Make CordaClock part of API
* Update api-current.txt
* Remove exclusion of nodeapi.internal
* Remove access to CordaPersistence from public api
* Don't expose DB Connection from StartedMockNode and remove unnecessary transaction from CustomVaultQueryTest
* Make internal tests that use need db access use InternalMockNetwork
* Make test certificates internal
* Address further review comments
* Revert some accidental changes to api-current.txt
* Address Shams' review comments
* Update Api Scanner to filter out CordaInternal attribute
* Update api-current.txt
* Remove superfluous brackets
* Add transaction to StartedMockNode
* More leaky transaction fixes
* Added per-cordapp configuration
* Added new API for Cordformation cordapp declarations to support per-cordapp configuration
* Added a cordapp configuration sample
* Remove sslConfiguration from public constructor of CordaRPCClient
* Address review comments
* Update api-current.txt
* sslConfiguration doesn't need to be a property
* Don't expose StartedNode via Node Driver
* Dont expose StartedNode/Abstract Node via MockNetwork
* Remove internal var from constructor as it doesn't hide from public api and change to internal initialisation method
* Update api
* Rename MockNode to StartedMockNode to avoid confusion
Update documentation
Update api-current.txt
* Fix typo
* Fix test failure
* Modify flow tests to use internal mock network and remove additional internal exposures from StartedMockNode
* Fix api-current
* Change InProcess and OutOfProcess to interfaces
* Explicitly declare MockNetwork parameters
Dont expose StateMachineManager
Move affected tests to use internal mock network
* Fix api-current
* Changes requested via review
* Fix IRS Demo address
* Fix api
* Remove internal attribute from classes in internal package
* Remove accidentally added code
* Move useHttps into NodeHandleInternal
* Remove duplicated code
* Update api-current
* Make webAddress internal on NodeHandle
* Make sure parameters in public api are explicitly specified
* Use correct address in IRS Demo
* Get webaddress from webserver handle
* Update api-current
* wire up and enforce max transaction size
* fixup after rebase
moved network parameter from AbstractNode to NodeProperties
* removed TODO
* fix broken import
* address PR issues
* remove API breaking change
address PR issue
* added max transaction size to driver and mock network.
address PR issues
* fix failing test
* added TODO
* fix verifier test
* fix spring driver build error
* Network parameters updates
Add two RPC methods networkParametersFeed and
acceptNewNetworkParameters. Implementation of client handling of network
parameters update event. Partial implementation of accepting new
parameters and installing them on the node as well as node startup with
updated parameters.
Move reading of network parameters on startup to separate
NetworkParametersReader class. Add tests.
Move NetworkParameters and NotaryInfo classes to core.
* Ignore evolvability test - to be fixed later
* Add documentation on update process
* Create CordaInternal attribute for properties on public classes that are not part of the api and apply to FlowLogic.stateMachine
* Remove startFlow from public test api and replace with startFlowAndReturnFuture
* Update api-current with changed signature
* Change test used in documentation to use public test methods
* Remove the rest of the unneccessary usages of the startFlow test utility
* Remove extra whitespace
* Rename startFlowAndReturnFuture back to startFlow
* Update api
* The annotation doesn't appear unless its marked as on the actual getter and setter
* Updated docs and removed pointless attribute
* Deleted whitespace
Minor tweaks to the invocation context code.
1) Un-deprecate FlowInitiator, move the deprecation to the field. This
eliminates large numbers of warnings and means developers are warned
only once in the place where they obtain one.
2) Add documentation for StateMachineInfo and create a type alias to give
it a better name in an ABI compatible way.
3) Improve markup on InvocationContext
4) Rename field from just "context" to "invocationContext" (Context is vague)
* set network registration poll interval via http cache control header from the server side
* default poll interval to 10 seconds if cache header not found
* address PR issues
* address PR issues
(cherry picked from commit dca8699)
* add cmdline option for network root truststore and password, instead of using node's truststore configuration to avoid confusion.
* revert line auto format
* fix failing integration test
* address PR issue
* Make notary service return the current time and the transaction time window
along with the TimeWindowInvalid error.
Deprecate TimeWindowChecker.
Add a static method for validating transaction time window to reduce code duplication.
* ENT-1403 Cache node attachments (and attachment content)
* ENT-1403 Make cache sizes configurable
* Update documentation with new config parameters
* Test that non-existence of attachments is not cached
* Remove unneeded defaults in interface
* It turned out we need the defaults on the interface in quite a few tests
* Codereview: typos, size in MB rather than bytes, charset in tests, move concurrencyLevel to a constant
* Codereview: Make the internal config value bytes again, but config file in MB
* Fix example config unit test
Changes compatible with R3.Corda (ENT-794):
1) Added Hibernate corda-wrapper-binary two to to columns.
2) Shorten names of tables in dummy schemas used in tests.
3) Undo removal of compound index of VaultTxnNote (b423fea).
4) Assertions for 2 vault tests don't rely on order of rows.