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

add pebble #4

Closed
wants to merge 13 commits into from
Closed

Conversation

catShaark
Copy link

I add pebble based on this branch of @faddat

@faddat
Copy link
Member

faddat commented Apr 13, 2022

@catShaark this seems to contain the wierd bug still. Maybe during execution it calls the stats method and we need to give it some love?

@catShaark
Copy link
Author

catShaark commented Apr 13, 2022

I don't think so, some db in tm-db also return null for stats()

@faddat
Copy link
Member

faddat commented Apr 13, 2022

uh, oh.

I wonder what it might be then. I'll continue exploring and @catShaark could you please mark this as draft for now?

@catShaark catShaark marked this pull request as draft April 13, 2022 15:48
Implementing stats
@faddat
Copy link
Member

faddat commented Apr 13, 2022

@moniya12 has added the stats part, @catShaark. I'm going to test a sync from genesis now, from my uh, test machine, which I'll likely tweet about later....

:)

Thanks @moniya12

@faddat
Copy link
Member

faddat commented Apr 13, 2022

Khanh, fyi it currently crashes like this:

3:05AM INF executed block height=4644 module=state num_invalid_txs=0 num_valid_txs=0
panic: Error reading Node. bytes: 978fca10285f3b3ecbcf3b18bb11f366093b2487496c446a92965e43bd5edace8448a3f046cd01a8f058000000000408dc2e186361706162696c6974795f696e6465780000000000000007203e4bb94603fc29e0c8adffb5435af9709f1ac0326530978abd1b43, error: invalid height, must be int8

