-
Notifications
You must be signed in to change notification settings - Fork 472
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
refactor: rename verification message #1637
Conversation
🦋 Changeset detectedLatest commit: 1b57489 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
3386e23
to
1afc542
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1637 +/- ##
==========================================
+ Coverage 73.75% 73.78% +0.02%
==========================================
Files 99 99
Lines 9000 9002 +2
Branches 1998 1999 +1
==========================================
+ Hits 6638 6642 +4
+ Misses 2244 2242 -2
Partials 118 118 ☔ View full report in Codecov by Sentry. |
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.
Generally looks good. Left some comments. I think biggest thing is we should keep this PR to be a pure rename refactoring. And add the sol changes in a followup
/** Adds a Verification of ownership of an Address based on Protocol */ | ||
message VerificationAddAddressBody { | ||
bytes address = 1; // Address being verified for a given Protocol | ||
bytes protocol_signature = 2; // Signature produced by the user's address for a given Protocol |
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.
maybe we should calls this user_signature
?
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.
yeah i wasn't sure what's best to name this
since we have the user signature for FID, i wanted something to help distinguish the two
open to user_signature
if we feel it won't clash with FID signature verification
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.
Hmm, fair. Maybe address_verification_signature
or user_address_signature
?
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 like address_verification_signature
- do we want it in this PR or can it be separate?
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've made the update on the followup branch built on top of this one: https://github.com/farcasterxyz/hub-monorepo/tree/feat/solana-verifications
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.
This is perhaps a silly question, but are these changes backwards compatible with the old message format? eth_signature
is referenced in a lot of places in code—will that suddenly start breaking for old messages when someone updates their hub-nodejs
package?
Or will the code generated by protobuf libraries automatically support both calls?
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.
Hmm, it would break. Consumers of the library would have to rename.
But maybe we can add a function to the class in hub-nodejs called eth_signature
that returns the eth_signature if protocol == ethereurm and throws otherwise?
4bc362c
to
c65cbba
Compare
c65cbba
to
51d8967
Compare
51d8967
to
9add14d
Compare
9add14d
to
52fa50d
Compare
52fa50d
to
38e145d
Compare
38e145d
to
1b57489
Compare
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.
Overall looks great. I always wondered why we insisted on tying it to ETH and not just have a verification_type
field.
/** Adds a Verification of ownership of an Address based on Protocol */ | ||
message VerificationAddAddressBody { | ||
bytes address = 1; // Address being verified for a given Protocol | ||
bytes protocol_signature = 2; // Signature produced by the user's address for a given Protocol |
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.
This is perhaps a silly question, but are these changes backwards compatible with the old message format? eth_signature
is referenced in a lot of places in code—will that suddenly start breaking for old messages when someone updates their hub-nodejs
package?
Or will the code generated by protobuf libraries automatically support both calls?
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.
What is this file apps/hubble/src/rustfunctions.test.ts
?
@@ -623,7 +620,12 @@ export const validateVerificationAddEthAddressBody = async ( | |||
export const validateVerificationRemoveBody = ( | |||
body: protobufs.VerificationRemoveBody, | |||
): HubResult<protobufs.VerificationRemoveBody> => { | |||
return validateEthAddress(body.address).map(() => body); | |||
switch (body.protocol) { | |||
case protobufs.Protocol.ETHEREUM: |
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.
We should have this in the validate Add as well
/** Adds a Verification of ownership of an Address based on Protocol */ | ||
message VerificationAddAddressBody { | ||
bytes address = 1; // Address being verified for a given Protocol | ||
bytes protocol_signature = 2; // Signature produced by the user's address for a given Protocol |
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.
Hmm, it would break. Consumers of the library would have to rename.
But maybe we can add a function to the class in hub-nodejs called eth_signature
that returns the eth_signature if protocol == ethereurm and throws otherwise?
@sanjayprabhu Some file aditya and cassie set up - I used it to test signature verification for phantom wallet |
Ah, weird, I don't know why github thinks it's a binary file. |
This reverts commit fd9f9ff.
Motivation
Change Summary
Merge Checklist
Choose all relevant options below by adding an
x
now or at any time before submitting for reviewAdditional Context
If this is a relatively large or complex change, provide more details here that will help reviewers
PR-Codex overview
This PR focuses on renaming the verification message from "VERIFICATION_ADD_ETH_ADDRESS" to "VERIFICATION_ADD_ADDRESS".
Detailed summary
VERIFICATION_ADD_ETH_ADDRESS
toVERIFICATION_ADD_ADDRESS
in multiple files.package.json
.