forked from hyperliquid-dex/hyperliquid-rust-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Multi sig fixes #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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
This reverts commit 7b7b4ec.
…not serialize package outer_signer and payload_multi_sig_user in MultiSigExtension
This reverts commit 9145271.
This reverts commit d1fe9e2.
This reverts commit 4451ce2.
This reverts commit 3b03853.
This reverts commit 5d81c38.
This causes issues especially with message packing multi-sig transaction
when for example a serde Value with a number will look like this when packed:
`0x83b07369676e6174757265436861696e4964a3307831aa7369676e6174757265739183a172d942307864623433373135643037383931613063363361383937376139393534646332346664326663363063373436643734353566363133326236396163396665393734a173d942307832386236323363376364643563383230643461663832326634323336623361663361613063373938653736396235353031613331323162343634623761353835a17681bc2473657264655f6a736f6e3a3a707269766174653a3a4e756d626572a23238a77061796c6f616483ac6d756c746953696755736572d92a307832623339633062636664343763356132376636333766383832303661666239356637616661323838ab6f757465725369676e6572d92a307862373131613133636261663734316138383263373230623433363861346566323661346631613632a6616374696f6e8aa474797065a973656e644173736574b07369676e6174757265436861696e4964a730783636656565b068797065726c6971756964436861696ea7546573746e6574ab64657374696e6174696f6ed92a307836643938383538373139363035643332366664633136343839363737333432343462323762386133a9736f75726365446578a0ae64657374696e6174696f6e446578a0a5746f6b656ea455534443a6616d6f756e74a4302e3031ae66726f6d5375624163636f756e74a0a56e6f6e636581bc2473657264655f6a736f6e3a3a707269766174653a3a4e756d626572ad31373632383338313437303030`
```
{
"signatureChainId": "0x1",
"signatures": [
{
"r": "0xdb43715d07891a0c63a8977a9954dc24fd2fc60c746d7455f6132b69ac9fe974",
"s": "0x28b623c7cdd5c820d4af822f4236b3af3aa0c798e769b5501a3121b464b7a585",
"v": {
"$serde_json::private::Number": "28"
}
}
],
"payload": {
"multiSigUser": "0x2b39c0bcfd47c5a27f637f88206afb95f7afa288",
"outerSigner": "0xb711a13cbaf741a882c720b4368a4ef26a4f1a62",
"action": {
"type": "sendAsset",
"signatureChainId": "0x66eee",
"hyperliquidChain": "Testnet",
"destination": "0x6d98858719605d326fdc1648967734244b27b8a3",
"sourceDex": "",
"destinationDex": "",
"token": "USDC",
"amount": "0.01",
"fromSubAccount": "",
"nonce": {
"$serde_json::private::Number": "1762838147000"
}
}
}
}
```
This reverts commit b79d86a.
This reverts commit c660e12.
This reverts commit 700679d.
This reverts commit 5ef467f.
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.
There's a bunch of issues with this. serde_json::Value doesn't preserving order when you remove from it (even if you add the preserve_order feature, and mp_serde::to_vec_named doesn't know what data type to use for the int when packing so it encodes information about serde in the msgpack. Also just manipulating the json value like that is just pretty jenky.
For example a serde Value with a number will look like this when packed:
0x83b07369676e6174757265436861696e4964a3307831aa7369676e6174757265739183a172d942307864623433373135643037383931613063363361383937376139393534646332346664326663363063373436643734353566363133326236396163396665393734a173d942307832386236323363376364643563383230643461663832326634323336623361663361613063373938653736396235353031613331323162343634623761353835a17681bc2473657264655f6a736f6e3a3a707269766174653a3a4e756d626572a23238a77061796c6f616483ac6d756c746953696755736572d92a307832623339633062636664343763356132376636333766383832303661666239356637616661323838ab6f757465725369676e6572d92a307862373131613133636261663734316138383263373230623433363861346566323661346631613632a6616374696f6e8aa474797065a973656e644173736574b07369676e6174757265436861696e4964a730783636656565b068797065726c6971756964436861696ea7546573746e6574ab64657374696e6174696f6ed92a307836643938383538373139363035643332366664633136343839363737333432343462323762386133a9736f75726365446578a0ae64657374696e6174696f6e446578a0a5746f6b656ea455534443a6616d6f756e74a4302e3031ae66726f6d5375624163636f756e74a0a56e6f6e636581bc2473657264655f6a736f6e3a3a707269766174653a3a4e756d626572ad31373632383338313437303030I refactored a lot of stuff to do it properly with the
ActionsEnum and other types without having to resort to Value.Send asset actually works now!