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

fix(cmd): Don't crash when paratime tx submitted without paratime set #64

Merged
merged 1 commit into from May 8, 2023

Conversation

kostko
Copy link
Member

@kostko kostko commented Apr 24, 2023

Fixes #62

@kostko kostko requested a review from matevz April 24, 2023 09:31
@kostko kostko enabled auto-merge April 24, 2023 09:31
@matevz
Copy link
Member

matevz commented Apr 27, 2023

Using 6dbb2a5 I'm getting a similar crash for tx show. This may require a fix in oasis-sdk :/

oasis tx show testtx2.json --network mainnet  --no-paratime
Hash: 3013be1ba6e1ef17921382f01b53f519174b2f35753d1fc37ad11bfc382f51f5
Signer(s):
  1. NcPzNW3YU2T+ugNUtUWtoQnRvbOL9dYSaBfbjHLP1pE=
     (signature: mxOARaaRkHrHiUObGO2KbUXZhmbIS2h3hsRM+3Y/DzvMtbVdwcZm2EZ7oP7dR5XHKkrQnjMwZnkT0mdZUsLIBw==)
     [INVALID SIGNATURE]
Content:
  Format: plain
  Method: accounts.Transfer
  Body:
    To: test:bob (oasis1qrydpazemvuwtnp3efm7vmfvg3tde044qg6cxwzx)
    Amount: panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xafb0b4]

goroutine 1 [running]:
github.com/oasisprotocol/oasis-sdk/client-sdk/go/config.(*ParaTime).GetDenominationInfo(...)
        /home/oa/go/pkg/mod/github.com/oasisprotocol/oasis-sdk/client-sdk/go@v0.4.0/config/paratime.go:157
github.com/oasisprotocol/oasis-sdk/client-sdk/go/types.(*BaseUnits).PrettyPrint(0xc0001b56f0, {0x13f9040?, 0xc0001ee600?}, {0xa?, 0xc0001b56b0?}, {0x13f1520, 0xc000014018})
        /home/oa/go/pkg/mod/github.com/oasisprotocol/oasis-sdk/client-sdk/go@v0.4.0/types/token.go:73 +0x94
github.com/oasisprotocol/oasis-sdk/client-sdk/go/types.PrettyPrintToAmount({0x13f9040, 0xc0001ee600}, {0xc00003bd30, 0x4}, {0x13f1520, 0xc000014018}, 0xc0000a4050?, {{}, {{0x0, {0xc00003bd28, ...}}}, ...})
        /home/oa/go/pkg/mod/github.com/oasisprotocol/oasis-sdk/client-sdk/go@v0.4.0/types/token.go:104 +0x318
github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules/accounts.(*Transfer).PrettyPrint(0x13f1520?, {0x13f9040?, 0xc0001ee600?}, {0xc00003bd30?, 0xc0001b5878?}, {0x13f1520?, 0xc000014018?})
        /home/oa/go/pkg/mod/github.com/oasisprotocol/oasis-sdk/client-sdk/go@v0.4.0/modules/accounts/types.go:18 +0xab
github.com/oasisprotocol/oasis-sdk/client-sdk/go/types.(*PrettyTransaction).PrettyPrint(0xc000194640, {0x13f9040, 0xc0001ee600}, {0x10717ae, 0x2}, {0x13f1520, 0xc000014018})
        /home/oa/go/pkg/mod/github.com/oasisprotocol/oasis-sdk/client-sdk/go@v0.4.0/types/transaction.go:523 +0x29e
github.com/oasisprotocol/oasis-sdk/client-sdk/go/types.(*Transaction).PrettyPrint(0x13f1520?, {0x13f9040, 0xc0001ee600}, {0x10717ae, 0x2}, {0x13f1520, 0xc000014018})
        /home/oa/go/pkg/mod/github.com/oasisprotocol/oasis-sdk/client-sdk/go@v0.4.0/types/transaction.go:265 +0x13a
github.com/oasisprotocol/oasis-sdk/client-sdk/go/types.(*UnverifiedTransaction).PrettyPrint(0xc0001ee360, {0x13f9040, 0xc0001ee600}, {0x0, 0x0}, {0x13f1520, 0xc000014018})
        /home/oa/go/pkg/mod/github.com/oasisprotocol/oasis-sdk/client-sdk/go@v0.4.0/types/transaction.go:135 +0xbc5
github.com/oasisprotocol/cli/cmd/common.PrintTransaction(0xc00012d7c0, {0xf74340?, 0xc0001ee360})
        /home/oa/cli/cmd/common/transaction.go:296 +0x39f
github.com/oasisprotocol/cli/cmd.glob..func41(0x1a9f120?, {0xc00009b7c0, 0x1, 0x4?})
        /home/oa/cli/cmd/tx.go:85 +0xbb
github.com/spf13/cobra.(*Command).execute(0x1a9f120, {0xc00009b740, 0x4, 0x4})
        /home/oa/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:944 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0x1a9e880)
        /home/oa/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /home/oa/go/pkg/mod/github.com/spf13/cobra@v1.7.0/command.go:992
github.com/oasisprotocol/cli/cmd.Execute(...)
        /home/oa/cli/cmd/root.go:36
main.main()
        /home/oa/cli/main.go:6 +0x25

@kostko
Copy link
Member Author

kostko commented May 8, 2023

@matevz, it should be fixed now.

Copy link
Member

@matevz matevz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, works :shipit:

@kostko kostko merged commit 775853a into master May 8, 2023
2 checks passed
@kostko kostko deleted the kostko/fix/issue-62 branch May 8, 2023 19:21
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

Successfully merging this pull request may close these issues.

Crash when sending ParaTime transaction to consensus
2 participants