Commit Graph

27 Commits

Author SHA1 Message Date
Ravin Perera
370e03fe84 Switched user input nonce from string to uint64. (#286) 2021-04-11 14:51:57 +05:30
Ravin Perera
3941f5f6c6 Revamped ledger input/output storage and query execution. (#285)
- Ledger sqlite db improvements.
- Removed flatbuffers from ledger blob data storage.
- Added consensus private mode blob data filtration.
2021-04-11 11:45:14 +05:30
Ravin Perera
0a3183a3d6 Included output hash and ledger info in output return message. (#284) 2021-04-08 10:42:33 +05:30
Ravin Perera
d4646179c2 Returned input hash and ledger info for input submissions. (#283)
- Introduced input hash which can later be used to query the ledger.
- Returned input hash and ledger info at input submission.
- Updated js client lib to support input hash.
- Updated consensus proposal candidate expiration rules.
2021-04-07 21:22:29 +05:30
Savinda Senevirathne
137d7633e0 Updated hpfs binary and its relevant hpcore changes. (#282)
* Hpfs index file is updated to match the file with the hpfs version.
* Added updated hpfs binary.
* Version log changes because Plog is not initialized at the time of version init.
2021-04-02 10:36:29 +05:30
Ravin Perera
bba5266f5d Fixed consensus issues with large no. of users and inputs. (#280)
* Fixed issue in consensus contract output  sorting.

* Improved load test script.

* Removed flatbuffer verifier restrictions to support large no. of users and inputs.

* Improved consensus proposal cleanup.

* Restored the earlier proposal cleanup logic.

* Minor fixes.

* const fix.
2021-04-01 17:12:39 +05:30
Ravin Perera
99c5912f14 Version management refactor. (#278)
- Introduced separate versioning for ledger file storage.
- Refactored versioning information code base.
2021-03-31 10:19:12 +05:30
Ravin Perera
ef42d4c986 Ledger query results raw input/output support. (#277) 2021-03-30 15:44:20 +05:30
Ravin Perera
948113398c Ledger query infrastructure. (#275)
* Added json ledger query param parser.

* Added initial query response creation.

* Updated client lib.

* Implemented get ledger by seq no.

* Added ledger query execution wrappers.

* Included log record info.

* Fixed empty output hash issue.

* Added bson support.

* Added db file existance check.

* Added requesy/reply tracking for queries in client lib.

* Improved multi connection usage in client lib.

* Added genesis ledger query support.

* Updated naming convention of query result fields.

* Comments.

* Used sqlite bind() for query param.

* Used binary hashes in ledger sqlite db.

* Missing const.
2021-03-29 11:20:15 +05:30
Savinda Senevirathne
b45cdb999d Include hp version number on all required places. (#265)
* Adding HP version header to binary files and adding hp table to ledger.sqlite.

* Updating hp_version in user challenge message.

* Minor improvement.
2021-03-10 20:08:04 +05:30
Ravin Perera
1cebcb1c35 Config runtime re-save refactor. (#258)
* Check peer discovery config when persisting peers.

* Refactored config persistance.

* Fixed config read offset issue.

* Refactored peer list structs.

* Minor constexpr.
2021-02-25 14:25:12 +05:30
Ravin Perera
5b56d9c1b3 Updated hpfs hash verification with file mode checks. (#257)
* Added file mode to hpfs responses.

* Parse file mode on hpfs response read.

* Apply file/dir mode.

* Fixed mode apply logic.

* Fixed code review comments.

* Additional fix.
2021-02-24 11:13:28 +05:30
Ravin Perera
137c199b07 P2P Flatbuffers schema refactor. (#255) 2021-02-23 13:15:03 +05:30
Savinda Senevirathne
16c5b3fae2 Introducing ledger shards and new ledger syncing logic. (#247)
- The ledgers are stored in a sqlite database in ledger file system.
- Ledgers are organized in shards inside primary folder.
- Raw inputs are saved as shards inside blob folder. No input files are created if neither inputs nor outputs are available.
- Both last primary shard hash and last blob shard hashes are subjected to consensus and necessary sync operations are performed if out of sync.
- Hpfs sync support setting single sync targets from both ends of the list. (Targets set from front are prioritized).
- Contract and ledger syncs and serving are performed independently.
2021-02-18 11:24:05 +05:30
Ravin Perera
610b67cec0 Contract execute config flag. (#226)
* Added contract execute flag. Made bin_path optional.
* Updated docker cluster default config.
* Renamed contract config to hp config.
2021-01-22 14:33:07 +05:30
Chalith Desaman
0914994772 Replaced ifstreams with file read inside the config and patch config read. (#220) 2021-01-15 11:50:26 +05:30
Savinda Senevirathne
c87ae6693d Patch config and hpfs sync refactor. (#208)
* Terminology changes from state to hpfs.
* Syncing hpfs parents in priority order.
* Changing how the hash is calculate in hpfs response validate check.
2021-01-06 10:50:58 +05:30
Chalith Desaman
e8a3882176 Prevent running multiple hpcore instances from the same directory (#207) 2021-01-05 11:18:23 +05:30
Ravin Perera
f97d7de530 Moved h32 hash type from hpfs to util. (#204) 2020-12-23 21:58:49 +05:30
Ravin Perera
c25ebe66f4 Util helper func simplification. (#203) 2020-12-23 21:49:13 +05:30
Ravin Perera
1a954ad96e Implemented output signature checks. (#200) 2020-12-22 16:55:44 +05:30
priyadharsun
9df8248af7 strdup memory cleanup in hpcore. (#194)
* strdup memory cleanup in hpcore.
* Updated hpfs binary.
2020-12-14 14:34:26 +05:30
Ravin Perera
f2ed9040c0 User protocol upgrade and js client lib. (#191)
* Unified js client lib for browser and nodejs.
* Client lib multiple connections support.
* Implemented server challenge response.
* Contract guid and version validation.
* Server key validation.
* User json message encoding improvements.
2020-12-11 11:02:58 +05:30
Chalith Desaman
b86efb2d9b Recursively deleting directories during state sync. (#189) 2020-12-09 13:43:34 +05:30
Chalith Desaman
2f5d95ae7a Save raw inputs alongside the ledger (#167)
* Saving raw inputs in the ledger.
* Store full history in separate folder.

* Moved full history fb structs to a seperate fbs file

* Removed raw_inputs from the proposal

* Fixed code comments

* Saving raw user input string

* Code refactoring

* Resolved PR comments
2020-11-30 15:42:20 +05:30
Ravin Perera
d9517b6164 Reorganized util and hpws source files. (#161) 2020-11-23 23:18:42 +05:30
Ravin Perera
9c1f62dbde Migrated user inputs from domain sockets to memfd. (#159) 2020-11-23 21:52:05 +05:30