-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat: SelfSign trait #14
Conversation
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.
Would be good if someone else can comment on the rustiness and compatibility with the overlay 😬
Based on discussion: Getting the proof has been moved to trait. I also made a new concrete type that does the strange mut setting of the proof. I moved the verify fn to the concrete type as well. This allows us to avoid making the trait public outside the crate to prevent user error. |
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.
Still would be good for @mariocao or @FranklinWaller to check the rustiness :)
stderr: Vec<String>, | ||
stdout: Vec<String>, |
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 was wondering if there should be any consideration not including these 2 fields in the signature. Any thoughts?
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.
The concern is about replaying the reveal transaction... but let's think about this.
Maybe they could be included as a sort of hash but inside of the reveal body.
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.
If you want to merge the PR without this, we should create an issue. :)
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.
Apart from comment the location of the lazy static VRF
, all looks great! ;-)
#[cfg(feature = "cosmwasm")] | ||
pub(crate) type U128 = cosmwasm_std::Uint128; | ||
#[cfg(not(feature = "cosmwasm"))] | ||
pub(crate) type U128 = u128; |
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 didn't notice it before but this breaks the overlay node. u128 cannot be used on the overlay node side because JSON does not support this. We should probably create some JSON conversion tests? And add a comment to not change these types. I'll work on this right now
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 should still work. The way it's setup is it's serialized as a string not a u128.
Motivation
So, the message signing and proof are all in one place and can be reused.
Explanation of Changes
A few things:
SelfSign
trait.U128
type for non-contracts to be au128
, which serializes as aString
, to avoid double parsing aString
as au128
. And I saw on the overlay side that we have this as au128
before converting it to a string just to put in the message type.VRF,
as we created instances of this several times. This was more for the contracts side.Testing
All tests still pass.
You can see an example of using the message hash in the contract branch.
Related PRs and Issues
Closes #10.
Closes #8.