From bfa5cc0f4d8192a80a4423014b2e75934441022b Mon Sep 17 00:00:00 2001 From: Bhakiyaraj Kalimuthu Date: Thu, 25 Apr 2024 10:08:51 +0200 Subject: [PATCH] use start time unixms header field across all the request --- server/service.go | 10 +++++----- server/utils.go | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/server/service.go b/server/service.go index d00fc103..73aa21fd 100644 --- a/server/service.go +++ b/server/service.go @@ -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)) @@ -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) @@ -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 diff --git a/server/utils.go b/server/utils.go index 60f21af1..f3c44186 100644 --- a/server/utils.go +++ b/server/utils.go @@ -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 (