Skip to content

Commit

Permalink
Merge branch 'main' into ziscky/11126-authz-delegate-all
Browse files Browse the repository at this point in the history
  • Loading branch information
ziscky authored Nov 28, 2024
2 parents 823b935 + 6cfe2dc commit 3a78451
Show file tree
Hide file tree
Showing 269 changed files with 12,243 additions and 5,684 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/dependabot-update-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ jobs:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Generate Token
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1
id: app-token
with:
app-id: "${{ secrets.APP_ID }}"
private-key: "${{ secrets.APP_PRIVATE_KEY }}"
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
token: "${{ steps.app-token.outputs.token }}"
- uses: actions/setup-go@v5
with:
go-version: "1.23"
Expand Down
26 changes: 13 additions & 13 deletions .mergify.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
queue_rules:
- name: default
conditions:
- "#approved-reviews-by>1"

pull_request_rules:
- name: automerge to main with label automerge and branch protection passing
conditions:
queue_conditions:
- "#approved-reviews-by>1"
- base=main
- label=A:automerge
actions:
queue:
name: default
method: squash
commit_message_template: |
{{ title }} (#{{ number }})
{{ body }}
merge_conditions:
- "#approved-reviews-by>1"
commit_message_template: |
{{ title }} (#{{ number }})
{{ body }}
merge_method: squash

pull_request_rules:
- name: backport patches to v0.52.x branch
conditions:
- base=main
Expand Down Expand Up @@ -56,3 +52,7 @@ pull_request_rules:
backport:
branches:
- release/v0.45.x
- name: automerge to main with label automerge and branch protection passing
conditions: []
actions:
queue:
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i

### Improvements

* RocksDB libraries have been upgraded to support RockDB v9 instead of v8.
* (testutil/integration) [#22616](https://github.com/cosmos/cosmos-sdk/pull/22616) Remove double context in integration tests v1.
* Use integrationApp.Context() instead of creating a context prior.

### Bug Fixes

* (sims) [#21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators
Expand Down
175 changes: 88 additions & 87 deletions api/cosmos/bank/v1beta1/query.pulsar.go

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions api/cosmos/bank/v1beta1/query_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/cosmos/staking/v1beta1/staking.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module cosmossdk.io/api
go 1.23

require (
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20240701160653-fedbb9acfd2f.1
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/gogoproto v1.7.0
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1
Expand Down
4 changes: 2 additions & 2 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20240701160653-fedbb9acfd2f.1 h1:V3ILbKtI97qU35SYV+5ZuiLfFCNl3mrD0d7DmnRS5hU=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20240701160653-fedbb9acfd2f.1/go.mod h1:wqOtclGXqh+7m/L6fn0SatBJ+m9E5muF/41a3LgIPVI=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1 h1:kAu+bRyXqQWarx/4mAdKFYW6bgvjGKhzvIXJvMHivC4=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.35.2-20241120201313-68e42a58b301.1/go.mod h1:wqOtclGXqh+7m/L6fn0SatBJ+m9E5muF/41a3LgIPVI=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.2-20240130113600-88ef6483f90f.1 h1:FYhA+EOS18QBdffLVpisUjBGsCtUljMx4bFOsZT81ZM=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.35.2-20240130113600-88ef6483f90f.1/go.mod h1:17Ax38yd8pg56din4ecwSDBRCSX0qLcif5Cdf8ayto4=
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
Expand Down
18 changes: 15 additions & 3 deletions baseapp/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,12 @@ func (app *BaseApp) FinalizeBlock(req *abci.FinalizeBlockRequest) (res *abci.Fin
defer func() {
// call the streaming service hooks with the FinalizeBlock messages
for _, streamingListener := range app.streamingManager.ABCIListeners {
if err := streamingListener.ListenFinalizeBlock(app.finalizeBlockState.Context(), *req, *res); err != nil {
if streamErr := streamingListener.ListenFinalizeBlock(app.finalizeBlockState.Context(), *req, *res); streamErr != nil {
app.logger.Error("ListenFinalizeBlock listening hook failed", "height", req.Height, "err", err)
if app.streamingManager.StopNodeOnErr {
// if StopNodeOnErr is set, we should return the streamErr in order to stop the node
err = streamErr
}
}
}
}()
Expand Down Expand Up @@ -976,12 +980,12 @@ func (app *BaseApp) Commit() (*abci.CommitResponse, error) {
rms.SetCommitHeader(header)
}

app.cms.Commit()

resp := &abci.CommitResponse{
RetainHeight: retainHeight,
}

app.cms.Commit()

abciListeners := app.streamingManager.ABCIListeners
if len(abciListeners) > 0 {
ctx := app.finalizeBlockState.Context()
Expand All @@ -991,6 +995,14 @@ func (app *BaseApp) Commit() (*abci.CommitResponse, error) {
for _, abciListener := range abciListeners {
if err := abciListener.ListenCommit(ctx, *resp, changeSet); err != nil {
app.logger.Error("Commit listening hook failed", "height", blockHeight, "err", err)
if app.streamingManager.StopNodeOnErr {
err = fmt.Errorf("Commit listening hook failed: %w", err)
rollbackErr := app.cms.RollbackToVersion(blockHeight - 1)
if rollbackErr != nil {
return nil, errors.Join(err, rollbackErr)
}
return nil, err
}
}
}
}
Expand Down
11 changes: 9 additions & 2 deletions baseapp/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package baseapp
import (
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"

coreheader "cosmossdk.io/core/header"
errorsmod "cosmossdk.io/errors"

sdk "github.com/cosmos/cosmos-sdk/types"
Expand Down Expand Up @@ -50,7 +51,8 @@ func (app *BaseApp) SimWriteState() {
func (app *BaseApp) NewContextLegacy(isCheckTx bool, header cmtproto.Header) sdk.Context {
if isCheckTx {
return sdk.NewContext(app.checkState.ms, true, app.logger).
WithMinGasPrices(app.minGasPrices).WithBlockHeader(header)
WithMinGasPrices(app.minGasPrices).
WithBlockHeader(header)
}

return sdk.NewContext(app.finalizeBlockState.ms, false, app.logger).WithBlockHeader(header)
Expand All @@ -62,7 +64,12 @@ func (app *BaseApp) NewContext(isCheckTx bool) sdk.Context {
}

func (app *BaseApp) NewUncachedContext(isCheckTx bool, header cmtproto.Header) sdk.Context {
return sdk.NewContext(app.cms, isCheckTx, app.logger).WithBlockHeader(header)
return sdk.NewContext(app.cms, isCheckTx, app.logger).
WithBlockHeader(header).
WithHeaderInfo(coreheader.Info{
Height: header.Height,
Time: header.Time,
})
}

func (app *BaseApp) GetContextForFinalizeBlock(txBytes []byte) sdk.Context {
Expand Down
10 changes: 9 additions & 1 deletion client/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ func CheckCometError(err error, tx cmttypes.Tx) *sdk.TxResponse {
txHash := fmt.Sprintf("%X", tx.Hash())

switch {
case strings.Contains(errStr, strings.ToLower(mempool.ErrTxInCache.Error())):
case strings.Contains(errStr, strings.ToLower(mempool.ErrTxInCache.Error())) ||
strings.Contains(errStr, strings.ToLower(sdkerrors.ErrTxInMempoolCache.Error())):
return &sdk.TxResponse{
Code: sdkerrors.ErrTxInMempoolCache.ABCICode(),
Codespace: sdkerrors.ErrTxInMempoolCache.Codespace(),
Expand All @@ -73,6 +74,13 @@ func CheckCometError(err error, tx cmttypes.Tx) *sdk.TxResponse {
TxHash: txHash,
}

case strings.Contains(errStr, "no signatures supplied"):
return &sdk.TxResponse{
Code: sdkerrors.ErrNoSignatures.ABCICode(),
Codespace: sdkerrors.ErrNoSignatures.Codespace(),
TxHash: txHash,
}

default:
return nil
}
Expand Down
Loading

0 comments on commit 3a78451

Please sign in to comment.