-
Notifications
You must be signed in to change notification settings - Fork 189
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
Introduce type common.ExtHash #1852
Conversation
332db2d
to
7f16b16
Compare
Update:
|
I removed RootNonce which was deemed unnecessary in the KIP-111 implementation. |
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 we need to test BytesTo* functions separately (like TestBytesConversion)
Added 050d2d8. Tell me if you are thinking of specific test cases other than this commit. |
050d2d8
to
b11cbf9
Compare
common/types.go
Outdated
|
||
extHashCounterMin = uint64(0x100) // Any counter below extHashCounterMin are reserved. | ||
extHashCounter = extHashCounterMin | ||
extHashLegacyNonce = ExtHashNonce{0, 0, 0, 0, 0, 0, 0x45} |
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.
The value doesn't have any meaning, right? Please comment about this for the later changes
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.
@ethan-kr Can you explain the meaning of the value? How about changing this to all-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.
When ExtHash was first developed, there was a magic number in a certain location that determined that it was ExtHash. 0x45 is a remnant of that. It would be possible to just set it to all-zero, but I wanted to leave something to distinguish it, so I left it. However, there is no logic to specifically check ExtHashNonce. It is left in the sense that it is better than nothing.
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.
Added comments as to why we have nonzero number.
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.
ExtHash requires many memory copies. Let's have a performance test about this in QA process
common/types.go
Outdated
|
||
extHashCounterMin = uint64(0x100) // Any counter below extHashCounterMin are reserved. | ||
extHashCounter = extHashCounterMin | ||
extHashLegacyNonce = ExtHashNonce{0, 0, 0, 0, 0, 0, 0x45} |
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.
When ExtHash was first developed, there was a magic number in a certain location that determined that it was ExtHash. 0x45 is a remnant of that. It would be possible to just set it to all-zero, but I wanted to leave something to distinguish it, so I left it. However, there is no logic to specifically check ExtHashNonce. It is left in the sense that it is better than nothing.
357d6a5
to
4e5ffc8
Compare
Update:
|
4e5ffc8
to
b843bcc
Compare
b843bcc
to
13793c8
Compare
Cleaned up and squashed. In a conversation with @ethan-kr and @aidan-kwon, we decided:
@jeongkyun-oh @ian0371 PTAL. |
Proposed changes
Types of changes
Checklist
$ make test
)Related issues
Further comments