Skip to content

Commit 9b4658b

Browse files
chore: Improve flow for custom artifacts (#1115)
* chore: Allow op-deployer version overrides for just create-config * chore: A bit of docs * fix: Link versions.json file
1 parent df5d4fe commit 9b4658b

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

docs/ops.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ just create-config <shortname> <path to your state file>
4646

4747
Where `shortname` is your chain's name (e.g. `op`) and the path to the state file points to the `state.json` file generated by `op-deployer`.
4848

49+
> If using custom contracts, `op-deployer` version needs to be specified as the third CLI argument to the `just` command above:
50+
> ```
51+
> just create-config <shortname> <path to your state file> <op deployer version>
52+
> ```
53+
>
54+
> Supported values for the `op-deployer` versions can be found in the <a href="/ops/internal/deployer/versions.json">`versions.json`</a> file.
55+
4956
This will put two files in the `.staging` directory - `<shortname>.toml` and `<shortname>.json.zst`
5057
5158
### 4. Update generated config

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ check-genesis-integrity: (_run_ops_bin 'check_genesis_integrity')
5050
codegen L1_RPC_URLS SUPERCHAINS="":
5151
@just _run_ops_bin "codegen" "--l1-rpc-urls {{L1_RPC_URLS}} --superchains={{SUPERCHAINS}}"
5252

53-
create-config SHORTNAME FILENAME: build-deployer-binaries
54-
@just _run_ops_bin "create_config" "--shortname {{SHORTNAME}} --state-filename $(realpath {{FILENAME}})"
53+
create-config SHORTNAME FILENAME OPDEPLOYERVERSION="": build-deployer-binaries
54+
@just _run_ops_bin "create_config" "--shortname {{SHORTNAME}} --state-filename $(realpath {{FILENAME}}) --op-deployer-version={{OPDEPLOYERVERSION}}"
5555

5656
import-devnet STATEFILE MANIFESTFILE OPDEPLOYERVERSION="": build-deployer-binaries
5757
@just _run_ops_bin "import_devnet" "--state-filename $(realpath {{STATEFILE}}) --manifest-path $(realpath {{MANIFESTFILE}}) --op-deployer-version={{OPDEPLOYERVERSION}}"

ops/cmd/create_config/main.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ var (
3030
EnvVars: []string{"DEPLOYER_CACHE_DIR"},
3131
Value: defaultBinDir(),
3232
}
33+
OpDeployerVersion = &cli.StringFlag{
34+
Name: "op-deployer-version",
35+
Usage: "Version of the op-deployer binary to use.",
36+
EnvVars: []string{"DEPLOYER_VERSION"},
37+
Value: "",
38+
}
3339
)
3440

3541
func main() {
@@ -40,6 +46,7 @@ func main() {
4046
StateFilename,
4147
Shortname,
4248
OpDeployerBinDir,
49+
OpDeployerVersion,
4350
},
4451
Action: action,
4552
}
@@ -57,11 +64,12 @@ func action(cliCtx *cli.Context) error {
5764

5865
statePath := cliCtx.String(StateFilename.Name)
5966
opDeployerBinDir := cliCtx.String(OpDeployerBinDir.Name)
67+
opDeployerVersion := cliCtx.String(OpDeployerVersion.Name)
6068

6169
output.WriteWarn("⚠️ Config generation behavior has changed: now generates only essential addresses by default.")
6270
output.WriteWarn("📄 All addresses are still available in addresses.json")
6371

64-
err = manage.GenerateChainArtifacts(statePath, wd, cliCtx.String(Shortname.Name), nil, nil, 0, "", opDeployerBinDir)
72+
err = manage.GenerateChainArtifacts(statePath, wd, cliCtx.String(Shortname.Name), nil, nil, 0, opDeployerVersion, opDeployerBinDir)
6573
if err != nil {
6674
return fmt.Errorf("failed to generate chain config: %w", err)
6775
}

0 commit comments

Comments
 (0)