Skip to content

era export: add filenames to accumulators.txt and checksums.txt #8454

@filoozom

Description

@filoozom

Is your feature request related to a problem? Please describe.

Right now, the accumulators.txt and checksums.txt files only contain one hash per line without any additional information. This makes it tough to compare the checksums and accumulator values to their corresponding file. It also makes it fairly complex and error prone to update those files on the long term.

Describe the solution you'd like

These text files should contain the filenames the hashes correspond to, like classical checksum files would. For example, this would be an acceptable output for checksums.txt (or with the 0x prefix):

$ sha256sum gnosis-0000*
575ccee3b514e969ddf9f90bc61f348cd06e4d3159a434cfc573c916fc80d4ec  gnosis-00000-ac7f28ba.era1
d053d242f0b3b03eb53d4483a1ec740773f459ce011be484b6048addaa17b555  gnosis-00001-faa0f4b7.era1
1a4e02fc14eec595c1d1685ffe722077e406bd12d2026c7ef24bb33c061099a6  gnosis-00002-755255e3.era1
1d6313583047b8118bc8f602efedf7464e6d4dab3a0d42b521874d17d44360f1  gnosis-00003-a16709a6.era1
f51e5a507e15bd5b0f9c9460de5e05c582e438c0a8b0cc5fb57963f2d559bc9a  gnosis-00004-1fc7f7af.era1
d3fa6a487cb511f2c738078e6ff465d793d500854684bc0a23c3876ce02b1979  gnosis-00005-a319c08c.era1
e532c8f557f2a7263e46de8b8c2cc926a92b9a652e5ed7587fb262f12adb8c6f  gnosis-00006-b4e949ce.era1
fd664adc0de3d8c231d2fc4ab8f7a017cbc0c8a5310a7782f7b528e7c66eaa5a  gnosis-00007-77f38b23.era1
c87c24de88f6bfde11c6a8a824b5790a7c137b16dcb5ea582bf36111237a1714  gnosis-00008-7c04fb4a.era1
cd17c42d7826bf8ff9e0f1e658616ec86595c707292ba9b18d9a3a9bec0c41b6  gnosis-00009-1cc62edc.era1

Describe alternatives you've considered

It is possible to work with the current files, but it requires some customs tools and just makes working with them quite painful. For example, if I wanted to somewhat safely merge those files together, I could export slots starting at the beginning of the last exported era up to the chain tip, and then compare the first line of the new accumulators.txt and checksums.txt files to the last on of the previous one. If they match, I can somewhat safely merge the files.

For example, if I have gnosis-00000-ac7f28ba.era1, gnosis-00001-faa0f4b7.era1 and gnosis-00002-755255e3.era1, with the following files:

$ cat accumulators.txt
0xac7f28ba4c9de3315fd785dcb1c5ae65c9b8dc753a1d2664e00645c545b33095
0xfaa0f4b77fc43fa5d318c4dc93b375eeb8a1743e8f77b7a33d612a3e2aa3810a
0x755255e34be8e4c91e2c77d8c0889aedb4035cff4c6f2fba8825a4627f77ab98

$ cat checksums.txt
0x575ccee3b514e969ddf9f90bc61f348cd06e4d3159a434cfc573c916fc80d4ec
0xd053d242f0b3b03eb53d4483a1ec740773f459ce011be484b6048addaa17b555
0x1a4e02fc14eec595c1d1685ffe722077e406bd12d2026c7ef24bb33c061099a6

I could then export blocks from 16384 to 24575, which would result in:

$ cat accumulators.txt
0x755255e34be8e4c91e2c77d8c0889aedb4035cff4c6f2fba8825a4627f77ab98
0xa16709a6d4cfc3dee7db3c16704e1745b67304a0ee72c035334e963b83ef1880

$ cat checksums.txt
0x1a4e02fc14eec595c1d1685ffe722077e406bd12d2026c7ef24bb33c061099a6
0x1d6313583047b8118bc8f602efedf7464e6d4dab3a0d42b521874d17d44360f1

It's just needlessly complex. Alternatively, I could also update the file to have the checksum of chain-X-*.era1 at line X, but that also feels somewhat fragile.

Additional context

We're working on a flow to systematically export era1 files as soon as they're ready to archive them, and anything to facilitate this process would be helpful.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions