Convert add-chain.sh into a go package#204
Merged
bitwiseguy merged 33 commits intomainfrom May 3, 2024
Merged
Conversation
bitwiseguy
commented
Apr 23, 2024
bitwiseguy
commented
Apr 23, 2024
geoknee
reviewed
Apr 24, 2024
geoknee
reviewed
Apr 24, 2024
Collaborator
Author
|
@geoknee regarding your test failure : I'm hoping this commit will fix it because I believe the smart contract function name is case sensitive. Let me know if it helps. |
Collaborator
This ended up being a problem with my local setup. I fixed that and the script worked! |
Collaborator
|
Looks like tests failed at least once because of rate limiting. To combat that we could follow this pattern: superchain-registry/validation/l2oo_test.go Lines 101 to 104 in 1e360a8 |
geoknee
reviewed
May 2, 2024
geoknee
approved these changes
May 2, 2024
Collaborator
geoknee
left a comment
There was a problem hiding this comment.
This looks good to me but left quite a few comments.
mds1
reviewed
May 2, 2024
mds1
reviewed
May 2, 2024
mds1
reviewed
May 2, 2024
mds1
reviewed
May 2, 2024
geoknee
reviewed
May 2, 2024
mds1
approved these changes
May 3, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR converts most of the existing
add-chain.shshell script code into go. As theadd-chain.shshell script grows more complex, it requires us to cover more edge cases and complex conditional statements/branching logic. Golang has the following advantages compared to shell scripting:Tests
An end-to-end test has been added at
add-chain/e2e_test.go.Additional context
This aims to be backwards compatible with the existing documentation in CONTRIBUTING.md that instructs the user to execute
sh ./scripts/add-chain.sh standard. Therefore, no documentation changes need to be made as a result of this work.The
add-chain.shscript becomes a wrapper that invokes two go programs:superchain-registry/add-chainoptimism/op-chain-ops/cmd/registry-dataFollow-up work could include moving [2] from the
optimismmonorepo into a new directory within thesuperchain-registryrepo:superchain-registry/registry-data. This would require removing some light dependencies that program currently has onop-serviceutility functions, but it would allow all of the scripts/programs related to adding a chain to the superchain-registry to live in thesuperchain-registryrepo.Metadata
add-chain.sh#177