-
Notifications
You must be signed in to change notification settings - Fork 2
fix: prevent overwrite existing l2 addresses #40
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
Conversation
scripts/l2/l2-gen-addresses.sh
Outdated
| } | ||
|
|
||
| if check_addresses_exist; then | ||
| echo "Error: Addresses or private keys already exist in .env file. Please remove them first." |
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.
it might be inconvenient to require manual removing the keys in cases such as the deployment failed in the middle and we want to start from scratch. maybe add a flag to allow overwrite?
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.
how about:
- if existing keys exist, check if they are funded
- if funded, run teardown
- backup keys to another file, e.g. .env.bak-202411200953
- overwrite keys and continue script execution
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.
yeah let's do that.
…hub.com/Snapchain/op-chain-deployment into feat/prevent-overwrite-gen-l2-addresses
|
tested this, now ready for review @bap2pecs |
Summary
This PR prevents overwrite of existing generated L2 addresses at the
make l2-preparestep.Currently, if the Ansible script execution fails at any step, re-executing the script will override existing addresses and cause funds to be lost.
Test plan
script logs