Skip to content

Conversation

tejasbadadare
Copy link
Contributor

Summary

Verify signature against trusted signers from state.
Next up i'll break up the parse function a bit so I can add better error handling.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

tejasbadadare and others added 25 commits August 19, 2025 14:17
Co-Authored-By: Tejas Badadare <[email protected]>
…and tests; verified with Sui CLI 1.53.2

Co-Authored-By: Tejas Badadare <[email protected]>
…d gate updates with admin cap

Co-Authored-By: Tejas Badadare <[email protected]>
…_lazer::init; share State; add OTW doc comments

Co-Authored-By: Tejas Badadare <[email protected]>
Copy link

vercel bot commented Aug 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
api-reference Ready Ready Preview Comment Aug 25, 2025 7:55pm
component-library Ready Ready Preview Comment Aug 25, 2025 7:55pm
developer-hub Ready Ready Preview Comment Aug 25, 2025 7:55pm
entropy-explorer Ready Ready Preview Comment Aug 25, 2025 7:55pm
insights Ready Ready Preview Comment Aug 25, 2025 7:55pm
proposals Ready Ready Preview Comment Aug 25, 2025 7:55pm
staking Ready Ready Preview Comment Aug 25, 2025 7:55pm

use pyth_lazer::admin::{Self, AdminCap};

const ED25519_PUBKEY_LEN: u64 = 32;
const SECP256K1_COMPRESSED_PUBKEY_LEN: u64 = 33;
Copy link
Contributor

@merolish merolish Aug 22, 2025

Choose a reason for hiding this comment

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

Was this mislabeled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gave a more accurate name

// When we have an unknown property, we do not know its length, and therefore
// we cannot ignore it and parse the next properties.
abort 0 // FIXME: return more granular error messages
abort EInvalidUpdate // FIXME: return more granular error messages
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this no longer a fixme?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Still a FIXME since there are several other places in the parsing where the code can revert. Will be tackling this next.

Copy link
Contributor

@merolish merolish left a comment

Choose a reason for hiding this comment

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

Seems reasonable as far as I can tell.

/// # Errors
/// * `ESignerNotTrusted` - The recovered public key is not in the trusted signers list
/// * `ESignerExpired` - The signer's certificate has expired
public fun verify_le_ecdsa_message(
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to make it public :? maybe public in crate be enough (so we can test it, but users don't use it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, figured it might be handy for users, but yeah i can't think of a scenario where they'd wanna validate without parsing.

Base automatically changed from tb/lazer/sui-storage to main August 25, 2025 19:23
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.

4 participants