Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Add CurrentBlock in backends.BlockChainForCaller #1893

Merged
merged 2 commits into from
Jul 26, 2023

Conversation

2dvorak
Copy link
Collaborator

@2dvorak 2dvorak commented Jul 25, 2023

Proposed changes

  • CurrentHeader() may mismatch with CurrentBlock() (see Fix to resolve node loading failure after unexpected node termination #1766).
  • So add CurrentBlock() in backends.BlockChainForCaller to replace CurrentHeader()
  • Following interfaces or structs have direct/indirect dependency with backends.BlockChainForCaller so also added CurrentBlock() to them
    • reward.blockChain is used as backends.BlockChainForCaller
    • consensus.ChainReader is used as backends.BlockChainForCaller
    • blockchain.HeaderChain is used as consensus.ChainReader
      • Since HeaderChain does not have blocks, its implementation of CurrentBlock immediately panics

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

Further comments

None

CurrentHeader may mismatch with CurrentBlock. So add CurrentBlock
in backends.BlockChainForCaller and its dependent interfaces
to replace CurrentHeader.
@2dvorak 2dvorak self-assigned this Jul 25, 2023
@2dvorak 2dvorak marked this pull request as ready for review July 25, 2023 07:50
@2dvorak 2dvorak mentioned this pull request Jul 25, 2023
9 tasks
blukat29
blukat29 previously approved these changes Jul 25, 2023
@2dvorak 2dvorak added the need to merge Need to merge for the next time label Jul 25, 2023
@2dvorak 2dvorak added this to the v1.11.0 milestone Jul 25, 2023
Thanks for the feedback.
@2dvorak 2dvorak merged commit d5f9190 into klaytn:dev Jul 26, 2023
2 checks passed
@aidan-kwon aidan-kwon mentioned this pull request Aug 3, 2023
20 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need to merge Need to merge for the next time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants