Skip to content

fix(signing): enable compact ints in msgpack encoder - #20

Merged
sonirico merged 1 commit into
sonirico:masterfrom
terwey:fix/actionhash
Aug 14, 2025
Merged

fix(signing): enable compact ints in msgpack encoder#20
sonirico merged 1 commit into
sonirico:masterfrom
terwey:fix/actionhash

Conversation

@terwey

@terwey terwey commented Aug 14, 2025

Copy link
Copy Markdown
Contributor

Small PR but big impact, this bubbled up as I was writing unit tests for Cancel as proposed in #18.

I for the life of me could not get a single Cancel out there, eventually I decided to compare the hex dumps of what Python packs and what Go packs and noticed a difference in the integer sizes. There was a suspicion but wasn't sure.

I decided to split it off as I want to do a proper code revert tomorrow (I tried a lot) to see what is really required and not. But this is for now a big one we need to match!

Hyperliquid’s backend (and the official Python SDK) serialise all small integers using msgpack’s compact-int formats (uint8/uint16/uint32/uint64). Our Go signer always emitted the int64 tag (0xd3), which changed the bytes that are hashed and caused cancel / modify signatures to recover an invalid wallet address (“User or API Wallet … does not exist.”).

Hyperliquid’s backend (and the official Python SDK) serialise all small
integers using msgpack’s compact-int formats (uint8/uint16/uint32/uint64).
Our Go signer always emitted the int64 tag (0xd3), which changed the
bytes that are hashed and caused cancel / modify signatures to recover
an invalid wallet address (“User or API Wallet … does not exist.”).
@sonirico
sonirico marked this pull request as ready for review August 14, 2025 11:28
@sonirico

Copy link
Copy Markdown
Owner

This is a big one. I personally consume public / historical data APIs and websocket feeds so I implemented authenticated endpoints just for completeness, so this completely passed by inadvertently. Thanks!

(Merging it out in spite of failed CI, seems like coveralls is down).

@sonirico
sonirico merged commit fe48a0f into sonirico:master Aug 14, 2025
2 of 8 checks passed
@terwey

terwey commented Aug 14, 2025

Copy link
Copy Markdown
Contributor Author

@sonirico all good, I mostly need the place order and cancel order endpoints. But before I integrate I want to ensure they're rock solid and don't accidentally bankrupt my user 😄

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.

2 participants