goroutine 189519 [running]:
github.com/cosmos/iavl.(*nodeDB).GetNode(0xc000eb3bc0, {0xc01890a8c0, 0x20, 0x20})
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/nodedb.go:96 +0x41b
github.com/cosmos/iavl.(*Node).getRightNode(...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:428
github.com/cosmos/iavl.(*Node).traverseInRange(0xc010671720, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x4c5
github.com/cosmos/iavl.(*Node).traverseInRange(0xc010671220, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc0106705a0, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc00f53bd60, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc01066a6e0, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc01066a640, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:479 +0x425
github.com/cosmos/iavl.(*Node).traverseInRange(0xc0105ebd60, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc010581d60, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc00f521680, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc00f5215e0, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:479 +0x425
github.com/cosmos/iavl.(*Node).traverseInRange(0xc01832e500, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc016bb2280, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc0236aa8c0, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc01225e780, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc0105abe00, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:485 +0x545
github.com/cosmos/iavl.(*Node).traverseInRange(0xc0105c0aa0, 0xc0125aab40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, 0x1, 0x0, ...)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:479 +0x425
github.com/cosmos/iavl.(*Node).traversePost(0x411a30?, 0xc002390010?, 0x4?, 0x0?)
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/node.go:450 +0x59
github.com/cosmos/iavl.(*Exporter).export(0xc0125aab58, {0x22f7e98?, 0xc0025b3780?})
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/export.go:53 +0x65
created by github.com/cosmos/iavl.newExporter
	/home/faddat/go/pkg/mod/github.com/cosmos/iavl@v0.16.0/export.go:46 +0x135

and go.mod for osmo 3.x is like this:

module github.com/osmosis-labs/osmosis/v3

go 1.17

require (
	github.com/cosmos/cosmos-sdk v0.42.10
	github.com/cosmos/go-bip39 v1.0.0
	github.com/cosmos/iavl v0.16.0
	github.com/gogo/protobuf v1.3.3
	github.com/golang/protobuf v1.5.2
	github.com/gorilla/mux v1.8.0
	github.com/grpc-ecosystem/grpc-gateway v1.16.0
	github.com/pkg/errors v0.9.1
	github.com/rakyll/statik v0.1.7
	github.com/regen-network/cosmos-proto v0.3.1
	github.com/spf13/cast v1.4.1
	github.com/spf13/cobra v1.3.0
	github.com/spf13/pflag v1.0.5
	github.com/stretchr/testify v1.7.1
	github.com/tendermint/tendermint v0.34.16
	github.com/tendermint/tm-db v0.6.7
	google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa
	google.golang.org/grpc v1.45.0
	google.golang.org/protobuf v1.27.1
	gopkg.in/yaml.v2 v2.4.0
)

require (
	github.com/99designs/keyring v1.1.6 // indirect
	github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
	github.com/DataDog/zstd v1.4.5 // indirect
	github.com/Workiva/go-datastructures v1.0.53 // indirect
	github.com/armon/go-metrics v0.3.10 // indirect
	github.com/beorn7/perks v1.0.1 // indirect
	github.com/bgentry/speakeasy v0.1.0 // indirect
	github.com/btcsuite/btcd v0.22.0-beta // indirect
	github.com/cespare/xxhash v1.1.0 // indirect
	github.com/cespare/xxhash/v2 v2.1.2 // indirect
	github.com/cockroachdb/errors v1.8.1 // indirect
	github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f // indirect
	github.com/cockroachdb/pebble v0.0.0-20220331191355-c6ff69042f1c // indirect
	github.com/cockroachdb/redact v1.0.8 // indirect
	github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 // indirect
	github.com/confio/ics23/go v0.6.6 // indirect
	github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect
	github.com/cosmos/ledger-go v0.9.2 // indirect
	github.com/danieljoos/wincred v1.0.2 // indirect
	github.com/davecgh/go-spew v1.1.1 // indirect
	github.com/dgraph-io/badger/v2 v2.2007.2 // indirect
	github.com/dgraph-io/ristretto v0.0.3 // indirect
	github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
	github.com/dustin/go-humanize v1.0.0 // indirect
	github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect
	github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 // indirect
	github.com/felixge/httpsnoop v1.0.1 // indirect
	github.com/fsnotify/fsnotify v1.5.1 // indirect
	github.com/go-kit/kit v0.12.0 // indirect
	github.com/go-kit/log v0.2.0 // indirect
	github.com/go-logfmt/logfmt v0.5.1 // indirect
	github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
	github.com/gogo/gateway v1.1.0 // indirect
	github.com/golang/snappy v0.0.3 // indirect
	github.com/google/btree v1.0.0 // indirect
	github.com/google/orderedcode v0.0.1 // indirect
	github.com/gorilla/handlers v1.5.1 // indirect
	github.com/gorilla/websocket v1.5.0 // indirect
	github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
	github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
	github.com/gtank/merlin v0.1.1 // indirect
	github.com/gtank/ristretto255 v0.1.2 // indirect
	github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
	github.com/hashicorp/golang-lru v0.5.4 // indirect
	github.com/hashicorp/hcl v1.0.0 // indirect
	github.com/inconshreveable/mousetrap v1.0.0 // indirect
	github.com/jmhodges/levigo v1.0.0 // indirect
	github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect
	github.com/klauspost/compress v1.13.6 // indirect
	github.com/kr/pretty v0.2.1 // indirect
	github.com/kr/text v0.2.0 // indirect
	github.com/lib/pq v1.10.4 // indirect
	github.com/libp2p/go-buffer-pool v0.0.2 // indirect
	github.com/linxGnu/grocksdb v1.7.1-0.20220327020612-ee0c6690507f // indirect
	github.com/magiconair/properties v1.8.5 // indirect
	github.com/mattn/go-isatty v0.0.14 // indirect
	github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
	github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 // indirect
	github.com/minio/highwayhash v1.0.2 // indirect
	github.com/mitchellh/go-homedir v1.1.0 // indirect
	github.com/mitchellh/mapstructure v1.4.3 // indirect
	github.com/mtibben/percent v0.2.1 // indirect
	github.com/pelletier/go-toml v1.9.4 // indirect
	github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
	github.com/pmezard/go-difflib v1.0.0 // indirect
	github.com/prometheus/client_golang v1.12.1 // indirect
	github.com/prometheus/client_model v0.2.0 // indirect
	github.com/prometheus/common v0.32.1 // indirect
	github.com/prometheus/procfs v0.7.3 // indirect
	github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
	github.com/rs/cors v1.8.2 // indirect
	github.com/rs/zerolog v1.21.0 // indirect
	github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect
	github.com/spf13/afero v1.6.0 // indirect
	github.com/spf13/jwalterweatherman v1.1.0 // indirect
	github.com/spf13/viper v1.10.1 // indirect
	github.com/subosito/gotenv v1.2.0 // indirect
	github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect
	github.com/tendermint/btcd v0.1.1 // indirect
	github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect
	github.com/tendermint/go-amino v0.16.0 // indirect
	github.com/zondax/hid v0.9.0 // indirect
	go.etcd.io/bbolt v1.3.6 // indirect
	golang.org/x/crypto v0.0.0-20210915214749-c084706c2272 // indirect
	golang.org/x/exp v0.0.0-20200513190911-00229845015e // indirect
	golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b // indirect
	golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect
	golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
	golang.org/x/text v0.3.7 // indirect
	gopkg.in/ini.v1 v1.66.2 // indirect
	gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

replace (
	// use osmosis-sdk
	github.com/cosmos/cosmos-sdk => github.com/osmosis-labs/cosmos-sdk v0.42.10-0.20210903155012-21486dadbb55
	// use cosmos-flavored protobufs
	github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.4
	// enforce tendermint 0.34.16
	github.com/tendermint/tendermint => github.com/tendermint/tendermint v0.34.16
	github.com/tendermint/tm-db => github.com/notional-labs/tm-db v0.6.7-0.20220413194741-5be48b846d14

	// use grpc version compatible with cosmos protobufs
	google.golang.org/grpc => google.golang.org/grpc v1.33.2
)

These both lead towards checking it out better in iavl

@faddat
Copy link
Member

faddat commented Apr 13, 2022

Just pushed the v3.x code I've been working from to here:

https://github.com/osmosis-labs/osmosis/tree/faddat/pebble3x

@catShaark
Copy link
Author

I'm getting this error after 1500 blocks panic: nodeDB.GetNode() requires hash

@faddat
Copy link
Member

faddat commented Apr 15, 2022

That error is related to the ones that I've been getting.

today I've been tracking this work here:

https://twitter.com/gadikian/status/1514820390253895680

I was able to reproduce it with this gaia branch, here:

cosmos/gaia#1413

I am thinking that I will look at the iterator & batch code again

@catShaark catShaark closed this Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants