Skip to content

Commit

Permalink
Merge branch 'main' into julien/wallog
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Dec 18, 2024
2 parents 270c5bc + a68f032 commit 5490578
Show file tree
Hide file tree
Showing 26 changed files with 177 additions and 203 deletions.
2 changes: 1 addition & 1 deletion docs/architecture/adr-045-check-delivertx-middlewares.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This ADR replaces the current BaseApp `runTx` and antehandlers design with a mid

BaseApp's implementation of ABCI `{Check,Deliver}Tx()` and its own `Simulate()` method call the `runTx` method under the hood, which first runs antehandlers, then executes `Msg`s. However, the [transaction Tips](https://github.com/cosmos/cosmos-sdk/issues/9406) and [refunding unused gas](https://github.com/cosmos/cosmos-sdk/issues/2150) use cases require custom logic to be run after the `Msg`s execution. There is currently no way to achieve this.

An naive solution would be to add post-`Msg` hooks to BaseApp. However, the Cosmos SDK team thinks in parallel about the bigger picture of making app wiring simpler ([#9181](https://github.com/cosmos/cosmos-sdk/discussions/9182)), which includes making BaseApp more lightweight and modular.
A naive solution would be to add post-`Msg` hooks to BaseApp. However, the Cosmos SDK team thinks in parallel about the bigger picture of making app wiring simpler ([#9181](https://github.com/cosmos/cosmos-sdk/discussions/9182)), which includes making BaseApp more lightweight and modular.

## Decision

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/adr-75-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ type StateTransitionFunction[T transaction.Tx] interface {

The design of the node comes with a number of tradeoffs.

* Maintenance cost can be the same as existing Baseapp as handling many go.mods is a overhead.
* Maintenance cost can be the same as existing Baseapp as handling many go.mods is an overhead.
* Modularity means different layers of abstractions, abstractions always have a cost.

### Backwards Compatibility
Expand Down
2 changes: 1 addition & 1 deletion docs/rfc/rfc-006-handlers.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The Cosmos SDK has a very powerful and flexible module system that has been test
and proven to be very good in production. The design of how messages are handled
is built around Protobuf services and gRPC. This design was proposed and implemented
during a time when we migrated from Amino to Protocol Buffers. This design has
fulfilled the needs of users today. While this design is useful it has caused a
fulfilled the needs of users today. While this design is useful it has caused an
elevated learning curve to be adopted by users. Today, these services are the
only way to write a module. This RFC proposes a new design that simplifies the
design and enables new use cases we are seeing today.
Expand Down
2 changes: 1 addition & 1 deletion docs/spec/store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ responsibility of the caller to ensure that concurrent access to the store is
not performed.

The main issue with concurrent use is when data is written at the same time as
it's being iterated over. Doing so will cause a irrecoverable fatal error because
it's being iterated over. Doing so will cause an irrecoverable fatal error because
of concurrent reads and writes to an internal map.

Although it's not recommended, you can iterate through values while writing to
Expand Down
2 changes: 1 addition & 1 deletion docs/user/run-node/01-run-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ When running a node (not a validator!) and not wanting to run the application me

```toml
[mempool]
# Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool.
# Setting max-txs to 0 will allow for an unbounded amount of transactions in the mempool.
# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool.
# Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount.
#
Expand Down
2 changes: 1 addition & 1 deletion systemtests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Therefore, we focus on the **critical path** and do not cover every condition.

## How to use

Read the [getting_started.md](../tests/systemtests/getting_started.md) guide to get started.
Read the [getting_started.md](../systemtests/getting_started.md) guide to get started.

### Execute a single test

Expand Down
1 change: 0 additions & 1 deletion tests/integration/v2/gov/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,4 @@ func (s *suite) registerMsgRouterService(router *integration.RouterService) {
}

func (f *suite) registerQueryRouterService(router *integration.RouterService) {

}
1 change: 0 additions & 1 deletion tests/integration/v2/gov/keeper/fixture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,4 @@ func (f *fixture) registerMsgRouterService(router *integration.RouterService) {
}

func (f *fixture) registerQueryRouterService(router *integration.RouterService) {

}
3 changes: 1 addition & 2 deletions tests/integration/v2/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ var (
_ event.Manager = &eventManager{}
)

type eventService struct {
}
type eventService struct{}

// EventManager implements event.Service.
func (e *eventService) EventManager(ctx context.Context) event.Manager {
Expand Down
1 change: 0 additions & 1 deletion x/accounts/defaults/lockup/lockup.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ func (bva *BaseLockup) checkUnbondingEntriesMature(ctx context.Context) error {
if !errorsmod.IsOf(err, stakingtypes.ErrNoUnbondingDelegation) {
return true, err
}

}

found := false
Expand Down
1 change: 0 additions & 1 deletion x/accounts/defaults/lockup/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ func newMockContext(t *testing.T) (context.Context, store.KVStoreService) {
default:
return nil, errors.New("unrecognized request type")
}

},
)
}
Expand Down
13 changes: 10 additions & 3 deletions x/bank/testutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ package testutil
import (
"context"

bankkeeper "cosmossdk.io/x/bank/keeper"
"cosmossdk.io/x/bank/types"

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

// minimalBankKeeper is a subset of the bankkeeper.Keeper interface that is used
// for the bank testing utilities.
type minimalBankKeeper interface {
MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error
SendCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt sdk.Coins) error
}

// FundAccount is a utility function that funds an account by minting and
// sending the coins to the address. This should be used for testing purposes
// only!
//
// TODO: Instead of using the mint module account, which has the
// permission of minting, create a "faucet" account. (@fdymylja)
func FundAccount(ctx context.Context, bankKeeper bankkeeper.Keeper, addr sdk.AccAddress, amounts sdk.Coins) error {
func FundAccount(ctx context.Context, bankKeeper minimalBankKeeper, addr sdk.AccAddress, amounts sdk.Coins) error {
if err := bankKeeper.MintCoins(ctx, types.MintModuleName, amounts); err != nil {
return err
}
Expand All @@ -29,7 +36,7 @@ func FundAccount(ctx context.Context, bankKeeper bankkeeper.Keeper, addr sdk.Acc
//
// TODO: Instead of using the mint module account, which has the
// permission of minting, create a "faucet" account. (@fdymylja)
func FundModuleAccount(ctx context.Context, bankKeeper bankkeeper.Keeper, recipientMod string, amounts sdk.Coins) error {
func FundModuleAccount(ctx context.Context, bankKeeper minimalBankKeeper, recipientMod string, amounts sdk.Coins) error {
if err := bankKeeper.MintCoins(ctx, types.MintModuleName, amounts); err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion x/distribution/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,5 @@ replace github.com/cosmos/cosmos-sdk => ../../.
// TODO remove post spinning out all modules
replace (
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/protocolpool => ../protocolpool
cosmossdk.io/x/staking => ../staking
)
12 changes: 1 addition & 11 deletions x/group/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ require (
cosmossdk.io/log v1.5.0
cosmossdk.io/math v1.4.0
cosmossdk.io/store v1.10.0-rc.1
cosmossdk.io/x/accounts v0.0.0-20240913065641-0064ccbce64e
cosmossdk.io/x/bank v0.0.0-20240226161501-23359a0b6d91
cosmossdk.io/x/consensus v0.0.0-00010101000000-000000000000
cosmossdk.io/x/gov v0.0.0-20231113122742-912390d5fc4a
cosmossdk.io/x/mint v0.0.0-00010101000000-000000000000
cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000
github.com/cockroachdb/apd/v3 v3.2.1
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.53.0
Expand All @@ -38,7 +34,7 @@ require (
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.0-20240130113600-88ef6483f90f.1 // indirect
cosmossdk.io/collections v1.0.0-rc.1 // indirect
cosmossdk.io/schema v1.0.0 // indirect
cosmossdk.io/x/epochs v0.0.0-20240522060652-a1ae4c3e0337 // indirect
cosmossdk.io/x/staking v0.0.0-00010101000000-000000000000 // indirect
cosmossdk.io/x/tx v1.0.0-alpha.3 // indirect
filippo.io/edwards25519 v1.1.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand Down Expand Up @@ -184,13 +180,7 @@ replace github.com/cosmos/cosmos-sdk => ../../
// TODO remove post spinning out all modules
replace (
cosmossdk.io/client/v2 => ../../client/v2
cosmossdk.io/x/accounts => ../accounts
cosmossdk.io/x/bank => ../bank
cosmossdk.io/x/consensus => ../consensus
cosmossdk.io/x/epochs => ../epochs
cosmossdk.io/x/gov => ../gov
cosmossdk.io/x/mint => ../mint
cosmossdk.io/x/protocolpool => ../protocolpool
cosmossdk.io/x/slashing => ../slashing
cosmossdk.io/x/staking => ../staking
)
2 changes: 2 additions & 0 deletions x/group/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ cosmossdk.io/schema v1.0.0 h1:/diH4XJjpV1JQwuIozwr+A4uFuuwanFdnw2kKeiXwwQ=
cosmossdk.io/schema v1.0.0/go.mod h1:RDAhxIeNB4bYqAlF4NBJwRrgtnciMcyyg0DOKnhNZQQ=
cosmossdk.io/store v1.10.0-rc.1 h1:/YVPJLre7lt/QDbl90k95TLt+IvafF1sHaU6WHd/rpc=
cosmossdk.io/store v1.10.0-rc.1/go.mod h1:eZNgZKvZRlDUk8CE3LTDVMAcSM7zLOet2S8fByQkF3s=
cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190 h1:XQJj9Dv9Gtze0l2TF79BU5lkP6MkUveTUuKICmxoz+o=
cosmossdk.io/x/protocolpool v0.0.0-20230925135524-a1bc045b3190/go.mod h1:7WUGupOvmlHJoIMBz1JbObQxeo6/TDiuDBxmtod8HRg=
cosmossdk.io/x/tx v1.0.0-alpha.3 h1:+55/JFH5QRqnFhOI2heH3DKsaNL0RpXcJOQNzUvHiaQ=
cosmossdk.io/x/tx v1.0.0-alpha.3/go.mod h1:h4pQ/j6Gfu8goB1R3Jbl4qY4RjYVNAsoylcleTXdSRg=
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
Expand Down
Loading

0 comments on commit 5490578

Please sign in to comment.