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

Problem: memiavl is not integrated with state machine #950

Merged
merged 37 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ab0b541
Problem: memiavl is not integrated with state machine
yihuang Mar 21, 2023
be4c313
update CI golang version
yihuang Apr 4, 2023
f9daeef
fix unit test
yihuang Apr 4, 2023
b6aeb2f
fix lint
yihuang Apr 4, 2023
d671061
Merge remote-tracking branch 'origin/main' into multistore
yihuang Apr 4, 2023
36cf0c8
Merge branch 'main' into multistore
yihuang Apr 5, 2023
d488e24
Merge remote-tracking branch 'origin/main' into multistore
yihuang Apr 11, 2023
3d3835a
tidy
yihuang Apr 11, 2023
aaadd1e
Merge remote-tracking branch 'origin/main' into multistore
yihuang Apr 13, 2023
82b3dc6
fix build
yihuang Apr 14, 2023
e5f228d
Merge remote-tracking branch 'origin/main' into multistore
yihuang Apr 14, 2023
93d2233
fix startup
yihuang Apr 14, 2023
6465a82
fix app hash
yihuang Apr 14, 2023
d2c26aa
fix initial commit info
yihuang Apr 14, 2023
81b44b5
cleanup and fix lint
yihuang Apr 14, 2023
f6c01c8
use sdk 0.46.12
yihuang Apr 14, 2023
5745c63
fix python lint
yihuang Apr 14, 2023
2e0034f
skip versiondb test for now
yihuang Apr 14, 2023
4b8f284
don't test file_streamer
yihuang Apr 15, 2023
e44c91d
skip file streamer test
yihuang Apr 15, 2023
e6b652d
Merge branch 'main' into multistore
yihuang Apr 17, 2023
1631131
support abci query and fix ibc tests
yihuang Apr 17, 2023
ed16eb5
implement Restore
yihuang Apr 18, 2023
8207434
fix unit test
yihuang Apr 18, 2023
04662a1
integrate snapshot
yihuang Apr 18, 2023
14f1514
commit the other stores
yihuang Apr 18, 2023
fbc5c3f
fix lint
yihuang Apr 18, 2023
15cafe6
Merge remote-tracking branch 'origin/main' into multistore
yihuang Apr 18, 2023
d8ba041
changelog
yihuang Apr 18, 2023
2ba093d
fix build
yihuang Apr 18, 2023
d1830a0
fix lint
yihuang Apr 18, 2023
2aa0f7f
Update memiavl/import.go
yihuang Apr 18, 2023
3ff6925
cleanup
yihuang Apr 18, 2023
6c3d5c5
reuse code
yihuang Apr 19, 2023
9dc9441
cleanup errors
yihuang Apr 19, 2023
3836457
handle error return
yihuang Apr 19, 2023
2cd0a41
try fix unittest in CI
yihuang Apr 19, 2023
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
Prev Previous commit
Next Next commit
cleanup errors
  • Loading branch information
yihuang committed Apr 19, 2023
commit 9dc9441709c14c8642d06ff4e1fbf13642483a5c
5 changes: 2 additions & 3 deletions memiavl/db.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package memiavl

import (
stderrors "errors"
"errors"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"sync"

"github.com/pkg/errors"
"github.com/tidwall/wal"
)

Expand Down Expand Up @@ -301,7 +300,7 @@ func (db *DB) RewriteSnapshotBackground() error {
}

func (db *DB) Close() error {
return stderrors.Join(db.MultiTree.Close(), db.wal.Close())
return errors.Join(db.MultiTree.Close(), db.wal.Close())
}

func snapshotName(version uint32) string {
Expand Down
3 changes: 2 additions & 1 deletion memiavl/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"math"

"cosmossdk.io/errors"
snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types"
"github.com/cosmos/iavl"
protoio "github.com/gogo/protobuf/io"
Expand All @@ -16,7 +17,7 @@ func (db *DB) Snapshot(height uint64, protoWriter protoio.Writer) error {

mtree, err := LoadMultiTree(snapshotPath(db.dir, uint32(height)))
Fixed Show fixed Hide fixed
mmsqe marked this conversation as resolved.
Show resolved Hide resolved

Check failure

Code scanning / gosec

Potential integer overflow by integer type conversion

Potential integer overflow by integer type conversion
if err != nil {
return err
return errors.Wrapf(err, "invalid snapshot height: %d", height)
}

for _, tree := range mtree.trees {
Expand Down
2 changes: 1 addition & 1 deletion memiavl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require (
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.8.1
github.com/tendermint/tm-db v0.6.7
github.com/tidwall/btree v1.5.0
Expand Down Expand Up @@ -59,6 +58,7 @@ require (
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.14.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion memiavl/multitree.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"path/filepath"
"sort"

"github.com/pkg/errors"
"cosmossdk.io/errors"

storetypes "github.com/cosmos/cosmos-sdk/store/types"
"github.com/cosmos/iavl"
Expand Down
2 changes: 1 addition & 1 deletion memiavl/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package memiavl
import (
"bytes"
"encoding/binary"
"errors"
"fmt"

ics23 "github.com/confio/ics23/go"
"github.com/cosmos/iavl"
"github.com/pkg/errors"
)

/*
Expand Down