Skip to content

Commit

Permalink
use start time unixms header field across all the request
Browse files Browse the repository at this point in the history
  • Loading branch information
bhakiyakalimuthu committed Apr 25, 2024
1 parent ba8a47e commit bfa5cc0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 5 additions & 5 deletions server/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (m *BoostService) handleRegisterValidator(w http.ResponseWriter, req *http.

// Add request headers
headers := map[string]string{
HeaderStartTimeMsUnix: fmt.Sprintf("%d", time.Now().UTC().UnixMilli()),
HeaderStartTimeUnixMS: fmt.Sprintf("%d", time.Now().UTC().UnixMilli()),
}

relayRespCh := make(chan error, len(m.relays))
Expand Down Expand Up @@ -344,8 +344,8 @@ func (m *BoostService) handleGetHeader(w http.ResponseWriter, req *http.Request)
}).Infof("getHeader request start - %d milliseconds into slot %d", msIntoSlot, _slot)
// Add request headers
headers := map[string]string{
HeaderKeySlotUID: slotUID.String(),
HeaderStartTimeMsIntoSlot: fmt.Sprintf("%d", msIntoSlot),
HeaderKeySlotUID: slotUID.String(),
HeaderStartTimeUnixMS: fmt.Sprintf("%d", time.Now().UTC().UnixMilli()),
}
// Prepare relay responses
result := bidResp{} // the final response, containing the highest bid (if any)
Expand Down Expand Up @@ -671,8 +671,8 @@ func (m *BoostService) processDenebPayload(w http.ResponseWriter, req *http.Requ

// Add request headers
headers := map[string]string{
HeaderKeySlotUID: currentSlotUID,
HeaderStartTimeMsIntoSlot: fmt.Sprintf("%d", msIntoSlot),
HeaderKeySlotUID: currentSlotUID,
HeaderStartTimeUnixMS: fmt.Sprintf("%d", time.Now().UTC().UnixMilli()),
}

// Prepare for requests
Expand Down
7 changes: 3 additions & 4 deletions server/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ import (
)

const (
HeaderKeySlotUID = "X-MEVBoost-SlotID"
HeaderKeyVersion = "X-MEVBoost-Version"
HeaderStartTimeMsUnix = "X-MEVBoost-StartTimeMSUnix"
HeaderStartTimeMsIntoSlot = "X-MEVBoost-StartTimeMSIntoSlot"
HeaderKeySlotUID = "X-MEVBoost-SlotID"
HeaderKeyVersion = "X-MEVBoost-Version"
HeaderStartTimeUnixMS = "X-MEVBoost-StartTimeUnixMS"
)

var (
Expand Down

0 comments on commit bfa5cc0

Please sign in to comment.