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

cluster: align hash timestamp to unix #2430

Merged
merged 4 commits into from
Jul 17, 2023
Merged

Conversation

dB2510
Copy link
Contributor

@dB2510 dB2510 commented Jul 14, 2023

Aligns timestamp format of validator registration in hash calculation to unix format. This is done to avoid any confusion between timestamp in cluster-lock.json and the format used to calculate lock hash. Also it aligns the timestamp format with that of go-eth2-client types.

category: bug
ticket: #2436

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Patch coverage: 84.61% and project coverage change: +0.17 🎉

Comparison is base (f6e7c24) 53.71% compared to head (8ef605d) 53.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2430      +/-   ##
==========================================
+ Coverage   53.71%   53.88%   +0.17%     
==========================================
  Files         199      198       -1     
  Lines       26467    26458       -9     
==========================================
+ Hits        14216    14257      +41     
+ Misses      10483    10438      -45     
+ Partials     1768     1763       -5     
Impacted Files Coverage Δ
eth2util/network.go 67.39% <0.00%> (ø)
cluster/distvalidator.go 73.91% <100.00%> (+1.37%) ⬆️
cluster/lock.go 56.04% <100.00%> (+0.28%) ⬆️
cluster/registration.go 100.00% <100.00%> (+12.50%) ⬆️
cluster/ssz.go 67.32% <100.00%> (ø)

... and 15 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dB2510 dB2510 self-assigned this Jul 14, 2023
cluster/ssz.go Outdated
@@ -695,7 +697,7 @@ func hashRegistration(r Registration, hh ssz.HashWalker) error {
hh.PutUint64(uint64(r.GasLimit))

// Field (2) 'Timestamp' Bytes48
hh.PutBytes([]byte(r.Timestamp.String()))
hh.PutBytes([]byte(r.Timestamp.Format(time.RFC3339)))
Copy link
Contributor

Choose a reason for hiding this comment

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

please use eth2 standard of ssz marshalling, also please ensure this hash equals canonical ssz hashing of validator registration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done 🫡

@dB2510 dB2510 changed the title cluster: align hash timestamp to RFC3339 cluster: align hash timestamp to unix Jul 17, 2023
@dB2510 dB2510 added the merge when ready Indicates bulldozer bot may merge when all checks pass label Jul 17, 2023
@obol-bulldozer obol-bulldozer bot merged commit 9fd6e15 into main Jul 17, 2023
@obol-bulldozer obol-bulldozer bot deleted the dhruv/alignv1.7ssz branch July 17, 2023 13:25
@dB2510 dB2510 linked an issue Jul 17, 2023 that may be closed by this pull request
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

align hash timestamp to eth2
2 participants