Skip to content

Commit

Permalink
Merge branch 'main' into marko/SS_removal
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Dec 3, 2024
2 parents 5d6c5f0 + 6a52694 commit cbd01ed
Show file tree
Hide file tree
Showing 25 changed files with 478 additions and 430 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ jobs:
- name: Build with rocksdb backend
if: matrix.go-arch == 'amd64'
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="rocksdb" make build
- name: Build with BLS12381
if: matrix.go-arch == 'amd64'
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="bls12381" make build
- name: Build with Secp_cgo
if: matrix.go-arch == 'amd64'
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="secp" make build
###################
## Build Tooling ##
###################
Expand Down
2 changes: 1 addition & 1 deletion CODING_GUIDELINES.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Desired outcomes:

As a developer, you must help the QA team by providing instructions for User Experience (UX) and functional testing.

### QA Team to cross check Acceptance Tests
### QA Team to cross-check Acceptance Tests

Once the AT are defined, the QA team will have an overview of the behavior a user can expect and:

Expand Down
4 changes: 2 additions & 2 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ v1.0.0-beta1 → v1.0.0-beta2 → ... → v1.0.0-rc1 → v1.0.0-rc2 → ... →
* All links must point to their respective pull request.
* The `CHANGELOG.md` must contain only the changes of that specific released version. All other changelog entries must be deleted and linked to the `main` branch changelog ([example](https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/CHANGELOG.md#previous-versions)).
* Create release notes, in `RELEASE_NOTES.md`, highlighting the new features and changes in the version. This is needed so the bot knows which entries to add to the release page on GitHub.
* Additionally verify that the `UPGRADING.md` file is up to date and contains all the necessary information for upgrading to the new version.
* Additionally verify that the `UPGRADING.md` file is up-to-date and contains all the necessary information for upgrading to the new version.
* Remove GitHub workflows that should not be in the release branch
* `test.yml`: All standalone go module tests should be removed (expect `./simapp`, and `./tests`, SDK and modules tests).
* These packages are tracked and tested directly on main.
Expand Down Expand Up @@ -57,7 +57,7 @@ A _patch release_ is an increment of the patch number (eg: `v1.2.0` → `v1.2.1`

**Patch release must not break API nor consensus.**

Updates to the release branch should come from `main` by backporting PRs (usually done by automatic cherry pick followed by a PRs to the release branch). The backports must be marked using `backport/Y` label in PR for main.
Updates to the release branch should come from `main` by backporting PRs (usually done by automatic cherry-pick followed by PRs to the release branch). The backports must be marked using `backport/Y` label in PR for main.
It is the PR author's responsibility to fix merge conflicts, update changelog entries, and
ensure CI passes. If a PR originates from an external contributor, a core team member assumes
responsibility to perform this process instead of the original author.
Expand Down
4 changes: 2 additions & 2 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Issue: https://github.com/cosmos/iavl/issues/548

* Toolkit/SDK ADR.
* Objective:
* Produce a RFC/ADR on how to make core composable
* Produce an RFC/ADR on how to make core composable
* Merge RFC/ADR into main
* Progress:
* on pause until abci 2.0 integration is completed
Expand Down Expand Up @@ -267,4 +267,4 @@ Issue: https://github.com/cosmos/iavl/issues/548



This document will be updated at the end of the quarter on what was achieved and what was not. Shortly before the quarter concludes a new section will be added for the next quarter. We are working on updating the complete one year roadmap and will be posting it here as well.
This document will be updated at the end of the quarter on what was achieved and what was not. Shortly before the quarter concludes a new section will be added for the next quarter. We are working on updating the complete one-year roadmap and will be posting it here as well.
2 changes: 1 addition & 1 deletion docs/architecture/adr-008-dCERT-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ mechanism. If those tokens are unbonded then the dCERT member must be
automatically kicked from the group.

Slashing of a particular dCERT member due to soft-contract breach should be
performed by governance on a per member basis based on the magnitude of the
performed by governance on a per-member basis based on the magnitude of the
breach. The process flow is anticipated to be that a dCERT member is suspended
by the dCERT group prior to being slashed by governance.

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/adr-033-protobuf-inter-module-comm.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (foo *FooMsgServer) Bar(ctx context.Context, req *MsgBarRequest) (*MsgBarRe
}
```

This design is also intended to be extensible to cover use cases of more fine grained permissioning like minting by
This design is also intended to be extensible to cover use cases of more fine-grained permissioning like minting by
denom prefix being restricted to certain modules (as discussed in
[#7459](https://github.com/cosmos/cosmos-sdk/pull/7459#discussion_r529545528)).

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/adr-049-state-sync-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ type ExtensionPayloadReader = func() ([]byte, error)
type ExtensionPayloadWriter = func([]byte) error

// ExtensionSnapshotter is an extension Snapshotter that is appended to the snapshot stream.
// ExtensionSnapshotter has an unique name and manages it's own internal formats.
// ExtensionSnapshotter has a unique name and manages it's own internal formats.
type ExtensionSnapshotter interface {
// SnapshotName returns the name of snapshotter, it should be unique in the manager.
SnapshotName() string
Expand Down
12 changes: 6 additions & 6 deletions schema/diff/field_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package diff
import "cosmossdk.io/schema"

// FieldDiff represents the difference between two fields.
// The KindChanged, NullableChanged, and ReferenceTypeChanged methods can be used to determine
// The KindChanged, NullableChanged, and ReferenceableTypeChanged methods can be used to determine
// what specific changes were made to the field.
type FieldDiff struct {
// Name is the name of the field.
Expand All @@ -22,11 +22,11 @@ type FieldDiff struct {
NewNullable bool

// OldReferencedType is the name of the old referenced type.
// It will be empty if the field is not a reference type or if there was no change.
// It will be empty if the field is not a referenceable type or if there was no change.
OldReferencedType string

// NewReferencedType is the name of the new referenced type.
// It will be empty if the field is not a reference type or if there was no change.
// It will be empty if the field is not a referenceable type or if there was no change.
NewReferencedType string
}

Expand All @@ -52,7 +52,7 @@ func compareField(oldField, newField schema.Field) FieldDiff {

// Empty returns true if the field diff has no changes.
func (d FieldDiff) Empty() bool {
return !d.KindChanged() && !d.NullableChanged() && !d.ReferenceTypeChanged()
return !d.KindChanged() && !d.NullableChanged() && !d.ReferenceableTypeChanged()
}

// KindChanged returns true if the field kind changed.
Expand All @@ -65,7 +65,7 @@ func (d FieldDiff) NullableChanged() bool {
return d.OldNullable != d.NewNullable
}

// ReferenceTypeChanged returns true if the referenced type changed.
func (d FieldDiff) ReferenceTypeChanged() bool {
// ReferenceableTypeChanged returns true if the referenced type changed.
func (d FieldDiff) ReferenceableTypeChanged() bool {
return d.OldReferencedType != d.NewReferencedType
}
2 changes: 1 addition & 1 deletion schema/diff/field_diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func Test_compareField(t *testing.T) {
OldReferencedType: "old",
NewReferencedType: "new",
},
trueF: FieldDiff.ReferenceTypeChanged,
trueF: FieldDiff.ReferenceableTypeChanged,
},
}

Expand Down
4 changes: 2 additions & 2 deletions schema/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func (e EnumType) TypeName() string {
return e.Name
}

func (EnumType) isType() {}
func (EnumType) isReferenceType() {}
func (EnumType) isType() {}
func (EnumType) isReferenceableType() {}

// Validate validates the enum definition.
func (e EnumType) Validate(TypeSet) error {
Expand Down
6 changes: 3 additions & 3 deletions schema/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ type Type interface {
isType()
}

// ReferenceType is a marker interface that all types that can be the target of Field.ReferencedType implement.
// ReferenceableType is a marker interface that all types that can be the target of Field.ReferencedType implement.
// Currently, this is only EnumType.
type ReferenceType interface {
type ReferenceableType interface {
Type

// isReferenceType is implemented if this is a reference type.
isReferenceType()
isReferenceableType()
}

// TypeSet represents something that has types and allows them to be looked up by name.
Expand Down
6 changes: 0 additions & 6 deletions scripts/build/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ ifeq (v2,$(findstring v2,$(COSMOS_BUILD_OPTIONS)))
endif

# DB backend selection
ifeq (cleveldb,$(findstring cleveldb,$(COSMOS_BUILD_OPTIONS)))
build_tags += gcc
endif
ifeq (badgerdb,$(findstring badgerdb,$(COSMOS_BUILD_OPTIONS)))
build_tags += badgerdb
endif
# handle rocksdb
ifeq (rocksdb,$(findstring rocksdb,$(COSMOS_BUILD_OPTIONS)))
CGO_ENABLED=1
Expand Down
36 changes: 0 additions & 36 deletions tests/integration/distribution/keeper/common_test.go

This file was deleted.

31 changes: 0 additions & 31 deletions tests/integration/distribution/module_test.go

This file was deleted.

15 changes: 14 additions & 1 deletion tests/integration/v2/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
corebranch "cosmossdk.io/core/branch"
"cosmossdk.io/core/comet"
corecontext "cosmossdk.io/core/context"
"cosmossdk.io/core/header"
"cosmossdk.io/core/server"
corestore "cosmossdk.io/core/store"
"cosmossdk.io/core/transaction"
Expand Down Expand Up @@ -96,6 +97,8 @@ type StartupConfig struct {
// RouterServiceBuilder defines the custom builder
// for msg router and query router service to be used in the app.
RouterServiceBuilder runtime.RouterServiceBuilder
// HeaderService defines the custom header service to be used in the app.
HeaderService header.Service
}

func DefaultStartUpConfig(t *testing.T) StartupConfig {
Expand Down Expand Up @@ -125,6 +128,7 @@ func DefaultStartUpConfig(t *testing.T) StartupConfig {
RouterServiceBuilder: runtime.NewRouterBuilder(
stf.NewMsgRouterService, stf.NewQueryRouterService(),
),
HeaderService: services.NewGenesisHeaderService(stf.HeaderService{}),
}
}

Expand Down Expand Up @@ -182,13 +186,13 @@ func NewApp(
"minimum-gas-prices": "0stake",
},
},
services.NewGenesisHeaderService(stf.HeaderService{}),
cometService,
kvFactory,
&eventService{},
storeBuilder,
startupConfig.BranchService,
startupConfig.RouterServiceBuilder,
startupConfig.HeaderService,
),
depinject.Invoke(
std.RegisterInterfaces,
Expand Down Expand Up @@ -313,6 +317,10 @@ type App struct {
txConfig client.TxConfig
}

func (a App) LastBlockHeight() uint64 {
return a.lastHeight
}

// Deliver delivers a block with the given transactions and returns the resulting state.
func (a *App) Deliver(
t *testing.T, ctx context.Context, txs []stateMachineTx,
Expand All @@ -327,6 +335,11 @@ func (a *App) Deliver(
resp, state, err := a.DeliverBlock(ctx, req)
require.NoError(t, err)
a.lastHeight++
// update block heigh if integeration context is present
iCtx, ok := ctx.Value(contextKey).(*integrationContext)
if ok {
iCtx.header.Height = int64(a.lastHeight)
}
return resp, state
}

Expand Down
3 changes: 3 additions & 0 deletions tests/integration/v2/auth/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"cosmossdk.io/depinject"
"cosmossdk.io/log"
"cosmossdk.io/runtime/v2"
"cosmossdk.io/runtime/v2/services"
"cosmossdk.io/server/v2/stf"
"cosmossdk.io/x/accounts"
basedepinject "cosmossdk.io/x/accounts/defaults/base/depinject"
accountsv1 "cosmossdk.io/x/accounts/v1"
Expand Down Expand Up @@ -77,6 +79,7 @@ func createTestSuite(t *testing.T) *suite {

startupCfg.BranchService = &integration.BranchService{}
startupCfg.RouterServiceBuilder = serviceBuilder
startupCfg.HeaderService = services.NewGenesisHeaderService(stf.HeaderService{})

res.app, err = integration.NewApp(
depinject.Configs(configurator.NewAppV2Config(moduleConfigs...), depinject.Provide(
Expand Down
29 changes: 29 additions & 0 deletions tests/integration/v2/distribution/common_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package distribution

import (
"testing"

"gotest.tools/v3/assert"

"cosmossdk.io/math"
"cosmossdk.io/x/distribution/types"
stakingtestutil "cosmossdk.io/x/staking/testutil"
stakingtypes "cosmossdk.io/x/staking/types"

sdk "github.com/cosmos/cosmos-sdk/types"
)

func setupValidatorWithCommission(t *testing.T, f *fixture, valAddr sdk.ValAddress, initialStake int64) {
t.Helper()
initTokens := f.stakingKeeper.TokensFromConsensusPower(f.ctx, int64(1000))
assert.NilError(t, f.bankKeeper.MintCoins(f.ctx, types.ModuleName, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initTokens))))
assert.NilError(t, f.stakingKeeper.Params.Set(f.ctx, stakingtypes.DefaultParams()))

funds := f.stakingKeeper.TokensFromConsensusPower(f.ctx, int64(1000))
assert.NilError(t, f.bankKeeper.SendCoinsFromModuleToAccount(f.ctx, types.ModuleName, sdk.AccAddress(valAddr), sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, funds))))
f.authKeeper.SetAccount(f.ctx, f.authKeeper.NewAccountWithAddress(f.ctx, sdk.AccAddress(valAddr)))

tstaking := stakingtestutil.NewHelper(t, f.ctx, f.stakingKeeper)
tstaking.Commission = stakingtypes.NewCommissionRates(math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDecWithPrec(5, 1), math.LegacyNewDec(0))
tstaking.CreateValidator(valAddr, valConsPk0, math.NewInt(initialStake), true)
}
Loading

0 comments on commit cbd01ed

Please sign in to comment.