Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pebble #8

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions .github/workflows/docker.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/gaia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow builds and pushes a new version of the build container image
# when the tools directory changes on master. Edit tools/Dockerfile.
#
# This workflow does not push a new image until it is merged, so tests that
# depend on changes in this image will not pass until this workflow succeeds.
# For that reason, changes here should be done in a separate PR in advance of
# work that depends on them.

name: State Sync Gaia
on:
pull_request:
push:

jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/faddat/gaia
continue-on-error: true
env:
INTERVAL: 1000
GAIAD_STATESYNC_ENABLE: true
GAIAD_P2P_MAX_NUM_OUTBOUND_PEERS: 200
GAIAD_P2P_SEEDS: "[email protected]:14956"
GAIAD_STATESYNC_RPC_SERVERS: "https://cosmos-rpc.polkachu.com:443,https://rpc-cosmoshub.blockapsis.com:443,https://cosmoshub.validator.network:443"
GOPATH: /go

strategy:
matrix:
database: [pebbledb, goleveldb, mdbx]

steps:
- run: git config --global --add safe.directory /__w/tendermint/tm-db
- uses: actions/checkout@v3
- name: state sync gaia with ${{ matrix.database }}
run: |
cd ..
git clone https://github.com/cosmos/gaia --branch release/v7.0.x
cd gaia
go mod edit -replace github.com/tendermint/tm-db=../tm-db
go mod tidy
go install -ldflags '-w -s -X github.com/cosmos/cosmos-sdk/types.DBBackend=${{ matrix.database }}' -tags ${{ matrix.database }} ./...
export LATEST_HEIGHT=$(curl -s https://rpc-cosmoshub.blockapsis.com/block | jq -r .result.block.header.height);
export BLOCK_HEIGHT=$(($LATEST_HEIGHT-$INTERVAL))
export TRUST_HASH=$(curl -s "https://rpc-cosmoshub.blockapsis.com/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
export GAIAD_STATESYNC_TRUST_HEIGHT=$BLOCK_HEIGHT
export GAIAD_STATESYNC_TRUST_HASH=$TRUST_HASH
export PATH=$PATH:/go/bin
echo "TRUST HEIGHT: $BLOCK_HEIGHT"
echo "TRUST HASH: $TRUST_HASH"
gaiad init gaia-matrix
cp /genesis.json ~/.gaia/config/genesis.json
gaiad start --x-crisis-skip-assert-invariants --db_backend ${{ matrix.database }} --halt-height $((LATEST_HEIGHT+25))
12 changes: 3 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
linters:
disable-all: true
enable:
- deadcode
- depguard
- dogsled
- dupl
Expand All @@ -25,7 +24,6 @@ linters:
- revive
- unconvert
- unused
- varcheck
- nolintlint

run:
Expand All @@ -40,10 +38,6 @@ issues:
- path: _test\.go
linters:
- gosec
linters-settings:
maligned:
suggest-new: true
errcheck:
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
# default is false: such cases aren't reported by default.
check-blank: true
- text: "leading space"
linters:
- nolintlint
5 changes: 2 additions & 3 deletions backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package db

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
Expand Down Expand Up @@ -35,7 +34,7 @@ func cleanupDBDir(dir, name string) {

func testBackendGetSetDelete(t *testing.T, backend BackendType) {
// Default
dirname, err := ioutil.TempDir("", fmt.Sprintf("test_backend_%s_", backend))
dirname, err := os.MkdirTemp("", fmt.Sprintf("test_backend_%s_", backend))
require.Nil(t, err)
db, err := NewDB("testdb", backend, dirname)
require.NoError(t, err)
Expand Down Expand Up @@ -302,7 +301,7 @@ func testDBIterator(t *testing.T, backend BackendType) {
[]int64(nil), "reverse iterator from 2 (ex) to 4")

// Ensure that the iterators don't panic with an empty database.
dir2, err := ioutil.TempDir("", "tm-db-test")
dir2, err := os.MkdirTemp("", "tm-db-test")
require.NoError(t, err)
db2, err := NewDB(name, backend, dir2)
require.NoError(t, err)
Expand Down
Loading