Skip to content

Commit 993b145

Browse files
committed
swarm/storage/localstore: fix export db.Put signature
cmd/swarm/swarm-smoke: improve smoke tests (bnb-chain#1337) swarm/network: remove dead code (bnb-chain#1339) swarm/network: remove FetchStore and SyncChunkStore in favor of NetStore (bnb-chain#1342)
1 parent 996755c commit 993b145

28 files changed

Lines changed: 374 additions & 659 deletions

‎cmd/swarm/swarm-smoke/feed_upload_and_sync.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ const (
2626
feedRandomDataLength = 8
2727
)
2828

29-
func feedUploadAndSyncCmd(ctx *cli.Context, tuid string) error {
29+
func feedUploadAndSyncCmd(ctx *cli.Context) error {
3030
errc := make(chan error)
3131

3232
go func() {
33-
errc <- feedUploadAndSync(ctx, tuid)
33+
errc <- feedUploadAndSync(ctx)
3434
}()
3535

3636
select {
@@ -46,7 +46,7 @@ func feedUploadAndSyncCmd(ctx *cli.Context, tuid string) error {
4646
}
4747
}
4848

49-
func feedUploadAndSync(c *cli.Context, tuid string) error {
49+
func feedUploadAndSync(c *cli.Context) error {
5050
log.Info("generating and uploading feeds to " + httpEndpoint(hosts[0]) + " and syncing")
5151

5252
// create a random private key to sign updates with and derive the address
@@ -272,7 +272,7 @@ func feedUploadAndSync(c *cli.Context, tuid string) error {
272272
ruid := uuid.New()[:8]
273273
go func(url string, endpoint string, ruid string) {
274274
for {
275-
err := fetch(url, endpoint, fileHash, ruid, "")
275+
err := fetch(url, endpoint, fileHash, ruid)
276276
if err != nil {
277277
continue
278278
}

‎cmd/swarm/swarm-smoke/main.go‎

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ var (
3737
)
3838

3939
var (
40-
allhosts string
41-
hosts []string
42-
filesize int
43-
inputSeed int
44-
syncDelay int
45-
httpPort int
46-
wsPort int
47-
verbosity int
48-
timeout int
49-
single bool
50-
trackTimeout int
40+
allhosts string
41+
hosts []string
42+
filesize int
43+
syncDelay int
44+
inputSeed int
45+
httpPort int
46+
wsPort int
47+
verbosity int
48+
timeout int
49+
single bool
50+
onlyUpload bool
5151
)
5252

5353
func main() {
@@ -101,7 +101,7 @@ func main() {
101101
},
102102
cli.IntFlag{
103103
Name: "timeout",
104-
Value: 120,
104+
Value: 180,
105105
Usage: "timeout in seconds after which kill the process",
106106
Destination: &timeout,
107107
},
@@ -110,11 +110,10 @@ func main() {
110110
Usage: "whether to fetch content from a single node or from all nodes",
111111
Destination: &single,
112112
},
113-
cli.IntFlag{
114-
Name: "track-timeout",
115-
Value: 5,
116-
Usage: "timeout in seconds to wait for GetAllReferences to return",
117-
Destination: &trackTimeout,
113+
cli.BoolFlag{
114+
Name: "only-upload",
115+
Usage: "whether to only upload content to a single node without fetching",
116+
Destination: &onlyUpload,
118117
},
119118
}
120119

‎cmd/swarm/swarm-smoke/sliding_window.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ type uploadResult struct {
3535
digest []byte
3636
}
3737

38-
func slidingWindowCmd(ctx *cli.Context, tuid string) error {
38+
func slidingWindowCmd(ctx *cli.Context) error {
3939
errc := make(chan error)
4040

4141
go func() {
42-
errc <- slidingWindow(ctx, tuid)
42+
errc <- slidingWindow(ctx)
4343
}()
4444

4545
err := <-errc
@@ -49,10 +49,10 @@ func slidingWindowCmd(ctx *cli.Context, tuid string) error {
4949
return err
5050
}
5151

52-
func slidingWindow(ctx *cli.Context, tuid string) error {
52+
func slidingWindow(ctx *cli.Context) error {
5353
var hashes []uploadResult //swarm hashes of the uploads
5454
nodes := len(hosts)
55-
log.Info("sliding window test started", "tuid", tuid, "nodes", nodes, "filesize(kb)", filesize, "timeout", timeout)
55+
log.Info("sliding window test started", "nodes", nodes, "filesize(kb)", filesize, "timeout", timeout)
5656
uploadedBytes := 0
5757
networkDepth := 0
5858
errored := false
@@ -107,7 +107,7 @@ outer:
107107
start = time.Now()
108108
// fetch hangs when swarm dies out, so we have to jump through a bit more hoops to actually
109109
// catch the timeout, but also allow this retry logic
110-
err := fetch(v.hash, httpEndpoint(hosts[idx]), v.digest, ruid, "")
110+
err := fetch(v.hash, httpEndpoint(hosts[idx]), v.digest, ruid)
111111
if err != nil {
112112
log.Error("error fetching hash", "err", err)
113113
continue

0 commit comments

Comments
 (0)