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

finality_provider_info returns response even if the fp doesn't exist #68

Closed
gusin13 opened this issue Sep 20, 2024 · 2 comments
Closed

Comments

@gusin13
Copy link
Collaborator

gusin13 commented Sep 20, 2024

One of the FP's below doesn't exist in contract storage but I think contract should return an error instead of success response if FP is not existing in storage.

root@11ff6ff54ba4:/ibcsim-bcd# bcd  q wasm contract-state smart bbnc1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqgn0kq0 '{"finality_provider_info": {"btc_pk_hex":"1eac9bca6174365dec6a814edc588de407364dbad6260babe8dcface7c3448d8"}}'
data:
  btc_pk_hex: 1eac9bca6174365dec6a814edc588de407364dbad6260babe8dcface7c3448d8
  power: 0

root@11ff6ff54ba4:/ibcsim-bcd# bcd  q wasm contract-state smart bbnc1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqgn0kq0 '{"finality_provider_info": {"btc_pk_hex":"4dada33478a8341c11082ce264a007335d530695e41bf5ddb35ba9e529311887"}}'
data:
  btc_pk_hex: 4dada33478a8341c11082ce264a007335d530695e41bf5ddb35ba9e529311887
  power: 0
@gusin13
Copy link
Collaborator Author

gusin13 commented Sep 20, 2024

for example this is what babylond returns when a FP doesn't exist

root@4d576afaeb0b:/# babylond q btcstaking finality-provider-power-at-height 1eac9bca6174365dec6a814edc588de407364dbad6260babe8dcface7c3448d8 198
Error: rpc error: code = Unknown desc =
github.com/cosmos/cosmos-sdk/baseapp.gRPCErrorToSDKError
	github.com/cosmos/cosmos-sdk@v0.50.7/baseapp/abci.go:1169
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).handleQueryGRPC
	github.com/cosmos/cosmos-sdk@v0.50.7/baseapp/abci.go:1141
github.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).Query
	github.com/cosmos/cosmos-sdk@v0.50.7/baseapp/abci.go:177
github.com/cosmos/cosmos-sdk/server.cometABCIWrapper.Query
	github.com/cosmos/cosmos-sdk@v0.50.7/server/cmt_abci.go:24
github.com/cometbft/cometbft/abci/client.(*localClient).Query
	github.com/cometbft/cometbft@v0.38.7/abci/client/local_client.go:106
github.com/cometbft/cometbft/proxy.(*appConnQuery).Query
	github.com/cometbft/cometbft@v0.38.7/proxy/app_conn.go:181
github.com/cometbft/cometbft/rpc/core.(*Environment).ABCIQuery
	github.com/cometbft/cometbft@v0.38.7/rpc/core/abci.go:22
reflect.Value.call
	reflect/value.go:596
reflect.Value.Call
	reflect/value.go:380
github.com/cometbft/cometbft/rpc/jsonrpc/server.RegisterRPCFuncs.makeJSONRPCHandler.func3
	github.com/cometbft/cometbft@v0.38.7/rpc/jsonrpc/server/http_json_handler.go:108
github.com/cometbft/cometbft/rpc/jsonrpc/server.RegisterRPCFuncs.handleInvalidJSONRPCPaths.func4
	github.com/cometbft/cometbft@v0.38.7/rpc/jsonrpc/server/http_json_handler.go:140
net/http.HandlerFunc.ServeHTTP
	net/http/server.go:2171
net/http.(*ServeMux).ServeHTTP
	net/http/server.go:2688
github.com/cometbft/cometbft/node.(*Node).startRPC.(*Cors).Handler.func9
	github.com/rs/cors@v1.8.3/cors.go:236
net/http.HandlerFunc.ServeHTTP
	net/http/server.go:2171
github.com/cometbft/cometbft/rpc/jsonrpc/server.maxBytesHandler.ServeHTTP
	github.com/cometbft/cometbft@v0.38.7/rpc/jsonrpc/server/http_server.go:256
github.com/cometbft/cometbft/rpc/jsonrpc/server.Serve.RecoverAndLogHandler.func1
	github.com/cometbft/cometbft@v0.38.7/rpc/jsonrpc/server/http_server.go:229
net/http.HandlerFunc.ServeHTTP
	net/http/server.go:2171
net/http.serverHandler.ServeHTTP
	net/http/server.go:3142
net/http.(*conn).serve
	net/http/server.go:2044
the finality provider is not found: unknown request
Usage:
  babylond query btcstaking finality-provider-power-at-height [fp_btc_pk_hex] [height] [flags]

@maurolacy
Copy link
Collaborator

Fixed by #71.

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