-
Notifications
You must be signed in to change notification settings - Fork 278
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 handling of config values reading bad configuration #7566
Conversation
The constants that got moved have caused issues in remote config, and now in local config. This change defaults the values, which means if they're not supplied it'll silently succeed assuming the values from old constant values. I've reverted the initial remote config change, as it didn't really address the local loading issue mentioned in Consensys#7555, and it was potentially also applying in the incorrect order. `MIN_EPOCHS_FOR_BLOCK_REQUESTS` is different on mainnet and minimal, so that will be using the mainnet value by default. fixes Consensys#7555 Signed-off-by: Paul Harris <paul.harris@consensys.net>
Signed-off-by: Paul Harris <paul.harris@consensys.net>
Signed-off-by: Paul Harris <paul.harris@consensys.net>
ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/SpecConfigBuilder.java
Outdated
Show resolved
Hide resolved
Why attempting to load config doesn't solve the issue? Is because web3signer doesn't use |
Maybe implement it in similar way to this? https://github.com/ConsenSys/teku/blob/6d4572ab8d6554f95035468aee97a4b8a221bb40/teku/src/main/java/tech/pegasys/teku/cli/subcommand/ValidatorClientCommand.java#L59 |
I'm not 100% sure on web3signer, but the old configuration being loaded didn't have the required values. Basically the constants we moved had well defined values, so this is a potential solution. by initialising to the values from constants, if an implementation doesn't provide the (now configured) value, it can fall back to the constant, and by 'hard coding' here we can minimise breakages on custom config and interop between clients that are yet to implement these config elements.
I think the future answer is if we move a constant, it should also be listed in a preset, that'd be the ideal. The main thing i need is to be able to have any actual configured values override the defaults that get set so that networks work correctly. One option would be to just add a note saying 'all these values must be set in configuration', but that doesnt help remote VC interactions with other clients (which the initial remote vc ticket was about) |
Signed-off-by: Paul Harris <paul.harris@consensys.net>
As per my comment here I think we should not do this. We could eventually consider the initial approach which was trying to load |
I'm on one side with Enrico, and we should follow spec. But if we decide to add some handy UX for non-spec configs, we may introduce dedicated flag, something like |
The thing about that is it does solve 'forever', but it's a bit of a mess. if i go that way i'm going to need to make a lot larger change so that people whats magically populated for them i think, and i was hoping to avoid that, but i guess i'll hack something together. This solution uses the actual constant values that was moved, so its far more targeted, and IMO more appropriate to the problem, but I can spend a day on it and see if there's a not awful, more generic, solution we can use. |
But what if we simply do nothing? |
At a bare minimum we can't just tell people the first flag and expect them to sit through 20 failures, thats horrible. |
For local configuration, will still fail to load, but will provide all of the fields failing validation, not just the first. Arguably we could have a CLI arg that loads default config for local resources also, but Im not sure that it should be the default, as we'd be hiding actual configuration issues and never be made aware. Error will be ``` java.lang.IllegalArgumentException: The specified network configuration had missing or invalid values for constants GOSSIP_MAX_SIZE, ATTESTATION_SUBNET_PREFIX_BITS, RESP_TIMEOUT, ATTESTATION_SUBNET_EXTRA_BITS, MAXIMUM_GOSSIP_CLOCK_DISPARITY, MAX_CHUNK_SIZE, ATTESTATION_PROPAGATION_SLOT_RANGE, MESSAGE_DOMAIN_INVALID_SNAPPY, TTFB_TIMEOUT, EPOCHS_PER_SUBNET_SUBSCRIPTION, MESSAGE_DOMAIN_VALID_SNAPPY, ATTESTATION_SUBNET_COUNT, MIN_EPOCHS_FOR_BLOCK_REQUESTS, MAX_REQUEST_BLOCKS ``` which is arguably harder to read, but doesnt force you to fix one, rinse repeat until you've got a valid configuration. Signed-off-by: Paul Harris <paul.harris@consensys.net>
Signed-off-by: Paul Harris <paul.harris@consensys.net>
ethereum/spec/src/main/java/tech/pegasys/teku/spec/config/builder/SpecBuilderUtil.java
Dismissed
Show dismissed
Hide dismissed
Yes that would be super nice. |
this should be in a state to merge @tbenr just need approval... |
Also improved a test case to allow us to see multiple fields returned (without listing the actual fields) Signed-off-by: Paul Harris <paul.harris@consensys.net>
The constants that got moved have caused issues in remote config, and now in local config.
RemoteConfig was loading the local config to work around the issue but it was in the wrong order, presets load first, then config.
LocalConfig could potentially do this with a CLI flag but shouldn't be default behaviour IMO, so i've left local config failing.
The error handling has been updated to report all fields not just the first field that fails validation. The error will look something like:
fixes #7555
Documentation
doc-change-required
label to this PR if updates are required.Changelog