ethersphere / bee

Bee is a Swarm client implemented in Go. It’s the basic building block for the Swarm network: a private; decentralized; and self-sustaining network for permissionless publishing and access to your (application) data.
https://www.ethswarm.org
BSD 3-Clause "New" or "Revised" License
1.45k stars 338 forks source link

pullsync key handling #4738

Closed nugaon closed 1 month ago

nugaon commented 2 months ago

Context

recent master; haven't tested but it may lead to shelling point mismatch.

Summary

Reserve storage is checked against chunk address, batch ID and fingerprint of batch serialization. https://github.com/ethersphere/bee/blob/master/pkg/pullsync/pullsync.go#L186

The main problem is that the pull syncing operates with different key composition than the reserve store has. https://github.com/ethersphere/bee/blob/master/pkg/pullsync/pullsync.go#L230

This is not only asymmetrical, but it can cause disagreement in the reserve database if two or more payloads being uploaded under one single owner chunk with the same postage batch.

Expected behavior

Reserve key handling is identical with the one that pullsync protocol has and it handles multiple SOC payloads with the same postage ID

Actual behavior

downstream will reject the 2nd SOC because the previous delete call on wantChunks

Steps to reproduce

Possible solution