Skip to content

Commit 90e1caf

Browse files
authored
Merge branch 'main' into chore/rm-params
2 parents 09ff0e7 + e857245 commit 90e1caf

File tree

26 files changed

+2509
-45
lines changed

26 files changed

+2509
-45
lines changed

.github/workflows/dependabot-update-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: ${{ github.actor == 'dependabot[bot]' }}
1515
steps:
1616
- name: Generate Token
17-
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v1
17+
uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v1
1818
id: app-token
1919
with:
2020
app-id: "${{ secrets.APP_ID }}"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
7272
* (x/bank) [#24660](https://github.com/cosmos/cosmos-sdk/pull/24660) Improve performance of the `GetAllBalances` and `GetAccountsBalances` keeper methods.
7373
* (collections) [#25464](https://github.com/cosmos/cosmos-sdk/pull/25464) Add `IterateRaw` method to `Multi` index type to satisfty query `Collection` interface.
7474
* (x/mint) [#25562](https://github.com/cosmos/cosmos-sdk/pull/25562) Improve and test `x/mint` params validation.
75+
* (api) [#25613](https://github.com/cosmos/cosmos-sdk/pull/25613) Separated deprecated modules into the contrib directory, distinct from api, to enable and unblock new proto changes without affecting legacy code.
7576

7677
### Bug Fixes
7778

baseapp/abci.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ func (app *BaseApp) ExtendVote(_ context.Context, req *abci.RequestExtendVote) (
627627
"panic recovered in ExtendVote",
628628
"height", req.Height,
629629
"hash", fmt.Sprintf("%X", req.Hash),
630-
"panic", err,
630+
"panic", r,
631631
)
632632
err = fmt.Errorf("recovered application panic in ExtendVote: %v", r)
633633
}

baseapp/abci_test.go

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,82 @@ func TestABCI_ExtendVote(t *testing.T) {
376376
require.Equal(t, abci.ResponseVerifyVoteExtension_REJECT, vres.Status)
377377
}
378378

379+
// TestABCI_ExtendVote_PanicRecovery tests that when ExtendVoteHandler panics,
380+
// the panic is recovered and the error contains the panic message.
381+
func TestABCI_ExtendVote_PanicRecovery(t *testing.T) {
382+
name := t.Name()
383+
db := dbm.NewMemDB()
384+
app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil)
385+
386+
panicMsg := "test panic message for ExtendVote"
387+
app.SetExtendVoteHandler(func(ctx sdk.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) {
388+
panic(panicMsg)
389+
})
390+
391+
app.SetVerifyVoteExtensionHandler(func(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) {
392+
return &abci.ResponseVerifyVoteExtension{Status: abci.ResponseVerifyVoteExtension_ACCEPT}, nil
393+
})
394+
395+
app.SetParamStore(&paramStore{db: dbm.NewMemDB()})
396+
_, err := app.InitChain(
397+
&abci.RequestInitChain{
398+
InitialHeight: 1,
399+
ConsensusParams: &cmtproto.ConsensusParams{
400+
Abci: &cmtproto.ABCIParams{
401+
VoteExtensionsEnableHeight: 1,
402+
},
403+
},
404+
},
405+
)
406+
require.NoError(t, err)
407+
408+
// Call ExtendVote which should panic and recover
409+
_, err = app.ExtendVote(context.Background(), &abci.RequestExtendVote{Height: 1, Hash: []byte("thehash")})
410+
411+
// The error should contain the panic message
412+
require.Error(t, err)
413+
require.Contains(t, err.Error(), panicMsg)
414+
require.Contains(t, err.Error(), "recovered application panic in ExtendVote")
415+
}
416+
417+
// TestABCI_VerifyVoteExtension_PanicRecovery tests that when VerifyVoteExtensionHandler panics,
418+
// the panic is recovered and the error contains the panic message.
419+
func TestABCI_VerifyVoteExtension_PanicRecovery(t *testing.T) {
420+
name := t.Name()
421+
db := dbm.NewMemDB()
422+
app := baseapp.NewBaseApp(name, log.NewTestLogger(t), db, nil)
423+
424+
panicMsg := "test panic message for VerifyVoteExtension"
425+
app.SetExtendVoteHandler(func(ctx sdk.Context, req *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) {
426+
return &abci.ResponseExtendVote{VoteExtension: []byte("extension")}, nil
427+
})
428+
429+
app.SetVerifyVoteExtensionHandler(func(ctx sdk.Context, req *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error) {
430+
panic(panicMsg)
431+
})
432+
433+
app.SetParamStore(&paramStore{db: dbm.NewMemDB()})
434+
_, err := app.InitChain(
435+
&abci.RequestInitChain{
436+
InitialHeight: 1,
437+
ConsensusParams: &cmtproto.ConsensusParams{
438+
Abci: &cmtproto.ABCIParams{
439+
VoteExtensionsEnableHeight: 1,
440+
},
441+
},
442+
},
443+
)
444+
require.NoError(t, err)
445+
446+
// Call VerifyVoteExtension which should panic and recover
447+
_, err = app.VerifyVoteExtension(&abci.RequestVerifyVoteExtension{Height: 1, Hash: []byte("thehash"), VoteExtension: []byte("extension")})
448+
449+
// The error should contain the panic message
450+
require.Error(t, err)
451+
require.Contains(t, err.Error(), panicMsg)
452+
require.Contains(t, err.Error(), "recovered application panic in VerifyVoteExtension")
453+
}
454+
379455
// TestABCI_OnlyVerifyVoteExtension makes sure we can call VerifyVoteExtension
380456
// without having called ExtendVote before.
381457
func TestABCI_OnlyVerifyVoteExtension(t *testing.T) {

client/v2/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ require (
122122
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
123123
github.com/prometheus/client_golang v1.23.2 // indirect
124124
github.com/prometheus/client_model v0.6.2 // indirect
125-
github.com/prometheus/common v0.67.3 // indirect
125+
github.com/prometheus/common v0.67.4 // indirect
126126
github.com/prometheus/procfs v0.16.1 // indirect
127127
github.com/rcrowley/go-metrics v0.0.0-20250401214520-65e299d6c5c9 // indirect
128128
github.com/rogpeppe/go-internal v1.14.1 // indirect

client/v2/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8b
594594
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
595595
github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s=
596596
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
597-
github.com/prometheus/common v0.67.3 h1:shd26MlnwTw5jksTDhC7rTQIteBxy+ZZDr3t7F2xN2Q=
598-
github.com/prometheus/common v0.67.3/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI=
597+
github.com/prometheus/common v0.67.4 h1:yR3NqWO1/UyO1w2PhUvXlGQs/PtFmoveVO0KZ4+Lvsc=
598+
github.com/prometheus/common v0.67.4/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI=
599599
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
600600
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
601601
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=

0 commit comments

Comments
 (0)