Skip to content

(coreth) Write block header/body/receipts on Accept instead of Verify #4628

@DracoLi

Description

@DracoLi

This issue is part of the effort to integrate blockdb in coreth.

Problem

Currently, coreth writes block headers, bodies, and receipts to disk during Verify. However, to simplify the integration with blockdb, we need to write these blocks to disk during Accept instead. This ensures that only one block per height will be persisted in the height-indexed db and aligns with the block persistent behaviour of other non-evm VMs (eg platform vm).

Motivation

While blocks will be written on Accept as part of SAE, this allows the blockdb + coreth integration to be shipped earlier and not dependent on SAE release timeline.

Solution

Move the persistence of block headers, bodies, and receipts from Verify to Accept. During Verify, we will cache the block data in memory so it can still be queried. The block data will then be written to disk on Accept.

Metadata

Metadata

Assignees

Labels

Projects

Status

Ready 🚦

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions