-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add network toggle switch command to cli runtime #467
Conversation
remove unused constant, replace with value from config for testability on testnet
apps/cli/src/index.ts
Outdated
@@ -136,6 +136,22 @@ cli.action(async () => { | |||
cli.outputHelp(); | |||
continue; | |||
} | |||
|
|||
// Show help message if the user asks for it |
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 we remove, or update this comment?
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.
Updated the comment, thanks !
|
||
// Show help message if the user asks for it | ||
if (command === 'toggle-switch-network') { | ||
if(config.defaultNetworkName === "arbitrum"){ |
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 this be arbitrumSepolia instead?
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.
I don't think it should.
If the current config's defaultNetworkName equals "arbitrum" we are currently using mainnet (default) so we switch to testnet, if not we switch back to mainnet.
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.
I understand now, I was thinking the config had already been changed but I follow now, thank you for the clarification!
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.
Looks good, I think the logic may be reversed on the defaultNetworkName, but everything else looks good to me!
@@ -9,7 +9,7 @@ export async function isChallengeSubmitTime(): Promise<{isSubmitTime:boolean, cu | |||
const lastChallengeTime = Number(currentChallenge.createdTimestamp); | |||
|
|||
// Calculate the minimum time to submit an assertion | |||
const minimumTimeToSubmit = lastChallengeTime + MINIMUM_SECONDS_BETWEEN_ASSERTIONS; | |||
const minimumTimeToSubmit = lastChallengeTime + config.minSecondsBetweenChallenges; |
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.
I love how you moved this to the config file.
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.
🙏
For #188385836
Add dev cli command to toggle network switch:
toggle-switch-network
Moved min seconds between challenges constant to config so it can be changes for testnet tests.
Increase loopCount for finding missed assertions, this will return undefined if too many blocks have passed until the latest NodeConfirmed. On testnet after about 10 hours, mainnet will have more blocks passing so this will be a shorter time.
Tested locally, added dev logs to print current config, tested toggle between mainnet and testnet and run commands in between to confirm toggle works.
Built locally and testent challenger and operator on testnet mode while confirming nodes on mockrollup.