Commit d11d6495 authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

op-deployer: Remove unused Isthmus code path (#13668)

parent 1c9e369d
...@@ -44,11 +44,6 @@ func (input *DeployOPChainInputV160) InputSet() bool { ...@@ -44,11 +44,6 @@ func (input *DeployOPChainInputV160) InputSet() bool {
return true return true
} }
type DeployOPChainInputIsthmus struct {
DeployOPChainInputV160
SystemConfigFeeAdmin common.Address
}
type DeployOPChainOutput struct { type DeployOPChainOutput struct {
OpChainProxyAdmin common.Address OpChainProxyAdmin common.Address
AddressManager common.Address AddressManager common.Address
...@@ -77,15 +72,7 @@ type DeployOPChainScript struct { ...@@ -77,15 +72,7 @@ type DeployOPChainScript struct {
} }
func DeployOPChainV160(host *script.Host, input DeployOPChainInputV160) (DeployOPChainOutput, error) { func DeployOPChainV160(host *script.Host, input DeployOPChainInputV160) (DeployOPChainOutput, error) {
return deployOPChain(host, input) return RunScriptSingle[DeployOPChainInputV160, DeployOPChainOutput](host, input, "DeployOPChain.s.sol", "DeployOPChain")
}
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")
} }
type ReadImplementationAddressesInput struct { type ReadImplementationAddressesInput struct {
......
...@@ -24,34 +24,15 @@ func DeployOPChain(env *Env, intent *state.Intent, st *state.State, chainID comm ...@@ -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) 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 var dco opcm.DeployOPChainOutput
lgr.Info("deploying OP chain using local allocs", "id", chainID.Hex()) 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 { if err != nil {
return fmt.Errorf("error deploying OP chain: %w", err) return fmt.Errorf("error deploying OP chain: %w", err)
} }
...@@ -67,7 +48,7 @@ func DeployOPChain(env *Env, intent *state.Intent, st *state.State, chainID comm ...@@ -67,7 +48,7 @@ func DeployOPChain(env *Env, intent *state.Intent, st *state.State, chainID comm
readInput := opcm.ReadImplementationAddressesInput{ readInput := opcm.ReadImplementationAddressesInput{
DeployOPChainOutput: dco, DeployOPChainOutput: dco,
Opcm: opcmAddr, Opcm: dci.Opcm,
Release: release, Release: release,
} }
impls, err := opcm.ReadImplementationAddresses(env.L1ScriptHost, readInput) impls, err := opcm.ReadImplementationAddresses(env.L1ScriptHost, readInput)
...@@ -151,18 +132,6 @@ func makeDCIV160(intent *state.Intent, thisIntent *state.ChainIntent, chainID co ...@@ -151,18 +132,6 @@ func makeDCIV160(intent *state.Intent, thisIntent *state.ChainIntent, chainID co
}, nil }, 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 { func makeChainState(chainID common.Hash, dco opcm.DeployOPChainOutput) *state.ChainState {
return &state.ChainState{ return &state.ChainState{
ID: chainID, ID: chainID,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment