contracts-bedrock: Invalid format of L1_RPC_URL causes configuration in getting-started.json error
Bug Description
Invalid environment L1_RPC_URL (e.g. string that is not RPC URL) causes incorrect string format injected to getting-started.json. From config.sh in packages/contracts-bedrock/scripts/getting-started/config.sh, if L1_RPC_URL is not valid RPC url, it will prompt error in shell and incorrect string injected as mentioned.
Error:
No such file or directory (os error 2)
Steps to Reproduce
This was referenced from tutorial.
- Add incorrect
L1_RPC_URLurl to.envrc - Run script
packages/contracts-bedrock/scripts/getting-started/config.sh - This will be resulted as above.
Expected behavior
Validation in config.sh with an error prompt indicating that current L1_RPC_URL is not valid could help fellow newcomers know what's wrong and helps them follow along tutorial more easily.
PS. Happy to help fixing this issue but not really sure if there are any other conditions is needed to validate.
Environment Information:
- Operating System: [e.g. Ubuntu 20.04]
- Package Version (or commit hash): [e.g. op-node v1.5.1, op-node c934019]
Configurations:
# Any of invalid RPC URL should result errors
export L1_RPC_URL=alchemy
# Other configuration is the same to tutorial.
Logs:
Result on running packages/contracts-bedrock/scripts/getting-started/config.sh with invalid environment variable.
Error:
No such file or directory (os error 2)
⚠️ Notice: Issues that do not include the following sections will be subject to closure:
- Bug Description
- Steps to Reproduce
- Environment Information
Please ensure all required sections are filled out accurately to expedite the debugging process and improve issue resolution efficiency.
Yeah, good catch. I think it would be best if the script caught this.