Skip to content
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

Osmosis: Unable to query MsgCreatePool transaction #17

Open
itsciccio opened this issue Apr 19, 2024 · 3 comments
Open

Osmosis: Unable to query MsgCreatePool transaction #17

itsciccio opened this issue Apr 19, 2024 · 3 comments

Comments

@itsciccio
Copy link

Using main.go, I am trying to query block 3513 from an Osmosis Archive Node. Although I am able to retrieve the block, I am unable to retrieve the transactions with the following error message:

rpc error: code = Unknown desc = unable to resolve type URL /osmosis.gamm.v1beta1.MsgCreatePool: tx parse error: unknown request

I have also attempted to add the following lines to the MakeCodec function, with the hopes of the system being able to recognize the MsgCreatePool transaction, however had no luck:

func MakeCodec(moduleBasics []module.AppModuleBasic) Codec {
	modBasic := module.NewBasicManager(moduleBasics...)
	encodingConfig := MakeCodecConfig()
	std.RegisterLegacyAminoCodec(encodingConfig.Amino)
	std.RegisterInterfaces(encodingConfig.InterfaceRegistry)
	modBasic.RegisterLegacyAminoCodec(encodingConfig.Amino)
	modBasic.RegisterInterfaces(encodingConfig.InterfaceRegistry)
 --->   RegisterOsmosisInterfaces(encodingConfig.InterfaceRegistry)
 --->   RegisterTendermintLiquidityInterfaces(encodingConfig.Amino, encodingConfig.InterfaceRegistry)

	return encodingConfig
}

Is there something I am doing incorrectly, or is this a bug?

NB: Querying other blocks not containing this transaction type works as intended.

TIA

@pharr117
Copy link
Collaborator

pharr117 commented May 6, 2024

@itsciccio

This could be 1 of 2 possible issues:

  1. This is an error on the RPC server indicating that the Node could not decode the underlying type in its own database. This is a known problem with Osmosis RPC archive servers. They had deprecated an old message type without keeping the underlying type in their codebase, (see here for details Removed / missing MsgCreatePool (v7) osmosis-labs/osmosis#1017)
  2. This is an error during codec decoding of the RPC response where probe is missing the correct type

I will test this out myself to see if its possible to query it from probe.

@itsciccio
Copy link
Author

itsciccio commented May 8, 2024

Thanks for the reply @pharr117. Let me know of any updates on the matter. I probably think its a node issue due to a deprecating change.

However, I also noticed that I was unable to fetch a few Osmosis blocks, for example 551165, as probe was unable to retrieve the block results for the block.

Got status, some data follows:
Node moniker: Simply Staking: Archive Node NL
Got block, some data follows:
Height: 551165
Error getting block results
error in json rpc client, with http response metadata: (Status: 200 OK, Protocol HTTP/1.1). Failed to read response body: unexpected EOF

Highly unlikely it is probe-related, as it is probably once again due to node versioning problems. However if you do get the chance to try querying it, would be appreciated also.

@pharr117
Copy link
Collaborator

pharr117 commented May 8, 2024

@itsciccio
A few things to note on Probe that I feel may block you later on down the road:

  1. Cosmos RPC querying for transactions/messages is entirely dependent on the Codecs you bring into the registry.
  2. If you dig into the Codecs Probe includes, you will see its VERY limited. The lift to bring the entire Osmosis message Codec is very high and prone to error as they deprecate changes.
    • Its a manually intensive process to bring the proto definitions, run buf generation on them and ensure the message types satisfy the Message interface, then get them included in the InterfaceRegistry

Defiant's Osmosis-specific solution to this was to:

  1. Fork the Lens package, which is what Probe is based off of
  2. Rework the entire package to use the exact Cosmos SDK versions/deps that Osmosis uses
  3. Include all Osmosis modules in the Codec AppModuleBasic by default
  4. Fix random one off bugs in missing Codecs as we found them
  5. Continue to update the codebase as Osmosis updates https://github.com/DefiantLabs/lens/branches/all?query=v0.0.

This gets around Codec issues, but is Osmosis-specific in that:

  1. You are tied to Osmosis' version of the Cosmos SDK which they forked
  2. You cannot bring any other Codecs in from non-Osmosis chains that rely on other Cosmos SDK versions

Both methods are pretty brittle and hard to maintain, but we found success in both.

tl;dr

What you may be looking for is the Defiant Lens fork branch v0.0.19-dl

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

No branches or pull requests

2 participants