Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

fix: remove HashOnRead #51

Closed
wants to merge 1 commit into from
Closed

fix: remove HashOnRead #51

wants to merge 1 commit into from

Conversation

Stebalien
Copy link
Member

Instead, provide a simple ValidatingBlockstore wrapper. This:

  1. Isn't racy (fixes HashOnRead Has A Race Condition #49).
  2. Keeps the base blockstore simple.

Really, "HashOnRead" should never have been a part of the blockstore API in the
first place.

// ValidatingBlockstore validates blocks on get, if enabled.
type ValidatingBlockstore struct {
Blockstore
ValidateGet bool

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of the wrapper already serves as this bool. remove it and just decide if you want to wrap an underlying blockstore with this wrapper.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put that there so we could also introduce validations for put. But you're right, that's probably not necessary.

Instead, provide a simple `ValidatingBlockstore` wrapper. This:

1. Isn't racy (fixes #49).
2. Keeps the base blockstore simple.
@lidel
Copy link
Member

lidel commented Jun 19, 2023

❗ This repository is no longer maintained.

This repository is no longer maintained and this library has been copied over to boxo/blockstore.

In an effort to avoid noise and crippling in the Boxo repo from the weight of issues of the past, we are closing most issues and PRs in this repo. This topic is continued in ipfs/boxo#365

You can learn more in the FAQs for the Boxo repo copying/consolidation effort.

@lidel lidel closed this Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

HashOnRead Has A Race Condition
3 participants