Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] - checksum when deserializing the ledger snapshot file #892

Open
nfrisby opened this issue Jan 18, 2024 · 2 comments
Open

[FEAT] - checksum when deserializing the ledger snapshot file #892

nfrisby opened this issue Jan 18, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@nfrisby
Copy link
Contributor

nfrisby commented Jan 18, 2024

Internal/External
Internal

Describe the feature you'd like
The deserialization of the ledger snapshot file should fail if what was read from disk differs from what was written to disk (eg disk corruption flipped a bit).

Describe alternatives you've considered
This requested feature is not strictly necessary: some interaction with the rest of the network will (eventually) fail if the node has the wrong ledger state. But it could be arbitrarily later, which would be especially confusing. Also, this would limit one of the ubiquitous "possible corruption" explanations for failures (such as VRFKeyBadProof).

Limitation: the checksum would not ensure that the ledger state was serialized to disk correctly---only that the bitstream written to disk was the same read from disk.

@nfrisby nfrisby added enhancement New feature or request good first issue Good for newcomers labels Jan 18, 2024
@nfrisby
Copy link
Contributor Author

nfrisby commented Jan 18, 2024

@jorisdral had some suggestions about how some utilities from fs-api might help here?

@jorisdral
Copy link
Contributor

We could use the file read/write functions from System.FS.CRC. They are used by the other storage components already, e.g.,

Now that we're talking about checksums, though it is orthogonal to this issue, the System.FS.CRC module is consensus specific and should probably be moved to consensus instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants