Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

letonchanh
Copy link
Contributor

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 letonchanh requested a review from a team as a code owner March 28, 2024 21:43
@letonchanh letonchanh changed the title chore(BlockByTimestamp): chore(BlockByTimestamp): Remove unnecessary conversion and infeasible check, add a case in findMinTargetEth1Block Mar 28, 2024
prestonvanloon
prestonvanloon previously approved these changes Aug 23, 2024
auto-merge was automatically disabled August 27, 2024 19:19

Head branch was pushed to by a user without write access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants