Skip to content

Commit

Permalink
op-deployer: error handling bugs (ethereum-optimism#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 and samlaf committed Nov 10, 2024
1 parent d6a6389 commit f33457b
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 f33457b

Please sign in to comment.