-
Notifications
You must be signed in to change notification settings - Fork 1k
Append client version info to user graffiti by default #9313
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
base: unstable
Are you sure you want to change the base?
Changes from all commits
78a3ba4
f50cf4e
6cab7f5
bbc0603
0b19d28
322a309
4af8aa8
7a86942
1ad7d99
8861721
0d172c2
bfc4ed4
a3eb614
4da58f9
70667fc
a8ec07b
5f826cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ use beacon_node_fallback::{ApiTopic, beacon_node_health::BeaconNodeSyncDistanceT | |
|
|
||
| use crate::exec::CommandLineTestExec; | ||
| use bls::{Keypair, PublicKeyBytes}; | ||
| use eth2::types::GraffitiPolicy; | ||
| use initialized_validators::DEFAULT_WEB3SIGNER_KEEP_ALIVE; | ||
| use sensitive_url::SensitiveUrl; | ||
| use std::fs::File; | ||
|
|
@@ -261,6 +262,50 @@ fn graffiti_file_with_pk_flag() { | |
| }); | ||
| } | ||
|
|
||
| // Tests for graffiti-append flag | ||
| #[test] | ||
| fn graffiti_append_default() { | ||
| CommandLineTest::new().run().with_config(|config| { | ||
| assert_eq!( | ||
| config.graffiti_policy, | ||
| Some(GraffitiPolicy::AppendClientVersions) | ||
| ); | ||
| }); | ||
| } | ||
|
|
||
| #[test] | ||
| fn graffiti_append_true_flag() { | ||
| CommandLineTest::new() | ||
| .flag("graffiti-append", Some("true")) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also need to test
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a test to prevent regression |
||
| .run() | ||
| .with_config(|config| { | ||
| assert_eq!( | ||
| config.graffiti_policy, | ||
| Some(GraffitiPolicy::AppendClientVersions) | ||
| ); | ||
| }); | ||
| } | ||
|
|
||
| #[test] | ||
| fn graffiti_append_false_flag() { | ||
| CommandLineTest::new() | ||
| .flag("graffiti-append", Some("false")) | ||
| .run() | ||
| .with_config(|config| { | ||
| assert_eq!( | ||
| config.graffiti_policy, | ||
| Some(GraffitiPolicy::PreserveUserGraffiti) | ||
| ); | ||
| }); | ||
| } | ||
|
|
||
| #[test] | ||
| #[should_panic] | ||
| fn graffiti_append_old_behaviour() { | ||
| // Previously the flag is a bool, so passing a None here should panic | ||
| CommandLineTest::new().flag("graffiti-append", None).run(); | ||
| } | ||
|
|
||
| // Tests for suggested-fee-recipient flags. | ||
| #[test] | ||
| fn fee_recipient_flag() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -152,13 +152,13 @@ pub struct ValidatorClient { | |
|
|
||
| #[clap( | ||
| long, | ||
| requires = "graffiti", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this |
||
| help = "When used, client version info will be prepended to user custom graffiti, with a space in between. \ | ||
| This should only be used with a Lighthouse beacon node.", | ||
| help = "Client version info will be appended to user custom graffiti, with a space in between. \ | ||
| This should only be set to false when using a Lighthouse beacon node.", | ||
| display_order = 0, | ||
| default_value = "true", | ||
| help_heading = FLAG_HEADER | ||
| )] | ||
| pub graffiti_append: bool, | ||
| pub graffiti_append: Option<bool>, | ||
|
|
||
| #[clap( | ||
| long, | ||
|
|
||
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.
Should leave as is
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.
Looking at this, I thought I wanted to be consistent with other variables of using
SkipRandaoVerification::Yes, that's probably why I changed to yes. As this is a test that is not related to RANDAO, I guess it is ok to useYeshere?(i.e., the previous
Nois probably not quite right)