neo-project / neo

NEO Smart Economy
MIT License
3.47k stars 1.03k forks source link

node: Incremental vs ordinary chain dumps #2998

Open roman-khimov opened 1 year ago

roman-khimov commented 1 year ago

Historically we've had two formats for chain dumps, a full one (starting with block 0) and an incremental one (starting from any block number). Those two are different at the file format level and C# node usually differentiates between the two by file name, expecting chain.acc for a full dump and chain.X.acc for an incremental one. NeoGo also supports both, but uses an --incremental flag (it treats any file names as equal and can even read the dump from stdin).

https://sync.ngd.network/ contains "official" dumps that can be used by people and we can see chain.acc published there in the "Full Offline Package" section for Legacy networks, yet we have chain.0.acc in the same section for N3 networks. This means that this dump in fact uses an incremental format. This changes nothing for the C# node, but requires using an --incremental flag with NeoGo which adds some additional cognitive overhead for NeoGo users expecting easy "download/restore/run" experience.

It looks like the reason for using this format is neo-project/neo-node#536, C# node can't produce chain.acc any longer, but it still can accept it (generated from NeoGo for example, I'm doing it quite regularly). Which makes the situation rather ambiguous, we have two file formats used in the same field, one of which is semi-supported.

I'd suggest dropping the chain.acc format completely and always using an incremental one irrespective of the file name. This will likely change nothing for the C# node and we can handle this in NeoGo with some transition period as well. The other way to solve this ambiguity is of course just restoring support for chain.acc generation and using this format for full offline packages the way it's done for Legacy.

Refs. nspcc-dev/neo-go#2849.

ixje commented 1 year ago

single format would be my vote

Jim8y commented 1 year ago

I prefer single format as well. But compatibility issues need to be handled carefully.

shargon commented 1 year ago

I think that it's better to use single format

superboyiii commented 1 year ago

Single format should be my choice.