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
Merge remote-tracking branch 'origin/main' into multistore
  • Loading branch information
yihuang committed Apr 11, 2023
commit d488e24bf499fc014a76fd7f8731504cd12c3c28
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-go@v3
with:
go-version: 1.20.2
go-version: '^1.20.0'
- id: changed-files
uses: tj-actions/changed-files@v34
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.20.2
go-version: '^1.20.0'
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.2
go-version: '^1.20.0'
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v19
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
if: github.event_name == 'push' || github.event_name == 'pull_request'
- uses: actions/setup-go@v3
with:
go-version: 1.20.2
go-version: '^1.20.0'
- name: Display go version
run: go version
- run: make build
Expand All @@ -131,7 +131,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.2
go-version: '^1.20.0'
- name: Display go version
run: go version
- name: Install runsim
Expand All @@ -157,7 +157,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.2
go-version: '^1.20.0'
- name: Checkout Comment PR Branch
uses: actions/checkout@v3
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.2
go-version: '^1.20.0'
- name: Checkout Comment PR Branch
uses: actions/checkout@v3
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -267,7 +267,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.2
go-version: '^1.20.0'
- name: Checkout Comment PR Branch
uses: actions/checkout@v3
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.2
go-version: '^1.20.0'
- name: Checkout Comment PR Branch
uses: actions/checkout@v3
if: github.event_name == 'issue_comment'
Expand Down
1 change: 1 addition & 0 deletions memiavl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ require (
github.com/linxGnu/grocksdb v1.7.10 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
Expand Down
21 changes: 8 additions & 13 deletions memiavl/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ var emptyHash = sha256.New().Sum(nil)

// verify change sets by replay them to rebuild iavl tree and verify the root hashes
type Tree struct {
snapshot *Snapshot
initialVersion uint32

version uint32
// root node of empty tree is represented as `nil`
root Node
root Node
snapshot *Snapshot

initialVersion, cowVersion uint32
}

// NewEmptyTree creates an empty tree at an arbitrary version.
Expand Down Expand Up @@ -50,10 +50,9 @@ func NewFromSnapshot(snapshot *Snapshot) *Tree {
version: snapshot.Version(),
snapshot: snapshot,
}
return &Tree{
snapshot: snapshot,
version: snapshot.Version(),
root: snapshot.RootNode(),

if !snapshot.IsEmpty() {
tree.root = snapshot.RootNode()
}

return tree
Expand Down Expand Up @@ -114,11 +113,7 @@ func (t *Tree) remove(key []byte) {
func (t *Tree) saveVersion(updateHash bool) ([]byte, int64, error) {
var hash []byte
if updateHash {
if t.root == nil {
hash = emptyHash
} else {
hash = t.root.Hash()
}
hash = t.RootHash()
}

if t.version >= uint32(math.MaxUint32) {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.