Teku is sending `exited` validators to MEV-Boost but should only send `active` or `pending` ones
Description
I recently set up MEV-Boost for Goerli/Prater. I have several exited validators on Prater (such as https://prater.beaconcha.in/validator/0xb00c002d0770d507af4b4d61d259ae44432745b7a9d693d167efbdc7e39e4c012f584c40d866cacf4557a08e86284e31) and during Teku's validator registration process, it sends this validator over to MEV-Boost which causes it to fail.
According to the official spec, only active or pending validators should be sent to the builder during validator registration.
Here are MEV-Boost's logs:
mev-boost_1 | time="2022-08-12T18:22:12Z" level=info msg="http: GET /eth/v1/builder/status 200" duration=0.059087851 method=GET module=service path=/eth/v1/builder/status status=200
mev-boost_1 | time="2022-08-12T18:22:24Z" level=warning msg="error calling registerValidator on relay" error="HTTP error response: 400 / {\"code\":400,\"message\":\"not a known validator: 0xb00c002d0770d507af4b4d61d259ae44432745b7a9d693d167efbdc7e39e4c012f584c40d866cacf4557a08e86284e31\"}\n" method=registerValidator module=service numRegistrations=36 ua=okhttp/4.9.2 url="https://builder-relay-goerli.flashbots.net/eth/v1/builder/validators?id=rocketpool"
mev-boost_1 | time="2022-08-12T18:22:24Z" level=info msg="http: POST /eth/v1/builder/validators 502" duration=0.131684409 method=POST module=service path=/eth/v1/builder/validators status=502
Unfortunately, Teku's BN doesn't log this failure at all so it was purely a coincidence that I noticed it while investigating the behavior of other clients. I would advise adding logs on validator registration failures.
I will note that this used a Teku BN with a remotely-connected Lighthouse VC (v2.5.1). Not sure if that matters here.
I reported this to Flashbots, who pointed me to the builder API spec above.
This issue is also present in Lighthouse and Nimbus.
Steps to Reproduce (Bug)
- Exit a validator
- Start Teku, which will load the keys for the exited validator
- Connect to MEV-boost as the block builder
- Observe the above behavior
Expected behavior:
Teku should only register active and pending validators
Actual behavior: Teku is registering every connected validator
Frequency: 100% of the time
Versions (Add all that apply)
- Software version: v22.8.0
- Java version: Whatever the Docker container uses
- OS Name & Version: Debian 11 x64
- Docker Version: 20.10.17
- Cloud VM, type, size: N/A
Thanks for raising this, I did comment on the builder issue as well, but just for context here:
Added a comment to https://github.com/flashbots/mev-boost/issues/245 - its possible to filter based on the head state from the BN (on the BN side before we call the builder api), but it's likely a better solution that the builder api is a little tolerant.
I filled in some context about active and pending statuses, and noted that active includes active_slashed which will not be doing any duties either.
If only active and pending is a fixed requirement on the builder side, we may need to update ProposersDataManager.updateValidatorRegistrations, and we'd likely want to clarify some of the behaviours in the rest api potentially.