Commit graph

269 commits

Author SHA1 Message Date
Trolli Schmittlauch 6ed441403d basic test for whether message splitting works 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch ca383420a6 fix off-by-one error in message splitting 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 0d91452641 add tests for serialising and deserialising messages 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 666a9602ba adjust tests to usage of RemoteCacheEntry 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch e4d350b8fb add tests for ASN.1 message encoding and decoding 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 89cc51af52 re-organise protocol definition and create own type for remote cache entries 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 91bb72cb57 fix ASN.1 container parsing 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 2f10ea6628 fix parser format inconsistencies 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 28254a9f83 better error handling in ASN.1 message parser 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 6dc9650da5 deserialisation of DHT messages 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch c9654d66d6 improve encoding documentation and syntax 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 31b73b7667 split FediChord messages into multiple parts for size restrictions
includes encoding of messages as ASN.1 DER
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 1d8d9a33fd implement ASN.1 parsing with parser combinators 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 9f16964efc define data types for DHT messaging
encoding and parsing functions have been adjusted accordingly
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch e81a4d23e7 make request and response distinguishable 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 187d164200 encode Ping as ASN.1 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 1968b5f883 functions for encoding protocol messages as ASN.1 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 947771ba18 add publicsuffix dependency for proper node ID hashing
still needs to be implemented
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch db229975b0 extract internal node parameters to own arithmetic type 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 24936d48c1 ASN.1 module schema specification for DHT protocol 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch e1228da74d start specifying protocol format in ASN.1 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 7a20ea5225 more complex prototype example of modular parsing 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 7e6c4985ce some prototyping and fiddling around with ASN.1 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 992320b67b example for encoding data as ASN1 DER 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 449fcb93bb safe responsibility recognisation, tests for responsibility lookup 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch bba14f6be3 add tests for entry deletion from cache 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch c1f8ec2c56 write tests for (local) cache lookup on queries
#2
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 66be1cc2b6 make local lookup return Sets instead of lists 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 90daa1ba9a NodeCache: write tests for lookup (#2) 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch a803751213 fix infinite loops during lookups 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 18bdcce266 re-implement NodeCache data structure to emulate ring properly
- previously, there was at least 1 gap in the identifier ring
- now use normal integer comparison again, but forward lookups using
  proxy entries at the ID space boundaries
- wrap cache operations to properly handle proxy elements
- fix all previously working tests
- document choice of cache data structure
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 3db7fcfba5 found an edge case where a Data.Map tree map does not work properly for retrieving a successor.
Need to find a better data structure
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch f4847da295 fix types and packaging to make inserting testable 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch aed80263a7 NodeCache: add entries
+ tests
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 8d9697c1ef local cache query lookup + some validation considerations
no unit tests done so far
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch e13dac4ded IPv6 only, noone needs legacy stuff 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 3faa4a8d61 specify protocol operations and affected data 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 357152da46 prototype of server and client successfully communicating via unconnected Datagram sockets 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 6958fc2f98 some tweaks to the demo UDP server 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 303a6ecbfa start prototyping a UDP socket server, ideas on UDP parsing
- start implementing a socket-based UDP server (cannot reply yet)
- some brainstorming about how to parse incoming UDP packet commands
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 76e7c60b96 bump nixpkgs version to include a fix for hoogle 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 6c7feb73c6 ignore .gitignored files for cabal2nix 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 6c90eb75b4 enable async and threading 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch ea6ebe590d adjust tests to new NodeState 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 0e33d442f9 EpiChord: create a stub cache-invariant checker
rough logic is implemented, but only for successors and not
predecessors.
Additionally it just returns empty IO actions instead of lookup
operations, until those are implemented.
part of #1

Untested!
2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 88897ea741 generation of key IDs 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 8ece8646d4 fix some more warnings 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch b234c7ac4e more tests #2 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 9d20589cf8 fix some warnings 2020-05-17 21:31:43 +02:00
Trolli Schmittlauch 84a48e63c2 stub main executable file 2020-05-17 21:31:43 +02:00