-
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
Updated istanbul consensus engine to verify headers synchronously #957
Updated istanbul consensus engine to verify headers synchronously #957
Conversation
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 except for minor comments.
7912509
to
010bf47
Compare
30c1951
to
a72a027
Compare
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
@ehnuje @winnie-byun @yoomee1313 Please take a look. |
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
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.
It would be nice to put explanation. Nice work:)
EN0 : master branch (Klaytn v1.6.1+f695312c38)
EN1 : After this PR (Klaytn v1.6.1+d76876935e)
EN2 : Before this PR (Klaytn v1.6.1+37b05fe791)
Proposed changes
UPDATE: The addresses cache is updated. Previously, the
ecrecover
method used an ARU cache with block hash as a key, but we need to cache all the addresses recovered from committed seals of a block. So, 65-bytes signatures are used as keys. Furthermore, the size of the cache is increased to 2048 * 30 (max number of downloaded blocks * approximate sub group size of validators).After the PR Updated minimum staking related logic #920, the
Refresh
method must be called all the time to refresh proposer candidates as well as validators.The
Refresh
method wasn't always called before because the header verification concurrently occurs while downloading a batch of blocks. (If the header does not exist, it ignores to refresh)The
Refresh
method didn't work properly since it was failed to get staking information to verify headers. (It tries to call a contract method on a specific block which is not yet inserted)This PR updates the header verification synchronously, while the computation of addresses will be processed concurrently to prevent download performance.
The simple synchronous verification performs poorly as below panel, so extracting the pub key from seals handled concurrently.
The comparision sync test is attached.
EN0 : master branch (Klaytn v1.6.1+f695312c38)
EN1 : After this PR (Klaytn v1.6.1+d76876935e)
EN2 : Before this PR (Klaytn v1.6.1+37b05fe791)
Types of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
$ make test
)