Skip to content

Commit

Permalink
op-deployer: Remove unused Isthmus code path (#13668)
Browse files Browse the repository at this point in the history
  • Loading branch information
mslipper authored Jan 9, 2025
1 parent 1c9e369 commit d11d649
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 53 deletions.
15 changes: 1 addition & 14 deletions op-deployer/pkg/deployer/opcm/opchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ func (input *DeployOPChainInputV160) InputSet() bool {
return true
}

type DeployOPChainInputIsthmus struct {
DeployOPChainInputV160
SystemConfigFeeAdmin common.Address
}

type DeployOPChainOutput struct {
OpChainProxyAdmin common.Address
AddressManager common.Address
Expand Down Expand Up @@ -77,15 +72,7 @@ type DeployOPChainScript struct {
}

func DeployOPChainV160(host *script.Host, input DeployOPChainInputV160) (DeployOPChainOutput, error) {
return deployOPChain(host, input)
}

func DeployOPChainIsthmus(host *script.Host, input DeployOPChainInputIsthmus) (DeployOPChainOutput, error) {
return deployOPChain(host, input)
}

func deployOPChain[T any](host *script.Host, input T) (DeployOPChainOutput, error) {
return RunScriptSingle[T, DeployOPChainOutput](host, input, "DeployOPChain.s.sol", "DeployOPChain")
return RunScriptSingle[DeployOPChainInputV160, DeployOPChainOutput](host, input, "DeployOPChain.s.sol", "DeployOPChain")
}

type ReadImplementationAddressesInput struct {
Expand Down
47 changes: 8 additions & 39 deletions op-deployer/pkg/deployer/pipeline/opchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,15 @@ func DeployOPChain(env *Env, intent *state.Intent, st *state.State, chainID comm
return fmt.Errorf("failed to get chain intent: %w", err)
}

var opcmAddr common.Address
var deployFunc func() (opcm.DeployOPChainOutput, error)
switch intent.L1ContractsLocator.Tag {
case standard.ContractsV160Tag, standard.ContractsV170Beta1L2Tag:
deployFunc = func() (opcm.DeployOPChainOutput, error) {
input, err := makeDCIV160(intent, thisIntent, chainID, st)
if err != nil {
return opcm.DeployOPChainOutput{}, fmt.Errorf("error making deploy OP chain input: %w", err)
}

opcmAddr = input.Opcm
return opcm.DeployOPChainV160(env.L1ScriptHost, input)
}
default:
deployFunc = func() (opcm.DeployOPChainOutput, error) {
input, err := makeDCIIsthmus(intent, thisIntent, chainID, st)
if err != nil {
return opcm.DeployOPChainOutput{}, fmt.Errorf("error making deploy OP chain input: %w", err)
}

opcmAddr = input.Opcm
return opcm.DeployOPChainIsthmus(env.L1ScriptHost, input)
}
}

var dco opcm.DeployOPChainOutput
lgr.Info("deploying OP chain using local allocs", "id", chainID.Hex())
dco, err = deployFunc()

dci, err := makeDCIV160(intent, thisIntent, chainID, st)
if err != nil {
return fmt.Errorf("error making deploy OP chain input: %w", err)
}

dco, err = opcm.DeployOPChainV160(env.L1ScriptHost, dci)
if err != nil {
return fmt.Errorf("error deploying OP chain: %w", err)
}
Expand All @@ -67,7 +48,7 @@ func DeployOPChain(env *Env, intent *state.Intent, st *state.State, chainID comm

readInput := opcm.ReadImplementationAddressesInput{
DeployOPChainOutput: dco,
Opcm: opcmAddr,
Opcm: dci.Opcm,
Release: release,
}
impls, err := opcm.ReadImplementationAddresses(env.L1ScriptHost, readInput)
Expand Down Expand Up @@ -151,18 +132,6 @@ func makeDCIV160(intent *state.Intent, thisIntent *state.ChainIntent, chainID co
}, nil
}

func makeDCIIsthmus(intent *state.Intent, thisIntent *state.ChainIntent, chainID common.Hash, st *state.State) (opcm.DeployOPChainInputIsthmus, error) {
dci, err := makeDCIV160(intent, thisIntent, chainID, st)
if err != nil {
return opcm.DeployOPChainInputIsthmus{}, fmt.Errorf("error making deploy OP chain input: %w", err)
}

return opcm.DeployOPChainInputIsthmus{
DeployOPChainInputV160: dci,
SystemConfigFeeAdmin: common.Address{'D', 'E', 'A', 'D'},
}, nil
}

func makeChainState(chainID common.Hash, dco opcm.DeployOPChainOutput) *state.ChainState {
return &state.ChainState{
ID: chainID,
Expand Down

0 comments on commit d11d649

Please sign in to comment.