Skip to content

Commit

Permalink
core/validatorapi: convert blinded to full proposal (#3144)
Browse files Browse the repository at this point in the history
Shortcut `/eth/v2/beacon/blinded_blocks/submit_blinded_block_v2` to use newer proposals rather than blinded block proposals.

category: bug
ticket: none
  • Loading branch information
gsora authored Jun 21, 2024
1 parent 6f6777e commit 80d55bc
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions core/bcast/bcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,39 @@ func (b Broadcaster) Broadcast(ctx context.Context, duty core.Duty, set core.Sig
return err
}

block, ok := aggData.(core.VersionedSignedProposal)
var (
block core.VersionedSignedProposal
blindedBlock core.VersionedSignedBlindedProposal

blinded bool
ok bool
)

block, ok = aggData.(core.VersionedSignedProposal)
if !ok {
return errors.New("invalid proposal")
// check if it's a blinded proposal
blindedBlock, blinded = aggData.(core.VersionedSignedBlindedProposal)
if !blinded {
return errors.New("invalid proposal")
}
}

switch blinded {
case true:
err = b.eth2Cl.SubmitBlindedProposal(ctx, &eth2api.SubmitBlindedProposalOpts{
Proposal: &blindedBlock.VersionedSignedBlindedProposal,
})
default:
err = b.eth2Cl.SubmitProposal(ctx, &eth2api.SubmitProposalOpts{
Proposal: &block.VersionedSignedProposal,
})
}

err = b.eth2Cl.SubmitProposal(ctx, &eth2api.SubmitProposalOpts{
Proposal: &block.VersionedSignedProposal,
})
if err == nil {
log.Info(ctx, "Successfully submitted block proposal to beacon node",
z.Any("delay", b.delayFunc(duty.Slot)),
z.Any("pubkey", pubkey),
z.Bool("blinded", blinded),
)
}

Expand Down

0 comments on commit 80d55bc

Please sign in to comment.