-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[entropy] Change provider interface to simplify supporting many chains #1149
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
@@ -186,7 +186,6 @@ contract Entropy is IEntropy, EntropyState { | |||
req.providerCommitment = providerInfo.currentCommitment; | |||
req.providerCommitmentSequenceNumber = providerInfo | |||
.currentCommitmentSequenceNumber; | |||
req.providerCommitmentMetadata = providerInfo.commitmentMetadata; |
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.
drive by: I deleted this field from req (it's not needed)
@@ -44,19 +44,14 @@ contract EntropyTest is Test { | |||
random.register( | |||
provider1FeeInWei, | |||
provider1Proofs[0], | |||
bytes32(keccak256(abi.encodePacked(uint256(0x0100)))), | |||
hex"0100", |
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.
drive-by: shorter way to write this
chain_id: &ChainId, | ||
random: [u8; 32], | ||
random: &[u8; 32], |
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.
I think seed is a better name here.
@@ -1,45 +1,4 @@ | |||
[ | |||
{ |
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.
Why these got deleted? :?
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.
Looks good! I left some minor inline comments.
Currently, the Entropy contract has a single
bytes32
field that providers can use to store arbitrary metadata associated with their hash chain. We're using this to store a random seed that the provider can use to regenerate the chain. However, the chain on the server is a function of both the random seed and a chain length parameter (and also a secret which of course isn't on the blockchain). Thus, at the moment, every blockchain must use the exact same chain length. This is brittle and will cause operational problems down the line when we need to manage different chains on many different chains.This PR changes the field to be
bytes
and the providers can choose to store however much data they want in there. I also changed fortuna to store both the secret and the chain length.