Commit 05961ccc authored by Blaine Malone's avatar Blaine Malone Committed by GitHub

op-deployer: error handling bugs (#12507)

* op-deployer: error handling bugs

* fix: less requests to node to get latest block.
parent 56330c08
...@@ -94,8 +94,10 @@ func DeployOPChain(ctx context.Context, env *Env, bundle ArtifactsBundle, intent ...@@ -94,8 +94,10 @@ func DeployOPChain(ctx context.Context, env *Env, bundle ArtifactsBundle, intent
DelayedWETHPermissionlessGameProxyAddress: dco.DelayedWETHPermissionlessGameProxy, DelayedWETHPermissionlessGameProxyAddress: dco.DelayedWETHPermissionlessGameProxy,
}) })
currentBlock, _ := env.L1Client.BlockNumber(ctx) block, err := env.L1Client.BlockByNumber(ctx, nil)
block, _ := env.L1Client.BlockByNumber(ctx, big.NewInt(int64(currentBlock))) if err != nil {
return fmt.Errorf("failed to get latest block by number: %w", err)
}
currentBlockHash := block.Hash() currentBlockHash := block.Hash()
errCh := make(chan error, 8) errCh := make(chan error, 8)
...@@ -137,7 +139,7 @@ func DeployOPChain(ctx context.Context, env *Env, bundle ArtifactsBundle, intent ...@@ -137,7 +139,7 @@ func DeployOPChain(ctx context.Context, env *Env, bundle ArtifactsBundle, intent
var lastTaskErr error var lastTaskErr error
for i := 0; i < len(setImplementationAddressTasks); i++ { for i := 0; i < len(setImplementationAddressTasks); i++ {
taskErr := <-errCh taskErr := <-errCh
if lastTaskErr != nil { if taskErr != nil {
lastTaskErr = taskErr lastTaskErr = taskErr
} }
} }
......
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