Skip to content

Commit

Permalink
handle context cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaubennassar committed Nov 12, 2024
1 parent 1a3109b commit f2d99e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/cdk/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"cdk_validium_node_image": "0xpolygon/cdk-validium-node:0.7.0-cdk",
"zkevm_bridge_proxy_image": "haproxy:3.0-bookworm",
"zkevm_bridge_service_image": "hermeznetwork/zkevm-bridge-service:v0.6.0-RC1",
"zkevm_bridge_ui_image": "leovct/zkevm-bridge-ui:multi-network",
"zkevm_bridge_ui_image": "leovct/zkevm-bridge-ui:multi-network-2",
"zkevm_contracts_image": "leovct/zkevm-contracts:v8.0.0-rc.4-fork.12",
"zkevm_da_image": "0xpolygon/cdk-data-availability:0.0.10",
"zkevm_node_image": "hermeznetwork/zkevm-node:v0.7.3",
Expand Down
10 changes: 7 additions & 3 deletions sync/evmdownloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,13 @@ func (d *EVMDownloaderImplementation) WaitForNewBlocks(
case <-ticker.C:
header, err := d.ethClient.HeaderByNumber(ctx, d.blockFinality)
if err != nil {
attempts++
d.log.Error("error getting last block num from eth client: ", err)
d.rh.Handle("waitForNewBlocks", attempts)
if errors.Is(err, context.Canceled) {
attempts++
d.log.Error("error getting last block num from eth client: ", err)
d.rh.Handle("waitForNewBlocks", attempts)
} else {
d.log.Warn("context has been canceled while trying to get header by number")
}
continue
}
if header.Number.Uint64() > lastBlockSeen {
Expand Down

0 comments on commit f2d99e1

Please sign in to comment.