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

Can not pipe password to eigenlayer operator keys create --key-type ecdsa test #30

Closed
coolsnake opened this issue Jan 4, 2024 · 2 comments · Fixed by #57
Closed

Can not pipe password to eigenlayer operator keys create --key-type ecdsa test #30

coolsnake opened this issue Jan 4, 2024 · 2 comments · Fixed by #57
Labels
bug Something isn't working

Comments

@coolsnake
Copy link

coolsnake commented Jan 4, 2024

Describe the bug

I am going to use pipe to input password when I execute "eigenlayer operator keys create --key-type ecdsa test". However, I got an exeception as following:
? Enter password to encrypt the ecdsa private key: panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x81456b]

goroutine 1 [running]:
github.com/AlecAivazis/survey/v2/terminal.(*RuneReader).ReadLineWithDefault.func2(...)
/home/runner/go/pkg/mod/github.com/!alec!aivazis/survey/[email protected]/terminal/runereader.go:65
github.com/AlecAivazis/survey/v2/terminal.(*RuneReader).ReadLineWithDefault(0xc0000c4380, 0x120018?, {0x1181ea0, 0x0, 0x0}, {0x0?, 0x7fdebc1b0108?, 0x50?})
/home/runner/go/pkg/mod/github.com/!alec!aivazis/survey/[email protected]/terminal/runereader.go:328 +0x8ab
github.com/AlecAivazis/survey/v2/terminal.(*RuneReader).ReadLine(...)
/home/runner/go/pkg/mod/github.com/!alec!aivazis/survey/[email protected]/terminal/runereader.go:37
github.com/AlecAivazis/survey/v2.(*Password).Prompt(0xc0000c6140, 0xc0000b74e8)
/home/runner/go/pkg/mod/github.com/!alec!aivazis/survey/[email protected]/password.go:63 +0x2cd
github.com/AlecAivazis/survey/v2.Ask({0xc0001dd1a0, 0x1, 0xc0001dd1c8?}, {0xa2f520?, 0xc000046b50}, {0xc0001dd198, 0x1, 0x10fe4d0?})
/home/runner/go/pkg/mod/github.com/!alec!aivazis/survey/[email protected]/survey.go:366 +0x36f
github.com/AlecAivazis/survey/v2.AskOne(...)
/home/runner/go/pkg/mod/github.com/!alec!aivazis/survey/[email protected]/survey.go:283
github.com/Layr-Labs/eigenlayer-cli/pkg/utils.(*prompter).InputHiddenString(0xc000042180?, {0xb77530, 0x30}, {0x0, 0x0}, 0xc000014ed0)
/home/runner/work/eigenlayer-cli/eigenlayer-cli/eigenlayer-cli/pkg/utils/prompter.go:69 +0x1b5
github.com/Layr-Labs/eigenlayer-cli/pkg/operator/keys.saveEcdsaKey({0x7ffe046986d9, 0x9}, {0xcb0a90, 0x1181ea0}, 0xc0000ac3f0, 0x0)
/home/runner/work/eigenlayer-cli/eigenlayer-cli/eigenlayer-cli/pkg/operator/keys/create.go:146 +0x175
github.com/Layr-Labs/eigenlayer-cli/pkg/operator.KeysCmd.CreateCmd.func1(0xc0001dd628?)
/home/runner/work/eigenlayer-cli/eigenlayer-cli/eigenlayer-cli/pkg/operator/keys/create.go:73 +0x216
github.com/urfave/cli/v2.(*Command).Run(0xc0000b6000, 0xc00007e400, {0xc00007e440, 0x4, 0x4})
/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:277 +0x9d8
github.com/urfave/cli/v2.(*Command).Run(0xc0000b6420, 0xc00007e300, {0xc0000920f0, 0x5, 0x5})
/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:270 +0xc25
github.com/urfave/cli/v2.(*Command).Run(0xc0000b6c60, 0xc00007e1c0, {0xc0000880c0, 0x6, 0x6})
/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:270 +0xc25
github.com/urfave/cli/v2.(*Command).Run(0xc0000b6f20, 0xc00007e080, {0xc000132000, 0x7, 0x7})
/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:270 +0xc25
github.com/urfave/cli/v2.(*App).RunContext(0xc0000b4000, {0xcb0ac8?, 0x1181ea0}, {0xc000132000, 0x7, 0x7})
/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:335 +0x5db
github.com/urfave/cli/v2.(*App).Run(...)
/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:309
main.main()
/home/runner/work/eigenlayer-cli/eigenlayer-cli/eigenlayer-cli/cmd/eigenlayer/main.go:34 +0x218

To Reproduce

echo '!@#123qwerQWER' | eigenlayer operator keys create --key-type ecdsa operator1

Expected behavior

generate key and ethereum address

Screenshots

OS details

Additional context

The issue is related to
AlecAivazis/survey#394
zk-org/zk#172
and
jetify-com/devbox#867

similar solution:
docker/compose#9739
docker/compose#10144

@coolsnake coolsnake added the bug Something isn't working label Jan 4, 2024
@shrimalmadhur
Copy link
Collaborator

thanks for reporting. will take a look but my suspicion is urfav/cli doesn't handle it properly but I will investigate

@kampleforth
Copy link

I have this same issue, we generate keys through automation so no human has to touch mainnet keys but this is blocking us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants