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

Block deposit: refactor batch verify and validation activation #8698

Merged
merged 12 commits into from
Apr 5, 2021

Conversation

terencechain
Copy link
Member

What type of PR is this?

Refactor

What does this PR do? Why is it needed?
Refactor functions activateValidatorWithEffectiveBalance and batchVerifyDepositsSignatures so they can be reused for Altair

@terencechain terencechain requested a review from a team as a code owner April 2, 2021 03:02
Copy link
Member

@nisdas nisdas left a comment

Choose a reason for hiding this comment

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

is there a reason we need to touch deposits for Altair ? Which change would be required here

Copy link
Contributor

@rkapka rkapka left a comment

Choose a reason for hiding this comment

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

activateValidatorWithEffectiveBalance can most likely be improved.

@@ -55,7 +64,7 @@ func ProcessPreGenesisDeposits(
return nil, err
}
}
return beaconState, nil
return nil, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

This function should not return a beacon state at all.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think you meant it should

Copy link
Member Author

Choose a reason for hiding this comment

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

Nvm 🤦

@terencechain
Copy link
Member Author

is there a reason we need to touch deposits for Altair ? Which change would be required here

This is just a clean refactor. There's no logic changes. The main goal here is to avoid duplicated code across forks

rkapka
rkapka previously approved these changes Apr 2, 2021
return false, err
}

var verified bool
Copy link
Member

Choose a reason for hiding this comment

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

This var name is pretty confusing for its actual use case, as on a first read it would look like the signature is verified when in truth it means the opposite

Copy link
Member Author

Choose a reason for hiding this comment

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

It's more standard than verifySignature which signals that the variable is actually a function.

Verified doesn't always imply true, it reads more as the act of verifying. ie. the state of being verified

In our code base, we do use verified as boolean through out

One way to improve is to make it verified := false

@prylabs-bulldozer prylabs-bulldozer bot merged commit f2f509b into develop Apr 5, 2021
@delete-merged-branch delete-merged-branch bot deleted the block-deposit-refactor branch April 5, 2021 16:49
@terencechain terencechain mentioned this pull request Apr 7, 2021
62 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants