-
Notifications
You must be signed in to change notification settings - Fork 213
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
Move signing keys selection to NodeOperatorsRegistry #226
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
the upsides are significant gas savings, less coupled code and decreased size of the Lido contract (which is currently the heaviest one)
1cb1bb0
to
1d7422f
Compare
this has a side effect of changing the key assignment order in the case when several node operators have the same effective stake: previously, keys were assigned in the id-reverse order (i.e. the ope that were added later were preferred over those who were added earlier); now, in the case of the same effective stake keys are assigned in the id order. related to: 44626e2
Merged
skozin
added a commit
that referenced
this pull request
Dec 7, 2020
skozin
added a commit
that referenced
this pull request
Dec 7, 2020
dechjo
pushed a commit
to dechjo/lido-dao
that referenced
this pull request
Jan 26, 2021
dechjo
pushed a commit
to dechjo/lido-dao
that referenced
this pull request
Jan 26, 2021
tamtamchik
pushed a commit
that referenced
this pull request
Oct 11, 2024
…ocator Use steth on optimism locator impl to fetch addresses for SR2 deploy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, signing keys are selected from eligible Node Operators in the following manner:
Lido
obtains all Node Operators' data (except pubkeys/signatures) fromNodeOperatorsRegistry
and caches it into memory.Lido
performs as many 32 ETH deposits as possible. Before making each deposit,Lido
selects the Node Operator with the least effective stake and retrieves its next unused pubkey and signature fromNodeOperatorsRegistry
.Lido
updates used keys counts inNodeOperatorsRegistry
.This PR changes the process to the following:
Lido
calculates the number of deposits it's allowed to make.Lido
requests the desired number of unused pubkeys/signatures fromNodeOperatorsRegistry
, which selects the operators with the least effective stake and returns their pubkeys/signatures as two concatenated byte arrays, updating operators' used keys counts at the same time.Lido
performs the deposits.The new approach has a number of benefits:
Gas profiling
The profiling was performed for 10 Node Operators, each having one key already used. The numbers below were obtained using the mock deposit contract and corrected for the real deposit gas usage (assuming it's
49000
for inter-contract calls).Index underflow fix
Also, this PR fixes #227 which was discovered in the process the refactoring.