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

Research transactional database & persistent memory support #1680

Closed
galaio opened this issue Jun 8, 2023 · 1 comment
Closed

Research transactional database & persistent memory support #1680

galaio opened this issue Jun 8, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@galaio
Copy link
Contributor

galaio commented Jun 8, 2023

This issue will research and discuss if BSC can be migrated to a transactional database, and have persistent memory to solve abnormal scenarios such as panic, force quit, and power shutdown, etc.

If BSC crashes in between writes, the database may be left in an inconsistent state. Especially for FastNode(only snap state), it is even more unacceptable. Usually the error of bad block will be displayed.

Many other similar data inconsistencies have been found, and the only solution is resync.

Transactional Database

Here are some discussions, ethereum/go-ethereum#22143, ethereum/go-ethereum#15717. At the same time, I noticed that prysm has used BoltDB as the underlying storage. An important reason is that boltDB provides the strongest guarantees against data loss.

Erigon uses MDBX as its database, it also supports transactions too.

What needs to be further investigated is, which alternative database is better, how is the performance, especially the higher TPS of BSC than Eth, and how high is the migration cost?

Here are some alternative Databases: LMDB, BoltDB, BadgerDB, MDBX, etc.

Persistent Memory

If BSC supports persistent memory, there is no need to worry about memory loss, especially in more common scenarios such as force quit and panic.

In particular, caches such as snap journals in BSC are relatively important data that need to be guaranteed persistently. Is it possible to introduce a WAL mechanism to ensure the validity of important memory data?

Or can put important cache data into Redis? Further research is needed, and migration costs, performance, and other issues also need to be considered.

Welcome to comment here~

@galaio galaio added the help wanted Extra attention is needed label Jun 8, 2023
@4406arthur
Copy link

Is that cockroachdb/pebble alternative ethdb implementation helpful?

ethereum/go-ethereum#27522

@zzzckck zzzckck closed this as completed Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants