From 072a95e0e1bfc1a0ef3ef6b9cfa8d87effc6f677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Francisco=20L=C3=B3pez?= Date: Wed, 15 May 2024 23:38:21 +0200 Subject: [PATCH] docs: Documented error handling in OfferSnapshot method (#20380) Co-authored-by: cool-developer <51834436+cool-develope@users.noreply.github.com> --- CHANGELOG.md | 1 + baseapp/abci.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce1fb5cc5c..22df961ada 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 diff --git a/baseapp/abci.go b/baseapp/abci.go index d0fb4b6c09..dea6a59814 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,