network
network copied to clipboard
NET-804: receipt layer (poc)
Open questions / challenges / TODO
Bucket cleanup logic
- How long to store buckets for, when to cleanup, possible persistence of them for later use?
- If messages arrive later (how late?) to an old bucket, do we consider this a new bucket to collect statistics for, or do we revive the original bucket and keep updating it?
- What to do about buckets of disconnected nodes?
- Current implementation: store buckets in memory until they get closed, after which they are removed from memory.
Empty bucket handling
- It is possible that no messages occur during a span of time covering one or more buckets.
- Buckets are now tied to specific message chains. How do we determine which message chains to emit empty buckets for? Or do we have some sort of meta-bucket covering multiple message chains?
- Current implementation: empty buckets are not implemented.
No ReceiptResponse corner case
Node identity and sessionId
- Nodes usually run under a node id of format
ethereumAddress#sessionIdbut receipt signing works with Ethereum addresses and private keys. - Multiple nodes with same ethereum address but different sessionId, how to handle?
- A node can crash and re-join, it's
sessionIdwill change. -
Current implementation: we treat all nodes as separate, even if they have same Ethereum address (as long as the
sessionIdis different of course). Signature validation and signing logic knows how to strip out thesessionId.
Signing of messages
- Network layer remains unaware of Ethereum addresses, private keys, and hence the exact format of node ids.
- Instead we provide an interface for signature generation / validation that the client implements with Ethereum-specific choices.
- Current implementation: pretty much done.
Misc missing things still
- Message validation missing on
protocollayer - Unit test for higher-level classes
- End-to-end test
- Tests that verify for possible "malicious" activity
Terminology
- Window vs. Bucket
- Closed Bucket
- [ ] Has passing tests that demonstrate this change works
- [ ] Updated Changelog
- [ ] Updated Documentation
Closing PR as we are most likely not going with this approach. Will not deleted branch because we could need the stuff form here for future reference.