Repository navigation
fix: lowercase checksummed addresses in transfer actions - #343
Open
saravanan619 wants to merge 2 commits into
Open
saravanan619 wants to merge 2 commits into
saravanan619 wants to merge 2 commits into
Conversation
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.
Bug
The node lowercases embedded address strings before computing the L1 action hash, but
vault_usd_transfer,sub_account_transferandsub_account_spot_transfersigned the address exactly as passed. Sinceeth_accountreturns checksummed addresses by default, the natural call pattern — e.g.ex.vault_usd_transfer(checksummed_vault, ...)— produced a signature the node rejects, surfacing as a confusing"User or API Wallet <garbage> does not exist"error. No funds move; the call simply fails.Fix
Lowercase the address argument in the signed action of all three methods (
vaultAddress/subAccountUser), matching the existing convention inspot_deploy_user_genesis/spot_deploy_freeze_user, which already call.lower()on addresses.Tests
Added 3 regression tests in
tests/signing_test.pythat call the Exchange methods with checksummed addresses (stubbed_post_action, no network) and assert:tokenis untouched in the spot transfer), andrecover_agent_or_user_from_l1_action.Verified red-then-green: the 3 new tests fail on unpatched code (recovered address is garbage) and pass after the fix. Full suite:
tests/signing_test.py16 passed.tests/info_test.pyhas 7 pre-existing failures on the clean tree too (stale cassettes / live API drift), unrelated to this change. Black + flake8 clean.Fixes #339