Skip to content

Commit

Permalink
op-deployer: error handling bugs (#12507)
Browse files Browse the repository at this point in the history
* op-deployer: error handling bugs

* fix: less requests to node to get latest block.
  • Loading branch information
blmalone authored Oct 17, 2024
1 parent 56330c0 commit 05961cc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions op-deployer/pkg/deployer/pipeline/opchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,10 @@ func DeployOPChain(ctx context.Context, env *Env, bundle ArtifactsBundle, intent
DelayedWETHPermissionlessGameProxyAddress: dco.DelayedWETHPermissionlessGameProxy,
})

currentBlock, _ := env.L1Client.BlockNumber(ctx)
block, _ := env.L1Client.BlockByNumber(ctx, big.NewInt(int64(currentBlock)))
block, err := env.L1Client.BlockByNumber(ctx, nil)
if err != nil {
return fmt.Errorf("failed to get latest block by number: %w", err)
}
currentBlockHash := block.Hash()

errCh := make(chan error, 8)
Expand Down Expand Up @@ -137,7 +139,7 @@ func DeployOPChain(ctx context.Context, env *Env, bundle ArtifactsBundle, intent
var lastTaskErr error
for i := 0; i < len(setImplementationAddressTasks); i++ {
taskErr := <-errCh
if lastTaskErr != nil {
if taskErr != nil {
lastTaskErr = taskErr
}
}
Expand Down

0 comments on commit 05961cc

Please sign in to comment.