prysm icon indicating copy to clipboard operation
prysm copied to clipboard

chore(BlockByTimestamp): Remove unnecessary conversion and infeasible check, add a case in `findMinTargetEth1Block`

Open letonchanh opened this issue 1 year ago • 0 comments

What type of PR is this?

  • Other

What does this PR do? Why is it needed?

  • In findMinTargetEth1Block, handle an additional case when the header with the current number does not exist, then return the previous header, the latest header whose timestamp is just earlier than the target time.
  • Change the type of cursorNum from *big.Int to uint64 to avoid unnecessary conversion from big.Int to uint64.
  • Remove an infeasible check in retrieveHeaderInfo as the case is already handled by HeaderByNumber.

Which issues(s) does this PR fix?

N/A

Other notes for review

letonchanh avatar Mar 28 '24 21:03 letonchanh