Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
acha-bill committed Feb 28, 2024
1 parent 652977f commit f1d6efb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 37 deletions.
35 changes: 3 additions & 32 deletions .github/workflows/beekeeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
9 changes: 5 additions & 4 deletions pkg/api/chunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
})
Expand Down

0 comments on commit f1d6efb

Please sign in to comment.