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

Adds --insecure-validator-i-know-what-i-do flag and new args version #1570

Merged
merged 4 commits into from
Dec 1, 2023

Conversation

mrcnski
Copy link
Contributor

@mrcnski mrcnski commented Dec 1, 2023

I did my best but you'll probably have to clean up after me. 😂

Some things I'm not sure about:

  • Should we always set v2 from now on, or should we check somehow if the flag is supported?
  • Should there be some way to disable the flag? (I say no, since secure-mode is meant for production anyway, unless there is a request for it, since it complicates things.)

closes #1551

@mrcnski mrcnski self-assigned this Dec 1, 2023
@@ -25,5 +25,5 @@ export const getCliArgsVersion = async (

return logs.includes("--ws-port <PORT>")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should check here if the flag --insecure-validator-i-know-what-i-do is present in the output to ensure that is V2, since could be that people are using not the latest version of polkadot.

@@ -9,7 +9,7 @@ export const getCliArgsVersion = async (
): Promise<SubstrateCliArgsVersion> => {
const client = getClient() as KubeClient;
// use echo to not finish the pod with error status.
const fullCmd = `${command} --help | grep ws-port || echo "V1"`;
const fullCmd = `${command} --help | grep ws-port || echo "V2"`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we are checking the output later we should grep for both flags or just remove the grep and use the full help output.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm a bit confused how this works. Why do we echo "v1"? Indeed, it seems like we can just remove the grep in favor of the log checks further down. How could I do that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, let just remove the grep. The main logic behind that echo was to ensure the exit code from the cmd was 0.
Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we just make it echo "" to avoid confusion? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK I get how it works now! Pushed the change. Thanks!

@pepoviola
Copy link
Collaborator

Hi @mrcnski, thanks for your help 🚀, looks great!!! There are a couple of things to change to make it full backward compatible. If you want I can just add those things. Again, thanks for your help!! 🙌

@pepoviola
Copy link
Collaborator

Hi @mrcnski, I just pushed some lint fixes. I think now test should pass and would be ready to go :)

NOTE to me: for a followup pr we can improve the logic to have the check in one place and make the providers only provide the output of the --help cmd.

@pepoviola pepoviola merged commit 6044762 into main Dec 1, 2023
22 checks passed
@pepoviola pepoviola deleted the mrcnski/add-insecure-validator-flag branch December 1, 2023 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

Pass --insecure-validator-i-know-what-i-do flag by default
2 participants