paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
4.02k stars 1.24k forks source link

split `DatabaseProvider::insert_block` to isolate transaction-specific writing #9959

Open Rjected opened 4 months ago

Rjected commented 4 months ago

In the new persistence / DB model we will not be first writing transactions to DB and gradually moving to static files. Instead, we will be directly writing transaction data to static files.

The insert_block method by default writes to the transaction and headers tables: https://github.com/paradigmxyz/reth/blob/02d25304f9c3352474a7f57e10467ae7a4038c1f/crates/storage/provider/src/providers/database/provider.rs#L3431

If we split the method, with the first being for transaction + header data, and the other method for everything else, we can use the second method instead of insert_block in the persistence task.

This may also be of use for the bodies stage: https://github.com/paradigmxyz/reth/blob/0fece98b0529788b56b24e806046d585b0517ea9/crates/stages/stages/src/stages/bodies.rs#L115

github-actions[bot] commented 3 months ago

This issue is stale because it has been open for 21 days with no activity.

elijahhampton commented 3 months ago

I can take this one @Rjected

Rjected commented 3 months ago

@elijahhampton assigned!

nkysg commented 3 months ago

Hi, @elijahhampton are you still working on this?

elijahhampton commented 3 months ago

Hi, @elijahhampton are you still working on this?

Yes

Rjected commented 2 months ago

Hi, @elijahhampton are you still working on this?

Yes

@elijahhampton let me know if you need some help or if you have a branch we can take a look at!

elijahhampton commented 2 months ago

Hi, @elijahhampton are you still working on this?

Yes

@elijahhampton let me know if you need some help or if you have a branch we can take a look at!

Sure. Sorry I have a branch ready. I meant to submit it a couple of days ago, but I got distracted. I will submit tonight.

elijahhampton commented 1 month ago

@Rjected Is there anything else needed for this PR?