likecoin / likecoin-chain

LikeCoin chain node binary - liked
https://docs.like.co/validator/likecoin-chain-node/setup-a-node
GNU General Public License v3.0
104 stars 23 forks source link

Upgrade dependency "github.com/tendermint/tm-db" #95

Closed Morty-luo closed 1 year ago

Morty-luo commented 1 year ago

It seems that likecoin/likecoin-chain directly depends on github.com/tendermint/tm-db@v0.6.6. But module github.com/tendermint/tm-db at version v0.6.6 uses replace directive to replace dependency github.com/tecbot/gorocksdb with github.com/roysc/gorocksdb.

https://github.com/likecoin/likecoin-chain/blob/master/go.mod#L21

github.com/tendermint/tm-db v0.6.6

https://github.com/tendermint/tm-db/blob/v0.6.6/go.mod(line 12&22)

github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c
replace github.com/tecbot/gorocksdb => github.com/roysc/gorocksdb v1.1.1

According to Go Modules wikis, replace directives in modules other than the main module are ignored when building the main module. It means such replace usage in dependency's go.mod cannot be inherited when building main module. And it turns out that likecoin/likecoin-chain indirectly relies on github.com/tecbot/gorocksdb, which is different from the replaced dependency tendermint/tm-db needed.
https://github.com/likecoin/likecoin-chain/blob/master/go.mod#L118

github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect

To avoid such inconsistency, the best approach is bumping the version of github.com/tendermint/tm-db since the latest release(v0.6.7) of github.com/tendermint/tm-db has eliminated the replace usage in go.mod.

williamchong commented 1 year ago

Latest version (v4.0.0) upgrades tm-db to v0.6.7 Thanks for reporting the issue