Skip to content
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

fixes related to metadata backends #117

Merged
merged 3 commits into from
Aug 21, 2023
Merged

Conversation

chaitanyapotti
Copy link
Member

No description provided.

// deriving address from pub key coz pubkey is always available
// but finalPrivKey won't be available for v2 user upgraded to 2/n
let finalEvmAddress = "";
if (finalPubKey) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in wht scenario finalPubKey won't be available ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the bug scenario where metadata doesn't come

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should throw when metadata is missing right?

@@ -33,8 +33,8 @@ export function generateMetadataParams(ecCurve: ec, serverTimeOffset: number, me
};
const sig = key.sign(keccak256(Buffer.from(stringify(setData), "utf8")).slice(2));
return {
pub_key_X: key.getPublic().getX().toString("hex", 64),
pub_key_Y: key.getPublic().getY().toString("hex", 64),
pub_key_X: key.getPublic().getX().toString("hex"), // DO NOT PAD THIS. BACKEND DOESN'T
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should update backend isn't it? Coz there might still be 0's in front which can get lost on the network.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't update backend due to legacy reasons.
0's don't get lost because we always transmit strings across network

Copy link
Member

@himanshuchawla009 himanshuchawla009 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

// deriving address from pub key coz pubkey is always available
// but finalPrivKey won't be available for v2 user upgraded to 2/n
let finalEvmAddress = "";
if (finalPubKey) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should throw when metadata is missing right?

@chaitanyapotti chaitanyapotti merged commit f29b2a8 into master Aug 21, 2023
1 check passed
@chaitanyapotti chaitanyapotti deleted the feat/metadata-fixes branch August 21, 2023 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants