Skip to content

Commit

Permalink
payload attribute and withdrawal fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz committed Nov 7, 2024
1 parent ce0130a commit 8ac2e61
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/blockchain/execution_engine_epbs.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (s *Service) notifyForkchoiceUpdateEPBS(ctx context.Context, blockhash [32]
FinalizedBlockHash: finalizedHash[:],
}
if attributes == nil {
attributes = payloadattribute.EmptyWithVersion(version.Electra)
attributes = payloadattribute.EmptyWithVersion(version.Deneb)
}
payloadID, lastValidHash, err := s.cfg.ExecutionEngineCaller.ForkchoiceUpdated(ctx, fcs, attributes)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/blockchain/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ func logStateTransitionData(b interfaces.ReadOnlyBeaconBlock) error {
if err != nil {
return err
}
log = log.WithFields(logrus.Fields{"payloadHash": header.BlockHash(),
log = log.WithFields(logrus.Fields{"payloadHash": fmt.Sprintf("%#x", header.BlockHash()),
"builderIndex": header.BuilderIndex(),
"value": header.Value(),
"blobKzgCommitmentsRoot": header.BlobKzgCommitmentsRoot(),
"blobKzgCommitmentsRoot": fmt.Sprintf("%#x", header.BlobKzgCommitmentsRoot()),
})
} else {
if b.Version() >= version.Bellatrix {
Expand Down
7 changes: 7 additions & 0 deletions beacon-chain/blockchain/process_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ func (s *Service) postBlockProcess(cfg *postBlockProcessConfig) error {
return nil
}
if cfg.roblock.Version() >= version.EPBS {
if err := s.saveHead(ctx, cfg.headRoot, cfg.roblock, cfg.postState); err != nil {
log.WithError(err).Error("could not save head")
}
if err := s.pruneAttsFromPool(cfg.roblock); err != nil {
log.WithError(err).Error("could not prune attestations from pool")
}

// update the NSC and handle epoch boundaries here since we do
// not send FCU at all
return s.updateCachesPostBlockProcessing(cfg)
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/blocks/withdrawals.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func ProcessWithdrawals(st state.BeaconState, executionData interfaces.Execution
}

if !IsParentBlockFull {
return nil, nil
return st, nil
}
}

Expand Down
1 change: 0 additions & 1 deletion beacon-chain/core/epbs/execution_payload_header.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ func ValidatePayloadHeaderSignature(st state.ReadOnlyBeaconState, sh interfaces.
if err != nil {
return err
}

pubkey := st.PubkeyAtIndex(h.BuilderIndex())
pub, err := bls.PublicKeyFromBytes(pubkey[:])
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion consensus-types/payload-attribute/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func New(i interface{}) (Attributer, error) {
func EmptyWithVersion(ver int) Attributer {
if ver == version.EPBS {
return &data{
version: version.Electra,
version: version.Deneb,
}
}
return &data{
Expand Down

0 comments on commit 8ac2e61

Please sign in to comment.