diff --git a/.github/workflows/atlas.yml b/.github/workflows/atlas.yml deleted file mode 100644 index 1070d6fbc8..0000000000 --- a/.github/workflows/atlas.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Atlas -# Atlas checks if a modules atlas manifest has been touched, if so it publishes the updated version -on: - push: - branches: - - main - paths: - - "x/**/atlas/*" - pull_request: - paths: - - "x/**/atlas/*" - -jobs: - auth: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v6.1.1 - id: git_diff - with: - PATTERNS: | - x/auth/atlas/** - - uses: marbar3778/atlas_action@main - with: - token: ${{ secrets.ATLAS_TOKEN }} - path: ./x/auth/atlas/atlas.toml - dry-run: ${{ github.event_name != 'pull_request' }} - if: env.GIT_DIFF - bank: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v6.1.1 - id: git_diff - with: - PATTERNS: | - x/bank/atlas/** - - uses: marbar3778/atlas_action@main - with: - token: ${{ secrets.ATLAS_TOKEN }} - path: ./x/bank/atlas/atlas.toml - dry-run: ${{ github.event_name != 'pull_request' }} - if: env.GIT_DIFF - evidence: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: technote-space/get-diff-action@v6.1.1 - id: git_diff - with: - PATTERNS: | - x/evidence/atlas/** - - uses: marbar3778/atlas_action@main - with: - token: ${{ secrets.ATLAS_TOKEN }} - path: ./x/evidence/atlas/manifest.toml - dry-run: ${{ github.event_name != 'pull_request' }} - if: env.GIT_DIFF diff --git a/.github/workflows/cosmovisor-release.yml b/.github/workflows/cosmovisor-release.yml index 755c01f4b1..17a94f4900 100644 --- a/.github/workflows/cosmovisor-release.yml +++ b/.github/workflows/cosmovisor-release.yml @@ -3,7 +3,7 @@ name: Release Cosmovisor on: push: tags: - - "cosmovisor/v*.*.*" + - "tools/cosmovisor/v*.*.*" permissions: contents: read diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000000..3650f45988 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "golang.go", + "bufbuild.vscode-buf", + "davidanson.vscode-markdownlint" + ] +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index be3daf178a..5664c578cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,7 +64,7 @@ To synchronize we have few major meetings: * Cosmos SDK Sprint Review on Monday and Thursday at 14:00 UTC (limited participation to core devs). * Cosmos SDK Community Call on Thursday at 16:00 UTC. -If you would like to join one of the community call, then please contact us on [Discord](https://discord.com/invite/cosmosnetwork) or reach out directly to Marko (@marbar3778). +If you would like to join one of the community call, then please contact us on [Discord](https://discord.com/invite/cosmosnetwork) or reach out directly to Marko (@tac0turtle). ## Architecture Decision Records (ADR) diff --git a/Makefile b/Makefile index 130cbfeead..2a1ce3e252 100644 --- a/Makefile +++ b/Makefile @@ -410,7 +410,7 @@ protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer) containerProtoGen=$(PROJECT_NAME)-proto-gen-$(protoVer) containerProtoGenSwagger=$(PROJECT_NAME)-proto-gen-swagger-$(protoVer) containerProtoFmt=$(PROJECT_NAME)-proto-fmt-$(protoVer) -DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.7.0 +DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf:1.9.0 proto-all: proto-format proto-lint proto-gen diff --git a/docs/architecture/adr-060-abci-1.0.md b/docs/architecture/adr-060-abci-1.0.md index 9ff76ae99e..c6304e8ae3 100644 --- a/docs/architecture/adr-060-abci-1.0.md +++ b/docs/architecture/adr-060-abci-1.0.md @@ -2,7 +2,7 @@ ## Changelog -* 2022-08-10: Initial Draft (@alexanderbez, @marbar3778) +* 2022-08-10: Initial Draft (@alexanderbez, @tac0turtle) ## Status diff --git a/docs/docs/building-modules/04-query-services.md b/docs/docs/building-modules/04-query-services.md index f405cd58c2..bec9a99c33 100644 --- a/docs/docs/building-modules/04-query-services.md +++ b/docs/docs/building-modules/04-query-services.md @@ -58,27 +58,18 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.46.0/x/bank/keeper/grpc_query.go ### Calling queries from the State Machine The Cosmos SDK v0.47 introduces a new `cosmos.query.v1.module_query_safe` Protobuf annotation which is used to state that a query that is safe to be called from within the state machine, for example: -- a Keeper's query function can be called from another module's Keeper, -- ADR-033 intermodule query calls, -- CosmWasm contracts can also directly interact with these queries. + +* a Keeper's query function can be called from another module's Keeper, +* ADR-033 intermodule query calls, +* CosmWasm contracts can also directly interact with these queries. If the `module_query_safe` annotation set to `true`, it means: - - The query is deterministic: given a block height it will return the same response upon multiple calls, and doesn't introduce any state-machine breaking changes across SDK patch versions. - - Gas consumption never fluctuates across calls and across patch versions. + +* The query is deterministic: given a block height it will return the same response upon multiple calls, and doesn't introduce any state-machine breaking changes across SDK patch versions. +* Gas consumption never fluctuates across calls and across patch versions. If you are a module developer and want to use `module_query_safe` annotation for your own query, you have to ensure the following things: - - the query is deterministic and won't introduce state-machine-breaking changes without coordinated upgrades - - it has its gas tracked, to avoid the attack vector where no gas is accounted for + +* the query is deterministic and won't introduce state-machine-breaking changes without coordinated upgrades +* it has its gas tracked, to avoid the attack vector where no gas is accounted for on potentially high-computation queries. - -#### Deterministic and Regression tests - -Tests are written for queries in the Cosmos SDK which have `module_query_safe`. Each query is tested using 2 methods: -- we use property-based testing using the [`rapid`](https://pkg.go.dev/pgregory.net/rapid@v0.5.3) library. The property that is tested is that the query response and gas consumption are the same upon 1000 query calls. -- we write regression tests with hardcoded responses and gas, and make sure they don't change upon 1000 calls and between SDK patch versions. - -Here's an example of regression tests: - -```go reference -https://github.com/cosmos/cosmos-sdk/blob/9f3575a10f1a6f1315b94a9be783df5156ce2292/tests/integration/bank/keeper/deterministic_test.go#L102-L115 -``` diff --git a/docs/docs/building-modules/14-testing.md b/docs/docs/building-modules/14-testing.md index 119b491734..3dde24bf52 100644 --- a/docs/docs/building-modules/14-testing.md +++ b/docs/docs/building-modules/14-testing.md @@ -85,6 +85,21 @@ Now the types are injected and we can use them for our tests: https://github.com/cosmos/cosmos-sdk/blob/e09516f4795c637ab12b30bf732ce5d86da78424/tests/integration/distribution/keeper/keeper_test.go#L21-L53 ``` +## Deterministic and Regression tests + +Tests are written for queries in the Cosmos SDK which have `module_query_safe` Protobuf annotation. + +Each query is tested using 2 methods: + +* Use property-based testing with the [`rapid`](https://pkg.go.dev/pgregory.net/rapid@v0.5.3) library. The property that is tested is that the query response and gas consumption are the same upon 1000 query calls. +* Regression tests are written with hardcoded responses and gas, and verify they don't change upon 1000 calls and between SDK patch versions. + +Here's an example of regression tests: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/9f3575a10f1a6f1315b94a9be783df5156ce2292/tests/integration/bank/keeper/deterministic_test.go#L102-L115 +``` + ## Simulations Simulations uses as well a minimal application, built with [`depinject`](../building-apps/01-depinject.md):