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

Filter out BlsToExecutionChange messages for 0x02 validators #6464

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

pawanjay176
Copy link
Member

Issue Addressed

N/A

Proposed Changes

Thanks @pk910 for finding the issue on electra devnet-3.

When producing a block, we get all the messages from our op pool filtering only for messages that have validators which already have an eth1_withdrawal_credential.

With electra, we can have the following sequence of events:

  1. We get a valid SignedBlsToExecutionMessage b for validator v and add it to our op pool
  2. The next proposer includes the message b in its block and the validator goes from 0x00 to 0x01
  3. We get another block with a DepositRequest/ConsolidationRequest that changes the withdrawal credential for v from 0x01 to 0x02
  4. We are the block proposer for the next slot and end up including the message b because its still in our op pool and the prefix is not 0x00 (its 0x02)
  5. The block proposal fails when we try to verify the block we just produced e.g.
Oct 03 14:04:36.044 ERRO Error whilst producing block            info: block v3 proposal failed, this error may or may not result in a missed block, block_slot: Slot(158868), error: "Some endpoints failed, num_failed: 1 http://beacon:5052/ => RequestFailed(Recoverable(\"Error from beacon node when producing block: Recoverable(\\\"Error from beacon node when producing block: ServerMessage(ErrorMessage { code: 400, message: \\\\\\\"BAD_REQUEST: failed to fetch a block: BlockProcessingError(BlsExecutionChangeInvalid { index: 0, reason: NonBlsWithdrawalCredentials })\\\\\\\", stacktraces: [] })\\\")\"))", service: block

This PR checks that the prefix is not 0x01 and 0x02 before getting it from the op pool. We also need to change the pruning routine to do the same.

TODO

  • Add a test for this scenario

@pawanjay176 pawanjay176 added ready-for-review The code is ready for review electra Required for the Electra/Prague fork labels Oct 4, 2024
@ethDreamer
Copy link
Member

I looked through the code and these two appear to be the only places where we used has_eth1_withdrawal_credentials() when we meant has_execution_withdrawal_credentials(). These were easy to miss because eth1_withdrawal_credentials() came first and the code was valid when it was written, but electra introduced has_execution_withdrawal_credentials() without modifying this piece of code.

@ethDreamer
Copy link
Member

@Mergifyio queue

Copy link

mergify bot commented Oct 7, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 48dd3f3

mergify bot added a commit that referenced this pull request Oct 7, 2024
@mergify mergify bot merged commit 48dd3f3 into sigp:unstable Oct 7, 2024
27 of 28 checks passed
chong-he pushed a commit to chong-he/lighthouse that referenced this pull request Nov 26, 2024
* Filter out 0x02 validators from `get_bls_to_execution_changes`

* Prune bls to execution changes that have a 0x02 credential

* lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electra Required for the Electra/Prague fork ready-for-review The code is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants