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

core/validatorapi: relax SlotFromTimestamp checks #3066

Merged
merged 3 commits into from
May 6, 2024

Conversation

gsora
Copy link
Collaborator

@gsora gsora commented May 6, 2024

Export SlotFromTimestamp instead of keeping two equal implementation.

Relax SlotFromTimestamp timestamp checks: if a timestamp comes before genesis time as fetched from the beacon node, fall back to time.Now() as timestamp.

This function is only ever used to check for validator registration validity, which has never been formalized and can be relaxed.

category: refactor
ticket: none

Export `SlotFromTimestamp` instead of keeping two equal implementation.

Relax `SlotFromTimestamp` timestamp checks: if a timestamp comes before genesis time as fetched from the beacon node, fall back to `time.Now()` as timestamp.

This function is only ever used to check for validator registration validity, which has never been formalized and can be relaxed.
@gsora gsora requested review from pinebit and KaloyanTanev May 6, 2024 13:36
Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 67.64706% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 56.40%. Comparing base (11e3000) to head (716558b).

Files Patch % Lines
core/validatorapi/validatorapi.go 71.87% 5 Missing and 4 partials ⚠️
app/app.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3066      +/-   ##
==========================================
+ Coverage   56.33%   56.40%   +0.07%     
==========================================
  Files         208      208              
  Lines       28846    28839       -7     
==========================================
+ Hits        16251    16268      +17     
+ Misses      10791    10773      -18     
+ Partials     1804     1798       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@boulder225 boulder225 added the protocol Protocol Team tickets label May 6, 2024
Copy link

sonarcloud bot commented May 6, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@gsora gsora added the merge when ready Indicates bulldozer bot may merge when all checks pass label May 6, 2024
@obol-bulldozer obol-bulldozer bot merged commit c51af10 into main May 6, 2024
12 checks passed
@obol-bulldozer obol-bulldozer bot deleted the gsora/valreg-timestamp-check-relax branch May 6, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass protocol Protocol Team tickets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants