celestiaorg / celestiaorg/celestia-node
architecture (share/Getter): Getter should be atomic
- Dominant language
- Go
- Stars
- 996
- Forks
- 1.1k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 34
Description
### Implementation ideas
Current high order getter [CascadeGetter](https://github.com/celestiaorg/celestia-node/pull/1628) implementation assumes that if underlying getter request has been canceled by context, the overall getter operation should be noop, allowing next getter to start from unaffected state. Thus every getter implementation is required to satisfy atomic property of transaction. Also getter should treat external context cancelation as expected at any time and update internal state(if any) accordingly (e.g .shrex.Getter peer manager)
For example, shrex.Getter(not finished yet) should make more complex decision on peer in case of context.Deadline, taking into account possibility of external ctx cancelation.
TeeGetter should either finish write operation, or rollback internal storage state.
Future contributions to existing or introduced Getters should always take transactional property into account. This could affect introduction of caching, for example
Need to check all getters that are already merged and in development to identify if there is need to be any enhancements:
- [x] #1488
- [x] #1489
- [x] #1490
- [x] #1491
- [ ] #1535
Contributor guide
Assessment
This issue has not been assessed yet.