Commit Graph

709 Commits

Author SHA1 Message Date
Ross Nicoll
979b07723d Give "Response" a more meaningful name 2017-03-27 18:14:13 +01:00
josecoll
0280299104 Soft locking implementation using database coin selection
Fix broken IssuerFlowTest

Fix IssuerFlowTests after rebase.

Resolve conflicts after rebase.

Soft locking converted to use persistent store.
Added additional optional 'includeLockStates' parameter in VaultService states API call.
Added Vault softLocked states query API call.

Fixed commercial paper failing test.
Improved exception handling on soft locking UPDATE statement.

Using SELECT FOR UPDATE to ensure correct soft locking data visibility.
Db query operations moved out of mutex code (as locking managed by underlying DB)

Adjusted logging severity levels.

Adjusted logging severity levels.

GenerateSpending now performing fine grained query for unconsumed states by joining with contract_cash_states table.
Using H2 proprietary cummulative counting feature (using sessioni SET variables)
Refactored and simplified HibernateObserver constructor to enable usage in JUnit tests.

Event generator issues larger random amounts (10,000..1,000,000) to those than are spent (0..10,000)
Adjusted Issue (5:1) and Exit (10:1) generation frequency vs spending.

Minor fixes: added optional lockid into select for spending criteria, set notary, additional trace logging.

Generate Cash Schema by default upon node start-up (as part of NodeSchemaService initialisation).

Explicitly close JDBC statements in finally() blocks.

Tightened HibernateObserver constructor.

Fix CommercialPaper test (was missing auto-generation of CONTRACT_CASH table)

Revert default JVM size back to 200Mb.

Revert default number of iterations in Explorer Node Simulation mode (back to 10000 with .5 sec sleep interval).

Remove redundant setter function.

Added TODO messages indicating Requery / H2 restrictions & caveats.

Consumed states lock updates now performed in general consumed state Update.

Updated/added Soft Locking documentation.

Addressed initial PR comments: use THREAD_LOCAL_KRYO, use AbstractParty, extract helper method, improve readability, address some doc typos

Addressed PR comment: removed lockId from WireTransaction.

Fixed soft locking UPDATE statements.

Improvements to VaultSoftLockManager for auto-registration of soft locks for flows with spendable states (as notifications from vault).
Other optimisations (IssuerFlow no longer explicitly reserve/release issued state) and improvements (soft lock release management of soft locks, docs update)

Performance update: now using Requery for UPDATE in release soft locking (non-composite key statement)

Removed redundant TODO messages (TODO: revisit Kryo bug when using THREAD_LOCAL_KYRO)

Minor fixes following rebase

Fixed failing JUnit following rebase

Addressed MH PR review items (1st pass)

Fix broken JUnit

Significant changes to RDBMS operations within coin selection and soft locking as requested by PR review.
(Removed SELECT FOR UPDATE; added RETRY upon coin selection; reverting partial soft locks)

Addressed a number of PR review requests added by MH (comments/spelling, lockID instantiation, HibernateObserver instantiation, cash schema white-listing usage)

Addressed latest PR review comments from RP.

Minor fixes following rebase from master.

Fixed final failing JUnit (issuer flow concurrent).

Updated TraderDemo to trigger concurrent issuance of cash.

Fixed compiler warning on lockId null check.

Fixed subtle bug in coin selection intermittently surfaced in IntegrationTestTutorial.

Fixed small memory leak.

Removed stray } in logger trace message.

Slight rewording of description of Soft Locking in docs.

Renamed NoStatesAvailableException to StatesNotAvailableException.
generateSpend is now Suspendable (calls sleep method on flow upon coin selection retry).

Added companion function to enable a Strand to sleep but without locking transactional context.

Improved logging, changed to StateNotAvailableException, using Flow sleep upon retry, tweaked SELECT criteria in coin selection, fixed bug when insufficient states selectable, generateSpend is now @suspendable

Improved handling and logging of flow results in Simulation Mode.

Fixed minor error in sleep when not an active flow.

Retry coin selection when unavailable states (as these may become available as new states).
Additional debug logging to highlight and identify H2 coin selection sporadic bug.

Inlined sleep method due to intermittent Quasar error.

Re-introduce selection clause that prevents selection and temporary locking of already locked states (by other flows).
Improved trace logging for coin selection (SQL row level info).
Correctly calling FlowStateMachineImpl sleep (now inlined and working correctly)

Fixed rebase error.

