ava-labs / subnet-evm

Launch your own EVM as an Avalanche Subnet
https://docs.avax.network/subnets/create-a-fuji-subnet
GNU Lesser General Public License v3.0
245 stars 225 forks source link

feat: Add possibility to separate databases for subnets #946

Open hitchhooker opened 1 year ago

hitchhooker commented 1 year ago

Is there way to separate P X C with subnet evm somehow? Even having own folder for subnet-evm:s database files would do a great deal.

aaronbuchwald commented 1 year ago

Could you expand on exactly what you mean by separating it?

It would be pretty easy to move the data to its own database it would just require a migration process. Specifically, current instances of Subnet-EVM put their data in the existing AvalancheGo database, so we’d need to remain backwards compatible with that. This would be a great feature request or PR if you’re interested to put one up.

hitchhooker commented 1 year ago

We run quite a few nodes for RPC(full&archive) avalanche & subnets. I feel it would be ideal to be able to run subnet-evm:s not just as plugins but as standalone clients with flag pointing to avalanche endpoint(--platformchain ws://localhost:9650). A bit in similar fashion as ethereum consensus clients or rollups are able to use any ethereum endpoint or polkadot parachains are capable of using any polkadot endpoint instead of needing to run every single time full relaychain node for subnets/rollups.

It is just quite painful place to be when one of the chains/db gets bricked leading loss of all advancement if not proper incremental snapshots in place. I think we had this issue happening on swimmer and dfk this far leading to resync from scratch for ALL chains.

ceyonur commented 1 year ago

There is a flag for partially syncing: only P-chain + subnets you track. See: https://docs.avax.network/nodes/configure/avalanchego-config-flags#partial-sync-primary-network