celestiaorg / celestiaorg/go-header
store: use Txn instead of Batch
- Dominant language
- Go
- Stars
- 21
- Forks
- 33
- Avg merge
- 5d 20h
- Merged PRs (30d)
- 7
Description
Methods like `DeleteTo` do multiple deletions underneath that have to be done atomically. This is currently done via Batching, however, Batches [do not guarantee](https://github.com/ipfs/go-datastore/blob/bee84ceeb277b14249d1ac4297860fa7e52556f4/datastore.go#L97-L103) atomicity while transactions do.
Basically, the issue is to identify other places like above where the transaction should be used instead and make it so
Contributor guide
Research direction
Start by locating DeleteTo and other datastore operations that perform multiple deletions or writes through Batching. Compare those call sites with the datastore transaction API, then verify that every operation requiring atomicity uses Txn rather than Batch and preserves its existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100