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

EIP-6110: Add deposits in EL #5055

Merged
merged 43 commits into from
Mar 28, 2023
Merged

EIP-6110: Add deposits in EL #5055

merged 43 commits into from
Mar 28, 2023

Conversation

ensi321
Copy link
Contributor

@ensi321 ensi321 commented Feb 5, 2023

PR description

Add deposits to the Execution Layer block structure: EIP-6110. The scope of this PR is to add Deposit related info into BlockHeader and BlockBody. The rest of the EIP including rpc api and validating Deposit with be included in the next PR.

Fixed Issue(s)

#5004

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if
    updates are required.

Changelog

@siladu
Copy link
Contributor

siladu commented Feb 10, 2023

Excited to review this! Thanks for picking it up @naviechan 👍

@non-fungible-nelson non-fungible-nelson added the EIP Ethereum Improvement Proposal label Feb 16, 2023
@siladu siladu added the mainnet label Feb 18, 2023
@siladu
Copy link
Contributor

siladu commented Feb 18, 2023

Hey @naviechan check out this page about DCO https://wiki.hyperledger.org/display/BESU/DCO

All commits need to be signed off to pass this check. You can amend your commit messages and force push (or squash the commits and do it once).

I've just approved the CI to run the rest of the checks - you might need to prod us if you want to run these at any point (or you can just run gradle commands locally to check unit tests etc)

Spotless is failing, to fix run ./gradlew spotlessApply and commit the changes.

Javadoc is also failing, run ./gradlew javadoc locally and fix up the warnings, certain packages require javadoc to be added to public methods.

Finally, assemble is failing. I would recommend at least running ./gradlew assemble locally before pushing to CI.
Not a bad idea to always run spotlessApply too, you can script both this and the dco so you don't forget (I use a precommit hook)

@ensi321 ensi321 force-pushed the eip-6110 branch 5 times, most recently from f39bb57 to 8ebb906 Compare February 19, 2023 14:50
Signed-off-by: Navie Chan <naviechan@gmail.com>
Signed-off-by: Navie Chan <naviechan@gmail.com>
@ensi321 ensi321 force-pushed the eip-6110 branch 2 times, most recently from aecb5c8 to 1c8de5a Compare February 19, 2023 15:24
Signed-off-by: Navie Chan <naviechan@gmail.com>
Signed-off-by: Navie Chan <naviechan@gmail.com>
Signed-off-by: Navie Chan <naviechan@gmail.com>
Signed-off-by: Navie Chan <naviechan@gmail.com>
@ensi321
Copy link
Contributor Author

ensi321 commented Feb 19, 2023

Hey @naviechan check out this page about DCO https://wiki.hyperledger.org/display/BESU/DCO

All commits need to be signed off to pass this check. You can amend your commit messages and force push (or squash the commits and do it once).

I've just approved the CI to run the rest of the checks - you might need to prod us if you want to run these at any point (or you can just run gradle commands locally to check unit tests etc)

Spotless is failing, to fix run ./gradlew spotlessApply and commit the changes.

Javadoc is also failing, run ./gradlew javadoc locally and fix up the warnings, certain packages require javadoc to be added to public methods.

Finally, assemble is failing. I would recommend at least running ./gradlew assemble locally before pushing to CI. Not a bad idea to always run spotlessApply too, you can script both this and the dco so you don't forget (I use a precommit hook)

Thanks so much this is very helpful! I think I ran into some kind of error for :acceptance-tests:tests:compileSolidity. The server returns 503 not sure what I can do on my end.

Also sorry for this huge PR. Was trying to limit the scope of this PR to just adding Deposit to block header and body. Turns out I had to modify a lot of the classes 😂

I will open another PR for json-rpc related changes

@siladu siladu added the TeamGroot GH issues worked on by Groot Team label Feb 20, 2023
import org.apache.tuweni.bytes.Bytes;
import org.apache.tuweni.units.bigints.UInt64;

public class Deposit implements org.hyperledger.besu.plugin.data.Deposit {

Check notice

Code scanning / CodeQL

Class has same name as super class

Deposit has the same name as its supertype [org.hyperledger.besu.plugin.data.Deposit](1).
Signed-off-by: Navie Chan <naviechan@gmail.com>
@siladu
Copy link
Contributor

siladu commented Feb 20, 2023

Thanks so much this is very helpful! I think I ran into some kind of error for :acceptance-tests:tests:compileSolidity. The server returns 503 not sure what I can do on my end.

This was a transient error, I gave it a kick and now you have a genuine test compilation error.

Also sorry for this huge PR. Was trying to limit the scope of this PR to just adding Deposit to block header and body. Turns out I had to modify a lot of the classes 😂

Large PRs are hard to review for sure, but not impossible. One approach that seems to work well is something like...

