Skip to content

Commit

Permalink
feat: Move CommunityPool to its own module (#17657)
Browse files Browse the repository at this point in the history
  • Loading branch information
likhita-809 authored Sep 27, 2023
1 parent ddd26b5 commit 9dd3451
Show file tree
Hide file tree
Showing 117 changed files with 10,348 additions and 3,903 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,15 @@ updates:
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/x/protocolpool"
schedule:
interval: weekly
day: wednesday
time: "03:00"
labels:
- "A:automerge"
- dependencies

# Dependencies should be up to date on release branch
- package-ecosystem: gomod
Expand Down
2 changes: 2 additions & 0 deletions .github/pr_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
- x/consensus/**/*
"C:x/circuit":
- x/circuit/**/*
"C:x/protocolpool":
- x/protocolpool/**/*
"C:x/tx":
- x/tx/**/*
"C:collections":
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,37 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: x/circuit/

test-x-protocolpool:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: x/protocolpool/go.sum
- uses: technote-space/[email protected]
id: git_diff
with:
PATTERNS: |
x/protocolpool/**/*.go
x/protocolpool/go.mod
x/protocolpool/go.sum
- name: tests
if: env.GIT_DIFF
run: |
cd x/protocolpool
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
- 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: x/protocolpool/

test-x-feegrant:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Features

* (x/protocolpool) [#17657](https://github.com/cosmos/cosmos-sdk/pull/17657) Create a new `x/protocolpool` module that is responsible for handling community pool funds. This module is split out into a new module from x/distribution.
* (baseapp) [#16581](https://github.com/cosmos/cosmos-sdk/pull/16581) Implement Optimistic Execution as an experimental feature (not enabled by default).
* (client/keys) [#17639](https://github.com/cosmos/cosmos-sdk/pull/17639) Allows using and saving public keys encoded as base64
* (client) [#17513](https://github.com/cosmos/cosmos-sdk/pull/17513) Allow overwritting `client.toml`. Use `client.CreateClientConfig` in place of `client.ReadFromClientConfig` and provide a custom template and a custom config.
Expand All @@ -61,6 +62,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

### API Breaking Changes

* (x/distribution) [#17657](https://github.com/cosmos/cosmos-sdk/pull/17657) The `FundCommunityPool` and `DistributeFromFeePool` keeper methods are now removed from x/distribution.
* (x/distribution) [#17657](https://github.com/cosmos/cosmos-sdk/pull/17657) The distribution module keeper now takes a new argument `PoolKeeper` in addition.
* (app) [#17838](https://github.com/cosmos/cosmos-sdk/pull/17838) Params module was removed from simapp and all imports of the params module removed throughout the repo.
* The Cosmos SDK has migrated aay from using params, if you're app still uses it, then you can leave it plugged into your app
* (x/staking) [#17778](https://github.com/cosmos/cosmos-sdk/pull/17778) Use collections for `Params`
Expand Down Expand Up @@ -154,10 +157,15 @@ Ref: https://keepachangelog.com/en/1.0.0/

### State Machine Breaking

* (x/distribution) [#17657](https://github.com/cosmos/cosmos-sdk/pull/17657) Migrate community pool funds from x/distribution to x/protocolpool.
* (x/distribution) [#17115](https://github.com/cosmos/cosmos-sdk/pull/17115) Migrate `PreviousProposer` to collections.
* (x/upgrade) [#16244](https://github.com/cosmos/cosmos-sdk/pull/16244) upgrade module no longer stores the app version but gets and sets the app version stored in the `ParamStore` of baseapp.
* (x/staking) [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `HistoricalInfo` was replaced with `HistoricalRecord`, it removes the validator set and comet header and only keep what is needed for IBC.

### Client Breaking Changes

* (x/distribution) [#17657](https://github.com/cosmos/cosmos-sdk/pull/17657) Deprecate `CommunityPool` and `FundCommunityPool` rpc methods. Use x/protocolpool module's rpc methods instead.

## [v0.50.0-rc.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.0-rc.1) - 2023-09-25

### Features
Expand Down
33 changes: 33 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,39 @@ Most of Cosmos SDK modules have migrated to [collections](https://docs.cosmos.ne
Many functions have been removed due to this changes as the API can be smaller thanks to collections.
For modules that have migrated, verify you are checking against `collections.ErrNotFound` when applicable.

#### `x/distribution`

The existing chains using x/distribution module needs to add the new x/protocolpool module.

#### `x/protocolpool`

Introducing a new `x/protocolpool` module to handle community pool funds. Its store must be added while upgrading to v0.51.x

Example:

```go
func (app SimApp) RegisterUpgradeHandlers() {
app.UpgradeKeeper.SetUpgradeHandler(
UpgradeName,
func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM)
},
)

// ...
}
```

Add `x/protocolpool` store while upgrading to v0.51.x:

```go
storetypes.StoreUpgrades{
Added: []string{
protocolpooltypes.ModuleName,
},
}
```

## [v0.50.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.0-alpha.0)

### Migration to CometBFT (Part 2)
Expand Down
Loading

0 comments on commit 9dd3451

Please sign in to comment.