@@ -22,7 +22,6 @@ import (
22
22
"github.com/ethereum-optimism/optimism/op-bindings/bindings"
23
23
"github.com/ethereum-optimism/optimism/op-bindings/predeploys"
24
24
"github.com/ethereum-optimism/optimism/op-chain-ops/clients"
25
- "github.com/ethereum-optimism/optimism/op-chain-ops/genesis"
26
25
"github.com/ethereum/go-ethereum/common"
27
26
"github.com/ethereum/go-ethereum/ethclient"
28
27
"github.com/ethereum/go-ethereum/log"
@@ -76,29 +75,6 @@ func entrypoint(ctx *cli.Context) error {
76
75
}
77
76
78
77
log .Info ("Checking predeploy proxy config" )
79
- g := new (errgroup.Group )
80
-
81
- // Check that all proxies are configured correctly
82
- // Do this in parallel but not too quickly to allow for
83
- // querying against rate limiting RPC backends
84
- count := uint64 (2048 )
85
- for i := uint64 (0 ); i < count ; i ++ {
86
- i := i
87
- if i % 4 == 0 {
88
- log .Info ("Checking proxy" , "index" , i , "total" , count )
89
- if err := g .Wait (); err != nil {
90
- return err
91
- }
92
- }
93
- g .Go (func () error {
94
- return checkPredeploy (clients .L2Client , i )
95
- })
96
- }
97
-
98
- if err := g .Wait (); err != nil {
99
- return err
100
- }
101
- log .Info ("All predeploy proxies are set correctly" )
102
78
103
79
// Check that all of the defined predeploys are set up correctly
104
80
for name , pre := range predeploys .Predeploys {
@@ -110,23 +86,6 @@ func entrypoint(ctx *cli.Context) error {
110
86
return nil
111
87
}
112
88
113
- // checkPredeploy ensures that the predeploy at index i has the correct proxy admin set
114
- func checkPredeploy (client * ethclient.Client , i uint64 ) error {
115
- bigAddr := new (big.Int ).Or (genesis .BigL2PredeployNamespace , new (big.Int ).SetUint64 (i ))
116
- addr := common .BigToAddress (bigAddr )
117
- if pre , ok := predeploys .PredeploysByAddress [addr ]; ok && pre .ProxyDisabled {
118
- return nil
119
- }
120
- admin , err := getEIP1967AdminAddress (client , addr )
121
- if err != nil {
122
- return err
123
- }
124
- if admin != predeploys .ProxyAdminAddr {
125
- return fmt .Errorf ("%s does not have correct proxy admin set" , addr )
126
- }
127
- return nil
128
- }
129
-
130
89
// checkPredeployConfig checks that the defined predeploys are configured correctly
131
90
func checkPredeployConfig (client * ethclient.Client , name string ) error {
132
91
predeploy := predeploys .Predeploys [name ]
@@ -136,50 +95,6 @@ func checkPredeployConfig(client *ethclient.Client, name string) error {
136
95
p := predeploy .Address
137
96
138
97
g := new (errgroup.Group )
139
- if ! predeploy .ProxyDisabled {
140
- // Check that an implementation is set. If the implementation has been upgraded,
141
- // it will be considered non-standard. Ensure that there is code set at the implementation.
142
- g .Go (func () error {
143
- impl , err := getEIP1967ImplementationAddress (client , p )
144
- if err != nil {
145
- return err
146
- }
147
- log .Info (name , "implementation" , impl .Hex ())
148
- standardImpl , err := genesis .AddressToCodeNamespace (p )
149
- if err != nil {
150
- return err
151
- }
152
- if impl != standardImpl {
153
- log .Warn (name + " does not have the standard implementation" )
154
- }
155
- implCode , err := client .CodeAt (context .Background (), impl , nil )
156
- if err != nil {
157
- return err
158
- }
159
- if len (implCode ) == 0 {
160
- return fmt .Errorf ("%s implementation is not deployed" , name )
161
- }
162
- return nil
163
- })
164
-
165
- // Ensure that the code is set to the proxy bytecode as expected
166
- // This will not work against production networks where the bytecode
167
- // has deviated from the current bytecode. We need a more reliable way to check for this.
168
- g .Go (func () error {
169
- proxyCode , err := client .CodeAt (context .Background (), p , nil )
170
- if err != nil {
171
- return err
172
- }
173
- proxy , err := bindings .GetDeployedBytecode ("Proxy" )
174
- if err != nil {
175
- return err
176
- }
177
- if ! bytes .Equal (proxyCode , proxy ) {
178
- return fmt .Errorf ("%s does not have the standard proxy code" , name )
179
- }
180
- return nil
181
- })
182
- }
183
98
184
99
// Check the predeploy specific config is correct
185
100
g .Go (func () error {
@@ -981,24 +896,6 @@ func checkPredeployBytecode(addr common.Address, client *ethclient.Client, expec
981
896
return nil
982
897
}
983
898
984
- func getEIP1967AdminAddress (client * ethclient.Client , addr common.Address ) (common.Address , error ) {
985
- slot , err := client .StorageAt (context .Background (), addr , genesis .AdminSlot , nil )
986
- if err != nil {
987
- return common.Address {}, err
988
- }
989
- admin := common .BytesToAddress (slot )
990
- return admin , nil
991
- }
992
-
993
- func getEIP1967ImplementationAddress (client * ethclient.Client , addr common.Address ) (common.Address , error ) {
994
- slot , err := client .StorageAt (context .Background (), addr , genesis .ImplementationSlot , nil )
995
- if err != nil {
996
- return common.Address {}, err
997
- }
998
- impl := common .BytesToAddress (slot )
999
- return impl , nil
1000
- }
1001
-
1002
899
// getInitialized will get the initialized value in storage of a contract.
1003
900
// This is an incrementing number that starts at 1 and increments each time that
1004
901
// the contract is upgraded.
0 commit comments