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

feat(internal/client): Implement read only BlockState for ClientAdapter #4549

Draft
wants to merge 8 commits into
base: development
Choose a base branch
from

Conversation

dimartiro
Copy link
Contributor

@dimartiro dimartiro commented Feb 18, 2025

Changes

Implement read only methods from BlockState in ClientAdapter

  • Implements all read only methods from BlockState
    • BestBlock() (*types.Block, error)
    • BestBlockHash() common.Hash
    • BestBlockHeader() (*types.Header, error)
    • BestBlockNumber() (number uint, err error)
    • GenesisHash() common.Hash
    • GetBlockBody(hash common.Hash) (*types.Body, error)
    • GetBlockStateRoot(bhash common.Hash) (common.Hash, error)
    • GetBlockByHash(common.Hash) (*types.Block, error)
    • GetBlockByNumber(blockNumber uint) (*types.Block, error)
    • GetFinalisedHeader(round, setID uint64) (*types.Header, error)
    • GetFinalisedHash(round, setID uint64) (common.Hash, error)
    • GetHashesByNumber(blockNumber uint) ([]common.Hash, error)
    • GetHashByNumber(blockNumber uint) (common.Hash, error)
    • GetHeader(bhash common.Hash) (*types.Header, error)
    • GetHeaderByNumber(num uint) (*types.Header, error)
    • GetHighestFinalisedHeader() (*types.Header, error)
    • GetHighestFinalisedHash() (common.Hash, error)
    • GetHighestRoundAndSetID() (uint64, uint64, error)
    • GetJustification(common.Hash) ([]byte, error)
    • GetNonFinalisedBlocks() []common.Hash
    • GetSlotForBlock(common.Hash) (uint64, error)
    • HasFinalisedBlock(round, setID uint64) (bool, error)
    • HasHeader(hash common.Hash) (bool, error)
    • HasJustification(hash common.Hash) (bool, error)
    • HasHeaderInDatabase(hash common.Hash) (bool, error)
    • NumberIsFinalised(blockNumber uint) (bool, error)
  • Tests

Tests

make test

Issues

Closes: #4461

@dimartiro dimartiro self-assigned this Feb 18, 2025
@dimartiro dimartiro force-pushed the diego/client_translation_shim branch 2 times, most recently from 17e4e54 to 3c55321 Compare February 19, 2025 01:52
Base automatically changed from diego/client_translation_shim to development February 19, 2025 13:06
@dimartiro dimartiro force-pushed the diego/client-read_only-blockstate branch from 8f7d740 to fd604e9 Compare February 20, 2025 16:20
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.

Implement read only BlockState functionality to translation shim type
1 participant