feat(keychain): verify signature type matches key_type during validation#2178
Merged
feat(keychain): verify signature type matches key_type during validation#2178
Conversation
74410ff to
8548d21
Compare
0xrusowsky
approved these changes
Jan 21, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes ZELLIC-20
Adds validation to ensure the signature type used in a keychain transaction matches the
key_typestored when the key was authorized. IntroducesSignatureTypeMismatcherror and extendsvalidate_keychain_authorizationto check signature types.