-
Notifications
You must be signed in to change notification settings - Fork 158
Blockdb integration poc #1079
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
Blockdb integration poc #1079
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really glad you tried to match interfaces as much as possible. The fact that blockDb can only store one block at any height is pretty prohibitive right now - I think some of this would be resolved with SAE, but @StephenButtolph would have more details on this
snaptree *snapshot.Tree | ||
} | ||
|
||
func ReadHeadBlock(db ethdb.Database, blockDb ethblockdb.Database) *types.Block { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function feels out of place here
if !bc.blockDb.HasBlock(blockNumber) { | ||
bc.blockDb.WriteBlock(block) | ||
} else { | ||
// write block to the chaindb if we already stored a block at the same height |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems really confusing, we only use blockDB
to store 1 block at any given height? This seems fine after SAE but is pretty incompatible until then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note: we usually use the prefix eth
to mean that it was taken from upstream (i.e. go-ethereum). You should drop it from this folder name
replaced by #1189 |
Why this should be merged
Shouldn't be merged in as is.
This is a POC for integrating a dedicated block database via
blockdb
and a starting point to start the discussion on how to best integratex/blockdb
into coreth.How this works
Updates coreth to use
blockdb
for block storage instead of the existing key-valueethdb.Database
. Block related data like hash -> block number mapping, receipts are all still stored in the eth database. Only the raw block bytes (block header and body) are moved out into the blockdb.Verify
.Reject
is called on them.How this was tested