diff --git a/.github/workflows/beekeeper.yml b/.github/workflows/beekeeper.yml index 95a09cfc1dc..b785ebf2f23 100644 --- a/.github/workflows/beekeeper.yml +++ b/.github/workflows/beekeeper.yml @@ -162,6 +162,9 @@ jobs: - name: Test staking id: stake run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-stake + - name: Test redundancy + id: redundancy + run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-redundancy - name: Collect debug artifacts if: failure() run: | diff --git a/pkg/api/chunk.go b/pkg/api/chunk.go index 25e1d6c65ed..27ed9e2a848 100644 --- a/pkg/api/chunk.go +++ b/pkg/api/chunk.go @@ -109,14 +109,15 @@ func (s *Service) chunkUploadHandler(w http.ResponseWriter, r *http.Request) { return } - chunk, err := cac.NewWithDataSpan(data) + hash, err := cac.DoHash(data[swarm.SpanSize:], data[:swarm.SpanSize]) if err != nil { - logger.Debug("chunk upload: create chunk failed", "error", err) - logger.Error(nil, "chunk upload: create chunk error") - jsonhttp.InternalServerError(ow, "create chunk error") + logger.Debug("chunk upload: hash data", "error", err) + logger.Error(nil, "chunk upload: hash data error") + jsonhttp.InternalServerError(ow, "hash data error") return } + chunk := swarm.NewChunk(swarm.NewAddress(hash), data) err = putter.Put(r.Context(), chunk) if err != nil { logger.Debug("chunk upload: write chunk failed", "chunk_address", chunk.Address(), "error", err) diff --git a/pkg/api/router.go b/pkg/api/router.go index 7c854543b88..351608a5e16 100644 --- a/pkg/api/router.go +++ b/pkg/api/router.go @@ -220,7 +220,7 @@ func (s *Service) mountAPI() { handle("/chunks", jsonhttp.MethodHandler{ "POST": web.ChainHandlers( - jsonhttp.NewMaxBodyBytesHandler(swarm.ChunkWithSpanSize), + jsonhttp.NewMaxBodyBytesHandler(swarm.SocMaxChunkSize), web.FinalHandlerFunc(s.chunkUploadHandler), ), })