Skip to content

chore(TODO): Implement caching for ConsensusBlock size #72

@ikwuoz

Description

@ikwuoz

pub fn size_bytes(&self) -> ByteSize {
// TODO: Cache this
ByteSize::b(block_as_ssz_data(self).ssz_bytes_len() as u64)
}

Propose a caching implementation for ConsensusBlock size by:

  • Introducing a new ConsensusBlock field cached_size_bytes of type OnceLock from std
  • Lazily initialize this field on demand in size_bytes
  • Update references to ConsensusBlock in codebase

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions