Skip to content

Commit

Permalink
Merge branch 'main' into feature/update_relay_metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
tabakuj committed Feb 14, 2023
2 parents 78ef80b + 92e946e commit d8c7fd5
Show file tree
Hide file tree
Showing 421 changed files with 19,982 additions and 211,614 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/consensus_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Lava Consensus Tests

on: [pull_request]

jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/setup-go@v3
with:
go-version: 1.18.2

# Install Ignite
- name: ignite install
run: git clone --depth 1 --branch v0.22.2 https://github.com/ignite/cli && cd cli && make install
# run: curl https://get.ignite.com/cli! | bash
- name: ignite version
run: ignite version

# Setup Paths
- name: home
run: pwd && ls -l
- name: ls usr
run: ls -l /home/runner/work/lava/lava
- name: cp lava
run: cp -r ~/work/lava/lava ~/go/lava
- name: export PATH
run: export PATH=$PATH:/go:/go/bin:$(go env GOPATH)/bin:/usr/local:`pwd`:/home/runner/work/lava/lava/
- name: export GOPATH
run: export GOPATH=$GOPATH:$(go env GOPATH):/go:/go/lava:/usr/local:`pwd`
- name: export LAVA
run: export LAVA=/home/runner/work/lava/lava
- name: go env
run: go env
- name: pwd
run: pwd
- name: tree
run: tree
- name: ls -l
run: ls -l

# Pre-build with ignite
- name: ignite build
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
timeout_minutes: 20
command: ignite chain build -v

######################################################
### Run Consensus unitests
######################################################
- name: lava pairing unit Tests
run: go test ./x/pairing/ ./x/pairing/keeper ./x/pairing/types -v

- name: lava epochstorage unit Tests
run: go test ./x/epochstorage/ ./x/epochstorage/keeper ./x/epochstorage/types -v

- name: lava spec unit Tests
run: go test ./x/spec/ ./x/spec/keeper ./x/spec/types -v

- name: lava conflict unit Tests
run: go test ./x/conflict/ ./x/conflict/keeper ./x/conflict/types -v

55 changes: 8 additions & 47 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Lava e2e Tests
name: Lava E2E Tests

on: [push, pull_request]
on: [pull_request]

jobs:
go:
Expand Down Expand Up @@ -57,29 +57,6 @@ jobs:
timeout_minutes: 20
command: ignite chain build -v

######################################################
### Run lava unitests
######################################################
- name: lava pairing unit Tests
run: go test ./x/pairing/ ./x/pairing/keeper ./x/pairing/types -v

- name: lava epochstorage unit Tests
run: go test ./x/epochstorage/ ./x/epochstorage/keeper ./x/epochstorage/types -v

- name: lava spec unit Tests
run: go test ./x/spec/ ./x/spec/keeper ./x/spec/types -v

- name: lava conflict unit Tests
run: go test ./x/conflict/ ./x/conflict/keeper ./x/conflict/types -v

######################################################
### Run relayer unitests
######################################################
- name: Run Relayer unit Tests
run: go test ./protocol/lavasession/ ./protocol/chaintracker/ ./relayer/chainproxy/ -v
- name: Run Relayer Metrics Unit Tests
run: go test ./relayer/metrics/ -v

######################################################
### Run Lava E2E Tests IGNITE VERSION:0.22.1
######################################################
Expand Down Expand Up @@ -135,15 +112,6 @@ jobs:
continue-on-error: true
run: grep "" testutil/e2e/logs/05_tendermintProvider* --include="*errors*"

- name: Tendermint Consumer All Logs
if: always()
run: cat testutil/e2e/logs/06_tendermintConsumer.log

- name: Tendermint Consumer Error Only Logs
if: always()
continue-on-error: true
run: cat testutil/e2e/logs/06_tendermintConsumer_errors.log

- name: Lava over Lava All Logs
if: always()
run: cat testutil/e2e/logs/07_lavaOverLava.log
Expand All @@ -162,15 +130,6 @@ jobs:
continue-on-error: true
run: grep "" testutil/e2e/logs/08_restProvider* --include="*errors*"

- name: Rest Consumer All Logs
if: always()
run: cat testutil/e2e/logs/09_restConsumer.log

- name: Rest Consumer Error Only Logs
if: always()
continue-on-error: true
run: cat testutil/e2e/logs/09_restConsumer_errors.log

- name: GRPC Provider All Logs
if: always()
run: grep "" testutil/e2e/logs/10_grpcProvider* --exclude="*errors*"
Expand All @@ -180,11 +139,13 @@ jobs:
continue-on-error: true
run: grep "" testutil/e2e/logs/10_grpcProvider* --include="*errors*"

- name: GRPC Consumer All Logs
- name: RPCConsumer Consumer All Logs
if: always()
run: cat testutil/e2e/logs/11_grpcConsumer.log
run: cat testutil/e2e/logs/06_RPCConsumer.log

- name: GRPC Consumer Error Only Logs
- name: RPCConsumer Consumer Error Only Logs
if: always()
continue-on-error: true
run: cat testutil/e2e/logs/11_grpcConsumer_errors.log
run: cat testutil/e2e/logs/06_RPCConsumer_errors.log


70 changes: 70 additions & 0 deletions .github/workflows/protocol_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Lava Protocol Tests

on: [pull_request]

jobs:
go:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- uses: actions/setup-go@v3
with:
go-version: 1.18.2

# Install Ignite
- name: ignite install
run: git clone --depth 1 --branch v0.22.2 https://github.com/ignite/cli && cd cli && make install
# run: curl https://get.ignite.com/cli! | bash
- name: ignite version
run: ignite version
# - name: starport install
# run: curl https://get.starport.network/starport@v0.19.2! | bash
# - name: starport version
# run: starport version

