Skip to content

refactor: remove deprecated zklogin variants from public signature enums#1195

Open
Thoralf-M wants to merge 3 commits into
developfrom
claude/sharp-dirac-trd3lt
Open

refactor: remove deprecated zklogin variants from public signature enums#1195
Thoralf-M wants to merge 3 commits into
developfrom
claude/sharp-dirac-trd3lt

Conversation

@Thoralf-M

@Thoralf-M Thoralf-M commented Jun 9, 2026

Copy link
Copy Markdown
Member

Removes the deprecated ZkLoginAuthenticatorDeprecated variant from the public UserSignature and SignatureScheme enums (and the FFI mirror). Follow-up to #1076.

Neither enum is serialized by variant index — UserSignature uses a custom flag-byte encoding, SignatureScheme an explicit #[repr(u8)] — so this changes no BCS bytes for any supported signature; 0x05 is now a reserved/rejected flag. The index-locked placeholders (BinaryPublicKey, MemberSignature, TransactionKind) are deliberately kept, since removing those would shift the on-chain wire format.

Tests: added hardcoded-tag anchors (round-trips can't catch a discriminant shift): signature_scheme_flag_values pins every flag byte and that 0x05 is rejected; user_signature_rejects_zklogin_flag; member_signature_bcs_tags pins the multisig member tags (passkey = 0x04).

https://claude.ai/code/session_01GKkvevz4vSZike1ryqCQMz

Drop ZkLoginAuthenticatorDeprecated from the public UserSignature and
SignatureScheme enums. Neither is serialized by variant index
(UserSignature uses a custom flag-byte encoding, SignatureScheme uses an
explicit #[repr(u8)]), so removing them does not shift any BCS
discriminants and needs no serde-specific placeholder.

The 0x05 flag is left documented as reserved. The index-locked
placeholders on the private BinaryPublicKey / MemberSignature serde
structs are kept, since removing those would shift the on-chain wire
format.

https://claude.ai/code/session_01GKkvevz4vSZike1ryqCQMz
@Thoralf-M Thoralf-M marked this pull request as ready for review June 9, 2026 08:28
@Thoralf-M Thoralf-M requested a review from a team as a code owner June 9, 2026 08:28
@Thoralf-M Thoralf-M linked an issue Jun 9, 2026 that may be closed by this pull request
@Thoralf-M Thoralf-M marked this pull request as draft June 9, 2026 08:33
claude and others added 2 commits June 9, 2026 08:39
Round-trip tests can't catch a shifted discriminant (encode and decode
move together), so add hardcoded-value anchors:

- signature_scheme_flag_values: pins every SignatureScheme flag byte and
  asserts the reserved 0x05 (zklogin) is rejected.
- user_signature_rejects_zklogin_flag: a bare 0x05 flag must no longer
  decode.
- member_signature_bcs_tags: pins the multisig MemberSignature tags,
  guarding the retained ZkLoginDeprecated placeholder that keeps Passkey
  at tag 0x04.

https://claude.ai/code/session_01GKkvevz4vSZike1ryqCQMz
@Thoralf-M Thoralf-M marked this pull request as ready for review June 9, 2026 08:44
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.

Can we remove ZkLogin from public enums?

2 participants