From e563c88d49b4ff37562112e10a1a667f49740d4c Mon Sep 17 00:00:00 2001 From: Lucas Francisco Lopez Date: Tue, 14 May 2024 13:58:52 +0200 Subject: [PATCH 1/2] Documented error handling in OfferSnapshot method --- baseapp/abci.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/baseapp/abci.go b/baseapp/abci.go index 7e83e68fc012..09734c5bd140 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -295,6 +295,10 @@ func (app *BaseApp) OfferSnapshot(req *abci.OfferSnapshotRequest) (*abci.OfferSn return &abci.OfferSnapshotResponse{Result: abci.OFFER_SNAPSHOT_RESULT_REJECT}, nil default: + // CometBFT errors are defined here: https://github.com/cometbft/cometbft/blob/main/statesync/syncer.go + // It may happen that in case of a CometBFT error, such as a timeout (which occurs after two minutes), + // the process is aborted. This is done intentionally because deleting the database programmatically + // can lead to more complicated situations. app.logger.Error( "failed to restore snapshot", "height", req.Snapshot.Height, From 1f070d5b47a2cd7d0b306bcd564200cb6e569672 Mon Sep 17 00:00:00 2001 From: Lucas Francisco Lopez Date: Tue, 14 May 2024 14:53:00 +0200 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e8b308835fe..2006b21a3909 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,6 +99,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (server) [#19966](https://github.com/cosmos/cosmos-sdk/pull/19966) Return BlockHeader by shallow copy in server Context. * (proto) [#20098](https://github.com/cosmos/cosmos-sdk/pull/20098) Use cosmos_proto added_in annotation instead of // Since comments. * (baseapp) [#20208](https://github.com/cosmos/cosmos-sdk/pull/20208) Skip running validateBasic for rechecking txs. +* (baseapp) [#20380](https://github.com/cosmos/cosmos-sdk/pull/20380) Enhanced OfferSnapshot documentation. ### Bug Fixes