Skip to content

Commit

Permalink
Merge pull request #113 from Bidon15/pfd-gsbn
Browse files Browse the repository at this point in the history
feat: Implementation of PayForData & GetSharesByNamespace test-plan
  • Loading branch information
Bidon15 authored Nov 18, 2022
2 parents 7dd05fb + 9a42ed4 commit d3f950d
Show file tree
Hide file tree
Showing 17 changed files with 300 additions and 47 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ FROM ${BUILD_BASE_IMAGE} AS builder
# PLAN_DIR is the location containing the plan source inside the container.
ENV PLAN_DIR /plan

ENV INFLUXDB_URL=http://94.130.224.187:8086/
#ENV INFLUXDB_URL=http://94.130.224.187:8086/

# SDK_DIR is the location containing the (optional) sdk source inside the container.
ENV SDK_DIR /sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
memory = "4Gi"
cpu = "3"
[groups.instances]
count = 80
count = 100
percentage = 0.0
[groups.build_config]
build_base_image = "golang:1.19.1"
Expand Down
109 changes: 109 additions & 0 deletions compositions/local-docker/pfd-gsbn/gsbn-8.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
[metadata]
name = "gsbn"
author = "Bidon15"

[global]
plan = "celestia"
case = "get-shares-by-namespace"
total_instances = 8
builder = "docker:generic"
runner = "local:docker"
disable_metrics = false

[global.run.test_params]
execution-time = "10"
persistent-peers = "3"
submit-times = "12"
namespace-id = "1"
msg-size = "100000"
validator = "3"
bridge = "3"
full = "1"
light = "1"

[[groups]]
id = "validators"
builder = "docker:generic"
[groups.resources]
memory = ""
cpu = ""
[groups.instances]
count = 3
percentage = 0.0
[groups.build_config]
build_base_image = "golang:1.19.1"
enable_go_build_cache = true
enabled = true
go_version = "1.19"
[groups.build]
[groups.run]
[groups.run.test_params]
latency = "0"
bandwidth = "256Mib"
role = "validator"

[[groups]]
id = "bridges"
builder = "docker:generic"
[groups.resources]
memory = ""
cpu = ""
[groups.instances]
count = 3
percentage = 0.0
[groups.build_config]
build_base_image = "golang:1.19.1"
enable_go_build_cache = true
enabled = true
go_version = "1.19"
[groups.build]
[groups.run]
[groups.run.test_params]
latency = "0"
bandwidth = "256Mib"
block-height = "5"
role = "bridge"

[[groups]]
id = "fulls"
builder = "docker:generic"
[groups.resources]
memory = ""
cpu = ""
[groups.instances]
count = 1
percentage = 0.0
[groups.build_config]
build_base_image = "golang:1.19.1"
enable_go_build_cache = true
enabled = true
go_version = "1.19"
[groups.build]
[groups.run]
[groups.run.test_params]
latency = "0"
bandwidth = "256Mib"
block-height = "5"
role = "full"

[[groups]]
id = "lights"
builder = "docker:generic"
[groups.resources]
memory = ""
cpu = ""
[groups.instances]
count = 1
percentage = 0.0
[groups.build_config]
build_base_image = "golang:1.19.1"
enable_go_build_cache = true
enabled = true
go_version = "1.19"
[groups.build]
[groups.run]
[groups.run.test_params]
latency = "0"
bandwidth = "256Mib"
block-height = "5"
role = "light"
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

[global]
plan = "celestia"
case = "pfd"
case = "pay-for-data"
total_instances = 8
builder = "docker:generic"
runner = "local:docker"
disable_metrics = false

[global.run.test_params]
execution-time = "30"
execution-time = "10"
persistent-peers = "3"
submit-times = "42"
submit-times = "12"
namespace-id = "1"
msg-size = "100000"
validator = "3"
bridge = "3"
Expand Down Expand Up @@ -60,7 +61,7 @@
[groups.run.test_params]
latency = "0"
bandwidth = "256Mib"
block-height = "20"
block-height = "5"
role = "bridge"