Remove redundant TODO message.
2017-03-27 17:12:33 +01:00
Patrick Kuo
dc06d37369 Intellij bug workaround (#434)
* Workaround for `"bound callable references" is only available since language version 1.1` when using kotlin 1.1.1 plugin.
2017-03-27 15:12:01 +01:00
Ross Nicoll
c73a2e6034 Add utility functions for requesting transaction keys
Add utility functions for requesting transaction keys and a small example flow which uses
these functions for testing purposes. These keys are required in for the anonymisation of
transactions, by providing per-transaction keys which cannot be associated with the owning
party's keys without an intermediary certificate.
2017-03-27 14:19:14 +01:00
Shams Asari
52ea54f742 Upgraded both guava and guava-testlib to 21.0 and made sure they share the same version variable 2017-03-24 17:17:36 +00:00
Chris Rankin
19ee4f2d7b Create testArtifacts configuration for 'core' module. (#425) 2017-03-24 13:33:54 +00:00
Mike Hearn
67e6bbc068 Support overloads in the StringToMethodCallParser 2017-03-24 12:44:54 +01:00
Mike Hearn
ac90fe724e Shell: add support for uploading and downloading attachments. 2017-03-24 12:44:54 +01:00
Katarzyna Streich
c5966a93e5 Remove duplicated SecureRandom functions in crypto package. 2017-03-24 10:36:05 +00:00
Chris Rankin
eaf9dad7c9 Remove junit-quickcheck from Corda because it is only used for testing. (#416) 2017-03-23 17:32:14 +00:00
Andrius Dagys
0713baf513 Fix isValidatingNotary check: throw exception if the provided party is not a notary 2017-03-23 12:11:18 +00:00
Chris Rankin
98266da41c Refactor CordaRPCClient into new :client:rpc Gradle module. (#405)
* CORDA-305: Refactor CordaRPCClient into :client:rpc module

* CORDA-305: Remove the Kotlin test framework from the artifacts.

* CORDA-305: Migrate serialisation whitelist into node-api module.

* CORDA-305: Clean up unused RPC observables.

* CORDA-305: Add :client:rpc module to documentation tasks.

* CORDA-305: Include :finance into :client:rpc for its serialisable classes.

* CORDA-305: Move test classes into the correct directory.

* CORDA-305: Migrate :finance dependency from :client:rpc into DemoBench.

* CORDA-305: Update wording of TODO about handling Observables.
2017-03-22 15:52:54 +00:00
Shams Asari
209f5c8a25 Logging fixes, including broken --logging-level cmd line arg 2017-03-21 15:36:32 +00:00
Chris Rankin
d415865efe Explicit dependency on SLF4J API, to help IntelliJ. (#393) 2017-03-20 17:04:39 +00:00
Mike Hearn
afbc8f9b5c De-issuerify the cash payment flow. This makes it easier to use the payment flow from the shell. 2017-03-20 15:14:28 +01:00
Rick Parker
1de1f9095f Several tests were corrupting Kryo which was then returned to the common pool. (#378)
* We were leaving trailing attachmentStorage on pooled kryo instances after some tests.  Changed attachment storage logic to make it impossible to leave it behind.

* Some low level tests corrupt the Kryo config, so do not return to pool when this is the case.  Also, we discovered that Kryo is caching class name to class resolution.  We don't want to do this where attachments are involved.  The errors raised highlighted a class missing from the whitelist.  Need to write a unit test to test the class loader issue.

* Unit test for attachment class loading with kryo.
2017-03-17 12:43:11 +00:00
Mike Hearn
eb21458885 Some fixes to emoji/ANSI renderer 2017-03-17 10:54:25 +01:00
Shams Asari
51a5eb77a0 Added @Suspendable to UntrustworthyData.unwrap to allow Java flows to do I/O inside unwrap 2017-03-16 16:30:28 +00:00
Konstantinos Chalkias
6844ab32f8 Custom Logger serializer and its related unit-test.
Custom Logger serialiser using only its name when serialising and deserialising using LoggerFactory.getLogger(name).
2017-03-16 15:38:37 +00:00
Rick Parker
f3a5f8e659 Pool Kryo instances for efficiency. (#352)
Pooled Kryo
2017-03-16 08:24:06 +00:00
Shams Asari
69a99b2f42 Merge pull request #364 from corda/shams-register-class
Flow registration takes in a Class object rather than a KClass
2017-03-15 17:14:03 +00:00
Konstantinos Chalkias
9db773d17c Remove unused vars + and change set/get with indexing operator. (#358) 2017-03-15 17:10:55 +00:00
Shams Asari
f581844f3f Flow registration takes in a Class object rather than a KClass 2017-03-15 16:32:13 +00:00
Clinton Alexander
f091659b7c Updated JAX RS to the actual version that is downloaded to avoid mismatches with the dependencies zip. 2017-03-14 16:08:30 +00:00
Andras Slemmer
31dc6e4b8f Merge pull request #338 from corda/aslemmer-generator-remove-any-constraint
Remove Any constraint from Generator type param
2017-03-13 18:05:24 +00:00
Chris Rankin
ba4cce36ab Use SLF4J's version of the commons-logging bindings. Only include SLF4J's Log4J back-end for actual applications, e.g. Node. (#350) 2017-03-13 15:57:17 +00:00
Konstantinos Chalkias
afd5521b00 Lazy NodeVaultService.states (#349)
Convert NodeVaultService states to return Iterable (backed by Sequence) Vs the old way using a List. Worth noting this relieves memory pressure as the number of vault states grows.

* remove toList in ContractUpgradeFlowTest
2017-03-13 14:06:47 +00:00
Mike Hearn
23fcbd284c Amount: add ruble and Yen, fix toString. 2017-03-13 14:51:19 +01:00
Mike Hearn
7cac55ca4a Amount: add support for basic parsing from text. 2017-03-13 14:51:19 +01:00
Ross Nicoll
7898c902e4 Remove out of date documentation
Remove out of date documentation about the "covering" field of DigitalSignature, which no longer
exists.
2017-03-10 17:24:36 +01:00
Andras Slemmer
c8b13b257f Remove Any constraint from Generator type param 2017-03-09 17:48:53 +00:00
Shams Asari
e9d63b2662 Added bits of versioning info to the node 2017-03-09 16:36:21 +00:00
Konstantinos Chalkias
4a9ff84fc7 Allowing multiple signature algorithms (#250)
Basic crypto API to support 5 signature schemes and MetaData-ed signatures.
Supported schemes: (1) RSA_SHA256, (2) ECDSA_SECP256K1_SHA256, (3) ECDSA_SECP256R1_SHA256, (4) EDDSA_ED25519_SHA512, (5) SPHINCS-256_SHA512.

To sign a transaction, a signer should create a MetaData wrapper that contains transaction's merkle root and some extra information, such as signer's public key, timestamp and visibleInputs. Actually, MetaData is utilised to support a practical partial, blind and extra-data attached signature model.
When a MetaData object is signed, the signer sends a TransactionSignature object that contains the signed output and the corresponding MetaData object.

Remarks: 
This is an temporary solution for signature algorithmic agility. Further development is required for a robust and extensible Crypto Manager/Provider PKI that will support certificate creation, key generation, signing/verifying, deterministic key derivation, encoding formats, SGX/HSM support, identity and key management, versioning, revocation, asynchronicity, metadata, partial sig. policies etc.
2017-03-08 17:45:23 +00:00
Mike Hearn
35836d9926 Add a registeredFlows() RPC that lists the RPCs the node knows about. 2017-03-08 15:01:13 +01:00
Karel Hajek
1e78d6a3a7 Simple Attachment Storage implementation using Requery/H2 database 2017-03-07 16:12:38 +01:00
Andrius Dagys
907a893ca1 BFT notary prototype: add validation and signature collection (#279)
* BFT notary prototype: add a non-validating service.
Each replica now validates the transaction timestamp and returns an individual signature to the BFT client. The client then returns a list of signatures back to the notary service flow.

The validating variant is still incomplete - it requires the ability to suspend flows on arbitrary function calls.
2017-03-07 12:39:19 +00:00
Chris Rankin
0a5080a4e4 Exclude old version of Javassist in favour of Hibernate's version from Node. (#320)
* Exclude old version of Javassist in favour of Hibernate's version.

* Comment why we are excluding javassist:javassist, and add TODO for when junit-quickcheck 0.8 is released.
2017-03-07 11:43:06 +00:00
Andras Slemmer
f00515b39e Merge pull request #293 from corda/aslemmer-services-for-resolution
core: Add ServicesForResolution interface
2017-03-02 12:08:08 +00:00
Ross Nicoll
0f6b806047 Add anonymous text in case party lookup fails 2017-03-02 12:07:12 +00:00
Mike Hearn
cc61be5b6a Inform users about the newly available Corda training programs at startup and in the docsite. 2017-02-28 16:50:43 +01:00
Rick Parker
6d375351bd Add a header to all serialised data & switch to compatibility serializer. (#294)
Add a header to all serialised data & switch to compatibility serializer
2017-02-28 11:17:57 +00:00
Rick Parker
c4c4c51d7d Kryo serialisation whitelisting and misc enhancements. (#267)
Kryo serialisation whitelisting and misc enhancements
2017-02-28 08:12:18 +00:00
Clinton Alexander
8414c97a61 Moved JsonSupport to new webserver module. Fixed a few compile errors.
Fixed compile issues caused by webserver being split to a separate project.
WebServer now starts and stops correctly as a separate module.
2017-02-27 16:41:48 +00:00
Andras Slemmer
8522d79371 core: Add ServicesForResolution interface 2017-02-27 14:03:25 +00:00
Gary Rowe
16a7298ef5 Fix incorrect whitespace character (required copy paste of tab) 2017-02-23 20:44:23 +00:00
Gary Rowe
544f2de75e Add Hong Kong to list of cities in lookup table 2017-02-23 16:54:19 +00:00
Chris Rankin
221278197a Implement RPCOp getCashBalances(). 2017-02-22 13:57:15 +00:00
Mike Hearn
8b1864e07c Minor: naming and doc tweaks in Merkle tree code. 2017-02-22 14:16:04 +01:00
Mike Hearn
b8942a2cc9 Remove the SignedTransaction.id field, which took part in serialisation. Calculate it on demand instead. 2017-02-22 14:16:04 +01:00
Mike Hearn
0b33b52d1a Minor: add a warning suppression over an unchecked cast in the upgrade code. 2017-02-22 14:16:04 +01:00