-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
Copy pathsystem.go
63 lines (52 loc) · 1.81 KB
/
system.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package sysext
import (
"encoding/json"
"github.com/ethereum-optimism/optimism/devnet-sdk/devstack/shim"
"github.com/ethereum-optimism/optimism/devnet-sdk/devstack/stack"
"github.com/ethereum-optimism/optimism/op-supervisor/supervisor/backend/depset"
)
func (o *Orchestrator) hydrateSuperchain(sys stack.ExtensibleSystem) {
env := o.env
sys.AddSuperchain(shim.NewSuperchain(shim.SuperchainConfig{
CommonConfig: shim.NewCommonConfig(sys.T()),
ID: stack.SuperchainID(env.Env.Name),
Deployment: newL1AddressBook(sys.T(), env.Env.L1.Addresses),
}))
}
func (o *Orchestrator) hydrateClusterMaybe(sys stack.ExtensibleSystem) {
if !o.isInterop() {
sys.T().Logger().Info("Interop is inactive, skipping cluster")
return
}
require := sys.T().Require()
env := o.env
depsets := o.env.Env.DepSets
for _, d := range depsets {
var depSet depset.StaticConfigDependencySet
require.NoError(json.Unmarshal(d, &depSet))
sys.AddCluster(shim.NewCluster(shim.ClusterConfig{
CommonConfig: shim.NewCommonConfig(sys.T()),
ID: stack.ClusterID(env.Env.Name),
DependencySet: &depSet,
}))
}
}
func (o *Orchestrator) hydrateSupervisorMaybe(sys stack.ExtensibleSystem) {
if !o.isInterop() {
sys.T().Logger().Info("Interop is inactive, skipping supervisor")
return
}
// hack, supervisor is part of the first L2
supervisorService, ok := o.env.Env.L2[0].Services["supervisor"]
if !ok {
sys.T().Logger().Warn("Missing supervisor service")
return
}
// ideally we should check supervisor is consistent across all L2s
// but that's what Kurtosis does.
sys.AddSupervisor(shim.NewSupervisor(shim.SupervisorConfig{
CommonConfig: shim.NewCommonConfig(sys.T()),
ID: stack.SupervisorID(supervisorService.Name),
Client: o.rpcClient(sys.T(), supervisorService, RPCProtocol),
}))
}