-
Notifications
You must be signed in to change notification settings - Fork 2.2k
chore: remove total difficulty from HeaderProvider
#19151
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
Conversation
| hash, | ||
| difficulty: header.difficulty(), | ||
| total_difficulty, | ||
| total_difficulty: U256::ZERO, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im guessing so, but is this okay?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be fine, in p2p this is deprecated as of eth/69 and the node builder only uses the Head to get the timestamp
TTD from HeaderProviderHeaderProvider
HeaderProviderHeaderProvider
Rjected
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a q about simplifying append_header args otherwise lgtm
|
|
||
| // Append to Headers segment | ||
| writer.append_header(header, td, header_hash)?; | ||
| writer.append_header(header, U256::ZERO, header_hash)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ever call this with something nonzero after this PR? if not then maybe we should just remove the arg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I think we should remove this from the function arg entirely
| hash, | ||
| difficulty: header.difficulty(), | ||
| total_difficulty, | ||
| total_difficulty: U256::ZERO, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be fine, in p2p this is deprecated as of eth/69 and the node builder only uses the Head to get the timestamp
mattsse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very nice, I only have the same pedantic suggestion as @Rjected
imo it would be fine to always use zero for the export as well but we can keep this
|
|
||
| // Append to Headers segment | ||
| writer.append_header(header, td, header_hash)?; | ||
| writer.append_header(header, U256::ZERO, header_hash)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I think we should remove this from the function arg entirely
mattsse
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
StorageApiera_utils::calculate_td_by_numberso we are able to generate era files with the same checksums. slightly expensive, since it has to iterate through all headers up to num.static_file_provider.append_headernow always sets TTD column to zero. This has the side-effect that static files will have a different checksum after this PR.closes #16586