testinprod-io / op-erigon

Optimism implementation on the efficiency frontier
https://op-erigon.testinprod.io
GNU Lesser General Public License v3.0
86 stars 15 forks source link

Start a OP mainnet node with pruning enabled #171

Open andreclaro opened 4 months ago

andreclaro commented 4 months ago

Question

How can we use op-erigon with pruning setting on optimism mainnet?

Details

we are testing op-erigon pruning features... How can we start a OP mainnet node with pruning enabled? I tried to start using the following snapshots and got error erigon[3671786]: not allowed change of --prune flag, last time you used: in op-erigon

The problem is that op-erigon requires pre-bedrock data to start, however the snapshots available have pruning disabled... Is that the problem?

How can we use op-erigon with pruning setting on optimism mainnet?

Thanks

andreclaro commented 4 months ago

From the documentation, it seems we really need to start op-erigon from the pre-bedrock snapshop and consequently we will be unable to setup pruning...

https://github.com/testinprod-io/op-erigon?tab=readme-ov-file#caution

Could anyone confirm this assumption? Is there any workaround?

Thanks!

mininny commented 3 months ago

@andreclaro You're right in that op-erigon's pre-bedrock snapshot was built with prune disabled, and erigon requires the whole db to have the same prune setting. So, we'd need to re-create the pre-bedrock snapshot with the prune setting enabled as well. This task might take some time for us to check it and recreate the db.

Is this an active problem on your end? Do you have to have the prune enabled for your node?

andreclaro commented 3 months ago

We want to configure our nodes (base/optimism mainnet/sepolia) to keep just 1 month worth of blocks.

Pruning flags:

# Prune blocks older than 1,300,000 (roughly 1 month).
    --prune.h.older=1300000 \
    --prune.r.older=1300000 \
    --prune.t.older=1300000 \
    --prune.c.older=1300000 \

The problem is that about snapshots is that it needs to match the pruning settings, right?

andreclaro commented 3 months ago

op-geth with snap sync and op-reth do not need bedrock snapshots for OP mainnet.

Can you also implement something like snap sync on op-erigon?!?!

source: https://geth.ethereum.org/docs/fundamentals/sync-modes

mininny commented 3 months ago

Erigon is archive node by default and it doesn't have snap sync like op-geth. Also, the op-reth's docs says they don't support op mainnet yet because of the bedrock snapshot.

AFAIK, there is ongoing work on the next major release of erigon v3, and they plan on making something like snap sync. When the erigon team releases the v3, we will bring that feature to op-erigon too. As for brining the prune flag to the snapshot, is this high priority for your team?

andreclaro commented 3 months ago

We will reassess op-erigon later again... so snapshots with prune flags are currently not required, but it will be nice to be able to spin-up a node from a snapshot with pruning enabled and the snapshot can have pruning enable (same of different pruning settings) or not.

Awesome to know erigon v3, will support something like snap sync. I reviewed their 2024 roadmap a couple of weeks ago (https://erigon.tech/erigons-roadmap-to-2024/). Is there a more detailed roadmap? thanks