Skip to content

Replace SledBackend by ckb-rocksdb#4956

Draft
eval-exec wants to merge 1 commit into
nervosnetwork:developfrom
eval-exec:exec-header-sync-persist
Draft

Replace SledBackend by ckb-rocksdb#4956
eval-exec wants to merge 1 commit into
nervosnetwork:developfrom
eval-exec:exec-header-sync-persist

Conversation

@eval-exec

@eval-exec eval-exec commented Sep 17, 2025

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

This PR want to load/store Headers from/into ckb-rocksdb

What is changed and how it works?

Proposal: xxx
Design doc: TODO

What's Changed:

Related changes

  • Remove SledBackend
  • Load/Store packed::HeaderView from ckb-rocksdb
  • Create a new COLUMN: COLUMN_HEADER_INDEX to store number->hash relation for Headers
  • in processing headers, use insert headers by 1 batch insert transaction instead of 2000x sequencial insert transaction

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code ci-runs-only: [ quick_checks,linters ]

Side effects

  • Performance regression
  • Breaking backward compatibility

Release note

Title Only: Include only the PR title in the release note.

@eval-exec eval-exec requested a review from a team as a code owner September 17, 2025 04:40
@eval-exec eval-exec requested review from quake and removed request for a team September 17, 2025 04:40
@eval-exec eval-exec force-pushed the exec-header-sync-persist branch 3 times, most recently from c4a5b40 to 2996109 Compare September 17, 2025 05:01
@eval-exec eval-exec changed the title Persist HeaderMap and shared_best_header to SledBackend Persist HeaderMap and shared_best_header to SledBackend Sep 17, 2025
@eval-exec eval-exec force-pushed the exec-header-sync-persist branch from 2996109 to a6b5588 Compare September 17, 2025 05:26
@eval-exec eval-exec changed the title Persist HeaderMap and shared_best_header to SledBackend Replace SledBackend by ckb-rocksdb Sep 26, 2025
@eval-exec eval-exec force-pushed the exec-header-sync-persist branch from 1498151 to 62c0d5d Compare October 28, 2025 02:46
@eval-exec eval-exec marked this pull request as draft October 28, 2025 02:46
@eval-exec eval-exec force-pushed the exec-header-sync-persist branch 3 times, most recently from 451ecf9 to 7c7a411 Compare November 22, 2025 03:57
@eval-exec eval-exec force-pushed the exec-header-sync-persist branch 2 times, most recently from 91cfe83 to 0b24cf8 Compare January 6, 2026 08:31
Signed-off-by: Eval EXEC <execvy@gmail.com>
@eval-exec eval-exec force-pushed the exec-header-sync-persist branch from 0b24cf8 to 95c6217 Compare January 6, 2026 08:33
@chainTe

chainTe commented Jun 9, 2026

Copy link
Copy Markdown

Security Review

Result: 3 confirmed finding(s)
Reviewed range: 2f0cbbdacb484b69b2bbc7575f0fa19bf3a278a2..95c62175132b678df7bde3e13b890b4d7c5dd9c9

Validation:

  • Existing broad tests were not run locally; CI is expected to cover them after the branch is buildable.
  • Runtime validation was blocked because shared/src/types/header_map/memory.rs contains unresolved conflict markers.
  • Static source tracing found security-relevant sync regressions.

Notes:

  • Mainnet MIN_CHAIN_WORK_500K is changed to zero, which disables the intended minimum-work gate before block download/assume-valid progression.
  • COLUMN_HEADER_INDEX is keyed only by block number, but get_ancestor_internal(base, number) trusts it before proving the returned hash is an ancestor of base; valid side-branch headers can poison branch-specific ancestor lookups.
  • Block fetching can now proceed from height-only/zero-work best-known headers because the previous total-difficulty superiority check is commented out.

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