Skip to content

chore: update protocol to rev 3154a3#1724

Merged
mmagician merged 1 commit intonextfrom
mmagician-base-update
Mar 2, 2026
Merged

chore: update protocol to rev 3154a3#1724
mmagician merged 1 commit intonextfrom
mmagician-base-update

Conversation

@mmagician
Copy link
Contributor

@mmagician mmagician commented Mar 1, 2026

Updates all protocol crates to rev 3154a3 and adapts to the following interface changes:

Authentication

  • AuthFalcon512Rpo::new(pk) replaced with AuthSingleSig::new(pk, AuthScheme::Falcon512Rpo)
  • create_basic_wallet now takes AuthMethod instead of AuthScheme as a paramter

AggLayer (in genesis tests)

  • create_existing_bridge_account now requires bridge_admin_id and ger_manager_id (which are created as two BasicWallets)
  • create_existing_agglayer_faucet now requires token_supply, origin_token_address, origin_network, scale. Cap max_decimals = 8 (prev. 18 to match Ethereum, but now we enforce max_decimals < 12. We will eventually need to adjust scale and/or max_decimals, but this is WIP in the protocol repo)

@mmagician mmagician force-pushed the mmagician-base-update branch from 8caf42b to 52824bc Compare March 1, 2026 16:10
@mmagician mmagician added the no changelog This PR does not require an entry in the `CHANGELOG.md` file label Mar 1, 2026
@mmagician mmagician force-pushed the mmagician-base-update branch from 52824bc to f1047dd Compare March 1, 2026 16:17
@mmagician mmagician marked this pull request as ready for review March 1, 2026 16:20
Comment on lines +485 to +488
.with_auth_component(AuthSingleSig::new(
PublicKeyCommitment::from(EMPTY_WORD),
AuthScheme::Falcon512Rpo,
))
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is such a common pattern, should we maybe make this easier?

impl AuthSingleSig {
    fn falcon_512(pub_key: Falcon512PublicKey) -> Self { ... }
}

Though I don't have enough insight into how these various components play together to really know what the right API is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could work, but IMO it would unnecessarily couple the enum definition to the API of AuthSingleSig:

#[non_exhaustive]
pub enum AuthScheme {
    Falcon512Rpo = FALCON_512_RPO,
    EcdsaK256Keccak = ECDSA_K256_KECCAK,
}

and whenever the enum changes, we'd need to adapt the constructors of AuthSingleSig. It's not a huge deal, but if I were to choose I'd probably avoid this coupling.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But the enum definition is tied to it already? Or why else do you need both the enum and the public key in AuthSingleSig::new(..)? Right now its possible to pass in effectively any value which seems very incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now its possible to pass in effectively any value which seems very incorrect.

That's a separate question in my mind: are you talking about validating that the passed pub key is consistent with the specified scheme?

This could be achieved with the current interface:

/// Creates a new [`AuthSingleSig`] component with the given `public_key`.
pub fn new(pub_key: PublicKeyCommitment, auth_scheme: AuthScheme) -> Self {
    match auth_scheme {
        // TODO verify that the pk is valid w.r.t. to scheme supplied 
    }
    Self { pub_key, auth_scheme }
    }

or with your suggested interface:

impl AuthSingleSig {
    fn falcon_512(pub_key: Falcon512PublicKey) -> Self {
        // TODO verify that pub key is a valid falcon key
        Self { pub_key, AuthScheme::Falcon512Rpo }
    }
}

having a AuthSingleSig::falcon_512 constructor would be purely for convenience, but unless we decide to add validation, it won't solve "pass in effectively any value which seems very incorrect."

Copy link
Collaborator

@Mirko-von-Leipzig Mirko-von-Leipzig Mar 2, 2026

Choose a reason for hiding this comment

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

My suggested interface does not require validation because the type already is that type? Which is kind of my point. If a user has t: T, why do we ask them to use new(t.to_string(), t.type()) instead of just taking new_t(t).

Or in other words, we should use types which are already validated instead of doing validation inside of other places. Or taking in vague blobs as an API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh I see, so instead of using PublicKeyCommitment (which both falcon and ecdsa "reduce into"), you'd require the helper constructors to take the individual scheme's pk (like Falcon512PublicKey, not just a commitment to it).

I think this could work

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah :) Because what ends up happening for me, is that "reducing"/From/Into aren't trivially discoverable. And then it takes me a while to figure out how to produce the correct blob from my actual data

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok thanks for your patience in explaning :) I'm glad we're on the same page now I created an issue for this

Copy link
Collaborator

@juan518munoz juan518munoz left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@juan518munoz
Copy link
Collaborator

oops misclicked 😅

@mmagician mmagician merged commit 35327af into next Mar 2, 2026
18 checks passed
@mmagician mmagician deleted the mmagician-base-update branch March 2, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog This PR does not require an entry in the `CHANGELOG.md` file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants