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

V2.13.0 rc0 #914

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
27c9133
update proto
skyargos Oct 31, 2024
a1fc459
update proto pb
skyargos Oct 31, 2024
c3aceb8
fix: 07-tendermint add in moudle manager
skyargos Nov 5, 2024
f0baea0
update app.go
skyargos Nov 5, 2024
0c2aa0e
refactor!: rm GetSignBytes
skyargos Nov 6, 2024
4e911ab
fix: make lint error
skyargos Nov 6, 2024
e400d06
rebuild e2e test
0311xuyang Nov 6, 2024
f9c4916
fix test errors
0311xuyang Nov 6, 2024
2317496
fix: error handling has been added to export.go
skyargos Nov 6, 2024
505a447
Merge remote-tracking branch 'origin/v2.13.0-rc0' into v2.13.0-rc0
skyargos Nov 7, 2024
58c019a
fix: add test case
skyargos Nov 7, 2024
433c8c6
update go.mod
skyargos Nov 7, 2024
9e9de57
fix: update cert proto
skyargos Nov 7, 2024
825b691
fix: add test case
skyargos Nov 7, 2024
0e7e37b
fix: sim_test.go
skyargos Nov 7, 2024
d9bfff4
update e2e test
0311xuyang Nov 7, 2024
e0947c3
update: change upgradeName
skyargos Nov 7, 2024
b21e323
Merge remote-tracking branch 'origin/v2.13.0-rc0' into v2.13.0-rc0
skyargos Nov 7, 2024
e99e658
bump: go.mod to 1.23
skyargos Nov 7, 2024
aff942a
fix oracle ut
0311xuyang Nov 7, 2024
7f759b1
fix: bank and mint test case
skyargos Nov 7, 2024
2171cd1
Merge remote-tracking branch 'origin/v2.13.0-rc0' into v2.13.0-rc0
skyargos Nov 7, 2024
33e067e
update workflow config
0311xuyang Nov 7, 2024
fc54d4c
update dockerfile
0311xuyang Nov 7, 2024
41b7849
update e2e config
0311xuyang Nov 7, 2024
f0d5d3b
refactor: gov query
skyargos Nov 7, 2024
5ec5ecc
Merge remote-tracking branch 'origin/v2.13.0-rc0' into v2.13.0-rc0
skyargos Nov 7, 2024
ad514d5
aa
skyargos Nov 7, 2024
d0c83bb
fix: e2e test
skyargos Nov 7, 2024
5935caf
update cov config
0311xuyang Nov 7, 2024
e2dd0a1
fix liveness action
0311xuyang Nov 7, 2024
7acde33
fix lint action
0311xuyang Nov 7, 2024
0488106
fix: test-sim-import-export
skyargos Nov 7, 2024
8fae226
Merge remote-tracking branch 'origin/v2.13.0-rc0' into v2.13.0-rc0
skyargos Nov 7, 2024
a3cc62e
fix: simulation
skyargos Nov 7, 2024
ff143e9
update: cosmos-sdk to 0.50.9
skyargos Nov 8, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: '1.21.10'
go-version: '1.23.0'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.21
go-version: 1.23
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
if: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main' }}

build:
runs-on: ubuntu-latest
Expand All @@ -28,7 +28,7 @@ jobs:

test-sim-nondeterminism:
runs-on: ubuntu-latest
needs: Build
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
Expand All @@ -44,15 +44,15 @@ jobs:
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
- name: test nondeterminism
run: |
make test-sim-nondeterminism
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}

test-sim-import-export:
runs-on: ubuntu-latest
needs: Build
needs: build
steps:
- uses: actions/[email protected]
with:
Expand All @@ -68,15 +68,15 @@ jobs:
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
- name: test-sim-import-export
run: |
make test-sim-import-export
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}

test-sim-after-import:
runs-on: ubuntu-latest
needs: Build
needs: build
steps:
- uses: actions/[email protected]
with:
Expand All @@ -92,15 +92,15 @@ jobs:
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
- name: test after import
run: |
make test-sim-after-import
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}

test-sim-multi-seed-short:
runs-on: ubuntu-latest
needs: Build
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
Expand All @@ -116,8 +116,8 @@ jobs:
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
- name: test-sim-multi-seed-short
run: |
make test-sim-multi-seed-short
if: "env.GIT_DIFF != ''"
if: ${{ env.GIT_DIFF != '' }}
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
cleanup-runs:
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
if: ${{ !startsWith(github.ref , 'refs/tags/') && github.ref != 'refs/heads/main' }}
runs-on: ubuntu-latest
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
Expand All @@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.21
go-version: 1.23
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
with:
Expand Down Expand Up @@ -53,6 +53,7 @@ jobs:
- uses: codecov/[email protected]
with:
file: ./coverage.txt # optional
token: 6556fc17-6f3d-40be-b947-0bba9a9fe92f
fail_ci_if_error: true

test-e2e:
Expand All @@ -61,7 +62,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.23
- uses: actions/checkout@v3
- uses: technote-space/[email protected]
with:
Expand All @@ -71,6 +72,8 @@ jobs:
go.sum
- name: Build Docker Image
run: make docker-build-debug
- name: Build Hermes Image
run: make docker-build-hermes
- name: Test E2E
run: make test-e2e

Expand All @@ -81,7 +84,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.23
- uses: technote-space/[email protected]
with:
PATTERNS: |
Expand Down
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ docker-build-debug:

# in CI.
docker-build-hermes:
@cd tests/e2e/docker; docker build -t cosmos/hermes-e2e:latest -f hermes.Dockerfile .
@cd tests/e2e/docker; docker build -t cosmos/hermes-e2e:1.0.0 -f hermes.Dockerfile .


image: Dockerfile Dockerfile.update
Expand Down Expand Up @@ -192,14 +192,13 @@ localnet-stop:
docker-compose down

start-localnet-ci:
./build/shentud init liveness --chain-id liveness --home ~/.shentud-liveness
./build/shentud config chain-id liveness --home ~/.shentud-liveness
./build/shentud config keyring-backend test --home ~/.shentud-liveness
./build/shentud keys add val --home ~/.shentud-liveness
./build/shentud add-genesis-account val 10000000000000000000000000uctk --home ~/.shentud-liveness --keyring-backend test
./build/shentud gentx val 1000000000uctk --home ~/.shentud-liveness --chain-id liveness
./build/shentud collect-gentxs --home ~/.shentud-liveness
sed -i'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' ~/.shentud-liveness/config/app.toml
./build/shentud init liveness -o --chain-id liveness --home ~/.shentud-liveness
./build/shentud config set client keyring-backend test --home ~/.shentud-liveness
./build/shentud keys add val --keyring-backend test --home ~/.shentud-liveness
./build/shentud add-genesis-account val 10000000000000000000stake --home ~/.shentud-liveness --keyring-backend test
./build/shentud genesis gentx val 1000000000stake --home ~/.shentud-liveness --chain-id liveness --keyring-backend test
./build/shentud genesis collect-gentxs --home ~/.shentud-liveness
sed -i 's/minimum-gas-prices = ".*"/minimum-gas-prices = "0stake"/' ~/.shentud-liveness/config/app.toml
./build/shentud start --home ~/.shentud-liveness --x-crisis-skip-assert-invariants

.PHONY: start-localnet-ci
Expand Down
17 changes: 10 additions & 7 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"io"
"os"

"github.com/spf13/cast"

