diff --git a/Hash2Pub/demoserver b/Hash2Pub/demoserver deleted file mode 100755 index 3c98f51..0000000 Binary files a/Hash2Pub/demoserver and /dev/null differ diff --git a/Hash2Pub/src/Hash2Pub/FediChord.hs b/Hash2Pub/src/Hash2Pub/FediChord.hs index 872f4e1..2c50ea3 100644 --- a/Hash2Pub/src/Hash2Pub/FediChord.hs +++ b/Hash2Pub/src/Hash2Pub/FediChord.hs @@ -99,7 +99,7 @@ data NodeState = NodeState { , nodeCache :: NodeCache -- ^ EpiChord node cache with expiry times for nodes -- as the map is ordered, lookups for the closes preceding node can be done using @lookupLT@ - , successors :: [NodeID] + , successors :: [NodeID] -- could be a set instead as these are ordered as well , predecessors :: [NodeID] ----- protocol parameters ----- -- TODO: evaluate moving these somewhere else @@ -121,9 +121,10 @@ type NodeCache = Map.Map NodeID CacheEntry -- |an entry of the 'nodeCache' type CacheEntry = ( - NodeState + Bool + , NodeState , SystemTime - ) -- ^ ( a node's data, timestamp for cache entry expiration ) + ) -- ^ ( a node's validation status, data, timestamp for cache entry expiration ) -- | generates a 256 bit long NodeID using SHAKE128, represented as ByteString genNodeIDBS :: HostAddress6 -- ^a node's IPv6 address @@ -202,7 +203,7 @@ checkCacheSlices state = diff = getNodeID $ upperBound - ownID lowerBound = ownID + NodeID (diff `div` 2) in - -- TODO: replace empty IO actions with actual lookups + -- TODO: replace empty IO actions with actual lookups to middle of slice -- TODO: validate ID before adding to cache case Map.lookupLT upperBound cache of Nothing -> return () : checkSlice j ownID lowerBound (Just lastSuccNode) cache