-
Notifications
You must be signed in to change notification settings - Fork 3
Refactor SubnetID and add ChainID to root #109
Conversation
} | ||
let mut hasher = FnvHasher::default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah cool, I didn't know there was a hasher that output u64 directly. I'll switch to using this then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a non-cryptographic hash. Really convenient for this cases (and also supported by Go, so even better).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to include some examples in the form of tests. For example https://github.com/tjwebb/fnv-plus has a default bit length of 52, but also has named methods for 32 and 64. It would help users to want to produce the same chain ID on different platforms to include some documentation on what the Rust version uses.
Addresses #78
Our previous implementation of
SubnetID
had two main issues:t/f
which meant that setting a different network type in Lotus and the actors led to really annoying panics/errors.root
to identify the root of an IPC hierarchy, we use theChainID
to "uniquely" identify different IPC trees.Finally, we've decided that instead of supporting Ethereum addressed for subnet actors, these will be included in the path of a
SubnetID
through their correspondingf4
address (thus supporting any future alternative addressing that comes to the network).Next
ChainIDs
to the different subnets lotus#178