[[groups]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
## Data Set:

| Number of Validators / Bridges / Fulls / Lights <br /> `I` | Bandwidth / Latency per v/b/f/l <br /> `J` | KB of random data <br /> `X` | Namespace ids <br /> `Y` | Times <br/> `Z` |
| :--------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: | :--------------------------: |:------------------------:| :-------------: |
|:----------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------:|:----------------------------:|:------------------------:|:---------------:|
| 40 / 40 / 20 / 100 | 1. 256(v/b/f)-100(l)MiB / 0ms <br />2. 320(v/b/f)-100(l)MiB / 100ms<br />3. 320(v/b/f)-100(i)MiB / 200ms | 4 | 1 | 10 |
| 40 / 40 / 20 / 100 | 1. 256(v/b/f)-100(l)MiB / 0ms <br />2. 320(v/b/f)-100(l)MiB / 100ms<br />3. 320(v/b/f)-100(i)MiB / 200ms | 4 | random | 10 |
| 100 / 100 / 50 / 1000 | 1. 320(v/b/f)-100(l)MiB / 0ms<br />2. 320(v/b/f)-100(l)MiB / 100ms<br />3. 320(v/b/f)-100(i)MiB / 200ms | 2 | 1 | 10 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
## Data Set:

| Number of Validators / Bridges / Fulls / Lights <br /> `I` | Bandwidth / Latency per v/b/f/l <br /> `J` | KB of random data <br /> `X` | Namespace ids <br /> `Y` | Times <br/> `Z` |
| :--------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: | :--------------------------: |:------------------------:| :-------------: |
|:----------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------:|:----------------------------:|:------------------------:|:---------------:|
| 40 / 40 / 20 / 100 | 1. 256(v/b/f)-100(l)MiB / 0ms <br />2. 320(v/b/f)-100(l)MiB / 100ms<br />3. 320(v/b/f)-100(i)MiB / 200ms | 4 | 1 | 10 |
| 40 / 40 / 20 / 100 | 1. 256(v/b/f)-100(l)MiB / 0ms <br />2. 320(v/b/f)-100(l)MiB / 100ms<br />3. 320(v/b/f)-100(i)MiB / 200ms | 4 | random | 10 |
| 100 / 100 / 50 / 1000 | 1. 320(v/b/f)-100(l)MiB / 0ms<br />2. 320(v/b/f)-100(l)MiB / 100ms<br />3. 320(v/b/f)-100(i)MiB / 200ms | 2 | 1 | 10 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
## Data Set:

| Number of Validators / Bridges / Fulls / Lights <br /> `I` | Bandwidth / Latency per v/b/f/l <br /> `J` | KB of random data <br /> `X` | Namespace ids <br /> `Y` | Times <br/> `Z` |
| :--------------------------------------------------------: | :------------------------------------------------------------------------------------------------------: | :--------------------------: |:------------------------:| :-------------: |
|:----------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------:|:----------------------------:|:------------------------:|:---------------:|
| 40 / 40 / 20 / 100 | 1. 256(v/b/f)-100(l)MiB / 0ms <br />2. 320(v/b/f)-100(l)MiB / 100ms<br />3. 320(v/b/f)-100(i)MiB / 200ms | 4 | 1 | 10 |
| 40 / 40 / 20 / 100 | 1. 256(v/b/f)-100(l)MiB / 0ms <br />2. 320(v/b/f)-100(l)MiB / 100ms<br />3. 320(v/b/f)-100(i)MiB / 200ms | 4 | 2 | 10 |
| 100 / 100 / 50 / 1000 | 1. 320(v/b/f)-100(l)MiB / 0ms<br />2. 320(v/b/f)-100(l)MiB / 100ms<br />3. 320(v/b/f)-100(i)MiB / 200ms | 2 | 1 | 10 |
Expand Down
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ require (
)

require (
github.com/celestiaorg/celestia-node v0.5.0-rc2
github.com/celestiaorg/celestia-node v0.5.0-rc5
github.com/celestiaorg/nmt v0.11.0
github.com/tendermint/tendermint v0.35.4
go.uber.org/fx v1.18.2
)
Expand Down Expand Up @@ -53,7 +54,6 @@ require (
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/celestiaorg/go-libp2p-messenger v0.1.0 // indirect
github.com/celestiaorg/merkletree v0.0.0-20210714075610-a84dc3ddbbe4 // indirect
github.com/celestiaorg/nmt v0.11.0 // indirect
github.com/celestiaorg/quantum-gravity-bridge v1.2.0 // indirect
github.com/celestiaorg/rsmt2d v0.7.0 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
Expand Down Expand Up @@ -283,14 +283,14 @@ require (
github.com/zondax/hid v0.9.1-0.20220302062450-5552068d2266 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.opencensus.io v0.23.0 // indirect
go.opentelemetry.io/otel v1.10.0 // indirect
go.opentelemetry.io/otel v1.11.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.31.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.31.0 // indirect
go.opentelemetry.io/otel/metric v0.32.1 // indirect
go.opentelemetry.io/otel/metric v0.33.0 // indirect
go.opentelemetry.io/otel/sdk v1.10.0 // indirect
go.opentelemetry.io/otel/sdk/metric v0.31.0 // indirect
go.opentelemetry.io/otel/trace v1.10.0 // indirect
go.opentelemetry.io/otel/trace v1.11.1 // indirect
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/dig v1.15.0 // indirect
Expand Down
18 changes: 9 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOC
github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/celestiaorg/celestia-core v1.5.0-tm-v0.34.20 h1:BqlcOQqL2UqdDTcdCtrOLXDlmwxIA8DiKiY79oahxkQ=
github.com/celestiaorg/celestia-core v1.5.0-tm-v0.34.20/go.mod h1:f4R8qNJrP1CDH0SNwj4jA3NymBLQM4lNdx6Ijmfllbw=
github.com/celestiaorg/celestia-node v0.5.0-rc2 h1:VVOKgxRYhV8yk87yO9nKD01nH5+dbvM3HCYAmeupw4s=
github.com/celestiaorg/celestia-node v0.5.0-rc2/go.mod h1:AsGCaSULGHb44AjC6RhQO7OCd9FcTgVktSrHe2iry6E=
github.com/celestiaorg/celestia-node v0.5.0-rc5 h1:hl4pYLWTVatNVpvQuvo1DZaKyUzK849WOxRPjBpLxNI=
github.com/celestiaorg/celestia-node v0.5.0-rc5/go.mod h1:nAm55dyp2G/LsgaR02XgONgM2dbhGg24h+0KsG1CXbI=
github.com/celestiaorg/go-libp2p-messenger v0.1.0 h1:rFldTa3ZWcRRn8E2bRWS94Qp1GFYXO2a0uvqpIey1B8=
github.com/celestiaorg/go-libp2p-messenger v0.1.0/go.mod h1:XzNksXrH0VxuNRGOnjPL9Ck4UyQlbmMpCYg9YwSBerI=
github.com/celestiaorg/go-libp2p-pubsub v0.6.2-0.20220812132010-46b2a019f2f2 h1:Tb1lPVAGSJvBjRCM7YpC+VaITzdZjjno4+KEnbPT6tU=
Expand Down Expand Up @@ -631,8 +631,8 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
Expand Down Expand Up @@ -1885,22 +1885,22 @@ go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.opentelemetry.io/otel v1.10.0 h1:Y7DTJMR6zs1xkS/upamJYk0SxxN4C9AqRd77jmZnyY4=
go.opentelemetry.io/otel v1.10.0/go.mod h1:NbvWjCthWHKBEUMpf0/v8ZRZlni86PpGFEMA9pnQSnQ=
go.opentelemetry.io/otel v1.11.1 h1:4WLLAmcfkmDk2ukNXJyq3/kiz/3UzCaYq6PskJsaou4=
go.opentelemetry.io/otel v1.11.1/go.mod h1:1nNhXBbWSD0nsL38H6btgnFN2k4i0sNLHNNMZMSbUGE=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0 h1:TaB+1rQhddO1sF71MpZOZAuSPW1klK2M8XxfrBMfK7Y=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.10.0/go.mod h1:78XhIg8Ht9vR4tbLNUhXsiOnE2HOuSeKAiAcoVQEpOY=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.31.0 h1:H0+xwv4shKw0gfj/ZqR13qO2N/dBQogB1OcRjJjV39Y=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.31.0/go.mod h1:nkenGD8vcvs0uN6WhR90ZVHQlgDsRmXicnNadMnk+XQ=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.31.0 h1:MuEG0gG27QZQrqhNl0f7vQ5Nl03OQfFeDAqWkGt+1zM=
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.31.0/go.mod h1:52qtPFDDaa0FaSyyzPnxWMehx2SZv0xuobTlNEZA2JA=
go.opentelemetry.io/otel/metric v0.32.1 h1:ftff5LSBCIDwL0UkhBuDg8j9NNxx2IusvJ18q9h6RC4=
go.opentelemetry.io/otel/metric v0.32.1/go.mod h1:iLPP7FaKMAD5BIxJ2VX7f2KTuz//0QK2hEUyti5psqQ=
go.opentelemetry.io/otel/metric v0.33.0 h1:xQAyl7uGEYvrLAiV/09iTJlp1pZnQ9Wl793qbVvED1E=
go.opentelemetry.io/otel/metric v0.33.0/go.mod h1:QlTYc+EnYNq/M2mNk1qDDMRLpqCOj2f/r5c7Fd5FYaI=
go.opentelemetry.io/otel/sdk v1.10.0 h1:jZ6K7sVn04kk/3DNUdJ4mqRlGDiXAVuIG+MMENpTNdY=
go.opentelemetry.io/otel/sdk v1.10.0/go.mod h1:vO06iKzD5baltJz1zarxMCNHFpUlUiOy4s65ECtn6kE=
go.opentelemetry.io/otel/sdk/metric v0.31.0 h1:2sZx4R43ZMhJdteKAlKoHvRgrMp53V1aRxvEf5lCq8Q=
go.opentelemetry.io/otel/sdk/metric v0.31.0/go.mod h1:fl0SmNnX9mN9xgU6OLYLMBMrNAsaZQi7qBwprwO3abk=
go.opentelemetry.io/otel/trace v1.10.0 h1:npQMbR8o7mum8uF95yFbOEJffhs1sbCOfDh8zAJiH5E=
go.opentelemetry.io/otel/trace v1.10.0/go.mod h1:Sij3YYczqAdz+EhmGhE6TpTxUO5/F/AzrK+kxfGqySM=
go.opentelemetry.io/otel/trace v1.11.1 h1:ofxdnzsNrGBYXbP7t7zpUK281+go5rF7dvdIZXF8gdQ=
go.opentelemetry.io/otel/trace v1.11.1/go.mod h1:f/Q9G7vzk5u91PhbmKbg1Qn0rzH1LJ4vbPHFGkTPtOk=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.opentelemetry.io/proto/otlp v0.19.0 h1:IVN6GR+mhC4s5yfcTbmzHYODqvWAp3ZedA2SJPI1Nnw=
go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U=
Expand Down
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
"github.com/celestiaorg/test-infra/tests"
"github.com/celestiaorg/test-infra/tests/plans/big-blocks"
"github.com/celestiaorg/test-infra/tests/plans/block-recon"
"github.com/celestiaorg/test-infra/tests/plans/pfd-gsbn"
"github.com/testground/sdk-go/run"
)

Expand All @@ -15,7 +15,10 @@ var testcases = map[string]interface{}{
"004-full-light-past": run.InitializedTestCaseFn(bigblocks.FullLightSyncPast),
"005-light-das-past": run.InitializedTestCaseFn(bigblocks.LightDasPast),
// Pay For Data & Get Shares by Namespace Plan
"pfd": run.InitializedTestCaseFn(tests.SubmitPFD),
// PayForDataAndGetShares is tracking TestCase key to know
// when to do shares checker scenario
"pay-for-data": run.InitializedTestCaseFn(pfdgsbn.PayForDataAndGetShares),
"get-shares-by-namespace": run.InitializedTestCaseFn(pfdgsbn.PayForDataAndGetShares),
// Block Reconstruction Plan
"reconstruction": run.InitializedTestCaseFn(blockrecon.BlockReconstruction),
}
Expand Down
21 changes: 20 additions & 1 deletion manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ instances = { min = 4, max = 3000, default = 12 }
role = { type = "string" }

[[testcases]]
name = "pfd"
name = "pay-for-data"
instances = { min = 4, max = 3000, default = 12 }
[testcases.params]
execution-time = { type = "int" }
Expand All @@ -106,6 +106,25 @@ instances = { min = 4, max = 3000, default = 12 }
validator = { type = "int", default = 3}
persistent-peers = { type = "int", default = 3}
submit-times = { type = "int", default = 4}
namespace-id = { type = "string", default = "1"}
msg-size = { type = "int", default = 10000}
bridge = { type = "int", default = 3}
full = { type = "int", default = 3}
light = { type = "int", default = 3}
block-height = { type = "int" }
role = { type = "string" }

[[testcases]]
name = "get-shares-by-namespace"
instances = { min = 4, max = 3000, default = 12 }
[testcases.params]
execution-time = { type = "int" }
latency = { type = "int", default = 0}
bandwidth = { type = "string", default = "256Mib"}
validator = { type = "int", default = 3}
persistent-peers = { type = "int", default = 3}
submit-times = { type = "int", default = 4}
namespace-id = { type = "string", default = "1"}
msg-size = { type = "int", default = 10000}
bridge = { type = "int", default = 3}
full = { type = "int", default = 3}
Expand Down
3 changes: 3 additions & 0 deletions tests/helpers/common/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func BuildBridge(ctx context.Context, runenv *runtime.RunEnv, initCtx *run.InitC
cfg := nodekit.NewConfig(node.Bridge, ip, []string{}, h)
cfg.Core.IP = appNode.IP.To4().String()
cfg.Core.RPCPort = "26657"
cfg.Core.GRPCPort = "9090"
cfg.Gateway.Enabled = true
cfg.Gateway.Port = "26659"

nd, err := nodekit.NewNode(ndhome, node.Bridge, cfg)
if err != nil {
Expand Down
Loading

0 comments on commit d3f950d

Please sign in to comment.