"cosmossdk.io/client/v2/autocli"
"cosmossdk.io/core/appmodule"
"cosmossdk.io/log"
Expand All @@ -22,21 +24,19 @@ import (
abci "github.com/cometbft/cometbft/abci/types"
tmjson "github.com/cometbft/cometbft/libs/json"
tmos "github.com/cometbft/cometbft/libs/os"
"github.com/spf13/cast"

dbm "github.com/cosmos/cosmos-db"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/server"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/address"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/runtime"
runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
"github.com/cosmos/cosmos-sdk/server"
"github.com/cosmos/cosmos-sdk/server/api"
"github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
Expand Down Expand Up @@ -82,6 +82,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/staking"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/cosmos/ibc-go/modules/capability"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
Expand All @@ -101,6 +102,7 @@ import (
porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"

appparams "github.com/shentufoundation/shentu/v2/app/params"
"github.com/shentufoundation/shentu/v2/x/auth"
Expand Down Expand Up @@ -509,6 +511,7 @@ func NewShentuApp(
oracle.NewAppModule(app.OracleKeeper, app.BankKeeper),
shield.NewAppModule(app.ShieldKeeper, app.AccountKeeper, app.BankKeeper),
ibc.NewAppModule(app.IBCKeeper),
ibctm.AppModule{},
params.NewAppModule(app.ParamsKeeper),
transferModule,
icaModule,
Expand Down Expand Up @@ -876,7 +879,7 @@ func (app *ShentuApp) RegisterNodeService(clientCtx client.Context, cfg config.C

// RegisterUpgradeHandlers registers necessary upgrade handlers
func (app *ShentuApp) RegisterUpgradeHandlers() {
app.setUpgradeHandler(app.appCodec, app.IBCKeeper.ClientKeeper)
app.setUpgradeHandler(app.appCodec)
}

// initParamsKeeper init params keeper and its subspaces
Expand Down
47 changes: 18 additions & 29 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ import (
"fmt"
"testing"

"cosmossdk.io/log"
"github.com/stretchr/testify/require"

"cosmossdk.io/log"
abci "github.com/cometbft/cometbft/abci/types"

dbm "github.com/cosmos/cosmos-db"
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ibc-go/v8/testing/simapp"
)

func TestSimAppExportAndBlockedAddrs(t *testing.T) {
func TestShentuAppExportAndBlockedAddrs(t *testing.T) {
db := dbm.NewMemDB()
logger := log.NewTestLogger(t)
app := NewShentuAppWithCustomOptions(t, false, simapp.SetupOptions{
app := NewShentuAppWithCustomOptions(t, false, SetupOptions{
Logger: logger.With("instance", "first"),
DB: db,
AppOpts: simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
Expand All @@ -38,32 +39,20 @@ func TestSimAppExportAndBlockedAddrs(t *testing.T) {
)
}

t.Log(app.AuthKeeper)
}
// finalize block so we have CheckTx state set
_, err := app.FinalizeBlock(&abci.RequestFinalizeBlock{
Height: 1,
})
require.NoError(t, err)

func TestSimAppExport(t *testing.T) {
db := dbm.NewMemDB()
logger := log.NewTestLogger(t)
appOpts := simapp.SetupOptions{
Logger: logger.With("instance", "first"),
DB: db,
AppOpts: simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
}
app := NewShentuAppWithCustomOptions(t, false, appOpts)
_, err = app.Commit()
require.NoError(t, err)

for acc := range maccPerms {
require.True(
t,
app.BankKeeper.BlockedAddr(app.AccountKeeper.GetModuleAddress(acc)),
"ensure that blocked addresses are properly set in bank keeper",
)
}
// Making a new app object with the db, so that initchain hasn't been called
app2 := NewShentuApp(logger.With("instance", "second"), db, nil, true, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()))
_, err = app2.ExportAppStateAndValidators(false, []string{}, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")

//logger2 := log.NewTestLogger(t)
// make a new app object with the db so that initchain hasn't been called
//app2 := NewShentuApp(logger2, db, nil, true, simtestutil.NewAppOptionsWithFlagHome(""), baseapp.SetChainID("test"))
//_, err := app2.ExportAppStateAndValidators(false, []string{}, []string{})
//require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
//_, err = app2.ExportAppStateAndValidators(true, []string{}, []string{})
//require.NoError(t, err, "ExportAppStateAndValidators for zero height should not have an error")
_, err = app2.ExportAppStateAndValidators(true, []string{}, []string{})
require.NoError(t, err, "ExportAppStateAndValidators for zero height should not have an error")
}
Loading
Loading