prysmaticlabs / prysm

Go implementation of Ethereum proof of stake
https://www.offchainlabs.com
GNU General Public License v3.0
3.47k stars 1.01k forks source link

Validator panics when adding keys to remote signer file #14636

Closed kajeagentspi closed 18 hours ago

kajeagentspi commented 2 days ago

Describe the bug

The validator panics when adding keys to remote signer file.

Has this worked before in a previous version?

No response

🔬 Minimal Reproduction

  1. Start with remote signer file
  2. Add validator keys to external_keys.txt
  3. It throws this sometimes

Error

time="2024-11-11 23:37:23" level=info msg="Successfully initialized file watcher" path="/data/external_keys.txt" prefix=remote-keymanager
time="2024-11-11 23:37:23" level=info msg="Remote signer key file updated" prefix=remote-keymanager
time="2024-11-11 23:37:23" level=info msg="Remote signer key file updated" prefix=remote-keymanager
panic: runtime error: index out of range [0] with length 0

goroutine 52 [running]:
github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api.(*beaconApiValidatorClient).validatorsStatusResponse(0xc00043c000, {0x1ae6c70, 0xc0006914a0}, {0x4410340, 0x0, 0xc000508001?}, {0x4410340, 0x0, 0x0})
        validator/client/beacon-api/status.go:104 +0xe6d
github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api.(*beaconApiValidatorClient).multipleValidatorStatus(0xc00043c000, {0x1ae6c70, 0xc0006914a0}, 0xc000753260)
        validator/client/beacon-api/status.go:35 +0xbf
github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api.(*beaconApiValidatorClient).MultipleValidatorStatus.func1()
        validator/client/beacon-api/beacon_api_validator_client.go:135 +0x25
github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api.wrapInMetrics[...]({0x1523119?, 0x17}, 0xc0005dadc0)
        validator/client/beacon-api/beacon_api_validator_client.go:312 +0x53
github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api.(*beaconApiValidatorClient).MultipleValidatorStatus(0xc00043c000, {0x1ae6c70?, 0xc0006914a0?}, 0xc000753260)
        validator/client/beacon-api/beacon_api_validator_client.go:134 +0x11b
github.com/prysmaticlabs/prysm/v5/validator/client.(*validator).updateValidatorStatusCache(0xc0001b0fc8, {0x1ae6c70, 0xc0006914a0}, {0x4410340?, 0x0?, 0xc0dbc327b0?})
        validator/client/validator.go:1250 +0x209
github.com/prysmaticlabs/prysm/v5/validator/client.(*validator).HandleKeyReload(0xc0001b0fc8, {0x1ae6c70?, 0xc0006914a0?}, {0x4410340, 0x0, 0x0})
        validator/client/key_reload.go:19 +0x108
github.com/prysmaticlabs/prysm/v5/validator/client.onAccountsChanged({0x1ae6c70, 0xc0006914a0}, {0x1b0c130, 0xc0001b0fc8}, {0x4410340?, 0x2d1801?, 0xc0dfeee9c0?}, 0xc000988960)
        validator/client/runner.go:140 +0x6b
github.com/prysmaticlabs/prysm/v5/validator/client.run({0x1ae6c70, 0xc0006914a0}, {0x1b0c130, 0xc0001b0fc8})
        validator/client/runner.go:134 +0x1265
created by github.com/prysmaticlabs/prysm/v5/validator/client.(*ValidatorService).Start in goroutine 316
        validator/client/service.go:221 +0xd0b

Platform(s)

Linux (x86)

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

5.1.2 current docker stable

Anything else relevant (validator index / public key)?

No response

james-prysm commented 1 day ago

looking into the above, it seems like you're also running with our experimental validator client REST mode, is that right? with the --enable-beacon-rest-api flag