prysmaticlabs / prysm

Go implementation of Ethereum proof of stake

Home Page:https://www.offchainlabs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prysmctl: Interactive UI is broken for selecting validators to exit

sjb933 opened this issue · comments

Describe the bug

The interactive UI for selecting which validator to exit in prysmctl is not rendering correctly. The user is not able to see which validator is currently selected, and long lists are cut off.

I have received a few user reports of this issue and have verified myself. This issue presented itself in v5.0.0 and is still present in the latest release v5.0.3 (it works as expected in v4.2.1).

Has this worked before in a previous version?

This worked in all versions `< v5`, verified working in `v4.2.1`.

🔬 Minimal Reproduction

This issue is very easy to reproduce with the standard command:

./prysmctl-v5.0.3-linux-amd64 validator exit --wallet-dir=/path/to/validatorwallet

Accept the TOS and then try to navigate the list of validators.

Error

Bugged interactive UI.

Platform(s)

Linux (x86)

What version of Prysm are you running? (Which release)

prysmctl v5.0.3

Anything else relevant (validator index / public key)?

No response

image
could you let me know what you were expecting? maybe more keys listed initially?

I pasted above what I see, you can scroll through the validator of choice using the arrow keys. Will test on another os

Hi James, I think it may be that you need a long list of validator keys for the issue to present itself. In order to reproduce I am:

  1. Connected to a linux server via SSH
  2. Running the validator exit command on a validator with many keys (more than one page is perhaps necessary for the issue to present itself).

I also triggered a panic related to this issue using the latest v5.0.3 prysmctl - detail below.

Here is the latest/broken version (v5.0.3) with panic stack trace

You can see that the rendering goes beyond the visible range of the terminal. Jumping around in the list causes sporadic rendering and it appears to jump around randomly in the list.

This is rendered first:
broken-v5 0 3 (1)

Then if navigate with the arrow keys it jumps to the head of the list and you can no longer see the selection:
broken-v5 0 3 (2)

When in this state, I was able to produce a panic by pressing the arrow keys several times and then exiting with CTRL-C:

panic: runtime error: slice bounds out of range [4468:4451]

goroutine 269 [running]:
bytes.(*Buffer).Write(0x0?, {0x2f77324?, 0x0?, 0x0?})
        GOROOT/src/bytes/buffer.go:181 +0xc5
github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Clear(0xc00033e420)
        external/com_github_manifoldco_promptui/screenbuf/screenbuf.go:47 +0x7c
github.com/manifoldco/promptui/screenbuf.(*ScreenBuf).Write(0xc00033e420, {0xc000c8cd00, 0xe, 0x10})
        external/com_github_manifoldco_promptui/screenbuf/screenbuf.go:68 +0x65
github.com/manifoldco/promptui.(*Select).innerRun.func1({0x31ce6c0?, 0xc00071f080?, 0x2cc9500?}, 0xc00041f030?, 0xba5c48?)
        external/com_github_manifoldco_promptui/select.go:336 +0xa89
github.com/chzyer/readline.(*DumpListener).OnChange(0xc00041efa0?, {0x31ce6c0?, 0x0?, 0xc3a040?}, 0xc000ba5f00?, 0x1?)
        external/com_github_chzyer_readline/operation.go:522 +0x2b
github.com/chzyer/readline.(*Operation).ioloop(0xc0004820e0)
        external/com_github_chzyer_readline/operation.go:341 +0x1a13
created by github.com/chzyer/readline.NewOperation in goroutine 1
        external/com_github_chzyer_readline/operation.go:88 +0x2d6

Here is the prior version which works as expected (v4.2.1)

You can see that it limits its rendering to a few lines that can be properly navigated with arrow keys

working-v4 2 1

I think this PR might be related: #13542