# Setup Paths
- name: home
run: pwd && ls -l
- name: ls usr
run: ls -l /home/runner/work/lava/lava
- name: cp lava
run: cp -r ~/work/lava/lava ~/go/lava
- name: export PATH
run: export PATH=$PATH:/go:/go/bin:$(go env GOPATH)/bin:/usr/local:`pwd`:/home/runner/work/lava/lava/
# - name: export
# run: export PATH=$PATH:/go/lava
- name: export GOPATH
run: export GOPATH=$GOPATH:$(go env GOPATH):/go:/go/lava:/usr/local:`pwd`
- name: export LAVA
run: export LAVA=/home/runner/work/lava/lava
- name: go env
run: go env
- name: pwd
run: pwd
- name: tree
run: tree
- name: ls -l
run: ls -l

# Pre-build with ignite
- name: ignite build
uses: nick-fields/retry@v2
with:
max_attempts: 3
retry_on: error
timeout_minutes: 20
command: ignite chain build -v

######################################################
### Run protocol unitests
######################################################
- name: Run Lava Session Tests
run: go test ./protocol/lavasession/ -v
- name: Run Lava Chain Tracker Tests
run: go test ./protocol/chaintracker/ -v
- name: Run Lava Chain Proxy Tests
run: go test ./relayer/chainproxy/ -v
- name: Run Relayer Metrics Unit Tests
run: go test ./relayer/metrics/ -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
build/
release/
ts-client/

# Intellij
.idea/
Expand Down
14 changes: 14 additions & 0 deletions app/upgrades/v0_5_2/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/lavanet/lava/app/keepers"
"github.com/lavanet/lava/app/upgrades"
epochstoragetypes "github.com/lavanet/lava/x/epochstorage/types"
pairingtypes "github.com/lavanet/lava/x/pairing/types"
spectypes "github.com/lavanet/lava/x/spec/types"
)

const UpgradeName = "v0.5.2"
Expand All @@ -31,6 +33,18 @@ func CreateUpgradeHandler(
log.Println("# STARTING UPGRADE #")
log.Println("########################")

// set the mistake in all the specs
specs := keepers.SpecKeeper.GetAllSpec(ctx)
for _, spec := range specs {
spec.MinStakeClient = sdk.NewCoin(epochstoragetypes.TokenDenom, sdk.NewInt(5000000000))
spec.MinStakeProvider = sdk.NewCoin(epochstoragetypes.TokenDenom, sdk.NewInt(500000000000))
spec.ProvidersTypes = spectypes.Spec_dynamic
keepers.SpecKeeper.SetSpec(ctx, spec)
}

// set the param unstakeHoldBlocks
keepers.EpochstorageKeeper.SetUnstakeHoldBlocksStaticRaw(ctx, 1400)

// we use a dedicated SET since the upgrade package doesn't have access to the paramstore, thus can't set a parameter directly
keepers.PairingKeeper.SetRecommendedEpochNumToCollectPayment(ctx, pairingtypes.DefaultRecommendedEpochNumToCollectPayment)

Expand Down
2 changes: 1 addition & 1 deletion cmd/lavad/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func main() {
cmdRPCConsumer.Flags().Bool("secure", false, "secure sends reliability on every message")
cmdRPCConsumer.Flags().String(performance.PprofAddressFlagName, "", "pprof server address, used for code profiling")
cmdRPCConsumer.Flags().String(performance.CacheFlagName, "", "address for a cache server to improve performance")
// rootCmd.AddCommand(cmdRPCConsumer) // TODO: DISABLE COMMAND SO IT'S NOT EXPOSED ON MAIN YET
rootCmd.AddCommand(cmdRPCConsumer)

// RPCProvider command flags
flags.AddTxFlagsToCmd(cmdRPCProvider)
Expand Down
52 changes: 20 additions & 32 deletions cookbook/spec_add_cosmoshub.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "tendermintrpc",
"type": "GET",
Expand All @@ -298,7 +299,8 @@
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "tendermintrpc",
"type": "GET",
Expand Down Expand Up @@ -916,7 +918,8 @@
"deterministic": false,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "rest",
"type": "POST",
Expand Down Expand Up @@ -1263,7 +1266,8 @@
"deterministic": false,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "rest",
"type": "POST",
Expand Down Expand Up @@ -4795,18 +4799,8 @@
"deterministic": false,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "grpc",
"type": "",
"extra_compute_units": "0"
},
{
"category": {
"deterministic": false,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "grpc",
"type": "",
Expand Down Expand Up @@ -6058,7 +6052,8 @@
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "tendermintrpc",
"type": "GET",
Expand All @@ -6082,7 +6077,8 @@
"deterministic": true,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "tendermintrpc",
"type": "GET",
Expand Down Expand Up @@ -6700,7 +6696,8 @@
"deterministic": false,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "rest",
"type": "POST",
Expand Down Expand Up @@ -7047,7 +7044,8 @@
"deterministic": false,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "rest",
"type": "POST",
Expand Down Expand Up @@ -10579,18 +10577,8 @@
"deterministic": false,
"local": false,
"subscription": false,
"stateful": 0
},
"interface": "grpc",
"type": "",
"extra_compute_units": "0"
},
{
"category": {
"deterministic": false,
"local": false,
"subscription": false,
"stateful": 0
"stateful": 0,
"hanging_api": true
},
"interface": "grpc",
"type": "",
Expand Down
Loading

0 comments on commit d8c7fd5

Please sign in to comment.