optimism icon indicating copy to clipboard operation
optimism copied to clipboard

contracts-bedrock: Invalid format of L1_RPC_URL causes configuration in getting-started.json error

Open badgooooor opened this issue 1 year ago • 1 comments

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)

Screenshot 2567-02-26 at 17 48 07

Steps to Reproduce

This was referenced from tutorial.

  1. Add incorrect L1_RPC_URL url to .envrc
  2. Run script packages/contracts-bedrock/scripts/getting-started/config.sh
  3. 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.

badgooooor avatar Feb 26 '24 11:02 badgooooor

Yeah, good catch. I think it would be best if the script caught this.

smartcontracts avatar Mar 05 '24 15:03 smartcontracts