mev-boost-relay icon indicating copy to clipboard operation
mev-boost-relay copied to clipboard

Draft: log timestamps in RFC3339Nano

Open alextes opened this issue 2 years ago • 4 comments

📝 Summary

  • Changes the timestamp format to human-readable RFC3339.
  • Increases the precision to nanosecond from second.

⛱ Motivation and Context

Current log precision is on the second level. On a high volume relay bids are in the hundreds per second, meaning logs, in the thousands, will share the same timestamp and lose their ordering. This would return ordering, and as a bonus make timestamps human-readable.

📚 References


✅ I have run these commands

  • [ ] make lint
  • [x] make test-race
  • [x] go mod tidy
  • [x] I have seen and agree to CONTRIBUTING.md

alextes avatar Oct 05 '23 16:10 alextes

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (c52858a) 33.26% compared to head (6523b33) 33.35%. Report is 10 commits behind head on main.

Files Patch % Lines
common/logging.go 0.00% 5 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #537      +/-   ##
==========================================
+ Coverage   33.26%   33.35%   +0.09%     
==========================================
  Files          24       24              
  Lines        5090     5315     +225     
==========================================
+ Hits         1693     1773      +80     
- Misses       3178     3318     +140     
- Partials      219      224       +5     
Flag Coverage Δ
unittests 33.35% <0.00%> (+0.09%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Oct 05 '23 16:10 codecov-commenter

Side note: this was discussed at the end of MEV Boost call 6.

JustinDrake avatar Oct 05 '23 16:10 JustinDrake

In mev-boost we're using this with millisecond precision: https://github.com/flashbots/mev-boost/blob/develop-deneb/cli/main.go#L223-L234 + https://github.com/flashbots/mev-boost/blob/develop-deneb/config/vars.go#L14

Any reason for nanoseconds over millis?

metachris avatar Jan 19 '24 08:01 metachris

(sorry accidentally clicked on close)

metachris avatar Jan 19 '24 08:01 metachris

@alextes do you want to rebase and update / engage in the comments?

metachris avatar Feb 19 '25 15:02 metachris

i just didn't see any RFC3339Milli in time and thought it'd be nice to use a standard format. otherwise i'd have gone with that probably. options are: https://pkg.go.dev/time#pkg-constants

alextes avatar Feb 19 '25 15:02 alextes

i see now i completely read over your suggestion to use a custom RFC3339Milli format like done in mev-boost if we don't care about nano precision 🙈 .

great suggestion, updated the PR.

alextes avatar Feb 20 '25 09:02 alextes