Commit Graph

83 Commits

Author SHA1 Message Date
Chalith Desaman
4a5c3554bd Hotpocket version changes (#336) 2021-07-28 16:33:58 +05:30
Ravin Perera
6a1fb3c5ad Added time based kill switch. (#325) 2021-06-22 11:08:15 +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
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
Savinda Senevirathne
a4399544b9 Separate contract and ledger file system mounts. (#235)
- Creating two separate hpfs folders for contract and ledger file systems (contract_fs and ledger_fs).
- Added separate mounts for contract and ledger file systems.
- Added separate instances for contract serving and ledger serving.
- Added separate instances for contract syncing and ledger syncing.
- Modified cluster creating script to accompany folder name changes in contract folder.
2021-02-05 11:48:52 +05:30
Savinda Senevirathne
d08d2630f6 Refactoring hpfs, hpfs sync and hpfs serve code. (#231)
* Refactoring hpfs code to a class so it can support multiple mounts.
* Refactoring hpfs serve into a class to support mulitiple mount serving.
* Refactoring hpfs sync into class to support multiple instances.
* Code improvements in hpfs_sync.
* Taking a sync target list for hpfs syncing target set.
2021-02-02 13:17:21 +05:30
Ravin Perera
11cb57e9ee Keep hp cfg and patch cfg consistent. (#216)
* Copy from hp cfg to patch cfg upon startup.
* Persist to hp cfg whenever patch cfg is updated.
2021-01-10 17:48:12 +05:30
Ravin Perera
e8e7921ac1 Single-process hpfs integration. (#212) 2021-01-06 21:53:39 +05:30
Savinda Senevirathne
bed8205ca8 Config patch change detection. (#211)
* Applying patch file changes to hpcore runtime after patch file change detection.
* Removing unl sync functionality.
* Removing subjecting unl changeset to consensus.
2021-01-06 20:02:14 +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
c25ebe66f4 Util helper func simplification. (#203) 2020-12-23 21:49:13 +05:30
Ravin Perera
8dc20bdab0 Naming changes and reintroducing key prefix to contract libraries. (#202) 2020-12-23 19:23:46 +05:30
Savinda Senevirathne
e835e18d18 New config file structure. (#201) 2020-12-23 18:52:58 +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
Savinda Senevirathne
7bf0475b6f Subject unl list to consensus. (#186)
* Unl hash in consensus proposals.
* Unl syncing and sync request serving.
* Adding unl hash to the ledger block.
2020-12-08 15:05:38 +05:30
Ravin Perera
da0eb08512 SIGTERM handler and minor startup improvements. (#185)
* SIGTERM handler and stderr usage.
* Create-contract state seed dir creation.
2020-12-06 10:38:35 +05:30
Ravin Perera
80392cc995 Persisted contract UNL updates in config file. (#171)
* Refactored config loading and saving.
* Aded unl update persistance.
2020-11-27 09:06:17 +05:30
Ravin Perera
d9517b6164 Reorganized util and hpws source files. (#161) 2020-11-23 23:18:42 +05:30
Ravin Perera
202a6a2715 Ledger and state sync improvements. (#143)
* Increased stage time window.
* Introduced central state tracker.
* Used shared mutex for target state update.
* Refactored lcl and state sync checks in consensus.
* lcl/state sync loop wait time improvements.
2020-11-04 16:01:10 +05:30
Ravin Perera
254e92fc7c Updated hpws binary with fd and zombie cleanup fixes. (#141) 2020-11-04 06:29:35 +05:30
Ravin Perera
116a54e980 Fixed ledger read fd leak. Reordered subsystem init. (#138) 2020-10-26 08:11:55 +05:30
Ravin Perera
7a4e91b0dd Integrated hpfs in-proc sessions. (#134) 2020-10-23 10:04:45 +05:30
Ravin Perera
cb4d0c4f59 Ledger maintenance refactor. (#130)
* Added ledger namespace.
* Thread-safe lcl access and update.
* Refactored history sync and serving into a thread.
* Restructured ledger cache item.
2020-10-08 22:25:47 +05:30
ravinsp
1245da52b2 Fixed configuration logic issues. 2020-09-26 23:12:55 +05:30
Ravin Perera
4d920a9219 Fixed child process signal behaviours. (#128)
* Restored signal handlers upon fork().
* Improved error handling of hpfs process kill scenario.
* Set pgid for forked processes for graceful sending of SIGINT.
2020-09-26 21:39:26 +05:30
priyadharsun
91122474a1 Replaced Boost log with Plog. (#124) 2020-09-23 06:06:42 +05:30
Savinda Senevirathne
37629471c5 Refactored consensus to run on a separate thread. (#123) 2020-09-18 15:53:15 +05:30
Ravin Perera
93f57efbe3 Added release build support. (#119)
* Cleaned up and updated cmake to have release build support.
* Added segfault handler.
* Added latest hpfs release build.
* Fixed coding issues revealed by release build.
2020-09-16 17:51:54 +05:30
Ravin Perera
d2f45daf4c Implemented multi-threaded inbound network message processing. (#115)
Used per-session thread to offload messages from network and a single thread for processing collected messages.
2020-09-10 15:40:08 +05:30
Ravin Perera
a54a5f43da Consensus proposal expiration time calculation fix. (#106)
* Logging improvements.
* Fixed time calculation issue in expiring proposals.
2020-08-07 13:03:02 +05:30
Ravin Perera
817ccd6a88 Implemented contract read requests. (#98) 2020-06-19 21:52:03 +05:30
Ravin Perera
04e230c82e Improvements in state request/response handling. (#97) 2020-06-18 15:07:33 +05:30
Ravin Perera
b89dbe0a2c Rearchitected state sync with hpfs. (#96) 2020-06-10 20:51:45 +05:30
ravinsp
9ee09bebb7 Renamed proc namespace. 2020-06-05 22:08:38 +05:30
Ravin Perera
10374352c6 hpfs integration. (#94) 2020-06-04 13:51:53 +05:30
Ravin Perera
920be03ade Websocket re-architecture with websocketd and websocat (#89)
- Replaced beast with websocketd and websocat. #79 #83 #84
- Implemented inbound/outbound peer connection merging.
- Added graceful shutdown of hpcore with sigint. #87
2020-04-05 08:12:55 +05:30
Ravin Perera
8cf869cf9e Observer mode fix (#78)
* Fixed observer mode consensus issues.
* Added startup_mode to fix mode change check.
2020-01-17 11:04:45 +05:30
Ravin Perera
b6497d0f82 Cmake cleanup (#77) 2019-12-21 07:05:20 +05:30
Ravidu Lashan
1972085b33 Changed boost error handling (#74) 2019-12-19 19:50:18 +05:30
Ravin Perera
7255dae84c Code cleanup and naming consistency improvement. (#73) 2019-12-19 19:22:17 +05:30
ravinsp
d6751c3e52 Added better error handling for socket errors. 2019-12-16 14:49:33 +05:30
ravinsp
fc108523ca Added stack trace logging for exceptions. 2019-12-15 23:28:49 +05:30
Asanka Indrajith
7a7aa6d5b3 Consensus enhancements and eliminating deadlocks after state inclusion. (#69) 2019-12-13 09:38:50 -05:00
Ravidu Lashan
1238e96423 State synchronization logic (#67)
* Added flat buffer state message request

* Added state vote

* Added state to ledger history and did necessary changes

* Completed receiveing state request

* State read/write helpers.

* Added new fbs schema

* Added more state_store helper methods.

* Started processing response

* Fixed compile errors

* Added get file length.

* Handled state content response

* Statefs code cleanup and fixes.

* Completed response handling

* Completed changes in handling state response

* State sync integration fixes.

* Fuse mount waiting logic.

* Fixed state syncing issues

* state sync fixes

* fixes

* State sync fixes.

* Fixed fs entries retrieval issues.

* changed desync logic

* Added directory helper functions.

* Handled return statemetns from statefs

* Fixed state folder deletion.

* handled errors from statefs

* Working for small files

* Got state sync working.

* Removed cout.

* Fixed catering for stae issue

* Fixed block hash map flatbuf issue.

* Added expected hash

* Added helpers for expected hash comparison.

* Improved state req/resp awaiting logic.

* Fixes.

* Fixes.

* Block request ordering fix.

* Removed couts

* Closed non-closed file descriptors

* Minor fixes.

* Cluster create script changes.

* Fixed reset time off issue.
2019-12-13 10:20:41 +05:30
Asanka Indrajith
b506b34b4f Consensus reliability enhancements (#62)
* Implemented going observer mode, fixed genesis lcl retrieval issue and stage closing time.

* Fixed clearing all user output instead of consensed outputs

* Modified waiting time to improve performance.

* Fixed deadlock of waiting for insufficient peers because of recent changes.

* Removed initial waiting time for peer connections to start consensus.
2019-12-06 05:08:51 -05:00
Ravin Perera
0dde10c306 Contract state monitoring and rollback infrastructure. (#61) 2019-11-25 19:30:15 +05:30
Asanka Indrajith
bebdace519 Achieving reliable consensus. (#60)
* Remove considering stage when voting and considering lcl.

* Stage sync , lcl sync  and candidate set changes.

* Implemented ledger close time resolution and fixed ledger retrieval issues.

* Code cleanup and added more comments on reliability changes.

* Added further comments and  clenup.
2019-11-25 07:40:22 -05:00
Asanka Indrajith
95683035b9 LCL history request and response. (#59)
Detect and request missing lcl history from another random node.
Sending lcl history response to a asked node.
Getting lcl history response and applying it.
Delete lcl that exceeds max ledger sequence.
2019-11-19 07:50:33 -05:00
ravinsp
403f2e1b21 Implemented passive operating mode. 2019-11-11 12:25:21 +05:30