Skip to content

Commit

Permalink
Merge branch 'main' into chore/remove-xparams
Browse files Browse the repository at this point in the history
  • Loading branch information
aljo242 committed Dec 20, 2024
2 parents 617a1c4 + 6ed9452 commit bebebc0
Show file tree
Hide file tree
Showing 83 changed files with 623 additions and 6,641 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
# go-arch: ["amd64", "arm", "arm64"]
go-arch: ["amd64", "arm64"] # drop 32 bit support for now (and maybe forever)
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -48,19 +47,17 @@ jobs:
###################
#### Build App ####
###################
- name: Build
run: GOARCH=${{ matrix.go-arch }} make build
- name: Build v2
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2 make build
- name: Build with rocksdb backend
if: matrix.go-arch == 'amd64'
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="rocksdb" make build
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2,rocksdb make build
- name: Build with BLS12381
if: matrix.go-arch == 'amd64'
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="bls12381" make build
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2,bls12381 make build
- name: Build with Secp_cgo
if: matrix.go-arch == 'amd64'
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="secp" make build
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2,secp make build
###################
## Build Tooling ##
###################
Expand Down
145 changes: 0 additions & 145 deletions .github/workflows/sims-047.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,46 +114,6 @@ jobs:
name: "${{ github.sha }}-integration-coverage"
path: ./tests/integration-profile.out

test-system: # v2 system tests are in v2-test.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
cache: true
cache-dependency-path: |
simapp/go.sum
systemtest/go.sum
- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/*.go
go.mod
go.sum
**/go.mod
**/go.sum
**/Makefile
Makefile
- name: Install musl lib for simd (docker) binary
if: env.GIT_DIFF
run: |
sudo apt-get install -y musl
- name: system tests v1
if: env.GIT_DIFF
run: |
make test-system
- uses: actions/upload-artifact@v4
if: failure()
with:
name: "testnet-setup"
path: ./systemtests/testnet/
retention-days: 3

repo-analysis:
runs-on: ubuntu-latest
needs: [tests, test-integration]
Expand Down Expand Up @@ -504,29 +464,6 @@ jobs:
with:
projectBaseDir: indexer/postgres/

test-simapp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
cache: true
cache-dependency-path: simapp/go.sum
- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
**/*.go
simapp/go.mod
simapp/go.sum
- name: tests simapp
if: env.GIT_DIFF
run: |
cd simapp
go test -mod=readonly -timeout 30m -tags='norace ledger test_ledger_mock' ./...
test-simapp-v2:
runs-on: ubuntu-latest
steps:
Expand Down
50 changes: 50 additions & 0 deletions UPGRADING_v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Upgrading Cosmos SDK v2 [DRAFT, see #22531](https://github.com/cosmos/cosmos-sdk/issues/22531)

This guide provides instructions for upgrading to specific versions of Cosmos SDK.
Note, always read the **SimApp** section for more information on application wiring updates.

## Upgrading from v0.52.x to v2.

First and foremost, v2 uses [depinject](./depinject/README.md) to wire the module and application dependencies.
This guide assumes that you have already made your modules depinject compatible, and that you made use of depinject in your application.

### Modules

### Server


### SimApp

With the migration to server/v2 and runtime/v2 some changes are required in the `root.go` and `app.go` of your application.

#### `app.go`


#### `root.go`

Thanks to the more modular design of v2, the application developer is free to pick which server to use in their application:

```go
// wire server commands
return serverv2.AddCommands[T](
rootCmd,
logger,
simApp,
deps.GlobalConfig,
initServerConfig(),
deps.ConsensusServer,
grpcServer,
storeComponent,
telemetryServer,
restServer,
grpcgatewayServer,
)
```

## Upgrading from v0.50.x to v2

Upgrading directly from v0.50.x to v2 is supported.
Modules should be updated to support all the latest changes in the SDK.

Read the module section from the v0.52 [UPGRADING.md](UPGRADING.md) file for more information.
Then simply follow the instructions from the [v0.52 section](#upgrading-from-v052x-to-v200) from this file.
9 changes: 7 additions & 2 deletions baseapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package baseapp

import (
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
cmttypes "github.com/cometbft/cometbft/types"

coreheader "cosmossdk.io/core/header"
errorsmod "cosmossdk.io/errors"
Expand Down Expand Up @@ -64,11 +65,15 @@ func (app *BaseApp) NewContext(isCheckTx bool) sdk.Context {
}

func (app *BaseApp) NewUncachedContext(isCheckTx bool, header cmtproto.Header) sdk.Context {
cmtHeader, _ := cmttypes.HeaderFromProto(&header)
return sdk.NewContext(app.cms, isCheckTx, app.logger).
WithBlockHeader(header).
WithHeaderInfo(coreheader.Info{
Height: header.Height,
Time: header.Time,
AppHash: cmtHeader.AppHash,
Hash: cmtHeader.Hash(),
ChainID: cmtHeader.ChainID,
Height: cmtHeader.Height,
Time: cmtHeader.Time,
})
}

Expand Down
24 changes: 0 additions & 24 deletions client/snapshot/cmd.go

This file was deleted.

37 changes: 0 additions & 37 deletions client/snapshot/delete.go

This file was deleted.

Loading

0 comments on commit bebebc0

Please sign in to comment.