nervosnetwork / ckb

The Nervos CKB is a public permissionless blockchain, and the layer 1 of Nervos network.
https://www.nervos.org
MIT License
1.15k stars 228 forks source link

Put parent_header to `PreloadUnverified`, and keep small block in memory #4461

Closed eval-exec closed 4 months ago

eval-exec commented 4 months ago

LonelyBlockHash

What problem does this PR solve?

  1. keep small block in LonelyBlockHash Change
    pub struct LonelyBlockHash {
    /// block
    pub block_number_and_hash: BlockNumberAndHash,

    to

    pub struct LonelyBlockHash {
    /// block
    pub block_number_and_hash: Either<BlockNumberAndHash, Arc<BlockView>>,
  2. put parent_header to PreloadUnverified

What's Changed:

Related changes

Check List

Tests

Side effects

Release note

None: Exclude this PR from the release note.