Skip to content

Commit

Permalink
bet
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdevbear committed May 29, 2024
1 parent adcfb0a commit 4c71cae
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
5 changes: 3 additions & 2 deletions mod/beacon/validator/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ func (s *Service[
st,
blk.GetSlot(),
// TODO: this is hood.
//nolint:mnd // bet.

max(
//#nosec:G701
uint64(time.Now().Unix()+1),
uint64((lph.GetTimestamp()+2)),
uint64((lph.GetTimestamp()+1)),
),
blk.GetParentBlockRoot(),
lph.GetBlockHash(),
Expand Down
20 changes: 15 additions & 5 deletions mod/beacon/validator/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,18 @@ func (s *Service[

// If we reject the incoming block, we attempt to rebuild a payload for
// this slot.
return s.rebuildPayloadForRejectedBlock(
ctx, st,
)
go func() {
if fErr := s.rebuildPayloadForRejectedBlock(ctx, st); fErr != nil {
//#nosec
slot, _ := st.GetSlot()
s.logger.Error(
"failed to re-build payload for rejected block",
"for_slot", slot,
"error", fErr,
)
}
}()
return err
}

s.logger.Info(
Expand Down Expand Up @@ -444,10 +453,11 @@ func (s *Service[
// We are rebuilding for the current slot.
slot,
// TODO: this is hood as fuck.
//nolint:mnd // bet.

max(
//#nosec:G701
uint64(time.Now().Unix()+1),
uint64((lph.GetTimestamp()+2)),
uint64((lph.GetTimestamp()+1)),
),
// We set the parent root to the previous block root.
previousBlockRoot,
Expand Down

0 comments on commit 4c71cae

Please sign in to comment.