Skip to content

[Bug]: protocolpool create-continuous-pool panics #20935

@JulianToledano

Description

@JulianToledano

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When calling create-continuous-fund with a percentage expressed as a float, the command panics.

As I understand, auto-cli generates dynamicpb messages using protoreflect message Descriptor() and Interface(). In the case of MsgCreateContinuousFund, the percentage is set as a human-readable number.

Screenshot 2024-07-11 at 10 39 02

Thus, it fails when decoding, as the unmarshalling of LegacyDec expects a machine representation of the floating-point number.

if err := m.Percentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}

panic: math/big: cannot unmarshal "0.1" into a *big.Int

goroutine 1 [running]:
cosmossdk.io/x/auth/tx.(*builder).GetTx(0x1400157a240)
        /Users/user/github.com/cosmos/cosmos-sdk/x/auth/tx/builder.go:99 +0xd8
github.com/cosmos/cosmos-sdk/client/tx.BroadcastTx({{0x1055f12e8, 0x140013b5650}, 0x0, {0x14001041b08, 0x4}, {0x10560dca8, 0x14000e37150}, {0x1055edf40, 0x14000d67040}, {0x105595da0, ...}, ...}, ...)
        /Users/user/github.com/cosmos/cosmos-sdk/client/tx/tx.go:108 +0x510
github.com/cosmos/cosmos-sdk/client/tx.GenerateOrBroadcastTxWithFactory({{0x1055f12e8, 0x140013b5650}, 0x0, {0x14001041b08, 0x4}, {0x10560dca8, 0x14000e37150}, {0x1055edf40, 0x14000d67040}, {0x105595da0, ...}, ...}, ...)
        /Users/user/github.com/cosmos/cosmos-sdk/client/tx/tx.go:67 +0x448
github.com/cosmos/cosmos-sdk/client/tx.GenerateOrBroadcastTxCLI({{0x1055f12e8, 0x140013b5650}, 0x0, {0x14001041b08, 0x4}, {0x10560dca8, 0x14000e37150}, {0x1055edf40, 0x14000d67040}, {0x105595da0, ...}, ...}, ...)
        /Users/user/github.com/cosmos/cosmos-sdk/client/tx/tx.go:32 +0x180
cosmossdk.io/client/v2/autocli.(*Builder).handleGovProposal(_, _, {_, _}, {{0x1055f12e8, 0x140013b5650}, 0x0, {0x14001041b08, 0x4}, {0x10560dca8, ...}, ...}, ...)
        /Users/user/github.com/cosmos/cosmos-sdk/client/v2/autocli/msg.go:227 +0x724
cosmossdk.io/client/v2/autocli.(*Builder).BuildMsgMethodCommand.func1(0x14001355808, {0x1056051c8, 0x140013ae8a0})
        /Users/user/github.com/cosmos/cosmos-sdk/client/v2/autocli/msg.go:136 +0x30c
cosmossdk.io/client/v2/autocli.(*Builder).buildMethodCommandCommon.func1(0x14001355808, {0x14000e90080, 0x2, 0x8})
        /Users/user/github.com/cosmos/cosmos-sdk/client/v2/autocli/common.go:97 +0x3dc
github.com/spf13/cobra.(*Command).execute(0x14001355808, {0x14000e90000, 0x8, 0x8})
        /Users/user/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:985 +0xbd8
github.com/spf13/cobra.(*Command).ExecuteC(0x14000eb6f08)
        /Users/user/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1117 +0x7d0
github.com/spf13/cobra.(*Command).Execute(0x14000eb6f08)
        /Users/user/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1041 +0x30
github.com/spf13/cobra.(*Command).ExecuteContext(0x14000eb6f08, {0x1055d12c8, 0x140013b4e70})
        /Users/user/go/pkg/mod/github.com/spf13/cobra@v1.8.1/command.go:1034 +0x70
github.com/cosmos/cosmos-sdk/server/cmd.Execute(0x14000eb6f08, {0x0, 0x0}, {0x14001029350, 0x21})
        /Users/user/github.com/cosmos/cosmos-sdk/server/cmd/execute.go:40 +0x2ac
main.main()
        /Users/user/github.com/cosmos/cosmos-sdk/simapp/simd/main.go:15 +0x40
Exiting.

Cosmos SDK Version

main

How to reproduce?

./simd tx protocolpool create-continuous-fund cosmos18mfx85veapt3xs0vdr2cx9skeregs9sqawku8f 0.1 --summary test --title test --deposit 100000stake

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions