Skip to content

Commit

Permalink
Merge branch 'main' into alex/sims2_s1
Browse files Browse the repository at this point in the history
* main:
  feat(log): remove core dependency and update core interface to be dependency free (#21045)
  chore: fix some comments (#21085)
  feat: simulate nested messages (#20291)
  chore(network): remove `DefaultConfigWithAppConfigWithQueryGasLimit` (#21055)
  fix(runtime): remove `appv1alpha1.Config` from runtime (#21042)
  feat(simapp/v2): Add store server to testnet init cmd (#21076)
  chore(indexer/postgres): update to changes on main (#21077)
  feat(schema/appdata): async listener mux'ing (#20879)
  ci: Use large box for 052 branch sims on CI (#21067)
  chore(all): replace all `fmt.Errorf` without paramters with `errors.New` (#21068)
  • Loading branch information
alpe committed Jul 26, 2024
2 parents f495a50 + 5c90246 commit e7a9942
Show file tree
Hide file tree
Showing 216 changed files with 2,617 additions and 705 deletions.
67 changes: 29 additions & 38 deletions .github/workflows/sims-052.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ concurrency:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read # for actions/checkout to fetch code
runs-on: large-sdk-runner
if: "!contains(github.event.head_commit.message, 'skip-sims')"
steps:
- uses: actions/checkout@v4
Expand All @@ -25,26 +27,9 @@ jobs:
check-latest: true
- run: make build

install-runsim:
permissions:
contents: none
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v4
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary

test-sim-import-export:
runs-on: ubuntu-latest
needs: [build, install-runsim]
runs-on: large-sdk-runner
needs: [build]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
Expand All @@ -54,17 +39,14 @@ jobs:
with:
go-version: "1.22"
check-latest: true
- uses: actions/cache@v4
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
- name: test-sim-import-export
run: |
make test-sim-import-export
test-sim-after-import:
runs-on: ubuntu-latest
needs: [build, install-runsim]
runs-on: large-sdk-runner
needs: [build]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -73,17 +55,14 @@ jobs:
with:
go-version: "1.22"
check-latest: true
- uses: actions/cache@v4
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
- name: test-sim-after-import
run: |
make test-sim-after-import
test-sim-multi-seed-short:
runs-on: ubuntu-latest
needs: [build, install-runsim]
test-sim-deterministic:
runs-on: large-sdk-runner
needs: [build]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -92,18 +71,30 @@ jobs:
with:
go-version: "1.22"
check-latest: true
- uses: actions/cache@v4
- name: test-sim-nondeterminism-streaming
run: |
make test-sim-nondeterminism-streaming
test-sim-multi-seed-short:
runs-on: large-sdk-runner
needs: [build]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
ref: "release/v0.52.x"
- uses: actions/setup-go@v5
with:
path: ~/go/bin
key: ${{ runner.os }}-go-runsim-binary
go-version: "1.22"
check-latest: true
- name: test-sim-multi-seed-short
run: |
make test-sim-multi-seed-short
sims-notify-success:
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
runs-on: ubuntu-latest
runs-on: large-sdk-runner
if: ${{ success() }}
steps:
- uses: actions/checkout@v4
Expand All @@ -130,7 +121,7 @@ jobs:
contents: none
needs:
[test-sim-multi-seed-short, test-sim-after-import, test-sim-import-export]
runs-on: ubuntu-latest
runs-on: large-sdk-runner
if: ${{ failure() }}
steps:
- name: Notify Slack on failure
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,14 +357,6 @@ jobs:
run: |
cd core/testing
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./...
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: core/testing/
test-depinject:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i

### Features

* (baseapp) [#20291](https://github.com/cosmos/cosmos-sdk/pull/20291) Simulate nested messages.
* (tests) [#20013](https://github.com/cosmos/cosmos-sdk/pull/20013) Introduce system tests to run multi node local testnet in CI
* (runtime) [#19953](https://github.com/cosmos/cosmos-sdk/pull/19953) Implement `core/transaction.Service` in runtime.
* (client) [#19905](https://github.com/cosmos/cosmos-sdk/pull/19905) Add grpc client config to `client.toml`.
Expand Down
35 changes: 34 additions & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,39 @@ Note, always read the **SimApp** section for more information on application wir

## [Unreleased]

### BaseApp

#### Nested Messages Simulation

Now it is possible to simulate the nested messages of a message, providing developers with a powerful tool for
testing and predicting the behavior of complex transactions. This feature allows for a more comprehensive
evaluation of gas consumption, state changes, and potential errors that may occur when executing nested
messages. However, it's important to note that while the simulation can provide valuable insights, it does not
guarantee the correct execution of the nested messages in the future. Factors such as changes in the
blockchain state or updates to the protocol could potentially affect the actual execution of these nested
messages when the transaction is finally processed on the network.

For example, consider a governance proposal that includes nested messages to update multiple protocol
parameters. At the time of simulation, the blockchain state may be suitable for executing all these nested
messages successfully. However, by the time the actual governance proposal is executed (which could be days or
weeks later), the blockchain state might have changed significantly. As a result, while the simulation showed
a successful execution, the actual governance proposal might fail when it's finally processed.

By default, when simulating transactions, the gas cost of nested messages is not calculated. This means that
only the gas cost of the top-level message is considered. However, this behavior can be customized using the
`SetIncludeNestedMsgsGas` option when building the BaseApp. By providing a list of message types to this option,
you can specify which messages should have their nested message gas costs included in the simulation. This
allows for more accurate gas estimation for transactions involving specific message types that contain nested
messages, while maintaining the default behavior for other message types.

Here is an example on how `SetIncludeNestedMsgsGas` option could be set to calculate the gas of a gov proposal
nested messages:
```go
baseAppOptions = append(baseAppOptions, baseapp.SetIncludeNestedMsgsGas([]sdk.Message{&gov.MsgSubmitProposal{}}))
// ...
app.App = appBuilder.Build(db, traceStore, baseAppOptions...)
```

### SimApp

In this section we describe the changes made in Cosmos SDK' SimApp.
Expand Down Expand Up @@ -1262,4 +1295,4 @@ message MsgSetWithdrawAddress {
}
```

When clients interact with a node they are required to set a codec in in the grpc.Dial. More information can be found in this [doc](https://docs.cosmos.network/v0.46/run-node/interact-node.html#programmatically-via-go).
When clients interact with a node they are required to set a codec in the grpc.Dial. More information can be found in this [doc](https://docs.cosmos.network/v0.46/run-node/interact-node.html#programmatically-via-go).
Loading

0 comments on commit e7a9942

Please sign in to comment.