Skip to content

feat(keychain): verify signature type matches key_type during validation#2178

Merged
fgimenez merged 3 commits intomainfrom
fgimenez/zellic-20
Jan 21, 2026
Merged

feat(keychain): verify signature type matches key_type during validation#2178
fgimenez merged 3 commits intomainfrom
fgimenez/zellic-20

Conversation

@fgimenez
Copy link
Copy Markdown
Member

Closes ZELLIC-20

Adds validation to ensure the signature type used in a keychain transaction matches the key_type stored when the key was authorized. Introduces SignatureTypeMismatch error and extends validate_keychain_authorization to check signature types.

@fgimenez fgimenez added the C-Bug An unexpected or incorrect behavior label Jan 20, 2026
@fgimenez fgimenez requested a review from klkvr as a code owner January 20, 2026 14:00
@fgimenez fgimenez added the A-evm Related to the EVM label Jan 20, 2026
@fgimenez fgimenez added this pull request to the merge queue Jan 21, 2026
Merged via the queue into main with commit 5b38992 Jan 21, 2026
18 checks passed
@fgimenez fgimenez deleted the fgimenez/zellic-20 branch January 21, 2026 11:20
gakonst added a commit that referenced this pull request Jan 28, 2026
The signature type validation added in #2178 (ZELLIC-20) was not gated
behind the T1 hardfork, causing re-execution of historical blocks to fail
with KeyNotFound errors. This is because the new validation requires
signature types to match key types stored in the keychain, but this check
should only apply to blocks after the T1 hardfork.

This fix makes the expected_sig_type parameter optional in
validate_keychain_authorization. When None is passed (pre-T1), the
signature type check is skipped. The handler now only passes the signature
type when T1 is active.

Fixes re-execution failure on moderato testnet.

Amp-Thread-ID: https://ampcode.com/threads/T-019c0591-24ab-74a9-80a9-42b1ddccc652
Co-authored-by: Amp <amp@ampcode.com>
github-merge-queue Bot pushed a commit that referenced this pull request Jan 28, 2026
## Summary
The signature type validation added in #2178 (ZELLIC-20) was not gated
behind the T1 hardfork, causing re-execution of historical blocks to
fail with `KeyNotFound` errors on moderato testnet.

## Root Cause
The new validation requires signature types to match key types stored in
the keychain, but this check was being applied to all blocks including
those mined before T1, which causes re-execution to fail.

## Fix
- Made `expected_sig_type` parameter optional (`Option<u8>`) in
`validate_keychain_authorization`
- When `None` is passed (pre-T1 blocks), the signature type check is
skipped
- The handler now only passes the signature type when `spec.is_t1()` is
active

## Testing
- Added test case for backward compatibility (passing `None` should
succeed)
- Verified all existing tests pass

## Related
- Addresses issue discovered during moderato snapshot re-execution
- Related Slack thread:
https://tempoxyz.slack.com/archives/C09KCGR4LQ4/p1769610185555929

---------

Co-authored-by: Amp <amp@ampcode.com>
Co-authored-by: 0xKitsune <77890308+0xKitsune@users.noreply.github.com>
Co-authored-by: 0xkitsune <0xkitsune@protonmail.com>
Co-authored-by: 0xrusowsky <90208954+0xrusowsky@users.noreply.github.com>
Co-authored-by: 0xrusowsky <0xrusowsky@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-evm Related to the EVM C-Bug An unexpected or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants