-
Notifications
You must be signed in to change notification settings - Fork 224
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
tx
method on the rpc client fails with InvalidParams error
#942
Comments
Edit: sorry about my previous response, I was mistaken. I managed to reproduce this with gaiad:
|
Also managed to reproduce with Tendermint running the kvstore now. It looks like a difference between how the hash deserialization's handled through the simple HTTP GET interface and the JSON-RPC (POST) interface (we use the JSON-RPC interface from tendermint-rs). I've tested a base64-encoded transaction hash and it works, but hexadecimal encoding doesn't. The Tendermint RPC docs for It seems like the HTTP URL client (like when you send GET requests using curl) has its own serialization approach. See here. The POST interface, which expects JSON-RPC messages, is dynamically constructed using reflection in Go. See here. This autodetects the method argument types and applies the relevant deserialization strategy to it (which I assume for Will log an issue with the Tendermint team about this to ask about what to do here. Ideally we'd want the format to be consistent, but if we need to cater for base64 encoding here for now then so be it. |
tendermint/tendermint#6802 includes information on how to reproduce this locally without our API in the way. |
I'm going to implement the base64 encoding here instead of hexadecimal encoding. Will submit a PR soon! |
@jstuczyn, with regard to the |
Yeah, as I said in my description |
Ah sorry! I missed that somehow 😁 Well, now we have an integration test that ensures the serialization format we use for an Once #948's merged, there are some other changes we need to implement in the next week or so and then we'll aim to cut a new release. |
- Add base64 `tendermint::hash::Hash` encoding/decoding support - Add base64 `Option<tendermint::hash::Hash>` encoding/decoding support - Add missing `FromStr` import - Rename `hash_base64` serializer to `tx_hash_base64` Relates informalsystems#942 Links informalsystems#832
* Add block_by_hash RPC endpoint and tests Signed-off-by: Felix C. Morency <[email protected]> * rpc-probe part of this Signed-off-by: Felix C. Morency <[email protected]> * Fix comments Signed-off-by: Felix C. Morency <[email protected]> * Update .changelog/unreleased/features/832-block-by-hash.md Co-authored-by: Thane Thomson <[email protected]> Signed-off-by: Felix C. Morency <[email protected]> * cargo fmt Signed-off-by: Felix C. Morency <[email protected]> * cargo fmt * Fix TM hash encoding - Add base64 `tendermint::hash::Hash` encoding/decoding support - Add base64 `Option<tendermint::hash::Hash>` encoding/decoding support - Add missing `FromStr` import - Rename `hash_base64` serializer to `tx_hash_base64` Relates #942 Links #832 * Fix outgoing kvstore `block_by_hash` fixture * Fix clippy Signed-off-by: Felix C. Morency <[email protected]> Co-authored-by: Hans Larsen <[email protected]> Co-authored-by: Thane Thomson <[email protected]>
Hi! I've been trying to use the rpc client to search for transaction details by its hash (using the
tx
method), unfortunately it's been failing for me with the following error:In my tests I have used
tendermint-rpc 0.21.0
run againstwasmd 0.17
(https://github.com/CosmWasm/wasmd) based validators which under the hood usecosmos-sdk 0.42.5
.Steps to reproduce
Start up a local (or could be remote for all it matters, I've checked it against both live and local instances) validator.
Run the following piece of code:
2.1. If you prefer to use the same environment in which it failed for me, the following live validator can also be used:
Note: I'm certain the block with the used hash exists as
curl http://127.0.0.1:26657/tx\?hash\=0xD716F496764E6D9D24DDCB55841D6E5226261106BFAA4EE31DAC5258DE60B62A
returns the relevant data. I'm including the response so that perhaps you might be able to spot invalid characters there or something:Also
tx_search
does work. For context, the code I've used fortx_search
is as follows:The text was updated successfully, but these errors were encountered: