Skip to content

Commit

Permalink
Merge branch 'main' into marko/serverv2-adr
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Jul 29, 2024
2 parents eb354c2 + 9b6f61e commit 7aed8b2
Show file tree
Hide file tree
Showing 173 changed files with 2,285 additions and 591 deletions.
3 changes: 2 additions & 1 deletion .github/.codespellignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ keypair
pastTime
hasTables
Nam
EyT
EyT
upTo
30 changes: 20 additions & 10 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 Expand Up @@ -544,7 +536,7 @@ jobs:
if: env.GIT_DIFF
run: |
cd simapp
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./...
go test -mod=readonly -timeout 30m -tags='norace ledger test_ledger_mock' ./...
- name: tests simapp v1
if: env.GIT_DIFF
run: |
Expand All @@ -570,10 +562,28 @@ jobs:
go.sum
**/go.mod
**/go.sum
- name: tests simapp
if: env.GIT_DIFF
run: |
cd simapp/v2
go test -mod=readonly -timeout 30m -tags='norace ledger test_ledger_mock' ./...
- name: simapp-v2-smoke-test
if: env.GIT_DIFF
run: |
./scripts/simapp-v2-init.sh
COSMOS_BUILD_OPTIONS=v2 make install
./scripts/init-simapp-v2.sh
simdv2 start &
SIMD_PID=$!
cnt=0
while ! simdv2 query block --type=height 5; do
cnt=$((cnt + 1))
if [ $cnt -gt 30 ]; then
kill -9 "$SIMD_PID"
exit 1
fi
sleep 1
done
kill -9 "$SIMD_PID"
test-collections:
runs-on: ubuntu-latest
Expand Down
36 changes: 30 additions & 6 deletions .github/workflows/v2-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: v2 core Tests
name: v2 core Tests
on:
pull_request:
merge_group:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
- name: test & coverage report creation
if: env.GIT_DIFF
run: |
cd server/v2 && go test -mod=readonly -race -timeout 30m -covermode=atomic -tags='ledger test_ledger_mock'
cd server/v2 && go test -mod=readonly -race -timeout 30m -tags='ledger test_ledger_mock'
stf:
runs-on: ubuntu-latest
strategy:
Expand All @@ -60,9 +60,9 @@ jobs:
- name: test & coverage report creation
if: env.GIT_DIFF
run: |
cd server/v2/stf && go test -mod=readonly -race -timeout 30m -covermode=atomic -tags='ledger test_ledger_mock'
appamanger:
cd server/v2/stf && go test -mod=readonly -race -timeout 30m -tags='ledger test_ledger_mock'
appmanager:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -84,4 +84,28 @@ jobs:
- name: test & coverage report creation
if: env.GIT_DIFF
run: |
cd server/v2/appmanager && go test -mod=readonly -race -timeout 30m -covermode=atomic -tags='ledger test_ledger_mock'
cd server/v2/appmanager && go test -mod=readonly -race -timeout 30m -tags='ledger test_ledger_mock'
cometbft:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
cache: true
cache-dependency-path: go.sum
- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
server/v2/cometbft/**/*.go
server/v2/cometbft/go.mod
server/v2/cometbft/go.sum
- name: test & coverage report creation
if: env.GIT_DIFF
run: |
cd server/v2/cometbft && go test -mod=readonly -race -timeout 30m -tags='ledger test_ledger_mock'
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 7aed8b2

Please sign in to comment.