-
Notifications
You must be signed in to change notification settings - Fork 801
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
[Merged by Bors] - VC: accept unknown fields in chain spec #2277
Conversation
c4e7f5d
to
d831e8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, we added deny_unknown_fields
because we realised we were silently ignoring some parameters in ef_tests
. Perhaps we could retain this functionality by doing something like:
#[cfg_attr(feature = "strict_yaml_config", serde(deny_unknown_fields))]
And then turning that on in ef_tests
. What are your thoughts? I'm not fully set on doing this.
Ah yeah, good idea! I think most errors would be caught by the test below (which used not exist), but it doesn't hurt to be extra-strict in testing: lighthouse/testing/ef_tests/tests/tests.rs Lines 7 to 20 in b34a79d
I'll add the cfg |
Actually, it can be more lightweight than that. We can just assert that |
Done. Let me know if that soln suits you @paulhauner 😊 |
-A clippy::from-over-into \ | ||
-A clippy::upper-case-acronyms \ | ||
-A clippy::vec-init-then-push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were a large number of places where we violated these lints, so I think we should leave them for another time. Particularly so we don't introduce unnecessary noise to conflict with other larger refactors that are ongoing (e.g. #2279).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! The extra_fields
trick is cool, I didn't know we could do that!
EDIT: looks like CI is a little unhappy.
bors r+ |
## Issue Addressed Closes #2274 ## Proposed Changes * Modify the `YamlConfig` to collect unknown fields into an `extra_fields` map, instead of failing hard. * Log a debug message if there are extra fields returned to the VC from one of its BNs. This restores Lighthouse's compatibility with Teku beacon nodes (and therefore Infura)
commit 84cbc2f Author: Michael Sproul <[email protected]> Date: Fri Mar 26 14:34:44 2021 +1100 Fixup release test commit b34429a Author: Michael Sproul <[email protected]> Date: Fri Mar 26 12:30:17 2021 +1100 Fix Clippy + Rust 1.51.0 issues commit d16d847 Author: Michael Sproul <[email protected]> Date: Fri Mar 26 11:09:10 2021 +1100 Be strict about extra fields in EF tests commit d831e8a Author: Michael Sproul <[email protected]> Date: Tue Mar 23 11:07:18 2021 +1100 VC: accept unknown fields in chain spec
Pull request successfully merged into unstable. Build succeeded: |
Issue Addressed
Closes #2274
Proposed Changes
YamlConfig
to collect unknown fields into anextra_fields
map, instead of failing hard.This restores Lighthouse's compatibility with Teku beacon nodes (and therefore Infura)