Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
metachris committed Jun 2, 2024
1 parent 7882108 commit 01c6ec0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions services/bidcollect/data-api-poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (poller *DataAPIPoller) Start() {
tNextSlot := common.SlotToTime(nextSlot)
untilNextSlot := tNextSlot.Sub(t)

poller.Log.Infof("[data-api poller] waiting until start of next slot (%d, %s from now)", nextSlot, untilNextSlot.String())
poller.Log.Infof("[data-api poller] waiting until start of next slot (%d - %s from now)", nextSlot, untilNextSlot.String())
time.Sleep(untilNextSlot)

// then run polling loop
Expand All @@ -59,7 +59,7 @@ func (poller *DataAPIPoller) Start() {
tNextSlot := common.SlotToTime(nextSlot)
untilNextSlot := tNextSlot.Sub(t)

poller.Log.Infof("[data-api poller] current slot: %d / next slot: %d (%s), waitTime: %s", slot, nextSlot, tNextSlot.String(), untilNextSlot.String())
poller.Log.Infof("[data-api poller] scheduling polling for upcoming slot: %d (%s - in %s)", nextSlot, tNextSlot.String(), untilNextSlot.String())

// Schedule polling at t-4, t-2, t=0, t=2
go poller.pollRelaysForBids(nextSlot, -4*time.Second)
Expand Down
1 change: 0 additions & 1 deletion services/bidcollect/getheader-poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ func (poller *GetHeaderPoller) Start() {
if nextProposerPubkey == "" {
poller.log.WithField("duties", duties).Error("no proposerPubkey for next slot")
} else {
go poller.pollRelaysForBids(-2*time.Second, nextSlot, block.Data.Message.Body.ExecutionPayload.BlockHash.String(), duties[nextSlot])
go poller.pollRelaysForBids(0*time.Second, nextSlot, block.Data.Message.Body.ExecutionPayload.BlockHash.String(), duties[nextSlot])
go poller.pollRelaysForBids(1500*time.Millisecond, nextSlot, block.Data.Message.Body.ExecutionPayload.BlockHash.String(), duties[nextSlot])
}
Expand Down
7 changes: 2 additions & 5 deletions services/bidcollect/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ func (bid *CommonBid) ValueAsBigInt() *big.Int {
}

func (bid *CommonBid) ToCSVFields() []string {
slotTms := bid.TimestampMs - common.SlotToTime(bid.Slot).UnixMilli()
if bid.TimestampMs == 0 {
slotTms = bid.ReceivedAtMs - common.SlotToTime(bid.Slot).UnixMilli()
}

tsMs := bid.TimestampMs
if tsMs == 0 {
if bid.Timestamp > 0 {
Expand All @@ -72,6 +67,8 @@ func (bid *CommonBid) ToCSVFields() []string {
}
}

slotTms := tsMs - common.SlotToTime(bid.Slot).UnixMilli()

return []string{
// Collector-internal fields
fmt.Sprint(bid.SourceType), fmt.Sprint(bid.ReceivedAtMs),
Expand Down

0 comments on commit 01c6ec0

Please sign in to comment.