  • PR to add feature toggle
  • PR to add new types
  • PR per feature, behind the toggle where necessary (should be production grade, including tests)

You can always use one giant draft PR as a prototype before splitting into smaller ones, but I think getting some code onto main ASAP is the least painful approach.

By the way, I see you added eip6110time. That'll work fine and it may prove useful to have a separate flag, but note we already have experimentaleipstime for this purpose: #4873

@siladu
Copy link
Contributor

siladu commented Feb 20, 2023

@naviechan would you like someone to do an early review or would you prefer to wait until you mark it as ready?

@ensi321
Copy link
Contributor Author

ensi321 commented Feb 20, 2023

@

Yes please do an early review! Thanks

Signed-off-by: Navie Chan <naviechan@gmail.com>
@ensi321 ensi321 marked this pull request as ready for review February 20, 2023 15:39
@ensi321 ensi321 changed the title EIP-6110: Handle validator deposits in EL EIP-6110: Add deposits in EL Feb 20, 2023
@ensi321
Copy link
Contributor Author

ensi321 commented Feb 22, 2023

By the way, I see you added eip6110time. That'll work fine and it may prove useful to have a separate flag, but note we already have experimentaleipstime for this purpose: #4873

Thanks for the feedback. I will remove the EIP6110Time in favour of experimentaleipstime

ensi321 added 12 commits March 11, 2023 13:37
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
@@ -304,4 +308,8 @@

return true;
}

private boolean validateDeposits(final Block unusedBlock) {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'unusedBlock' is never used.
Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

Thanks for your small commits and clear commit messages :)

I am pretty happy with this, only blocker is the BodyValidator test which I'll see if I can help you with.

Will give @jframe a chance to re-review as well.

Comment on lines +27 to +28
public class BLSPublicKey extends DelegatingBytes
implements org.hyperledger.besu.plugin.data.PublicKey {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think BLSPublicKey and BLSSignature are OK as new types since they are quite a general concept and could imagine them being reused in the future.
Whereas DepositWithdrawalsCredential is quite specific Bytes32 is better IMO...it's not clear to me from the EIP what format this credential takes exactly, maybe there's an existing data type that is appropriate?

Possibly BLSPublicKey and BLSSignature shouldn't live in data types though since they are not broadly used. Maybe should live alongside Deposit.java for now?

@siladu siladu requested a review from jframe March 21, 2023 05:38
Copy link
Contributor

@jframe jframe left a comment

Choose a reason for hiding this comment

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

Happy with the PR now too. Agree with @siladu the only thing missing is a test for the depositRoot in the BodyValidationTest

ensi321 added 3 commits March 27, 2023 01:19
Signed-off-by: Navie Chan <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
@ensi321 ensi321 requested a review from siladu March 28, 2023 06:24
@siladu
Copy link
Contributor

siladu commented Mar 28, 2023

As a regression test, I span up 1x sepolia (snap sync), 1x goerli and 2x mainnet nodes which all got into sync and have stayed in sync for a number of days

Screenshot 2023-03-28 at 5 13 41 pm

Copy link
Contributor

@siladu siladu left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

@siladu siladu merged commit 3aef587 into hyperledger:main Mar 28, 2023
@ensi321 ensi321 deleted the eip-6110 branch April 3, 2023 04:20
elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
Add deposits to the Execution Layer block structure: EIP-6110. The scope of this commit is to add Deposit related info into BlockHeader and BlockBody. The rest of the EIP including RPC API and validating Deposit with be included in future PRs.

---------

Signed-off-by: Navie Chan <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
Add deposits to the Execution Layer block structure: EIP-6110. The scope of this commit is to add Deposit related info into BlockHeader and BlockBody. The rest of the EIP including RPC API and validating Deposit with be included in future PRs.

---------

Signed-off-by: Navie Chan <naviechan@gmail.com>
Signed-off-by: navie <naviechan@gmail.com>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EIP Ethereum Improvement Proposal mainnet TeamGroot GH issues worked on by Groot Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants