Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
d1aec67a
Unverified
Commit
d1aec67a
authored
Jul 21, 2021
by
mrekucci
Committed by
GitHub
Jul 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: reinstate gc test (#2318)
parent
2edc5328
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
23 deletions
+39
-23
postagecontract.patch
.github/patches/postagecontract.patch
+1
-1
postagereserve.patch
.github/patches/postagereserve.patch
+1
-1
postagereserve_gc.patch
.github/patches/postagereserve_gc.patch
+1
-1
beekeeper.yml
.github/workflows/beekeeper.yml
+26
-1
postage.go
pkg/debugapi/postage.go
+5
-4
reserve.go
pkg/postage/batchstore/reserve.go
+5
-15
No files found.
.github/patches/postagecontract.patch
View file @
d1aec67a
26c26
< BucketDepth = uint8(16)
---
> BucketDepth = uint8(
10
)
> BucketDepth = uint8(
2
)
.github/patches/postagereserve.patch
View file @
d1aec67a
43c43
< var DefaultDepth = uint8(12) // 12 is the testnet depth at the time of merging to master
---
> var DefaultDepth = uint8(
5
) // 12 is the testnet depth at the time of merging to master
> var DefaultDepth = uint8(
2
) // 12 is the testnet depth at the time of merging to master
.github/patches/postagereserve_gc.patch
View file @
d1aec67a
48c48
< var Capacity = exp2(22)
---
> var Capacity = exp2(
6
)
> var Capacity = exp2(
4
)
.github/workflows/beekeeper.yml
View file @
d1aec67a
...
...
@@ -113,6 +113,29 @@ jobs:
run
:
|
beekeeper delete bee-cluster --cluster-name local-clef
make beelocal ACTION=uninstall
-
name
:
Apply patches
run
:
|
patch pkg/postage/batchstore/reserve.go .github/patches/postagereserve_gc.patch
-
name
:
Prepare testing cluster (storage incentives setup)
run
:
|
timeout 10m make beelocal OPTS='ci skip-vet'
-
name
:
Set kube config
run
:
|
mkdir -p ~/.kube
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
-
name
:
Set testing cluster (storage incentives setup)
run
:
|
timeout 10m make deploylocal BEEKEEPER_CLUSTER=local-gc
-
name
:
Test pingpong
id
:
pingpong-3
run
:
until beekeeper check --cluster-name local-gc --checks ci-pingpong; do echo "waiting for pingpong..."; sleep .3; done
-
name
:
Test gc
id
:
gc-chunk-1
run
:
beekeeper check --cluster-name local-gc --checks=ci-gc
-
name
:
Destroy the cluster
run
:
|
beekeeper delete bee-cluster --cluster-name local-gc
make beelocal ACTION=uninstall
-
name
:
Retag Docker image and push for cache
if
:
success()
run
:
|
...
...
@@ -154,6 +177,8 @@ jobs:
if ${{ steps.settlements-2.outcome=='failure' }}; then FAILED=settlements-2; fi
if ${{ steps.pss.outcome=='failure' }}; then FAILED=pss; fi
if ${{ steps.soc.outcome=='failure' }}; then FAILED=soc; fi
if ${{ steps.pingpong-3.outcome=='failure' }}; then FAILED=pingpong-3; fi
if ${{ steps.gc-chunk-1.outcome=='failure' }}; then FAILED=gc-chunk-1; fi
KEYS=$(curl -sSf -X POST https://eu.relay.tunshell.com/api/sessions)
curl -sSf -X POST -H "Content-Type: application/json" -d "{\"text\": \"**${RUN_TYPE}** ${{ github.head_ref }}\nFailed -> \`${FAILED}\`\nDebug -> \`sh <(curl -sSf https://lets.tunshell.com/init.sh) L $(echo $KEYS | jq -r .peer2_key) \${TUNSHELL_SECRET} eu.relay.tunshell.com\`\"}" https://beehive.ethswarm.org/hooks/${{ secrets.WEBHOOK_KEY }}
echo "Failed test: ${FAILED}"
...
...
pkg/debugapi/postage.go
View file @
d1aec67a
...
...
@@ -265,6 +265,7 @@ func (s *Service) reserveStateHandler(w http.ResponseWriter, _ *http.Request) {
jsonhttp
.
OK
(
w
,
reserveStateResponse
{
Radius
:
state
.
Radius
,
StorageRadius
:
state
.
StorageRadius
,
Available
:
state
.
Available
,
Outer
:
bigint
.
Wrap
(
state
.
Outer
),
Inner
:
bigint
.
Wrap
(
state
.
Inner
),
...
...
pkg/postage/batchstore/reserve.go
View file @
d1aec67a
...
...
@@ -39,9 +39,6 @@ import (
"github.com/ethersphere/bee/pkg/swarm"
)
// ErrBatchNotFound is returned when the postage batch is not found or expired
var
ErrBatchNotFound
=
errors
.
New
(
"postage batch not found or expired"
)
// DefaultDepth is the initial depth for the reserve
var
DefaultDepth
=
uint8
(
12
)
// 12 is the testnet depth at the time of merging to master
...
...
@@ -179,7 +176,7 @@ func (s *store) evictExpired() error {
return
true
,
err
}
s
.
rs
.
Available
+=
multiplier
*
exp2
(
b
.
Radius
-
s
.
rs
.
Radius
-
1
)
s
.
rs
.
Available
+=
multiplier
*
exp2
(
uint
(
b
.
Radius
-
s
.
rs
.
Radius
-
1
)
)
// if batch has no value then delete it
if
b
.
Value
.
Cmp
(
s
.
cs
.
TotalAmount
)
<=
0
{
...
...
@@ -236,7 +233,7 @@ func (rs *reserveState) change(oldv, newv *big.Int, oldDepth, newDepth uint8) (i
// size returns the number of chunks the local node is responsible
// to store in its reserve.
func
(
rs
*
reserveState
)
size
(
depth
uint8
,
t
tier
)
int64
{
size
:=
exp2
(
depth
-
rs
.
Radius
-
1
)
size
:=
exp2
(
uint
(
depth
-
rs
.
Radius
-
1
)
)
switch
t
{
case
inner
:
return
size
...
...
@@ -354,7 +351,7 @@ func (s *store) evictOuter(last *postage.Batch) error {
return
true
,
nil
}
// unreserve outer PO of the lowest priority batch until capacity is back to positive
s
.
rs
.
Available
+=
exp2
(
b
.
Depth
-
s
.
rs
.
Radius
-
1
)
s
.
rs
.
Available
+=
exp2
(
uint
(
b
.
Depth
)
-
uint
(
s
.
rs
.
Radius
)
-
1
)
s
.
rs
.
Outer
.
Set
(
b
.
Value
)
return
false
,
s
.
unreserveFn
(
b
.
ID
,
s
.
rs
.
Radius
)
})
...
...
@@ -409,13 +406,6 @@ func (u *UnreserveItem) UnmarshalBinary(b []byte) error {
}
// exp2 returns the e-th power of 2
func
exp2
(
e
uint8
)
int64
{
if
e
==
0
{
return
1
}
b
:=
int64
(
2
)
for
i
:=
uint8
(
1
);
i
<
e
;
i
++
{
b
*=
2
}
return
b
func
exp2
(
e
uint
)
int64
{
return
1
<<
e
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment