fix: normalize signer_key 0x prefix in signer stackers lookup#2451
Open
the-fixr wants to merge 1 commit intohirosystems:developfrom
Open
fix: normalize signer_key 0x prefix in signer stackers lookup#2451the-fixr wants to merge 1 commit intohirosystems:developfrom
the-fixr wants to merge 1 commit intohirosystems:developfrom
Conversation
The `getPoxCycleSignerStackers` method normalizes `args.signer_key` to include the `0x` prefix (line 891) but the signer existence check on line 901 used the raw `args.signer_key` instead of the normalized `signerKey` variable. This caused lookups to fail when users omitted the `0x` prefix, since `signing_key` values in `pox_sets` are stored with the prefix. Fixes hirosystems#2009
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.
Summary
getPoxCycleSignerStackersmethod correctly normalizessigner_keyto include the0xprefix (viahas0xPrefix) but the signer existence check on line 901 used the rawargs.signer_keyinstead of the normalizedsignerKeyvariable/v2/pox/cycles/{cycle_number}/signers/{signer_key}/stackersendpoint to return a404 PoX cycle signer not founderror when a user queried without the0xprefix, even though the main query (line 968) correctly used the normalized variableThe fix is a one-line change: use
signerKey(already normalized on line 891) instead ofargs.signer_keyin the existence check query.Test plan
/v2/pox/cycles/{N}/signers/{key}/stackerswith0x-prefixed key — should return results (no change)0xprefix — should now return results instead of 404Fixes #2009