Skip to content

Commit

Permalink
Increase timeout for GetBlockHashByNumber function (#3754)
Browse files Browse the repository at this point in the history
During tests of the RFC 12 implementation, we discovered that the
timeout of 10 seconds for `GetBlockHashByNumber` is sometimes too short.
Here we are increasing it to 30 seconds to improve success rate.
  • Loading branch information
tomaszslabon authored Dec 8, 2023
2 parents 52592e0 + 217d601 commit 1d813c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/chain/ethereum/ethereum.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,9 @@ func (bc *baseChain) currentBlock() (*types.Block, error) {
}

// blockByNumber returns the block for the given block number. Times out
// if the underlying client call takes more than 10 seconds.
// if the underlying client call takes more than 30 seconds.
func (bc *baseChain) blockByNumber(number uint64) (*types.Block, error) {
ctx, cancelCtx := context.WithTimeout(context.Background(), 10*time.Second)
ctx, cancelCtx := context.WithTimeout(context.Background(), 30*time.Second)
defer cancelCtx()

return bc.client.BlockByNumber(ctx, big.NewInt(int64(number)))
Expand Down

0 comments on commit 1d813c5

Please sign in to comment.