Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(baseapp): fix snapshot interval bug (backport #14049) #14052

Merged
merged 2 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

* (x/upgrade) [#13936](https://github.com/cosmos/cosmos-sdk/pull/13936) Make downgrade verification work again.
* (x/group) [#13742](https://github.com/cosmos/cosmos-sdk/pull/13742) Fix `validate-genesis` when group policy accounts exist.
* (baseapp) [#14049](https://github.com/cosmos/cosmos-sdk/pull/14049) Fix state sync when interval is zero.

## [v0.47.0-alpha1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.0-alpha1) - 2022-11-21

Expand Down
2 changes: 1 addition & 1 deletion baseapp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (app *BaseApp) SetSnapshot(snapshotStore *snapshots.Store, opts snapshottyp
if app.sealed {
panic("SetSnapshot() on sealed BaseApp")
}
if snapshotStore == nil || opts.Interval == snapshottypes.SnapshotIntervalOff {
if snapshotStore == nil {
app.snapshotManager = nil
return
}
Expand Down
4 changes: 0 additions & 4 deletions snapshots/types/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ type SnapshotOptions struct {
KeepRecent uint32
}

// SnapshotIntervalOff represents the snapshot interval, at which
// no snapshots are taken.
const SnapshotIntervalOff uint64 = 0

func NewSnapshotOptions(interval uint64, keepRecent uint32) SnapshotOptions {
return SnapshotOptions{
Interval: interval,
Expand Down