Skip to content

Commit 52d4520

Browse files
authored
Merge branch 'main' into hoa/fix-lint
2 parents 8727d71 + 36d1335 commit 52d4520

File tree

8 files changed

+815
-863
lines changed

8 files changed

+815
-863
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Ref: https://keepachangelog.com/en/1.0.0/
5555

5656
### State Machine Breaking
5757

58+
* (light-clients/07-tendermint) [\#6276](https://github.com/cosmos/ibc-go/pull/6276) Fix: No-op to avoid panicking on `UpdateState` for invalid misbehaviour submissions.
59+
5860
### Improvements
5961

6062
* (apps/27-interchain-accounts) [\#5533](https://github.com/cosmos/ibc-go/pull/5533) ICA host sets the host connection ID on `OnChanOpenTry`, so that ICA controller implementations are not obliged to set the value on `OnChanOpenInit` if they are not able.

docs/docusaurus.config.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,15 @@ const config = {
347347
src: "https://widget.kapa.ai/kapa-widget.bundle.js",
348348
"data-website-id": "806aa1dc-0d46-4563-a8b8-880eecac59f1",
349349
"data-project-name": "Interchain",
350+
"data-user-analytics-fingerprint-enabled": true,
350351
"data-project-color": "#1878FF",
351-
"data-modal-disclaimer": "This is a custom LLM for Interchain with access to IBC developer documentation and resources. Please note that answers are generated by an AI so please use your best judgement before implementing",
352+
"data-modal-title": "IBC Docs AI",
353+
"data-modal-disclaimer": "This is a custom LLM for the Inter-Blockchain Communication Protocol in Golang (ibc-go). It is trained on the IBC developer documentation, code base, and resources. Answers are AI-generated. Please use your best judgment before implementing. The bot is not trained on documentation, code, or resources for the Cosmos SDK, CometBFT, CosmJS, CosmWasm, or interchain ecosystem blockchains. Please refer to those specific documentation sites for answers to those questions.",
354+
"data-modal-ask-ai-input-placeholder": "Ask me a question about IBC...",
355+
"data-modal-disclaimer-text-color": "#000000",
356+
"data-modal-disclaimer-font-size": "14px",
357+
"data-modal-image":
358+
"img/black-ibc-logo-400x400.svg",
352359
"data-project-logo":
353360
"img/white-ibc-logo-400x400.svg",
354361
async: true,

docs/package-lock.json

Lines changed: 773 additions & 845 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
"write-heading-ids": "docusaurus write-heading-ids"
1616
},
1717
"dependencies": {
18-
"@docusaurus/core": "^3.1.1",
19-
"@docusaurus/plugin-client-redirects": "^3.1.1",
20-
"@docusaurus/plugin-content-docs": "^3.1.1",
21-
"@docusaurus/plugin-google-gtag": "^3.1.1",
22-
"@docusaurus/plugin-sitemap": "^3.1.1",
23-
"@docusaurus/preset-classic": "^3.1.1",
18+
"@docusaurus/core": "^3.3.2",
19+
"@docusaurus/plugin-client-redirects": "^3.3.2",
20+
"@docusaurus/plugin-content-docs": "^3.3.2",
21+
"@docusaurus/plugin-google-gtag": "^3.3.2",
22+
"@docusaurus/plugin-sitemap": "^3.3.2",
23+
"@docusaurus/preset-classic": "^3.3.2",
2424
"@easyops-cn/docusaurus-search-local": "^0.40.1",
2525
"@gracefullight/docusaurus-plugin-microsoft-clarity": "^1.0.0",
2626
"@mdx-js/react": "^3.0.0",
@@ -36,7 +36,7 @@
3636
"tailwindcss": "^3.4.0"
3737
},
3838
"devDependencies": {
39-
"@docusaurus/module-type-aliases": "^3.1.1"
39+
"@docusaurus/module-type-aliases": "^3.3.2"
4040
},
4141
"browserslist": {
4242
"production": [
Lines changed: 10 additions & 0 deletions
Loading

modules/apps/29-fee/ibc_middleware.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func (im IBCMiddleware) OnChanUpgradeInit(
345345
versionMetadata, err := types.MetadataFromVersion(proposedVersion)
346346
if err != nil {
347347
// since it is valid for fee version to not be specified, the upgrade version may be for a middleware
348-
// or application further down in the stack. Thus, passthrough to next middleware or application in callstack.
348+
// or application further down in the stack. Thus, pass through to next middleware or application in callstack.
349349
return cbs.OnChanUpgradeInit(ctx, portID, channelID, proposedOrder, proposedConnectionHops, proposedVersion)
350350
}
351351

@@ -367,7 +367,7 @@ func (im IBCMiddleware) OnChanUpgradeInit(
367367
return string(versionBz), nil
368368
}
369369

370-
// OnChanUpgradeTry implement s the IBCModule interface
370+
// OnChanUpgradeTry implements the IBCModule interface
371371
func (im IBCMiddleware) OnChanUpgradeTry(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, counterpartyVersion string) (string, error) {
372372
cbs, ok := im.app.(porttypes.UpgradableModule)
373373
if !ok {
@@ -377,7 +377,7 @@ func (im IBCMiddleware) OnChanUpgradeTry(ctx sdk.Context, portID, channelID stri
377377
versionMetadata, err := types.MetadataFromVersion(counterpartyVersion)
378378
if err != nil {
379379
// since it is valid for fee version to not be specified, the counterparty upgrade version may be for a middleware
380-
// or application further down in the stack. Thus, passthrough to next middleware or application in callstack.
380+
// or application further down in the stack. Thus, pass through to next middleware or application in callstack.
381381
return cbs.OnChanUpgradeTry(ctx, portID, channelID, proposedOrder, proposedConnectionHops, counterpartyVersion)
382382
}
383383

@@ -409,7 +409,7 @@ func (im IBCMiddleware) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, cou
409409
versionMetadata, err := types.MetadataFromVersion(counterpartyVersion)
410410
if err != nil {
411411
// since it is valid for fee version to not be specified, the counterparty upgrade version may be for a middleware
412-
// or application further down in the stack. Thus, passthrough to next middleware or application in callstack.
412+
// or application further down in the stack. Thus, pass through to next middleware or application in callstack.
413413
return cbs.OnChanUpgradeAck(ctx, portID, channelID, counterpartyVersion)
414414
}
415415

@@ -430,13 +430,13 @@ func (im IBCMiddleware) OnChanUpgradeOpen(ctx sdk.Context, portID, channelID str
430430

431431
versionMetadata, err := types.MetadataFromVersion(proposedVersion)
432432
if err != nil {
433-
// set fee disabled and passthrough to the next middleware or application in callstack.
433+
// set fee disabled and pass through to the next middleware or application in callstack.
434434
im.keeper.DeleteFeeEnabled(ctx, portID, channelID)
435435
cbs.OnChanUpgradeOpen(ctx, portID, channelID, proposedOrder, proposedConnectionHops, proposedVersion)
436436
return
437437
}
438438

439-
// set fee enabled and passthrough to the next middleware of application in callstack.
439+
// set fee enabled and pass through to the next middleware of application in callstack.
440440
im.keeper.SetFeeEnabled(ctx, portID, channelID)
441441
cbs.OnChanUpgradeOpen(ctx, portID, channelID, proposedOrder, proposedConnectionHops, versionMetadata.AppVersion)
442442
}

modules/light-clients/07-tendermint/update.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ func (cs *ClientState) verifyHeader(
131131
// UpdateState must only be used to update within a single revision, thus header revision number and trusted height's revision
132132
// number must be the same. To update to a new revision, use a separate upgrade path
133133
// UpdateState will prune the oldest consensus state if it is expired.
134+
// If the provided clientMsg is not of type of Header then the handler will noop and empty slice is returned.
134135
func (cs ClientState) UpdateState(ctx sdk.Context, cdc codec.BinaryCodec, clientStore storetypes.KVStore, clientMsg exported.ClientMessage) []exported.Height {
135136
header, ok := clientMsg.(*Header)
136137
if !ok {
137-
panic(fmt.Errorf("expected type %T, got %T", &Header{}, clientMsg))
138+
// clientMsg is invalid Misbehaviour, no update necessary
139+
return []exported.Height{}
138140
}
139141

140142
cs.pruneOldestConsensusState(ctx, cdc, clientStore)

modules/light-clients/07-tendermint/update_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,12 @@ func (suite *TendermintTestSuite) TestUpdateState() {
546546
suite.Require().Equal(expConsensusState, updatedConsensusState)
547547

548548
} else {
549-
suite.Require().Panics(func() {
550-
clientState.UpdateState(suite.chainA.GetContext(), suite.chainA.App.AppCodec(), clientStore, clientMessage)
551-
})
549+
consensusHeights = clientState.UpdateState(suite.chainA.GetContext(), suite.chainA.App.AppCodec(), clientStore, clientMessage)
550+
suite.Require().Empty(consensusHeights)
551+
552+
consensusState, found := suite.chainA.GetSimApp().GetIBCKeeper().ClientKeeper.GetClientConsensusState(suite.chainA.GetContext(), path.EndpointA.ClientID, clienttypes.NewHeight(1, uint64(suite.chainB.GetContext().BlockHeight())))
553+
suite.Require().False(found)
554+
suite.Require().Nil(consensusState)
552555
}
553556

554557
// perform custom checks

0 commit comments

Comments
 (0)