From f1d6efbdfda9fd45735be108fa78e3c0d0f56b1c Mon Sep 17 00:00:00 2001 From: Acha Bill Date: Wed, 28 Feb 2024 19:41:24 +0100 Subject: [PATCH] chore: wip --- .github/workflows/beekeeper.yml | 35 +++------------------------------ pkg/api/chunk.go | 9 +++++---- pkg/api/router.go | 2 +- 3 files changed, 9 insertions(+), 37 deletions(-) diff --git a/.github/workflows/beekeeper.yml b/.github/workflows/beekeeper.yml index 95a09cfc1dc..437236925cd 100644 --- a/.github/workflows/beekeeper.yml +++ b/.github/workflows/beekeeper.yml @@ -130,38 +130,9 @@ jobs: - name: Test fullconnectivity id: fullconnectivity run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks=ci-full-connectivity; do echo "waiting for full connectivity..."; sleep .3; done' - - name: Test settlements - id: settlements - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-settlements - - name: Sleep for time allowance to replenish - run: sleep 2 - - name: Test pss - id: pss - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-pss - - name: Test soc - id: soc - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-soc - - name: Test pushsync (chunks) - id: pushsync-chunks-1 - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-pushsync-chunks - - name: Test pushsync (light mode chunks) - id: pushsync-chunks-2 - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-pushsync-light-chunks - - name: Test retrieval - id: retrieval - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-retrieval - - name: Test manifest - id: manifest - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks=ci-manifest - - name: Test authenticate - id: authenticate - run: timeout ${TIMEOUT} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-authenticate; do echo "waiting for auth..."; sleep .3; done' - - name: Test postage stamps - id: postage-stamps - run: timeout ${TIMEOUT} beekeeper check --cluster-name local-dns --checks ci-postage - - 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} bash -c 'until beekeeper check --cluster-name local-dns --checks ci-redundancy; do echo "waiting for redundancy..."; sleep .3; done' - 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 08aaee08fa1..c1f87e28905 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), ), })