Commit graph

14 commits

Author SHA1 Message Date
Trolli Schmittlauch f6481996d7 Change default response to QueryID for unjoined nodes
reason: allow unjoined nodes to find bootstrap node in local cache,
while always advertising itself to incoming requests for bootstrapping.
2020-07-02 00:54:14 +02:00
Trolli Schmittlauch 0494ddd696 stabilise periodically
contributes to #44
2020-06-20 21:24:31 +02:00
Trolli Schmittlauch 3f42f98443 adjust lookup to RingMap, fix #48
- change default lookup result when not joined to FOUND
- fix determining own responsibility #48
- adjust tests
2020-06-18 23:08:20 +02:00
Trolli Schmittlauch 22a6becf6b fix all previously working tests 2020-06-15 16:41:11 +02:00
Trolli Schmittlauch 7612f5532a create a test for parts of #48 2020-06-13 14:56:05 +02:00
Trolli Schmittlauch f15d83baff Refactor predecessors and successors to hold RemoteNodeStates
- neighbour nodes need to be contacted reliably
- Only holding NodeIDs requires a cache lookup for getting hostname and
  port. This is brittle as the entry could've been purged from cache.
- refactored ASN.1 scheme, types and add/ sort/ remove implementations

closes #46
2020-06-09 15:21:22 +02:00
Trolli Schmittlauch 2c827ea326 rename responseTo -> requestID to avoid partial record accessors 2020-06-08 20:31:18 +02:00
Trolli Schmittlauch cb769e088f add test for serialiseMessage part numbering 2020-06-06 13:45:35 +02:00
Trolli Schmittlauch 914e07a412 change NodeCache protection to STM
- putting the NodeCache behind an IORef had been chose because those
  could've been read non-blocking
- the same is true for TVars. The performance characteristics are likely
  worse, but at the advantage of composability within STM monads
2020-06-05 22:07:47 +02:00
Trolli Schmittlauch 2542091379 adjust rest of code to new message structure 2020-05-30 13:52:06 +02:00
Trolli Schmittlauch bbe7078369 adjust tests to work with new NodeState types
closes #20
2020-05-22 00:05:23 +02:00
Trolli Schmittlauch f6c252d314 sending a queryID request compiles (untested) 2020-05-20 18:55:24 +02:00
Hécate 41e999ed99 Linting integration
This commit brings in an HLint configuration file
and several recommended modifications such as:

* End-of-line extra spaces removal;
* Import lines ordering;
* Redundant $ removal;
* Generalisation of ++ and map to <> and fmap;
* Preferring `pure` over `return`;
* Removing extraenous extensions.

And finally, a `stylish-haskell` helper script
that detects if code files are dirty. Can be useful for CI,
although manually calling it can be nice if you would rather
first implement then beautify.
2020-05-19 12:42:06 +02:00
Trolli Schmittlauch 60c164dbb0 remove unnecessary directory level 2020-05-19 00:01:32 +02:00