Skip to content

Commit

Permalink
Update Transaction-manager.md (#20)
Browse files Browse the repository at this point in the history
* Update Transaction-manager.md

Update new Data recovery (batch resend) method introduced along with privacy enhancement changes

* Update Tessera.md

* Update Tessera.md

* Update SampleConfiguration.md

* Update Tessera.md

* fix markdownlint check

* fix markdownlint check

* fix vale check

Co-authored-by: namtruong <[email protected]>
  • Loading branch information
Krish1979 and namtruong authored Oct 26, 2020
1 parent 852d096 commit 6fcc7d0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/HowTo/Configure/Tessera.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ should exist in the serverConfigs):
"bootstrapNode": true,
```

### Privacy Enhancements Flag

Privacy enhancement features to support Party Protection (PP) and Private State Validation (PSV) are enabled by setting the flag to true. The default value is set to FALSE

```json
"enablePrivacyEnhancements" : "true",
```

### CORS: Server sub-config

For the ThirdParty server type it may be relevant to configure CORS.
Expand Down
22 changes: 21 additions & 1 deletion docs/HowTo/Configure/Transaction-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The default transaction manager comes with the standard options most setups will

These must be built from source and can be found inside the `tessera-dist` module.

## Data recovery
## Data recovery (Legacy)

Tessera contains functionality to request transactions from other nodes in the network; this is useful if the database is lost or corrupted somehow.

Expand All @@ -59,3 +59,23 @@ The data recovery mechanism is intended to be a "switch-on" feature as a startup
The data recovery procedure works by invoking a "resend request" to each new node it sees in the network. This request will cause the target node to resend each of its transactions to the intended recipient, meaning they will again save the transaction in their database.

The target node will not send back transactions as a response the request in order to ensure that a malicious node cannot get access to the transactions. example: anyone can send a request for a particular key, but it will mean that the node that holds that key will receive the transactions, not the node making the request. In normal usage, the node making the request and the node holding the public key are the same.

## Data recovery (Enhanced from `Privacy Enhancement` release)

Due to the interdependence between Party Protection and PSV transactions (the existence and validation of ACOTHs), transactions cannot just be accepted but need to be recovered in the appropriate manner so that they don’t get wrongly rejected.

To do this we introduce a separate persistence unit called `tessera-recover` which consists a number of tables so that incoming history transactions received can be sorted before synchronising to the main database

The recovery process will include these steps:

- **Request** - the transaction manager that runs in recovery mode will send resend requests to other nodes in the network and wait for requests to be completed. The requested nodes will attempt to resend the transactions they have for the recovery node in batches (rather than singles compared to the legacy resend process). Transactions received are persisted to a separate staging database unit, and the batch request will be considered successful once the requested node finishes sending the transactions.
- **Stage** - All transactions in the staging area will be sorted by dependency. This is done by executing a special staging query multiple times, until all transactions in the staging area are sorted and validated.
- **Sync** - Once the staging process is done, the transactions are copied to the main database - by utilising the normal /push. During the sync, enhanced-privacy transactions are checked and validated the same way they were before.

Tessera recovery process will stop and shutdown once the above steps are executed. Each stage result will be reported as SUCCESS(0), PARTIAL_SUCCESS(1), or FAILURE(2). The result code would be useful for scripting purpose (for example automatically start Tessera in normal mode if recovery successfully completed)

To trigger the recovery process, Tessera will need to be started in recovery mode by using the command line

tessera -r or tessera --recover

During the recovery process, Tessera won’t accept any new enhanced-privacy transactions but will continue to accept 'standard' private transactions.
4 changes: 3 additions & 1 deletion docs/Reference/SampleConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ description: Sample configuration file
"alwaysSendTo": [
"String..."
],
"bootstrapNode": false,
"unixSocketFile": "Path",
"features": {
"enableRemoteKeyValidation": false
"enableRemoteKeyValidation": false,
"enablePrivacyEnhancements": false
},
"encryptor": {
"type": "Enumeration: NACL, EC",
Expand Down

0 comments on commit 6fcc7d0

Please sign in to comment.