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

Ensure difficulty/hash/epoch overrides change the ChainSpec #2798

Merged
merged 13 commits into from
Nov 16, 2021

Conversation

paulhauner
Copy link
Member

Issue Addressed

NA

Proposed Changes

Ensures the difficulty/hash/epoch overrides change the ChainSpec. This will result in changes to the /eth/v1/config/spec when the overrides are used, I think this is the correct behaviour (@ajsutton agrees, at least).

Additional Info

NA

Copy link
Member

@realbigsean realbigsean left a comment

Choose a reason for hiding this comment

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

Nice! Just had a couple comments and nits.

General question:

Since we check for complete spec compatibility, both the BN and VC will need the override flags to function. It seems like it'd be very difficult to actually socially coordinate this with things like Infura and BN fallbacks. Is there away to go about this without having strict BN <> VC compatibility on these fields?

#[serde(with = "eth2_serde_utils::quoted_u256")]
pub terminal_total_difficulty: Uint256,
pub terminal_block_hash: Hash256,
#[serde(with = "eth2_serde_utils::quoted_u64")]
Copy link
Member

Choose a reason for hiding this comment

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

Epoch uses quoted_u64 by default, so this shouldn't be necessary

Incorrect use of this flag will cause your node to experience a consensus
failure. Be extremely careful with this flag.")
.takes_value(true)
.global(true)
Copy link
Member

Choose a reason for hiding this comment

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

This is going to make these flags available in lighthouse account_manager which is a little strange. But I think this is fixable once we upgrade to clap v3 (v3 is still in beta but I implemented the upgrade here: #2808)

Conversation about why it's not yet fixable:
clap-rs/clap#1183

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it's indeed a bit unfortunate. However, I think I'm OK with that. The ability to ensure a consistent spec across all components is worth the occasional weirdness. With this setup, at least the account_manager has access to a correct spec, if it turns out it needs it later.

.long("terminal-block-hash-override")
.value_name("TERMINAL_BLOCK_HASH")
.help("Used to coordinate manual overrides to the TERMINAL_BLOCK_HASH parameter. \
Accepts a 256-bit decimal integer (not a hex value). \
Copy link
Member

Choose a reason for hiding this comment

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

Seems like this part of the description should be in the terminal-total-difficulty-override description?

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch!

@paulhauner
Copy link
Member Author

Since we check for complete spec compatibility, both the BN and VC will need the override flags to function. It seems like it'd be very difficult to actually socially coordinate this with things like Infura and BN fallbacks. Is there away to go about this without having strict BN <> VC compatibility on these fields?

This is a good question. There was some discussion on the merge tech chat earlier this week. It seemed to get a consensus from clients that we should change this value. These values are a last resort and they're critical to consensus, since setting them wrong can lead to chain splits. So, if we do need to use them then it's going to be a massive coordination effort anyway. Notably, the LH VC only warns if the spec doesn't match, it doesn't error and exit anymore. So, I was thinking it's probably nice to have a little warning around if it turns out we need to do a big coordination effort on these.

@paulhauner
Copy link
Member Author

All comments addressed! Thanks for the review @realbigsean

@paulhauner paulhauner added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Nov 15, 2021
@paulhauner paulhauner merged commit eecf66e into sigp:kintsugi Nov 16, 2021
paulhauner added a commit that referenced this pull request Nov 28, 2021
* Unify loading of eth2_network_config

* Apply overrides at lighthouse binary level

* Remove duplicate override values

* Add merge values to existing net configs

* Make override flags global

* Add merge fields to testing config

* Add one to TTD

* Fix failing engine tests

* Fix test compile error

* Remove TTD flags

* Move get_eth2_network_config

* Fix warn

* Address review comments
paulhauner added a commit that referenced this pull request Nov 28, 2021
* Unify loading of eth2_network_config

* Apply overrides at lighthouse binary level

* Remove duplicate override values

* Add merge values to existing net configs

* Make override flags global

* Add merge fields to testing config

* Add one to TTD

* Fix failing engine tests

* Fix test compile error

* Remove TTD flags

* Move get_eth2_network_config

* Fix warn

* Address review comments
paulhauner added a commit that referenced this pull request Dec 2, 2021
* Unify loading of eth2_network_config

* Apply overrides at lighthouse binary level

* Remove duplicate override values

* Add merge values to existing net configs

* Make override flags global

* Add merge fields to testing config

* Add one to TTD

* Fix failing engine tests

* Fix test compile error

* Remove TTD flags

* Move get_eth2_network_config

* Fix warn

* Address review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kintsugi 🍵 ready-for-review The code is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants