Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose eligible_at and signed_at in data api #359

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rajivpo
Copy link

@rajivpo rajivpo commented Apr 20, 2023

πŸ“ Summary

Exposes eligible_at and signed_at via data api

β›± Motivation and Context

The two relevant timestamps were captured and added in #301. For research purposes, it would be convenient to expose these as part of builder_blocks_received and proposer_payload_delivered. I have opted for providing the millisecond timestamps as milliseconds should be the roughly the relevant timeframe for sim and is aligned with the existing timestamp_ms field in BidTraceV2WithTimestampJSON. Additionally, tests for /relay/v1/data/bidtraces/builder_blocks_received have been added.

This is definitely not the cleanest implementation, so any and all feedback is appreciated!

πŸ“š References

#301
#260 (edited to include)


βœ… I have run these commands

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

@metachris
Copy link
Collaborator

Interesting, thanks! Reminds me a bit of #260

Will review in depth soon

@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2023

Codecov Report

Merging #359 (5654d09) into main (cfb5923) will increase coverage by 11.77%.
The diff coverage is 36.76%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@             Coverage Diff             @@
##             main     #359       +/-   ##
===========================================
+ Coverage   19.18%   30.96%   +11.77%     
===========================================
  Files          20       24        +4     
  Lines        3722     4819     +1097     
===========================================
+ Hits          714     1492      +778     
- Misses       2915     3125      +210     
- Partials       93      202      +109     
Flag Coverage Ξ”
unittests 30.96% <36.76%> (+11.77%) ⬆️

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

Impacted Files Coverage Ξ”
beaconclient/mock_multi_beacon_client.go 0.00% <0.00%> (ΓΈ)
common/common.go 0.00% <0.00%> (ΓΈ)
common/types.go 2.04% <0.00%> (-0.08%) ⬇️
common/types_spec.go 0.00% <0.00%> (ΓΈ)
common/utils.go 21.85% <0.00%> (-19.40%) ⬇️
database/mockdb.go 0.00% <0.00%> (ΓΈ)
database/types.go 27.27% <ΓΈ> (+27.27%) ⬆️
datastore/memcached.go 0.00% <ΓΈ> (ΓΈ)
...ons/validator-registration-signature-check/main.go 0.00% <0.00%> (ΓΈ)
services/api/blocksim_ratelimiter.go 12.00% <0.00%> (-1.05%) ⬇️
... and 13 more

@rajivpo
Copy link
Author

rajivpo commented Apr 20, 2023

yeah #260 was definitely a partial inspiration for some of the structure/implementation

@rajivpo
Copy link
Author

rajivpo commented May 1, 2023

@metachris wanted to see if you've had a chance to take a look at this

require.Equal(t, http.StatusOK, rr.Code)
})

t.Run("Accept valid slot", func(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate test?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep good catch

@@ -74,3 +74,60 @@ func BuilderSubmissionEntryToBidTraceV2WithTimestampJSON(payload *BuilderBlockSu
},
}
}

func DeliveredPayloadEntryToBidTraceV3JSON(payload *DeliveredPayloadEntry) common.BidTraceV3JSON {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it'll be great if there's tests for these for json marshal and unmarshalling

@metachris
Copy link
Collaborator

Asking for a bit of patience, as we're working on other important PRs to get merged first (in particular #380)

@metachris
Copy link
Collaborator

@rajivpo could you please rebase?

@rajivpo
Copy link
Author

rajivpo commented Jun 13, 2023

yes will get this done shortly

@metachris
Copy link
Collaborator

something went wrong with this rebase, it now has 45 commits and a ton of changes πŸ€”

@metachris metachris force-pushed the main branch 2 times, most recently from 18524f1 to 6a4f5da Compare June 21, 2023 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants