bsc icon indicating copy to clipboard operation
bsc copied to clipboard

core: separated databases for block data

Open jingjunLi opened this issue 2 years ago • 0 comments

Description

This pull request uses the finalized block tag as the indicator for chain freezing and introduces the separation of block data into a dedicated blockdb.

uses the finalized block tag as the indicator for chain freezing

Originally, the latest 90K blocks will be retained in the key-value store by default, which is regarded as "non-finalized" in the context of Proof-of-work. However, in Proof-of-Stake, we do have the concrete finalized block tag from the consensus client. Therefore, it makes more sense to directly rely on the Finalized for chain freezing.

By deploying it on a full node, we can see there are only 23 blocks left in the key-value store. image

introduces the separation of block data into a dedicated blockdb

  • Background recent blocks are first stored in a key-value (KV) database. Once they reach the ancient threshold, they will be moved to the ancient database, which wastes some disk bandwidth. Another thing that we should be aware of is EIP-4844. Once BSC supports EIP-4844, the block size will increase due to the inclusion of blobs. The size of the blob storage may not increase over time, but it will still demand extra disk space from the node operators.
  • Implement Split database by data pattern will make disk bandwidth usage more reasonable and improve the whole performance.

Rationale

tell us why we need these changes...

Example

add an example CLI or API response...

Changes

Notable changes:

  • add each change in a bullet point here
  • ...

jingjunLi avatar Feb 21 '24 01:02 jingjunLi