-
Notifications
You must be signed in to change notification settings - Fork 383
Description
Context
2.1.0-rc2 (and probably 2.0.* as well)
Summary
See #4693 for details, but tracking that down found that SetLevelInContext is never invoked by the /bytes api therefore when the joiner invokes GetLevelFromContext, it gets the default value of 4 or PARANOID.
Expected behavior
If the Swarm-Redundancy-Strategy is specified on /bytes, then I would expect it to be honored by the joiner.
Actual behavior
My hacked logs (see here ) prove that the joiner is using rLevel = 4.
Steps to reproduce
Add your own logs, retrieve something with the /bytes API specifying Swarm-Redundancy-Strategy and verify that it doesn't get to the joiner. Or just grep the source code for SetLevelInContext and GetLevelInContext. The file pipeline invokes the former, but that isn't invoked for the root chunk.
Possible solution
Have the API invoke SetLevelInContext before creating the joiner like maybe as in this hack that only handles NONE:
https://github.com/ldeffenb/bee/blob/ed323f9561f1ae541895153383fcb6edc1d142fc/pkg/api/bzz.go#L546