From ab0b541d891bc2c9848f47f704ecef04ecb97e81 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 21 Mar 2023 11:47:52 +0800 Subject: [PATCH 01/30] Problem: memiavl is not integrated with state machine Solution: - implement custom rootmulti store and kvstore wrappers add flag --memiavl to enable memiavl kvstore use change set api --- app/app.go | 8 +- default.nix | 1 + go.mod | 4 +- go.sum | 4 +- gomod2nix.toml | 4 +- integration_tests/configs/default.jsonnet | 1 + memiavl/go.mod | 2 +- memiavl/tree.go | 46 ++- store/go.mod | 76 ++++ store/go.sum | 397 +++++++++++++++++++ store/memiavlstore/store.go | 127 ++++++ store/rootmulti/store.go | 453 ++++++++++++++++++++++ 12 files changed, 1110 insertions(+), 13 deletions(-) create mode 100644 store/go.mod create mode 100644 store/go.sum create mode 100644 store/memiavlstore/store.go create mode 100644 store/rootmulti/store.go diff --git a/app/app.go b/app/app.go index 3ed78edd33..ab625d092b 100644 --- a/app/app.go +++ b/app/app.go @@ -124,6 +124,7 @@ import ( // this line is used by starport scaffolding # stargate/app/moduleImport + "github.com/crypto-org-chain/cronos/store/rootmulti" "github.com/crypto-org-chain/cronos/v2/x/cronos" cronosclient "github.com/crypto-org-chain/cronos/v2/x/cronos/client" cronoskeeper "github.com/crypto-org-chain/cronos/v2/x/cronos/keeper" @@ -149,7 +150,7 @@ const ( // NOTE: In the SDK, the default value is 255. AddrLen = 20 - FileStreamerDirectory = "file_streamer" + FlagMemIAVL = "memiavl" ) // this line is used by starport scaffolding # stargate/wasm/app/enabledProposals @@ -343,6 +344,11 @@ func New( interfaceRegistry := encodingConfig.InterfaceRegistry bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) + + if cast.ToBool(appOpts.Get(FlagMemIAVL)) { + bApp.SetCMS(rootmulti.NewStore(filepath.Join(homePath, "memiavl.db"), logger)) + } + bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(interfaceRegistry) diff --git a/default.nix b/default.nix index 26e2c3b47f..eabe0caeeb 100644 --- a/default.nix +++ b/default.nix @@ -34,6 +34,7 @@ buildGoApplication rec { "!/client/" "!/versiondb/" "!/memiavl/" + "!/store/" "!go.mod" "!go.sum" "!gomod2nix.toml" diff --git a/go.mod b/go.mod index 337262b453..4053a0f6b9 100644 --- a/go.mod +++ b/go.mod @@ -9,6 +9,7 @@ require ( github.com/cosmos/cosmos-sdk v0.46.11 github.com/cosmos/gogoproto v1.4.2 github.com/cosmos/ibc-go/v5 v5.2.0 + github.com/crypto-org-chain/cronos/store v0.0.0 github.com/crypto-org-chain/cronos/versiondb v0.0.0 github.com/ethereum/go-ethereum v1.10.26 github.com/evmos/ethermint v0.6.1-0.20221101220534-a8ea4eceb6d9 @@ -208,8 +209,9 @@ replace ( github.com/cometbft/cometbft-db => github.com/crypto-org-chain/cometbft-db v0.0.0-20230306031617-b3e4fd3331c4 // Ref: https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702 github.com/confio/ics23/go => github.com/confio/ics23/go v0.9.0 - github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.11 + github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.12-0.20230403092311-152465bd0ca7 github.com/crypto-org-chain/cronos/memiavl => ./memiavl + github.com/crypto-org-chain/cronos/store => ./store github.com/crypto-org-chain/cronos/versiondb => ./versiondb github.com/ethereum/go-ethereum => github.com/crypto-org-chain/go-ethereum v1.10.19-deepcopy-jumptable github.com/evmos/ethermint => github.com/crypto-org-chain/ethermint v0.20.8-cronos.0.20230315032257-cb741e1d8196 diff --git a/go.sum b/go.sum index ac1d28c965..231c80a548 100644 --- a/go.sum +++ b/go.sum @@ -384,8 +384,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= -github.com/cosmos/cosmos-sdk v0.46.11 h1:csMJQHtcb/EIu2EJmeg/2NaGkGw3ZScFwa4CRpCCw18= -github.com/cosmos/cosmos-sdk v0.46.11/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= +github.com/cosmos/cosmos-sdk v0.46.12-0.20230403092311-152465bd0ca7 h1:NhJVy00Q2PDTjxufX7f8Byy/qkS2Kl9YezOYosdXMhI= +github.com/cosmos/cosmos-sdk v0.46.12-0.20230403092311-152465bd0ca7/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= diff --git a/gomod2nix.toml b/gomod2nix.toml index c75f261746..df6e56c4ca 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -115,8 +115,8 @@ schema = 3 version = "v1.0.0-beta.1" hash = "sha256-oATkuj+fM5eBn+ywO+w/tL0AFSIEkx0J3Yz+VhVe0QA=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.46.11" - hash = "sha256-RpjzVDZw5n0y4kobBCy2d1oPmDCgL5k47UaZMI67sqU=" + version = "v0.46.12-0.20230403092311-152465bd0ca7" + hash = "sha256-pxjj8RzbtYoJ3mRqSze33piQBZHVCB4Qk0iOgqtbdHw=" replaced = "github.com/cosmos/cosmos-sdk" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" diff --git a/integration_tests/configs/default.jsonnet b/integration_tests/configs/default.jsonnet index ae37278cd5..204e08ef60 100644 --- a/integration_tests/configs/default.jsonnet +++ b/integration_tests/configs/default.jsonnet @@ -35,6 +35,7 @@ staked: '1000000000000000000stake', mnemonic: '${VALIDATOR1_MNEMONIC}', 'app-config': { + memiavl: true, store: { streamers: ['file', 'versiondb'], }, diff --git a/memiavl/go.mod b/memiavl/go.mod index 2b64e2f318..198afc0a7a 100644 --- a/memiavl/go.mod +++ b/memiavl/go.mod @@ -7,6 +7,7 @@ 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 @@ -34,7 +35,6 @@ 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/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect diff --git a/memiavl/tree.go b/memiavl/tree.go index 9055ca186d..e5370a341e 100644 --- a/memiavl/tree.go +++ b/memiavl/tree.go @@ -4,20 +4,22 @@ import ( "crypto/sha256" "errors" "math" + "os" - dbm "github.com/tendermint/tm-db" "github.com/cosmos/iavl" + dbm "github.com/tendermint/tm-db" ) 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 - - initialVersion uint32 } // NewEmptyTree creates an empty tree at an arbitrary version. @@ -50,9 +52,30 @@ func NewFromSnapshot(snapshot *Snapshot) *Tree { return NewEmptyTree(int64(snapshot.Version())) } return &Tree{ - version: snapshot.Version(), - root: snapshot.RootNode(), + snapshot: snapshot, + version: snapshot.Version(), + root: snapshot.RootNode(), + } +} + +// Load try to load an existing memiavl tree at the directory, +// if the directory don't exists, creates an empty tree with the provided initial version. +func Load(dir string, initialVersion int64) (*Tree, error) { + snapshot, err := OpenSnapshot(dir) + if err != nil { + if os.IsNotExist(err) { + return NewWithInitialVersion(initialVersion), nil + } + return nil, err } + return NewFromSnapshot(snapshot), nil +} + +func (t *Tree) SetInitialVersion(version int64) { + if version >= int64(math.MaxUint32) { + panic("version overflows uint32") + } + t.initialVersion = uint32(version) } // ApplyChangeSet apply the change set of a whole version, and update hashes. @@ -80,7 +103,11 @@ func (t *Tree) remove(key []byte) { func (t *Tree) saveVersion(updateHash bool) ([]byte, int64, error) { var hash []byte if updateHash { - hash = t.root.Hash() + if t.root == nil { + hash = emptyHash + } else { + hash = t.root.Hash() + } } if t.version >= uint32(math.MaxUint32) { @@ -118,6 +145,13 @@ func (t *Tree) Get(key []byte) []byte { return t.root.Get(key) } +func (t *Tree) Has(key []byte) bool { + if t.Get(key) == nil { + return false + } + return true +} + func (t *Tree) Iterator(start, end []byte, ascending bool) dbm.Iterator { return NewIterator(start, end, ascending, t.root) } diff --git a/store/go.mod b/store/go.mod new file mode 100644 index 0000000000..86650fb779 --- /dev/null +++ b/store/go.mod @@ -0,0 +1,76 @@ +module github.com/crypto-org-chain/cronos/store + +go 1.20 + +require ( + github.com/cosmos/cosmos-sdk v0.46.11 + github.com/cosmos/iavl v0.19.5 + github.com/crypto-org-chain/cronos/memiavl v0.0.1 + github.com/gogo/protobuf v1.3.2 + github.com/pkg/errors v0.9.1 + github.com/tendermint/tendermint v0.34.27 + github.com/tendermint/tm-db v0.6.7 +) + +require ( + cosmossdk.io/errors v1.0.0-beta.7 // indirect + github.com/VictoriaMetrics/metrics v1.23.1 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b // indirect + github.com/cespare/xxhash v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/confio/ics23/go v0.9.0 // indirect + github.com/cosmos/gorocksdb v1.2.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect + github.com/dustin/go-humanize v1.0.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.5.1 // indirect + github.com/go-stack/stack v1.8.1 // indirect + github.com/golang/glog v1.0.0 // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/btree v1.1.2 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/jmhodges/levigo v1.0.0 // indirect + github.com/klauspost/compress v1.15.11 // indirect + github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263 // indirect + github.com/ledgerwatch/log/v3 v3.7.0 // 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 + github.com/stretchr/testify v1.8.1 // indirect + github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect + github.com/tendermint/go-amino v0.16.0 // indirect + github.com/tidwall/btree v1.5.0 // indirect + github.com/torquem-ch/mdbx-go v0.27.5 // indirect + github.com/valyala/fastrand v1.1.0 // indirect + github.com/valyala/histogram v1.2.0 // indirect + go.etcd.io/bbolt v1.3.6 // indirect + go.uber.org/atomic v1.10.0 // indirect + golang.org/x/crypto v0.6.0 // indirect + golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect + golang.org/x/net v0.7.0 // indirect + golang.org/x/sys v0.5.0 // indirect + golang.org/x/text v0.7.0 // indirect + google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect + google.golang.org/grpc v1.53.0 // indirect + google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) + +replace ( + github.com/crypto-org-chain/cronos/memiavl => ../memiavl + github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 + // use cometbft + github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 +) diff --git a/store/go.sum b/store/go.sum new file mode 100644 index 0000000000..ff3a9aa4b6 --- /dev/null +++ b/store/go.sum @@ -0,0 +1,397 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= +cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE= +cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= +cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= +cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= +cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= +cosmossdk.io/math v1.0.0-beta.3 h1:TbZxSopz2LqjJ7aXYfn7nJSb8vNaBklW6BLpcei1qwM= +filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= +github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= +github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/VictoriaMetrics/metrics v1.23.1 h1:/j8DzeJBxSpL2qSIdqnRFLvQQhbJyJbbEi22yMm7oL0= +github.com/VictoriaMetrics/metrics v1.23.1/go.mod h1:rAr/llLpEnAdTehiNlUxKgnjcOuROSzpw0GvjpEbvFc= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/aws/aws-sdk-go v1.40.45 h1:QN1nsY27ssD/JmW4s83qmSb+uL6DG4GmCDzjmJB4xUI= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.2 h1:XLMbX8JQEiwMcYft2EGi8zPUkoa0abKIU6/BJSRsjzQ= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b h1:6+ZFm0flnudZzdSE0JxlhR2hKnGPcNB35BjQf4RYQDY= +github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b/go.mod h1:S/7n9copUssQ56c7aAgHqftWO4LTf4xY6CGWt8Bc+3M= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= +github.com/cometbft/cometbft v0.34.27 h1:ri6BvmwjWR0gurYjywcBqRe4bbwc3QVs9KRcCzgh/J0= +github.com/cometbft/cometbft v0.34.27/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= +github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= +github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= +github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= +github.com/cosmos/cosmos-sdk v0.46.11 h1:csMJQHtcb/EIu2EJmeg/2NaGkGw3ZScFwa4CRpCCw18= +github.com/cosmos/cosmos-sdk v0.46.11/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= +github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= +github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= +github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= +github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= +github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= +github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= +github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= +github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= +github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= +github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= +github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= +github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= +github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= +github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= +github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/googleapis/enterprise-certificate-proxy v0.2.0 h1:y8Yozv7SZtlU//QXbezB6QkpuE6jMD2/gfzk4AftXjs= +github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= +github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= +github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= +github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= +github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= +github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= +github.com/hashicorp/go-getter v1.6.1 h1:NASsgP4q6tL94WH6nJxKWj8As2H/2kop/bB1d8JMyRY= +github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= +github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263 h1:LGEzZvf33Y1NhuP5+jI/ni9l1TFS6oYPDilgy74NusM= +github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263/go.mod h1:OXgMDuUo2lZ3NpH29ZvMYbk+LxFd5ffDl2Z2mGMuY/I= +github.com/ledgerwatch/log/v3 v3.7.0 h1:aFPEZdwZx4jzA3+/Pf8wNDN5tCI0cIolq/kfvgcM+og= +github.com/ledgerwatch/log/v3 v3.7.0/go.mod h1:J2Jl6zV/58LeA6LTaVVnCGyf1/cYYSEOOLHY4ZN8S2A= +github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= +github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= +github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= +github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= +github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= +github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.8.2 h1:xehSyVa0YnHWsJ49JFljMpg1HX19V6NDZ1fkm1Xznbo= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= +github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= +github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= +github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= +github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= +github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= +github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= +github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= +github.com/torquem-ch/mdbx-go v0.27.5 h1:bbhXQGFCmoxbRDXKYEJwxSOOTeBKwoD4pFBUpK9+V1g= +github.com/torquem-ch/mdbx-go v0.27.5/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= +github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8= +github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= +github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= +github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= +github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= +go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= +go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= +golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= +golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= +golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +google.golang.org/api v0.102.0 h1:JxJl2qQ85fRMPNvlZY/enexbxpCjLwGhZUtgfGeQ51I= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 h1:vArvWooPH749rNHpBGgVl+U9B9dATjiEhJzcWGlovNs= +google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= +google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/store/memiavlstore/store.go b/store/memiavlstore/store.go new file mode 100644 index 0000000000..cb96a679ee --- /dev/null +++ b/store/memiavlstore/store.go @@ -0,0 +1,127 @@ +package memiavlstore + +import ( + "bytes" + "io" + + "github.com/cosmos/cosmos-sdk/store/tracekv" + "github.com/cosmos/iavl" + "github.com/crypto-org-chain/cronos/memiavl" + "github.com/tendermint/tendermint/libs/log" + + pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" + "github.com/cosmos/cosmos-sdk/store/cachekv" + "github.com/cosmos/cosmos-sdk/store/types" +) + +var ( + _ types.KVStore = (*Store)(nil) + _ types.CommitStore = (*Store)(nil) + _ types.CommitKVStore = (*Store)(nil) +) + +// Store Implements types.KVStore and CommitKVStore. +type Store struct { + tree memiavl.Tree + logger log.Logger + + changeSet iavl.ChangeSet +} + +func LoadStoreWithInitialVersion(dir string, logger log.Logger, initialVersion int64) (types.CommitKVStore, error) { + tree, err := memiavl.Load(dir, initialVersion) + if err != nil { + return nil, err + } + return &Store{tree: *tree, logger: logger}, nil +} + +func (st *Store) Commit() types.CommitID { + hash, version, err := st.tree.ApplyChangeSet(&st.changeSet, true) + if err != nil { + panic(err) + } + st.changeSet.Pairs = st.changeSet.Pairs[:0] + + return types.CommitID{ + Version: version, + Hash: hash, + } +} + +func (st *Store) LastCommitID() types.CommitID { + hash := st.tree.RootHash() + return types.CommitID{ + Version: st.tree.Version(), + Hash: hash, + } +} + +// SetPruning panics as pruning options should be provided at initialization +// since IAVl accepts pruning options directly. +func (st *Store) SetPruning(_ pruningtypes.PruningOptions) { + panic("cannot set pruning options on an initialized IAVL store") +} + +// SetPruning panics as pruning options should be provided at initialization +// since IAVl accepts pruning options directly. +func (st *Store) GetPruning() pruningtypes.PruningOptions { + panic("cannot get pruning options on an initialized IAVL store") +} + +// Implements Store. +func (st *Store) GetStoreType() types.StoreType { + return types.StoreTypeIAVL +} + +func (st *Store) CacheWrap() types.CacheWrap { + return cachekv.NewStore(st) +} + +// CacheWrapWithTrace implements the Store interface. +func (st *Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { + return cachekv.NewStore(tracekv.NewStore(st, w, tc)) +} + +// Implements types.KVStore. +// +// we assume Set is only called in `Commit`, so the written state is only visible after commit. +func (st *Store) Set(key, value []byte) { + st.changeSet.Pairs = append(st.changeSet.Pairs, iavl.KVPair{ + Key: key, Value: value, + }) +} + +// Implements types.KVStore. +func (st *Store) Get(key []byte) []byte { + return bytes.Clone(st.tree.Get(key)) +} + +// Implements types.KVStore. +func (st *Store) Has(key []byte) bool { + return st.tree.Has(key) +} + +// Implements types.KVStore. +// +// we assume Delete is only called in `Commit`, so the written state is only visible after commit. +func (st *Store) Delete(key []byte) { + st.changeSet.Pairs = append(st.changeSet.Pairs, iavl.KVPair{ + Key: key, Delete: true, + }) +} + +func (st *Store) Iterator(start, end []byte) types.Iterator { + return st.tree.Iterator(start, end, true) +} + +func (st *Store) ReverseIterator(start, end []byte) types.Iterator { + return st.tree.Iterator(start, end, false) +} + +// SetInitialVersion sets the initial version of the IAVL tree. It is used when +// starting a new chain at an arbitrary height. +// implements interface StoreWithInitialVersion +func (st *Store) SetInitialVersion(version int64) { + st.tree.SetInitialVersion(version) +} diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go new file mode 100644 index 0000000000..5456272dcc --- /dev/null +++ b/store/rootmulti/store.go @@ -0,0 +1,453 @@ +package rootmulti + +import ( + "fmt" + "io" + "os" + "path/filepath" + "sort" + "strings" + + "github.com/cosmos/cosmos-sdk/store/listenkv" + "github.com/crypto-org-chain/cronos/store/memiavlstore" + "github.com/pkg/errors" + "github.com/tendermint/tendermint/libs/log" + + pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" + snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" + "github.com/cosmos/cosmos-sdk/store/cachemulti" + "github.com/cosmos/cosmos-sdk/store/mem" + "github.com/cosmos/cosmos-sdk/store/transient" + "github.com/cosmos/cosmos-sdk/store/types" + protoio "github.com/gogo/protobuf/io" + dbm "github.com/tendermint/tm-db" +) + +const CommitInfoFileName = "commit_infos" + +var ( + _ types.CommitMultiStore = (*Store)(nil) +) + +type Store struct { + dir string + logger log.Logger + + storesParams map[types.StoreKey]storeParams + keysByName map[string]types.StoreKey + stores map[types.StoreKey]types.CommitKVStore + listeners map[types.StoreKey][]types.WriteListener + + initialVersion int64 + lastCommitInfo *types.CommitInfo +} + +func NewStore(dir string, logger log.Logger) *Store { + return &Store{ + dir: dir, + logger: logger, + + storesParams: make(map[types.StoreKey]storeParams), + keysByName: make(map[string]types.StoreKey), + stores: make(map[types.StoreKey]types.CommitKVStore), + listeners: make(map[types.StoreKey][]types.WriteListener), + } +} + +// Implements interface Committer +func (rs *Store) Commit() types.CommitID { + var previousHeight, version int64 + if rs.lastCommitInfo.GetVersion() == 0 && rs.initialVersion > 1 { + // This case means that no commit has been made in the store, we + // start from initialVersion. + version = rs.initialVersion + } else { + // This case can means two things: + // - either there was already a previous commit in the store, in which + // case we increment the version from there, + // - or there was no previous commit, and initial version was not set, + // in which case we start at version 1. + previousHeight = rs.lastCommitInfo.GetVersion() + version = previousHeight + 1 + } + + rs.lastCommitInfo = commitStores(version, rs.stores, nil) + + // TODO persist to disk + + return types.CommitID{ + Version: version, + Hash: rs.lastCommitInfo.Hash(), + } +} + +// Implements interface Committer +func (rs *Store) LastCommitID() types.CommitID { + return rs.lastCommitInfo.CommitID() +} + +// Implements interface Committer +func (rs *Store) SetPruning(pruningtypes.PruningOptions) { +} + +// Implements interface Committer +func (rs *Store) GetPruning() pruningtypes.PruningOptions { + return pruningtypes.NewPruningOptions(pruningtypes.PruningDefault) +} + +// Implements interface Store +func (rs *Store) GetStoreType() types.StoreType { + return types.StoreTypeMulti +} + +// Implements interface CacheWrapper +func (rs *Store) CacheWrap() types.CacheWrap { + return rs.CacheMultiStore().(types.CacheWrap) +} + +// Implements interface CacheWrapper +func (rs *Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap { + return rs.CacheWrap() +} + +// Implements interface MultiStore +func (rs *Store) CacheMultiStore() types.CacheMultiStore { + // TODO custom cache store + stores := make(map[types.StoreKey]types.CacheWrapper) + for k, v := range rs.stores { + store := types.KVStore(v) + // Wire the listenkv.Store to allow listeners to observe the writes from the cache store, + // set same listeners on cache store will observe duplicated writes. + if rs.ListeningEnabled(k) { + store = listenkv.NewStore(store, k, rs.listeners[k]) + } + stores[k] = store + } + return cachemulti.NewStore(nil, stores, rs.keysByName, nil, nil) +} + +// Implements interface MultiStore +// used to createQueryContext, abci_query or grpc query service. +func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStore, error) { + panic("rootmulti Store don't support historical query service") +} + +// Implements interface MultiStore +func (rs *Store) GetStore(key types.StoreKey) types.Store { + return rs.GetKVStore(key) +} + +// Implements interface MultiStore +func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore { + s := rs.stores[key] + if s == nil { + panic(fmt.Sprintf("store does not exist for key: %s", key.Name())) + } + store := types.KVStore(s) + + if rs.ListeningEnabled(key) { + store = listenkv.NewStore(store, key, rs.listeners[key]) + } + + return store +} + +// Implements interface MultiStore +func (rs *Store) TracingEnabled() bool { + return false +} + +// Implements interface MultiStore +func (rs *Store) SetTracer(w io.Writer) types.MultiStore { + return nil +} + +// Implements interface MultiStore +func (rs *Store) SetTracingContext(types.TraceContext) types.MultiStore { + return nil +} + +// Implements interface MultiStore +func (rs *Store) LatestVersion() int64 { + return rs.lastCommitInfo.Version +} + +// Implements interface Snapshotter +func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error { + // TODO + return nil +} + +// Implements interface Snapshotter +func (rs *Store) Restore(height uint64, format uint32, protoReader protoio.Reader) (snapshottypes.SnapshotItem, error) { + // TODO + return snapshottypes.SnapshotItem{}, nil +} + +// Implements interface Snapshotter +func (rs *Store) PruneSnapshotHeight(height int64) { + // TODO +} + +// Implements interface Snapshotter +func (rs *Store) SetSnapshotInterval(snapshotInterval uint64) { + // TODO +} + +// Implements interface CommitMultiStore +func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, db dbm.DB) { + if key == nil { + panic("MountIAVLStore() key cannot be nil") + } + if _, ok := rs.storesParams[key]; ok { + panic(fmt.Sprintf("store duplicate store key %v", key)) + } + if _, ok := rs.keysByName[key.Name()]; ok { + panic(fmt.Sprintf("store duplicate store key name %v", key)) + } + rs.storesParams[key] = newStoreParams(key, db, typ, 0) + rs.keysByName[key.Name()] = key + +} + +// Implements interface CommitMultiStore +func (rs *Store) GetCommitStore(key types.StoreKey) types.CommitStore { + return rs.GetCommitKVStore(key) +} + +// Implements interface CommitMultiStore +func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore { + return rs.stores[key] +} + +// Implements interface CommitMultiStore +// used by normal node startup. +func (rs *Store) LoadLatestVersion() error { + return rs.LoadLatestVersionAndUpgrade(nil) +} + +// Implements interface CommitMultiStore +// used by node startup with UpgradeStoreLoader +func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) error { + cInfo := &types.CommitInfo{} + bz, err := os.ReadFile(filepath.Join(rs.dir, CommitInfoFileName)) + if err != nil { + // if file not exists, assume empty db + if !os.IsNotExist(err) { + return errors.Wrap(err, "fail to read commit info file") + } + } else { + if err := cInfo.Unmarshal(bz); err != nil { + return errors.Wrap(err, "failed unmarshal commit info") + } + } + + infos := make(map[string]types.StoreInfo) + // convert StoreInfos slice to map + for _, storeInfo := range cInfo.StoreInfos { + infos[storeInfo.Name] = storeInfo + } + + // load each Store (note this doesn't panic on unmounted keys now) + newStores := make(map[types.StoreKey]types.CommitKVStore) + + storesKeys := make([]types.StoreKey, 0, len(rs.storesParams)) + for key := range rs.storesParams { + storesKeys = append(storesKeys, key) + } + // deterministic iteration order for upgrades + sort.Slice(storesKeys, func(i, j int) bool { + return storesKeys[i].Name() < storesKeys[j].Name() + }) + + var ( + commitID types.CommitID + ) + for _, key := range storesKeys { + storeParams := rs.storesParams[key] + + if info, ok := infos[key.Name()]; !ok { + commitID = info.CommitId + } else { + commitID = types.CommitID{} + } + + // If it has been added, set the initial version + if upgrades.IsAdded(key.Name()) || upgrades.RenamedFrom(key.Name()) != "" { + storeParams.initialVersion = uint64(cInfo.Version) + 1 + } else if commitID.Version != cInfo.Version && storeParams.typ == types.StoreTypeIAVL { + return fmt.Errorf("version of store %s mismatch root store's version; expected %d got %d", key.Name(), cInfo.Version, commitID.Version) + } + + store, err := rs.loadCommitStoreFromParams(key, commitID, storeParams) + if err != nil { + return errors.Wrap(err, "failed to load store") + } + + newStores[key] = store + // If it was deleted, remove all data + if upgrades.IsDeleted(key.Name()) { + // TODO efficient deletion + } else if oldName := upgrades.RenamedFrom(key.Name()); oldName != "" { + // TODO efficient rename + } + } + + rs.lastCommitInfo = cInfo + rs.stores = newStores + return nil +} + +func (rs *Store) loadCommitStoreFromParams(key types.StoreKey, id types.CommitID, params storeParams) (types.CommitKVStore, error) { + switch params.typ { + case types.StoreTypeMulti: + panic("recursive MultiStores not yet supported") + case types.StoreTypeIAVL: + dir := filepath.Join(rs.dir, key.Name()) + return memiavlstore.LoadStoreWithInitialVersion(dir, rs.logger, int64(params.initialVersion)) + case types.StoreTypeDB: + panic("recursive MultiStores not yet supported") + case types.StoreTypeTransient: + _, ok := key.(*types.TransientStoreKey) + if !ok { + return nil, fmt.Errorf("invalid StoreKey for StoreTypeTransient: %s", key.String()) + } + + return transient.NewStore(), nil + + case types.StoreTypeMemory: + if _, ok := key.(*types.MemoryStoreKey); !ok { + return nil, fmt.Errorf("unexpected key type for a MemoryStoreKey; got: %s", key.String()) + } + + return mem.NewStore(), nil + + default: + panic(fmt.Sprintf("unrecognized store type %v", params.typ)) + } +} + +// Implements interface CommitMultiStore +// not used in sdk +func (rs *Store) LoadVersionAndUpgrade(ver int64, upgrades *types.StoreUpgrades) error { + panic("rootmulti store don't support LoadVersionAndUpgrade") +} + +// Implements interface CommitMultiStore +// used by export cmd +func (rs *Store) LoadVersion(ver int64) error { + if ver != 0 { + return errors.New("rootmulti store only support load the latest version") + } + return rs.LoadLatestVersion() +} + +// Implements interface CommitMultiStore +func (rs *Store) SetInterBlockCache(_ types.MultiStorePersistentCache) { +} + +// Implements interface CommitMultiStore +// used by InitChain when the initial height is bigger than 1 +func (rs *Store) SetInitialVersion(version int64) error { + rs.initialVersion = version + + // Loop through all the stores, if it's an IAVL store, then set initial + // version on it. + for key, store := range rs.stores { + if store.GetStoreType() == types.StoreTypeIAVL { + // If the store is wrapped with an inter-block cache, we must first unwrap + // it to get the underlying IAVL store. + store = rs.GetCommitKVStore(key) + store.(types.StoreWithInitialVersion).SetInitialVersion(version) + } + } + + return nil +} + +// Implements interface CommitMultiStore +func (rs *Store) SetIAVLCacheSize(size int) { +} + +// Implements interface CommitMultiStore +func (rs *Store) SetIAVLDisableFastNode(disable bool) { +} + +// Implements interface CommitMultiStore +func (rs *Store) SetLazyLoading(lazyLoading bool) { +} + +// Implements interface CommitMultiStore +func (rs *Store) RollbackToVersion(version int64) error { + return errors.New("rootmulti store don't support rollback") +} + +// Implements interface CommitMultiStore +func (rs *Store) ListeningEnabled(key types.StoreKey) bool { + if ls, ok := rs.listeners[key]; ok { + return len(ls) != 0 + } + return false +} + +// Implements interface CommitMultiStore +func (rs *Store) AddListeners(key types.StoreKey, listeners []types.WriteListener) { + if ls, ok := rs.listeners[key]; ok { + rs.listeners[key] = append(ls, listeners...) + } else { + rs.listeners[key] = listeners + } +} + +type storeParams struct { + key types.StoreKey + db dbm.DB + typ types.StoreType + initialVersion uint64 +} + +func newStoreParams(key types.StoreKey, db dbm.DB, typ types.StoreType, initialVersion uint64) storeParams { + return storeParams{ + key: key, + db: db, + typ: typ, + initialVersion: initialVersion, + } +} + +// Commits each store and returns a new commitInfo. +func commitStores(version int64, storeMap map[types.StoreKey]types.CommitKVStore, removalMap map[types.StoreKey]bool) *types.CommitInfo { + storeInfos := make([]types.StoreInfo, 0, len(storeMap)) + + for key, store := range storeMap { + last := store.LastCommitID() + + // If a commit event execution is interrupted, a new iavl store's version will be larger than the rootmulti's metadata, when the block is replayed, we should avoid committing that iavl store again. + var commitID types.CommitID + if last.Version >= version { + last.Version = version + commitID = last + } else { + commitID = store.Commit() + } + if store.GetStoreType() == types.StoreTypeTransient { + continue + } + + if !removalMap[key] { + si := types.StoreInfo{} + si.Name = key.Name() + si.CommitId = commitID + storeInfos = append(storeInfos, si) + } + } + + sort.SliceStable(storeInfos, func(i, j int) bool { + return strings.Compare(storeInfos[i].Name, storeInfos[j].Name) < 0 + }) + + return &types.CommitInfo{ + Version: version, + StoreInfos: storeInfos, + } +} From be4c313d81c269d7bf7fdecf2ab53f872696e90a Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 4 Apr 2023 16:02:04 +0800 Subject: [PATCH 02/30] update CI golang version --- .github/workflows/build.yml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/sims.yml | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 316655ec0d..110fbe22bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -66,7 +66,7 @@ jobs: access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - uses: actions/setup-go@v3 with: - go-version: 1.20.0 + go-version: 1.20.2 - id: changed-files uses: tj-actions/changed-files@v34 with: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 283ae6468e..2ab231a801 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,7 +44,7 @@ jobs: uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.20.0 + go-version: 1.20.2 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7e74dbad06..91d2858943 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,7 +22,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.19.4 + go-version: 1.20.2 - uses: actions/checkout@v3 - uses: cachix/install-nix-action@v19 with: diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 91c7051abf..12fc962668 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -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.0 + go-version: 1.20.2 - name: Display go version run: go version - run: make build @@ -131,7 +131,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.20.0 + go-version: 1.20.2 - name: Display go version run: go version - name: Install runsim @@ -157,7 +157,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.20.0 + go-version: 1.20.2 - name: Checkout Comment PR Branch uses: actions/checkout@v3 if: github.event_name == 'issue_comment' @@ -212,7 +212,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.20.0 + go-version: 1.20.2 - name: Checkout Comment PR Branch uses: actions/checkout@v3 if: github.event_name == 'issue_comment' @@ -267,7 +267,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.20.0 + go-version: 1.20.2 - name: Checkout Comment PR Branch uses: actions/checkout@v3 if: github.event_name == 'issue_comment' @@ -322,7 +322,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.20.0 + go-version: 1.20.2 - name: Checkout Comment PR Branch uses: actions/checkout@v3 if: github.event_name == 'issue_comment' From f9daeef1df83fa59d0296b636ba4d6574e0584dc Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 4 Apr 2023 16:24:57 +0800 Subject: [PATCH 03/30] fix unit test --- memiavl/iterator_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/memiavl/iterator_test.go b/memiavl/iterator_test.go index c11ff38f8e..2b0549e972 100644 --- a/memiavl/iterator_test.go +++ b/memiavl/iterator_test.go @@ -72,8 +72,7 @@ func TestIterator(t *testing.T) { require.Equal(t, expItems[0], collect(tree.Iterator(nil, nil, true))) for _, changes := range ChangeSets { - applyChangeSet(tree, changes) - _, v, err := tree.SaveVersion(true) + _, v, err := tree.ApplyChangeSet(&changes, true) require.NoError(t, err) require.Equal(t, expItems[v], collect(tree.Iterator(nil, nil, true))) require.Equal(t, reverse(expItems[v]), collect(tree.Iterator(nil, nil, false))) @@ -83,8 +82,7 @@ func TestIterator(t *testing.T) { func TestIteratorRange(t *testing.T) { tree := NewEmptyTree(0) for _, changes := range ChangeSets[:6] { - applyChangeSet(tree, changes) - _, _, err := tree.SaveVersion(true) + _, _, err := tree.ApplyChangeSet(&changes, true) require.NoError(t, err) } From b6aeb2fa13ac37ec3264fc0710e945374dab001f Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 4 Apr 2023 17:48:53 +0800 Subject: [PATCH 04/30] fix lint --- .golangci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index e5b8c80765..6176b6c0da 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -23,7 +23,6 @@ linters: - nakedret - nolintlint - staticcheck - - revive - stylecheck - typecheck - unconvert From 3d3835ae777496cc76c284ea4da7ea7334e92195 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 11 Apr 2023 10:26:30 +0800 Subject: [PATCH 05/30] tidy --- store/go.mod | 20 ++++++++++++++------ store/go.sum | 40 +++++++++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/store/go.mod b/store/go.mod index 86650fb779..e4196b4205 100644 --- a/store/go.mod +++ b/store/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/cosmos/cosmos-sdk v0.46.11 - github.com/cosmos/iavl v0.19.5 + github.com/cosmos/iavl v0.19.6-0.20230410112350-e1e212a3a3aa github.com/crypto-org-chain/cronos/memiavl v0.0.1 github.com/gogo/protobuf v1.3.2 github.com/pkg/errors v0.9.1 @@ -20,6 +20,7 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/confio/ics23/go v0.9.0 // indirect + github.com/cosmos/gogoproto v1.4.7 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect @@ -31,9 +32,10 @@ require ( github.com/go-logfmt/logfmt v0.5.1 // indirect github.com/go-stack/stack v1.8.1 // indirect github.com/golang/glog v1.0.0 // indirect - github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect + github.com/google/go-cmp v0.5.9 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/jmhodges/levigo v1.0.0 // indirect @@ -50,6 +52,11 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect github.com/tendermint/go-amino v0.16.0 // indirect github.com/tidwall/btree v1.5.0 // indirect + github.com/tidwall/gjson v1.10.2 // indirect + github.com/tidwall/match v1.1.1 // indirect + github.com/tidwall/pretty v1.2.0 // indirect + github.com/tidwall/tinylru v1.1.0 // indirect + github.com/tidwall/wal v1.1.7 // indirect github.com/torquem-ch/mdbx-go v0.27.5 // indirect github.com/valyala/fastrand v1.1.0 // indirect github.com/valyala/histogram v1.2.0 // indirect @@ -57,12 +64,13 @@ require ( go.uber.org/atomic v1.10.0 // indirect golang.org/x/crypto v0.6.0 // indirect golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/sync v0.1.0 // indirect + golang.org/x/sys v0.6.0 // indirect + golang.org/x/text v0.8.0 // indirect google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect google.golang.org/grpc v1.53.0 // indirect - google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect + google.golang.org/protobuf v1.29.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect diff --git a/store/go.sum b/store/go.sum index ff3a9aa4b6..3dc43a2214 100644 --- a/store/go.sum +++ b/store/go.sum @@ -50,10 +50,12 @@ github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hk github.com/cosmos/cosmos-sdk v0.46.11 h1:csMJQHtcb/EIu2EJmeg/2NaGkGw3ZScFwa4CRpCCw18= github.com/cosmos/cosmos-sdk v0.46.11/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= +github.com/cosmos/gogoproto v1.4.7 h1:RzYKVnsEC7UIkDnhTIkqEB7LnIQbsySvmNEqPCiPevk= +github.com/cosmos/gogoproto v1.4.7/go.mod h1:gxGePp9qedovvl/StQL2BIJ6qlIBn1+9YxR0IulGBKA= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= -github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/iavl v0.19.6-0.20230410112350-e1e212a3a3aa h1:nRlSq1UT5NSiTfcQMDCrxxexLt4+VrFNAVyMIUrb6ro= +github.com/cosmos/iavl v0.19.6-0.20230410112350-e1e212a3a3aa/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= @@ -114,8 +116,8 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -127,6 +129,7 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -257,6 +260,16 @@ github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= github.com/tidwall/btree v1.5.0 h1:iV0yVY/frd7r6qGBXfEYs7DH0gTDgrKTrDjS7xt/IyQ= github.com/tidwall/btree v1.5.0/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE= +github.com/tidwall/gjson v1.10.2 h1:APbLGOM0rrEkd8WBw9C24nllro4ajFuJu0Sc9hRz8Bo= +github.com/tidwall/gjson v1.10.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= +github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/tinylru v1.1.0 h1:XY6IUfzVTU9rpwdhKUF6nQdChgCdGjkMfLzbWyiau6I= +github.com/tidwall/tinylru v1.1.0/go.mod h1:3+bX+TJ2baOLMWTnlyNWHh4QMnFyARg2TLTQ6OFbzw8= +github.com/tidwall/wal v1.1.7 h1:emc1TRjIVsdKKSnpwGBAcsAGg0767SvUk8+ygx7Bb+4= +github.com/tidwall/wal v1.1.7/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= github.com/torquem-ch/mdbx-go v0.27.5 h1:bbhXQGFCmoxbRDXKYEJwxSOOTeBKwoD4pFBUpK9+V1g= github.com/torquem-ch/mdbx-go v0.27.5/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= @@ -301,8 +314,8 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -312,6 +325,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -328,14 +342,14 @@ golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.5.0 h1:n2a8QNdAb0sZNpU9R1ALUXBbY+w51fCQDN+7EdxNBsY= +golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -374,8 +388,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= -google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM= +google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 82b3dc65dcfa741e06caedc562b2cd57017a7ada Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 14 Apr 2023 11:25:42 +0800 Subject: [PATCH 06/30] fix build --- memiavl/db.go | 30 ++++-- memiavl/multitree.go | 30 ++++-- memiavl/tree.go | 21 ---- store/go.sum | 4 +- store/memiavlstore/store.go | 34 +++--- store/rootmulti/store.go | 200 +++++++++++------------------------- 6 files changed, 119 insertions(+), 200 deletions(-) diff --git a/memiavl/db.go b/memiavl/db.go index 062ae04a02..6ba00f114a 100644 --- a/memiavl/db.go +++ b/memiavl/db.go @@ -102,18 +102,16 @@ func Load(dir string, opts Options) (*DB, error) { // SetInitialVersion wraps `MultiTree.SetInitialVersion`. // it do an immediate snapshot rewrite, because we can't use wal log to record this change, // because we need it to convert versions to wal index in the first place. -func (db *DB) SetInitialVersion(initialVersion int64) { +func (db *DB) SetInitialVersion(initialVersion int64) error { if err := db.MultiTree.SetInitialVersion(initialVersion); err != nil { - panic(err) + return err } - if err := db.RewriteSnapshot(); err != nil { - panic(err) + if err := initEmptyDB(db.dir, db.initialVersion); err != nil { + return err } - if err := db.Reload(); err != nil { - panic(err) - } + return db.Reload() } // ApplyUpgrades wraps MultiTree.ApplyUpgrades, it also append the upgrades in a temporary field, @@ -234,7 +232,7 @@ func (db *DB) RewriteSnapshot() error { if err := db.WriteSnapshot(snapshotDir); err != nil { return err } - tmpLink := filepath.Join(db.dir, "current-tmp") + tmpLink := currentTmpPath(db.dir) if err := os.Symlink(snapshotDir, tmpLink); err != nil { return err } @@ -256,7 +254,11 @@ func (db *DB) reloadMultiTree(mtree *MultiTree) error { } db.MultiTree = *mtree - db.pendingUpgrades = nil + + if len(db.pendingUpgrades) > 0 { + db.MultiTree.ApplyUpgrades(db.pendingUpgrades) + } + return nil } @@ -316,6 +318,10 @@ func currentPath(root string) string { return filepath.Join(root, "current") } +func currentTmpPath(root string) string { + return filepath.Join(root, "current-tmp") +} + func walPath(root string) string { return filepath.Join(root, "wal") } @@ -335,5 +341,9 @@ func initEmptyDB(dir string, initialVersion uint32) error { if err := tmp.WriteSnapshot(snapshotDir); err != nil { return err } - return os.Symlink(snapshotDir, currentPath(dir)) + tmpPath := currentTmpPath(dir) + if err := os.Symlink(snapshotDir, tmpPath); err != nil { + return err + } + return os.Rename(tmpPath, currentPath(dir)) } diff --git a/memiavl/multitree.go b/memiavl/multitree.go index 5546e23a36..9a040e638c 100644 --- a/memiavl/multitree.go +++ b/memiavl/multitree.go @@ -20,7 +20,7 @@ import ( const MetadataFileName = "__metadata" -type namedTree struct { +type NamedTree struct { tree *Tree name string } @@ -45,7 +45,7 @@ type MultiTree struct { // it always corresponds to the wal entry with index 1. initialVersion uint32 - trees []namedTree + trees []NamedTree treesByName map[string]int // reversed index of the trees lastCommitInfo storetypes.CommitInfo } @@ -96,11 +96,11 @@ func LoadMultiTree(dir string) (*MultiTree, error) { sort.Strings(treeNames) - trees := make([]namedTree, len(treeNames)) + trees := make([]NamedTree, len(treeNames)) treesByName := make(map[string]int, len(trees)) for i, name := range treeNames { tree := treeMap[name] - trees[i] = namedTree{tree: tree, name: name} + trees[i] = NamedTree{tree: tree, name: name} treesByName[name] = i } @@ -114,6 +114,14 @@ func LoadMultiTree(dir string) (*MultiTree, error) { return mtree, nil } +func (t *MultiTree) Trees() []NamedTree { + return t.trees +} + +func (t *MultiTree) TreeByName(name string) *Tree { + return t.trees[t.treesByName[name]].tree +} + func (t *MultiTree) SetInitialVersion(initialVersion int64) error { if initialVersion >= math.MaxUint32 { return fmt.Errorf("version overflows uint32: %d", initialVersion) @@ -142,11 +150,11 @@ func (t *MultiTree) setInitialVersion(initialVersion int64) { // Copy returns a snapshot of the tree which won't be corrupted by further modifications on the main tree. func (t *MultiTree) Copy() *MultiTree { - trees := make([]namedTree, len(t.trees)) + trees := make([]NamedTree, len(t.trees)) treesByName := make(map[string]int, len(t.trees)) for i, entry := range t.trees { tree := entry.tree.Copy() - trees[i] = namedTree{tree: tree, name: entry.name} + trees[i] = NamedTree{tree: tree, name: entry.name} treesByName[entry.name] = i } @@ -164,6 +172,10 @@ func (t *MultiTree) Version() int64 { return t.lastCommitInfo.Version } +func (t *MultiTree) LastCommitInfo() storetypes.CommitInfo { + return t.lastCommitInfo +} + // ApplyUpgrades store name upgrades func (t *MultiTree) ApplyUpgrades(upgrades []*TreeNameUpgrade) error { if len(upgrades) == 0 { @@ -175,7 +187,7 @@ func (t *MultiTree) ApplyUpgrades(upgrades []*TreeNameUpgrade) error { for _, upgrade := range upgrades { switch { case upgrade.Delete: - i := slices.IndexFunc(t.trees, func(entry namedTree) bool { + i := slices.IndexFunc(t.trees, func(entry NamedTree) bool { return entry.name == upgrade.Name }) if i < 0 { @@ -186,7 +198,7 @@ func (t *MultiTree) ApplyUpgrades(upgrades []*TreeNameUpgrade) error { t.trees = t.trees[:len(t.trees)-1] case upgrade.RenameFrom != "": // rename tree - i := slices.IndexFunc(t.trees, func(entry namedTree) bool { + i := slices.IndexFunc(t.trees, func(entry NamedTree) bool { return entry.name == upgrade.RenameFrom }) if i < 0 { @@ -196,7 +208,7 @@ func (t *MultiTree) ApplyUpgrades(upgrades []*TreeNameUpgrade) error { default: // add tree tree := NewWithInitialVersion(uint32(nextVersion(t.Version(), t.initialVersion))) - t.trees = append(t.trees, namedTree{tree: tree, name: upgrade.Name}) + t.trees = append(t.trees, NamedTree{tree: tree, name: upgrade.Name}) } } diff --git a/memiavl/tree.go b/memiavl/tree.go index 7d80b7bb6c..aa13dddaba 100644 --- a/memiavl/tree.go +++ b/memiavl/tree.go @@ -4,7 +4,6 @@ import ( "crypto/sha256" "errors" "math" - "os" "github.com/cosmos/iavl" dbm "github.com/tendermint/tm-db" @@ -72,26 +71,6 @@ func (t *Tree) Copy() *Tree { return &newTree } -// Load try to load an existing memiavl tree at the directory, -// if the directory don't exists, creates an empty tree with the provided initial version. -func Load(dir string, initialVersion int64) (*Tree, error) { - snapshot, err := OpenSnapshot(dir) - if err != nil { - if os.IsNotExist(err) { - return NewWithInitialVersion(initialVersion), nil - } - return nil, err - } - return NewFromSnapshot(snapshot), nil -} - -func (t *Tree) SetInitialVersion(version int64) { - if version >= int64(math.MaxUint32) { - panic("version overflows uint32") - } - t.initialVersion = uint32(version) -} - // ApplyChangeSet apply the change set of a whole version, and update hashes. func (t *Tree) ApplyChangeSet(changeSet iavl.ChangeSet, updateHash bool) ([]byte, int64, error) { for _, pair := range changeSet.Pairs { diff --git a/store/go.sum b/store/go.sum index 3dc43a2214..09693028e6 100644 --- a/store/go.sum +++ b/store/go.sum @@ -168,11 +168,11 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263 h1:LGEzZvf33Y1NhuP5+jI/ni9l1TFS6oYPDilgy74NusM= github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263/go.mod h1:OXgMDuUo2lZ3NpH29ZvMYbk+LxFd5ffDl2Z2mGMuY/I= github.com/ledgerwatch/log/v3 v3.7.0 h1:aFPEZdwZx4jzA3+/Pf8wNDN5tCI0cIolq/kfvgcM+og= diff --git a/store/memiavlstore/store.go b/store/memiavlstore/store.go index cb96a679ee..4c5dbbc6d5 100644 --- a/store/memiavlstore/store.go +++ b/store/memiavlstore/store.go @@ -22,31 +22,18 @@ var ( // Store Implements types.KVStore and CommitKVStore. type Store struct { - tree memiavl.Tree + tree *memiavl.Tree logger log.Logger changeSet iavl.ChangeSet } -func LoadStoreWithInitialVersion(dir string, logger log.Logger, initialVersion int64) (types.CommitKVStore, error) { - tree, err := memiavl.Load(dir, initialVersion) - if err != nil { - return nil, err - } - return &Store{tree: *tree, logger: logger}, nil +func New(tree *memiavl.Tree, logger log.Logger) *Store { + return &Store{tree: tree, logger: logger} } func (st *Store) Commit() types.CommitID { - hash, version, err := st.tree.ApplyChangeSet(&st.changeSet, true) - if err != nil { - panic(err) - } - st.changeSet.Pairs = st.changeSet.Pairs[:0] - - return types.CommitID{ - Version: version, - Hash: hash, - } + panic("memiavl store is not supposed to be committed alone") } func (st *Store) LastCommitID() types.CommitID { @@ -87,7 +74,7 @@ func (st *Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.Ca // // we assume Set is only called in `Commit`, so the written state is only visible after commit. func (st *Store) Set(key, value []byte) { - st.changeSet.Pairs = append(st.changeSet.Pairs, iavl.KVPair{ + st.changeSet.Pairs = append(st.changeSet.Pairs, &iavl.KVPair{ Key: key, Value: value, }) } @@ -106,7 +93,7 @@ func (st *Store) Has(key []byte) bool { // // we assume Delete is only called in `Commit`, so the written state is only visible after commit. func (st *Store) Delete(key []byte) { - st.changeSet.Pairs = append(st.changeSet.Pairs, iavl.KVPair{ + st.changeSet.Pairs = append(st.changeSet.Pairs, &iavl.KVPair{ Key: key, Delete: true, }) } @@ -123,5 +110,12 @@ func (st *Store) ReverseIterator(start, end []byte) types.Iterator { // starting a new chain at an arbitrary height. // implements interface StoreWithInitialVersion func (st *Store) SetInitialVersion(version int64) { - st.tree.SetInitialVersion(version) + panic("memiavl store's SetInitialVersion is not supposed to be called directly") +} + +// PopChangeSet returns the change set and clear it +func (st *Store) PopChangeSet() iavl.ChangeSet { + cs := st.changeSet + st.changeSet = iavl.ChangeSet{} + return cs } diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 5456272dcc..dae9795153 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -3,12 +3,10 @@ package rootmulti import ( "fmt" "io" - "os" - "path/filepath" "sort" - "strings" "github.com/cosmos/cosmos-sdk/store/listenkv" + "github.com/crypto-org-chain/cronos/memiavl" "github.com/crypto-org-chain/cronos/store/memiavlstore" "github.com/pkg/errors" "github.com/tendermint/tendermint/libs/log" @@ -31,6 +29,7 @@ var ( type Store struct { dir string + db *memiavl.DB logger log.Logger storesParams map[types.StoreKey]storeParams @@ -39,7 +38,6 @@ type Store struct { listeners map[types.StoreKey][]types.WriteListener initialVersion int64 - lastCommitInfo *types.CommitInfo } func NewStore(dir string, logger log.Logger) *Store { @@ -56,34 +54,34 @@ func NewStore(dir string, logger log.Logger) *Store { // Implements interface Committer func (rs *Store) Commit() types.CommitID { - var previousHeight, version int64 - if rs.lastCommitInfo.GetVersion() == 0 && rs.initialVersion > 1 { - // This case means that no commit has been made in the store, we - // start from initialVersion. - version = rs.initialVersion - } else { - // This case can means two things: - // - either there was already a previous commit in the store, in which - // case we increment the version from there, - // - or there was no previous commit, and initial version was not set, - // in which case we start at version 1. - previousHeight = rs.lastCommitInfo.GetVersion() - version = previousHeight + 1 + var changeSets []*memiavl.NamedChangeSet + for storeKey, store := range rs.stores { + if memiavlStore, ok := store.(*memiavlstore.Store); ok { + changeSets = append(changeSets, &memiavl.NamedChangeSet{ + Name: storeKey.Name(), + Changeset: memiavlStore.PopChangeSet(), + }) + } else { + _ = store.Commit() + } + } + sort.SliceStable(changeSets, func(i, j int) bool { + return changeSets[i].Name < changeSets[j].Name + }) + hash, v, err := rs.db.Commit(changeSets) + if err != nil { + panic(err) } - - rs.lastCommitInfo = commitStores(version, rs.stores, nil) - - // TODO persist to disk return types.CommitID{ - Version: version, - Hash: rs.lastCommitInfo.Hash(), + Version: v, + Hash: hash, } } // Implements interface Committer func (rs *Store) LastCommitID() types.CommitID { - return rs.lastCommitInfo.CommitID() + return rs.db.LastCommitInfo().CommitID() } // Implements interface Committer @@ -134,22 +132,12 @@ func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStor // Implements interface MultiStore func (rs *Store) GetStore(key types.StoreKey) types.Store { - return rs.GetKVStore(key) + panic("uncached KVStore is not supposed to be accessed directly") } // Implements interface MultiStore func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore { - s := rs.stores[key] - if s == nil { - panic(fmt.Sprintf("store does not exist for key: %s", key.Name())) - } - store := types.KVStore(s) - - if rs.ListeningEnabled(key) { - store = listenkv.NewStore(store, key, rs.listeners[key]) - } - - return store + panic("uncached KVStore is not supposed to be accessed directly") } // Implements interface MultiStore @@ -169,7 +157,7 @@ func (rs *Store) SetTracingContext(types.TraceContext) types.MultiStore { // Implements interface MultiStore func (rs *Store) LatestVersion() int64 { - return rs.lastCommitInfo.Version + return rs.db.Version() } // Implements interface Snapshotter @@ -229,28 +217,6 @@ func (rs *Store) LoadLatestVersion() error { // Implements interface CommitMultiStore // used by node startup with UpgradeStoreLoader func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) error { - cInfo := &types.CommitInfo{} - bz, err := os.ReadFile(filepath.Join(rs.dir, CommitInfoFileName)) - if err != nil { - // if file not exists, assume empty db - if !os.IsNotExist(err) { - return errors.Wrap(err, "fail to read commit info file") - } - } else { - if err := cInfo.Unmarshal(bz); err != nil { - return errors.Wrap(err, "failed unmarshal commit info") - } - } - - infos := make(map[string]types.StoreInfo) - // convert StoreInfos slice to map - for _, storeInfo := range cInfo.StoreInfos { - infos[storeInfo.Name] = storeInfo - } - - // load each Store (note this doesn't panic on unmounted keys now) - newStores := make(map[types.StoreKey]types.CommitKVStore) - storesKeys := make([]types.StoreKey, 0, len(rs.storesParams)) for key := range rs.storesParams { storesKeys = append(storesKeys, key) @@ -260,51 +226,59 @@ func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) erro return storesKeys[i].Name() < storesKeys[j].Name() }) - var ( - commitID types.CommitID - ) - for _, key := range storesKeys { - storeParams := rs.storesParams[key] + initialStores := make([]string, len(storesKeys)) + for i, key := range storesKeys { + initialStores[i] = key.Name() + } + db, err := memiavl.Load(rs.dir, memiavl.Options{ + CreateIfMissing: true, + InitialStores: initialStores, + }) + if err != nil { + return err + } - if info, ok := infos[key.Name()]; !ok { - commitID = info.CommitId - } else { - commitID = types.CommitID{} + var treeUpgrades []*memiavl.TreeNameUpgrade + for _, key := range storesKeys { + switch { + case upgrades.IsDeleted(key.Name()): + treeUpgrades = append(treeUpgrades, &memiavl.TreeNameUpgrade{Name: key.Name(), Delete: true}) + case upgrades.IsAdded(key.Name()) || upgrades.RenamedFrom(key.Name()) != "": + treeUpgrades = append(treeUpgrades, &memiavl.TreeNameUpgrade{Name: key.Name(), RenameFrom: upgrades.RenamedFrom(key.Name())}) + default: + return errors.New("invalid upgrade specification") } + } - // If it has been added, set the initial version - if upgrades.IsAdded(key.Name()) || upgrades.RenamedFrom(key.Name()) != "" { - storeParams.initialVersion = uint64(cInfo.Version) + 1 - } else if commitID.Version != cInfo.Version && storeParams.typ == types.StoreTypeIAVL { - return fmt.Errorf("version of store %s mismatch root store's version; expected %d got %d", key.Name(), cInfo.Version, commitID.Version) + if len(treeUpgrades) > 0 { + if err := db.ApplyUpgrades(treeUpgrades); err != nil { + return err } + } - store, err := rs.loadCommitStoreFromParams(key, commitID, storeParams) + newStores := make(map[types.StoreKey]types.CommitKVStore, len(storesKeys)) + for _, key := range storesKeys { + newStores[key], err = rs.loadCommitStoreFromParams(db, key, rs.storesParams[key]) if err != nil { - return errors.Wrap(err, "failed to load store") - } - - newStores[key] = store - // If it was deleted, remove all data - if upgrades.IsDeleted(key.Name()) { - // TODO efficient deletion - } else if oldName := upgrades.RenamedFrom(key.Name()); oldName != "" { - // TODO efficient rename + return err } } - rs.lastCommitInfo = cInfo + rs.db = db rs.stores = newStores return nil } -func (rs *Store) loadCommitStoreFromParams(key types.StoreKey, id types.CommitID, params storeParams) (types.CommitKVStore, error) { +func (rs *Store) loadCommitStoreFromParams(db *memiavl.DB, key types.StoreKey, params storeParams) (types.CommitKVStore, error) { switch params.typ { case types.StoreTypeMulti: panic("recursive MultiStores not yet supported") case types.StoreTypeIAVL: - dir := filepath.Join(rs.dir, key.Name()) - return memiavlstore.LoadStoreWithInitialVersion(dir, rs.logger, int64(params.initialVersion)) + tree := db.TreeByName(key.Name()) + if tree == nil { + return nil, fmt.Errorf("new store is not added in upgrades") + } + return memiavlstore.New(tree, rs.logger), nil case types.StoreTypeDB: panic("recursive MultiStores not yet supported") case types.StoreTypeTransient: @@ -349,20 +323,7 @@ func (rs *Store) SetInterBlockCache(_ types.MultiStorePersistentCache) { // Implements interface CommitMultiStore // used by InitChain when the initial height is bigger than 1 func (rs *Store) SetInitialVersion(version int64) error { - rs.initialVersion = version - - // Loop through all the stores, if it's an IAVL store, then set initial - // version on it. - for key, store := range rs.stores { - if store.GetStoreType() == types.StoreTypeIAVL { - // If the store is wrapped with an inter-block cache, we must first unwrap - // it to get the underlying IAVL store. - store = rs.GetCommitKVStore(key) - store.(types.StoreWithInitialVersion).SetInitialVersion(version) - } - } - - return nil + return rs.db.SetInitialVersion(version) } // Implements interface CommitMultiStore @@ -414,40 +375,3 @@ func newStoreParams(key types.StoreKey, db dbm.DB, typ types.StoreType, initialV initialVersion: initialVersion, } } - -// Commits each store and returns a new commitInfo. -func commitStores(version int64, storeMap map[types.StoreKey]types.CommitKVStore, removalMap map[types.StoreKey]bool) *types.CommitInfo { - storeInfos := make([]types.StoreInfo, 0, len(storeMap)) - - for key, store := range storeMap { - last := store.LastCommitID() - - // If a commit event execution is interrupted, a new iavl store's version will be larger than the rootmulti's metadata, when the block is replayed, we should avoid committing that iavl store again. - var commitID types.CommitID - if last.Version >= version { - last.Version = version - commitID = last - } else { - commitID = store.Commit() - } - if store.GetStoreType() == types.StoreTypeTransient { - continue - } - - if !removalMap[key] { - si := types.StoreInfo{} - si.Name = key.Name() - si.CommitId = commitID - storeInfos = append(storeInfos, si) - } - } - - sort.SliceStable(storeInfos, func(i, j int) bool { - return strings.Compare(storeInfos[i].Name, storeInfos[j].Name) < 0 - }) - - return &types.CommitInfo{ - Version: version, - StoreInfos: storeInfos, - } -} From 93d223393cc59e21abb1a374a527522e6b860f69 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 14 Apr 2023 12:49:47 +0800 Subject: [PATCH 07/30] fix startup --- app/app.go | 2 +- memiavl/db.go | 4 ++-- store/rootmulti/store.go | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/app.go b/app/app.go index baa110b16f..2dcc6a9d2d 100644 --- a/app/app.go +++ b/app/app.go @@ -347,7 +347,7 @@ func New( bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) if cast.ToBool(appOpts.Get(FlagMemIAVL)) { - bApp.SetCMS(rootmulti.NewStore(filepath.Join(homePath, "memiavl.db"), logger)) + bApp.SetCMS(rootmulti.NewStore(filepath.Join(homePath, "data", "memiavl.db"), logger)) } bApp.SetCommitMultiStoreTracer(traceStore) diff --git a/memiavl/db.go b/memiavl/db.go index 6ba00f114a..28b5d1efe7 100644 --- a/memiavl/db.go +++ b/memiavl/db.go @@ -233,7 +233,7 @@ func (db *DB) RewriteSnapshot() error { return err } tmpLink := currentTmpPath(db.dir) - if err := os.Symlink(snapshotDir, tmpLink); err != nil { + if err := os.Symlink(filepath.Base(snapshotDir), tmpLink); err != nil { return err } // assuming file renaming operation is atomic @@ -342,7 +342,7 @@ func initEmptyDB(dir string, initialVersion uint32) error { return err } tmpPath := currentTmpPath(dir) - if err := os.Symlink(snapshotDir, tmpPath); err != nil { + if err := os.Symlink(filepath.Base(snapshotDir), tmpPath); err != nil { return err } return os.Rename(tmpPath, currentPath(dir)) diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index dae9795153..7b176b74f0 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -235,7 +235,7 @@ func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) erro InitialStores: initialStores, }) if err != nil { - return err + return errors.Wrapf(err, "fail to load memiavl at %s", rs.dir) } var treeUpgrades []*memiavl.TreeNameUpgrade @@ -245,8 +245,6 @@ func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) erro treeUpgrades = append(treeUpgrades, &memiavl.TreeNameUpgrade{Name: key.Name(), Delete: true}) case upgrades.IsAdded(key.Name()) || upgrades.RenamedFrom(key.Name()) != "": treeUpgrades = append(treeUpgrades, &memiavl.TreeNameUpgrade{Name: key.Name(), RenameFrom: upgrades.RenamedFrom(key.Name())}) - default: - return errors.New("invalid upgrade specification") } } From 6465a821413fd6b16eb3509a23f5b6cd30e5c6d6 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 14 Apr 2023 14:50:06 +0800 Subject: [PATCH 08/30] fix app hash --- memiavl/multitree.go | 4 +-- store/rootmulti/store.go | 61 +++++++++++++++++++++++++++++++--------- 2 files changed, 50 insertions(+), 15 deletions(-) diff --git a/memiavl/multitree.go b/memiavl/multitree.go index 9a040e638c..1112e7ee7f 100644 --- a/memiavl/multitree.go +++ b/memiavl/multitree.go @@ -172,8 +172,8 @@ func (t *MultiTree) Version() int64 { return t.lastCommitInfo.Version } -func (t *MultiTree) LastCommitInfo() storetypes.CommitInfo { - return t.lastCommitInfo +func (t *MultiTree) LastCommitInfo() *storetypes.CommitInfo { + return &t.lastCommitInfo } // ApplyUpgrades store name upgrades diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 7b176b74f0..b686a4795b 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -32,6 +32,9 @@ type Store struct { db *memiavl.DB logger log.Logger + // to keep it comptaible with cosmos-sdk 0.46, merge the memstores into commit info + lastCommitInfo *types.CommitInfo + storesParams map[types.StoreKey]storeParams keysByName map[string]types.StoreKey stores map[types.StoreKey]types.CommitKVStore @@ -55,33 +58,39 @@ func NewStore(dir string, logger log.Logger) *Store { // Implements interface Committer func (rs *Store) Commit() types.CommitID { var changeSets []*memiavl.NamedChangeSet - for storeKey, store := range rs.stores { + var extraStoreInfos []types.StoreInfo + for key, store := range rs.stores { if memiavlStore, ok := store.(*memiavlstore.Store); ok { changeSets = append(changeSets, &memiavl.NamedChangeSet{ - Name: storeKey.Name(), + Name: key.Name(), Changeset: memiavlStore.PopChangeSet(), }) } else { - _ = store.Commit() + commitID := store.Commit() + // to keep the root hash compatible with cosmos-sdk 0.46 + if store.GetStoreType() != types.StoreTypeTransient { + si := types.StoreInfo{ + Name: key.Name(), + CommitId: commitID, + } + extraStoreInfos = append(extraStoreInfos, si) + } } } sort.SliceStable(changeSets, func(i, j int) bool { return changeSets[i].Name < changeSets[j].Name }) - hash, v, err := rs.db.Commit(changeSets) + _, _, err := rs.db.Commit(changeSets) if err != nil { panic(err) } - - return types.CommitID{ - Version: v, - Hash: hash, - } + rs.lastCommitInfo = mergeStoreInfos(rs.db.LastCommitInfo(), extraStoreInfos) + return rs.lastCommitInfo.CommitID() } // Implements interface Committer func (rs *Store) LastCommitID() types.CommitID { - return rs.db.LastCommitInfo().CommitID() + return rs.lastCommitInfo.CommitID() } // Implements interface Committer @@ -226,9 +235,20 @@ func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) erro return storesKeys[i].Name() < storesKeys[j].Name() }) - initialStores := make([]string, len(storesKeys)) - for i, key := range storesKeys { - initialStores[i] = key.Name() + initialStores := make([]string, 0, len(storesKeys)) + var extraStoreInfos []types.StoreInfo + for _, key := range storesKeys { + switch rs.storesParams[key].typ { + case types.StoreTypeIAVL: + initialStores = append(initialStores, key.Name()) + case types.StoreTypeTransient: + continue + default: + extraStoreInfos = append(extraStoreInfos, types.StoreInfo{ + Name: key.Name(), + CommitId: types.CommitID{}, + }) + } } db, err := memiavl.Load(rs.dir, memiavl.Options{ CreateIfMissing: true, @@ -264,6 +284,8 @@ func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) erro rs.db = db rs.stores = newStores + // to keep the root hash compatible with cosmos-sdk 0.46 + rs.lastCommitInfo = mergeStoreInfos(db.LastCommitInfo(), extraStoreInfos) return nil } @@ -373,3 +395,16 @@ func newStoreParams(key types.StoreKey, db dbm.DB, typ types.StoreType, initialV initialVersion: initialVersion, } } + +func mergeStoreInfos(commitInfo *types.CommitInfo, storeInfos []types.StoreInfo) *types.CommitInfo { + infos := make([]types.StoreInfo, 0, len(commitInfo.StoreInfos)+len(storeInfos)) + infos = append(infos, commitInfo.StoreInfos...) + infos = append(infos, storeInfos...) + sort.SliceStable(infos, func(i, j int) bool { + return infos[i].Name < infos[j].Name + }) + return &types.CommitInfo{ + Version: commitInfo.Version, + StoreInfos: infos, + } +} From d2c26aa8e642bf9f2d6b8e2976bb92ae7cb3682f Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 14 Apr 2023 15:21:42 +0800 Subject: [PATCH 09/30] fix initial commit info --- store/rootmulti/store.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index b686a4795b..881120fb56 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -285,7 +285,11 @@ func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) erro rs.db = db rs.stores = newStores // to keep the root hash compatible with cosmos-sdk 0.46 - rs.lastCommitInfo = mergeStoreInfos(db.LastCommitInfo(), extraStoreInfos) + if db.Version() != 0 { + rs.lastCommitInfo = mergeStoreInfos(db.LastCommitInfo(), extraStoreInfos) + } else { + rs.lastCommitInfo = &types.CommitInfo{} + } return nil } From 81b44b5289794a34610a8dfadd05dffd45df6871 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 14 Apr 2023 15:44:20 +0800 Subject: [PATCH 10/30] cleanup and fix lint --- memiavl/multitree.go | 3 +++ memiavl/tree.go | 5 +---- store/rootmulti/store.go | 25 ++++++++----------------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/memiavl/multitree.go b/memiavl/multitree.go index 1112e7ee7f..bdb96f10e5 100644 --- a/memiavl/multitree.go +++ b/memiavl/multitree.go @@ -217,6 +217,9 @@ func (t *MultiTree) ApplyUpgrades(upgrades []*TreeNameUpgrade) error { }) t.treesByName = make(map[string]int, len(t.trees)) for i, tree := range t.trees { + if _, ok := t.treesByName[tree.name]; ok { + return fmt.Errorf("memiavl tree name conflicts: %s", tree.name) + } t.treesByName[tree.name] = i } diff --git a/memiavl/tree.go b/memiavl/tree.go index aa13dddaba..4db2e763b3 100644 --- a/memiavl/tree.go +++ b/memiavl/tree.go @@ -135,10 +135,7 @@ func (t *Tree) Get(key []byte) []byte { } func (t *Tree) Has(key []byte) bool { - if t.Get(key) == nil { - return false - } - return true + return t.Get(key) != nil } func (t *Tree) Iterator(start, end []byte, ascending bool) dbm.Iterator { diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 881120fb56..a61872e448 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -23,9 +23,7 @@ import ( const CommitInfoFileName = "commit_infos" -var ( - _ types.CommitMultiStore = (*Store)(nil) -) +var _ types.CommitMultiStore = (*Store)(nil) type Store struct { dir string @@ -39,8 +37,6 @@ type Store struct { keysByName map[string]types.StoreKey stores map[types.StoreKey]types.CommitKVStore listeners map[types.StoreKey][]types.WriteListener - - initialVersion int64 } func NewStore(dir string, logger log.Logger) *Store { @@ -192,7 +188,7 @@ func (rs *Store) SetSnapshotInterval(snapshotInterval uint64) { } // Implements interface CommitMultiStore -func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, db dbm.DB) { +func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, _ dbm.DB) { if key == nil { panic("MountIAVLStore() key cannot be nil") } @@ -202,9 +198,8 @@ func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, db db if _, ok := rs.keysByName[key.Name()]; ok { panic(fmt.Sprintf("store duplicate store key name %v", key)) } - rs.storesParams[key] = newStoreParams(key, db, typ, 0) + rs.storesParams[key] = newStoreParams(key, typ) rs.keysByName[key.Name()] = key - } // Implements interface CommitMultiStore @@ -385,18 +380,14 @@ func (rs *Store) AddListeners(key types.StoreKey, listeners []types.WriteListene } type storeParams struct { - key types.StoreKey - db dbm.DB - typ types.StoreType - initialVersion uint64 + key types.StoreKey + typ types.StoreType } -func newStoreParams(key types.StoreKey, db dbm.DB, typ types.StoreType, initialVersion uint64) storeParams { +func newStoreParams(key types.StoreKey, typ types.StoreType) storeParams { return storeParams{ - key: key, - db: db, - typ: typ, - initialVersion: initialVersion, + key: key, + typ: typ, } } From f6c01c84434cdb6fea887e1aa7e732078eb81afd Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 14 Apr 2023 15:50:08 +0800 Subject: [PATCH 11/30] use sdk 0.46.12 --- go.mod | 4 ++-- go.sum | 4 ++-- gomod2nix.toml | 4 ++-- integration_tests/test_versiondb.py | 2 ++ memiavl/go.mod | 2 +- memiavl/go.sum | 4 ++-- store/go.mod | 2 +- store/go.sum | 4 ++-- versiondb/go.mod | 2 +- versiondb/go.sum | 4 ++-- 10 files changed, 17 insertions(+), 15 deletions(-) diff --git a/go.mod b/go.mod index 226ca37d38..426bc94af9 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( cosmossdk.io/errors v1.0.0-beta.7 cosmossdk.io/math v1.0.0-beta.4 github.com/armon/go-metrics v0.4.1 - github.com/cosmos/cosmos-sdk v0.46.11 + github.com/cosmos/cosmos-sdk v0.46.12 github.com/cosmos/gogoproto v1.4.7 github.com/cosmos/ibc-go/v5 v5.2.0 github.com/crypto-org-chain/cronos/store v0.0.0 @@ -225,7 +225,7 @@ replace ( github.com/cometbft/cometbft-db => github.com/crypto-org-chain/cometbft-db v0.0.0-20230412133340-ac70df4b45f6 // Ref: https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702 github.com/confio/ics23/go => github.com/confio/ics23/go v0.9.0 - github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.12-0.20230403092311-152465bd0ca7 + github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.12 github.com/crypto-org-chain/cronos/memiavl => ./memiavl github.com/crypto-org-chain/cronos/store => ./store github.com/crypto-org-chain/cronos/versiondb => ./versiondb diff --git a/go.sum b/go.sum index 319e8528a8..dd0adc5a23 100644 --- a/go.sum +++ b/go.sum @@ -409,8 +409,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= -github.com/cosmos/cosmos-sdk v0.46.12-0.20230403092311-152465bd0ca7 h1:NhJVy00Q2PDTjxufX7f8Byy/qkS2Kl9YezOYosdXMhI= -github.com/cosmos/cosmos-sdk v0.46.12-0.20230403092311-152465bd0ca7/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= +github.com/cosmos/cosmos-sdk v0.46.12 h1:M3LAKjCDqseJUkSIAJD/PUGeMsRq1Jf0GX+MocHVjrM= +github.com/cosmos/cosmos-sdk v0.46.12/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= diff --git a/gomod2nix.toml b/gomod2nix.toml index bfb43fa5d4..35a845658b 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -137,8 +137,8 @@ schema = 3 version = "v1.0.0-beta.1" hash = "sha256-oATkuj+fM5eBn+ywO+w/tL0AFSIEkx0J3Yz+VhVe0QA=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.46.12-0.20230403092311-152465bd0ca7" - hash = "sha256-pxjj8RzbtYoJ3mRqSze33piQBZHVCB4Qk0iOgqtbdHw=" + version = "v0.46.12" + hash = "sha256-0ZdWZr3qYfOpwQ5ztsmGOGltI8tmZFwTTzS8v11xfSQ=" replaced = "github.com/cosmos/cosmos-sdk" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" diff --git a/integration_tests/test_versiondb.py b/integration_tests/test_versiondb.py index 35970a623b..e6e7e29630 100644 --- a/integration_tests/test_versiondb.py +++ b/integration_tests/test_versiondb.py @@ -1,4 +1,5 @@ import shutil +import pytest import tempfile import tomlkit @@ -8,6 +9,7 @@ from .utils import ADDRS, send_transaction, wait_for_port +@pytest.marker.skip def test_versiondb_migration(cronos: Cronos): """ test versiondb migration commands. diff --git a/memiavl/go.mod b/memiavl/go.mod index a413d09e6b..bb629cb2e5 100644 --- a/memiavl/go.mod +++ b/memiavl/go.mod @@ -3,7 +3,7 @@ module github.com/crypto-org-chain/cronos/memiavl go 1.20 require ( - github.com/cosmos/cosmos-sdk v0.46.11 + github.com/cosmos/cosmos-sdk v0.46.12 github.com/cosmos/gogoproto v1.4.7 github.com/cosmos/iavl v0.19.6-0.20230410112350-e1e212a3a3aa github.com/gogo/protobuf v1.3.2 diff --git a/memiavl/go.sum b/memiavl/go.sum index c519f89b7b..47f8af0ed7 100644 --- a/memiavl/go.sum +++ b/memiavl/go.sum @@ -116,8 +116,8 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= -github.com/cosmos/cosmos-sdk v0.46.11 h1:csMJQHtcb/EIu2EJmeg/2NaGkGw3ZScFwa4CRpCCw18= -github.com/cosmos/cosmos-sdk v0.46.11/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= +github.com/cosmos/cosmos-sdk v0.46.12 h1:M3LAKjCDqseJUkSIAJD/PUGeMsRq1Jf0GX+MocHVjrM= +github.com/cosmos/cosmos-sdk v0.46.12/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/gogoproto v1.4.7 h1:RzYKVnsEC7UIkDnhTIkqEB7LnIQbsySvmNEqPCiPevk= github.com/cosmos/gogoproto v1.4.7/go.mod h1:gxGePp9qedovvl/StQL2BIJ6qlIBn1+9YxR0IulGBKA= diff --git a/store/go.mod b/store/go.mod index e4196b4205..d7a376ce05 100644 --- a/store/go.mod +++ b/store/go.mod @@ -3,7 +3,7 @@ module github.com/crypto-org-chain/cronos/store go 1.20 require ( - github.com/cosmos/cosmos-sdk v0.46.11 + github.com/cosmos/cosmos-sdk v0.46.12 github.com/cosmos/iavl v0.19.6-0.20230410112350-e1e212a3a3aa github.com/crypto-org-chain/cronos/memiavl v0.0.1 github.com/gogo/protobuf v1.3.2 diff --git a/store/go.sum b/store/go.sum index 09693028e6..49cb86c65f 100644 --- a/store/go.sum +++ b/store/go.sum @@ -47,8 +47,8 @@ github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8Nz github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/cosmos-proto v1.0.0-alpha7 h1:yqYUOHF2jopwZh4dVQp3xgqwftE5/2hkrwIV6vkUbO0= -github.com/cosmos/cosmos-sdk v0.46.11 h1:csMJQHtcb/EIu2EJmeg/2NaGkGw3ZScFwa4CRpCCw18= -github.com/cosmos/cosmos-sdk v0.46.11/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= +github.com/cosmos/cosmos-sdk v0.46.12 h1:M3LAKjCDqseJUkSIAJD/PUGeMsRq1Jf0GX+MocHVjrM= +github.com/cosmos/cosmos-sdk v0.46.12/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/gogoproto v1.4.7 h1:RzYKVnsEC7UIkDnhTIkqEB7LnIQbsySvmNEqPCiPevk= github.com/cosmos/gogoproto v1.4.7/go.mod h1:gxGePp9qedovvl/StQL2BIJ6qlIBn1+9YxR0IulGBKA= diff --git a/versiondb/go.mod b/versiondb/go.mod index 7b0f55b997..4bebf88109 100644 --- a/versiondb/go.mod +++ b/versiondb/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( cosmossdk.io/errors v1.0.0-beta.7 github.com/alitto/pond v1.8.2 - github.com/cosmos/cosmos-sdk v0.46.11 + github.com/cosmos/cosmos-sdk v0.46.12 github.com/cosmos/iavl v0.19.6-0.20230410112350-e1e212a3a3aa github.com/crypto-org-chain/cronos/memiavl v0.0.1 github.com/gogo/protobuf v1.3.3 diff --git a/versiondb/go.sum b/versiondb/go.sum index 23bd88b4c8..c32e503731 100644 --- a/versiondb/go.sum +++ b/versiondb/go.sum @@ -234,8 +234,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0= github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE= -github.com/cosmos/cosmos-sdk v0.46.11 h1:csMJQHtcb/EIu2EJmeg/2NaGkGw3ZScFwa4CRpCCw18= -github.com/cosmos/cosmos-sdk v0.46.11/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= +github.com/cosmos/cosmos-sdk v0.46.12 h1:M3LAKjCDqseJUkSIAJD/PUGeMsRq1Jf0GX+MocHVjrM= +github.com/cosmos/cosmos-sdk v0.46.12/go.mod h1:bG4AkW9bqc8ycrryyKGQEl3YV9BY2wr6HggGq8kvcgM= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= From 5745c63eb9203f07bc2f4302b7e77616bcb09832 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 14 Apr 2023 15:57:58 +0800 Subject: [PATCH 12/30] fix python lint --- integration_tests/test_versiondb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/test_versiondb.py b/integration_tests/test_versiondb.py index e6e7e29630..2c7bf0ad6b 100644 --- a/integration_tests/test_versiondb.py +++ b/integration_tests/test_versiondb.py @@ -1,7 +1,7 @@ import shutil -import pytest import tempfile +import pytest import tomlkit from pystarport import ports From 2e0034f68e0799365f1d734be4743f7982fac324 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Fri, 14 Apr 2023 16:11:53 +0800 Subject: [PATCH 13/30] skip versiondb test for now --- integration_tests/test_versiondb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/test_versiondb.py b/integration_tests/test_versiondb.py index 2c7bf0ad6b..7070eff905 100644 --- a/integration_tests/test_versiondb.py +++ b/integration_tests/test_versiondb.py @@ -9,7 +9,7 @@ from .utils import ADDRS, send_transaction, wait_for_port -@pytest.marker.skip +@pytest.mark.skip(reason="adjust the test to memiavl later") def test_versiondb_migration(cronos: Cronos): """ test versiondb migration commands. From 4b8f28415721a90615ccf0cd8bceb5e9d3203d17 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Sat, 15 Apr 2023 17:53:00 +0800 Subject: [PATCH 14/30] don't test file_streamer --- integration_tests/configs/default.jsonnet | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/integration_tests/configs/default.jsonnet b/integration_tests/configs/default.jsonnet index 3c03f246e5..00b82ae91b 100644 --- a/integration_tests/configs/default.jsonnet +++ b/integration_tests/configs/default.jsonnet @@ -21,14 +21,6 @@ 'block-range-cap': 10000, 'logs-cap': 10000, }, - store: { - streamers: ['file'], - }, - streamers: { - file: { - write_dir: 'data/file_streamer', - }, - }, }, validators: [{ coins: '1000000000000000000stake,10000000000000000000000basetcro', @@ -37,7 +29,7 @@ 'app-config': { memiavl: true, store: { - streamers: ['file', 'versiondb'], + streamers: ['versiondb'], }, }, }, { From e44c91d788c3f2490eada7fc72b9f3cc22e5bd5a Mon Sep 17 00:00:00 2001 From: HuangYi Date: Sun, 16 Apr 2023 07:36:40 +0800 Subject: [PATCH 15/30] skip file streamer test --- integration_tests/test_streamer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration_tests/test_streamer.py b/integration_tests/test_streamer.py index d003e4c0ed..c7c4f31d76 100644 --- a/integration_tests/test_streamer.py +++ b/integration_tests/test_streamer.py @@ -1,3 +1,4 @@ +import pytest from cprotobuf import Field, ProtoEntity, decode_primitive from hexbytes import HexBytes @@ -31,6 +32,7 @@ def decode_stream_file(data, entry_cls=StoreKVPairs): return items +@pytest.mark.skip(reason="file streamer is not useful for now") def test_streamers(cronos): """ - check the streaming files are created From 1631131cce05e9d506f520a3128ab5c37553d07a Mon Sep 17 00:00:00 2001 From: HuangYi Date: Mon, 17 Apr 2023 11:36:38 +0800 Subject: [PATCH 16/30] support abci query and fix ibc tests --- memiavl/db.go | 8 +- memiavl/db_test.go | 34 +++++++++ memiavl/iterator_test.go | 72 ++---------------- memiavl/multitree.go | 16 +++- memiavl/tree_test.go | 65 +++++++++++++++- store/memiavlstore/store.go | 80 ++++++++++++++++++++ store/rootmulti/store.go | 143 +++++++++++++++++++++++++++++------- 7 files changed, 319 insertions(+), 99 deletions(-) diff --git a/memiavl/db.go b/memiavl/db.go index 28b5d1efe7..950f763d03 100644 --- a/memiavl/db.go +++ b/memiavl/db.go @@ -48,6 +48,8 @@ type Options struct { // the initial stores when initialize the empty instance InitialStores []string SnapshotKeepRecent uint32 + // load the target version instead of latest version + TargetVersion uint32 } const ( @@ -74,7 +76,7 @@ func Load(dir string, opts Options) (*DB, error) { return nil, err } - if err := mtree.CatchupWAL(wal); err != nil { + if err := mtree.CatchupWAL(wal, int64(opts.TargetVersion)); err != nil { return nil, err } @@ -143,7 +145,7 @@ func (db *DB) cleanupSnapshotRewrite() (bool, error) { } // snapshot rewrite succeeded, catchup and switch - if err := result.mtree.CatchupWAL(db.wal); err != nil { + if err := result.mtree.CatchupWAL(db.wal, 0); err != nil { return true, fmt.Errorf("catchup failed: %w", err) } if err := db.reloadMultiTree(result.mtree); err != nil { @@ -291,7 +293,7 @@ func (db *DB) RewriteSnapshotBackground() error { return } // do a best effort catch-up first, will try catch-up again in main thread. - if err := mtree.CatchupWAL(wal); err != nil { + if err := mtree.CatchupWAL(wal, 0); err != nil { ch <- snapshotResult{err: err} return } diff --git a/memiavl/db_test.go b/memiavl/db_test.go index 8e94c20405..671ab44ded 100644 --- a/memiavl/db_test.go +++ b/memiavl/db_test.go @@ -206,3 +206,37 @@ func TestInitialVersion(t *testing.T) { require.Equal(t, hex.EncodeToString(info.CommitId.Hash), hex.EncodeToString(info2.CommitId.Hash)) } } + +func TestLoadVersion(t *testing.T) { + dir := t.TempDir() + db, err := Load(dir, Options{ + CreateIfMissing: true, + InitialStores: []string{"test"}, + }) + require.NoError(t, err) + + for i, changes := range ChangeSets { + cs := []*NamedChangeSet{ + { + Name: "test", + Changeset: changes, + }, + } + t.Run(strconv.Itoa(i), func(t *testing.T) { + _, _, err := db.Commit(cs) + require.NoError(t, err) + }) + } + + for v, expItems := range ExpectItems { + if v == 0 { + continue + } + tmp, err := Load(dir, Options{ + TargetVersion: uint32(v), + }) + require.NoError(t, err) + require.Equal(t, RefHashes[v-1], tmp.TreeByName("test").RootHash()) + require.Equal(t, expItems, collectIter(tmp.TreeByName("test").Iterator(nil, nil, true))) + } +} diff --git a/memiavl/iterator_test.go b/memiavl/iterator_test.go index 4b887de65e..30784c1021 100644 --- a/memiavl/iterator_test.go +++ b/memiavl/iterator_test.go @@ -8,74 +8,14 @@ import ( ) func TestIterator(t *testing.T) { - expItems := [][]pair{ - {}, - {{[]byte("hello"), []byte("world")}}, - { - {[]byte("hello"), []byte("world1")}, - {[]byte("hello1"), []byte("world1")}, - }, - { - {[]byte("hello"), []byte("world1")}, - {[]byte("hello1"), []byte("world1")}, - {[]byte("hello2"), []byte("world1")}, - {[]byte("hello3"), []byte("world1")}, - }, - { - {[]byte("hello"), []byte("world1")}, - {[]byte("hello00"), []byte("world1")}, - {[]byte("hello1"), []byte("world1")}, - {[]byte("hello2"), []byte("world1")}, - {[]byte("hello3"), []byte("world1")}, - }, - { - {[]byte("hello00"), []byte("world1")}, - {[]byte("hello1"), []byte("world1")}, - {[]byte("hello2"), []byte("world1")}, - {[]byte("hello3"), []byte("world1")}, - }, - { - {[]byte("aello00"), []byte("world1")}, - {[]byte("aello01"), []byte("world1")}, - {[]byte("aello02"), []byte("world1")}, - {[]byte("aello03"), []byte("world1")}, - {[]byte("aello04"), []byte("world1")}, - {[]byte("aello05"), []byte("world1")}, - {[]byte("aello06"), []byte("world1")}, - {[]byte("aello07"), []byte("world1")}, - {[]byte("aello08"), []byte("world1")}, - {[]byte("aello09"), []byte("world1")}, - {[]byte("aello10"), []byte("world1")}, - {[]byte("aello11"), []byte("world1")}, - {[]byte("aello12"), []byte("world1")}, - {[]byte("aello13"), []byte("world1")}, - {[]byte("aello14"), []byte("world1")}, - {[]byte("aello15"), []byte("world1")}, - {[]byte("aello16"), []byte("world1")}, - {[]byte("aello17"), []byte("world1")}, - {[]byte("aello18"), []byte("world1")}, - {[]byte("aello19"), []byte("world1")}, - {[]byte("aello20"), []byte("world1")}, - {[]byte("hello00"), []byte("world1")}, - {[]byte("hello1"), []byte("world1")}, - {[]byte("hello2"), []byte("world1")}, - {[]byte("hello3"), []byte("world1")}, - }, - { - {[]byte("hello1"), []byte("world1")}, - {[]byte("hello2"), []byte("world1")}, - {[]byte("hello3"), []byte("world1")}, - }, - } - tree := NewEmptyTree(0) - require.Equal(t, expItems[0], collect(tree.Iterator(nil, nil, true))) + require.Equal(t, ExpectItems[0], collectIter(tree.Iterator(nil, nil, true))) for _, changes := range ChangeSets { _, v, err := tree.ApplyChangeSet(changes, true) require.NoError(t, err) - require.Equal(t, expItems[v], collect(tree.Iterator(nil, nil, true))) - require.Equal(t, reverse(expItems[v]), collect(tree.Iterator(nil, nil, false))) + require.Equal(t, ExpectItems[v], collectIter(tree.Iterator(nil, nil, true))) + require.Equal(t, reverse(ExpectItems[v]), collectIter(tree.Iterator(nil, nil, false))) } } @@ -93,15 +33,15 @@ func TestIteratorRange(t *testing.T) { {[]byte("aello08"), []byte("world1")}, {[]byte("aello09"), []byte("world1")}, } - require.Equal(t, expItems, collect(tree.Iterator([]byte("aello05"), []byte("aello10"), true))) - require.Equal(t, reverse(expItems), collect(tree.Iterator([]byte("aello05"), []byte("aello10"), false))) + require.Equal(t, expItems, collectIter(tree.Iterator([]byte("aello05"), []byte("aello10"), true))) + require.Equal(t, reverse(expItems), collectIter(tree.Iterator([]byte("aello05"), []byte("aello10"), false))) } type pair struct { key, value []byte } -func collect(iter dbm.Iterator) []pair { +func collectIter(iter dbm.Iterator) []pair { result := []pair{} for ; iter.Valid(); iter.Next() { result = append(result, pair{key: iter.Key(), value: iter.Value()}) diff --git a/memiavl/multitree.go b/memiavl/multitree.go index bdb96f10e5..9fbf41d074 100644 --- a/memiavl/multitree.go +++ b/memiavl/multitree.go @@ -48,6 +48,9 @@ type MultiTree struct { trees []NamedTree treesByName map[string]int // reversed index of the trees lastCommitInfo storetypes.CommitInfo + + // the initial metadata loaded from disk snapshot + metadata MultiTreeMetadata } func NewEmptyMultiTree(initialVersion uint32) *MultiTree { @@ -108,6 +111,7 @@ func LoadMultiTree(dir string) (*MultiTree, error) { trees: trees, treesByName: treesByName, lastCommitInfo: *metadata.CommitInfo, + metadata: metadata, } // initial version is nesserary for wal index conversion mtree.setInitialVersion(metadata.InitialVersion) @@ -293,7 +297,7 @@ func (t *MultiTree) UpdateCommitInfo() []byte { } // CatchupWAL replay the new entries in the WAL on the tree to catch-up to the latest state. -func (t *MultiTree) CatchupWAL(wal *wal.Log) error { +func (t *MultiTree) CatchupWAL(wal *wal.Log, endVersion int64) error { lastIndex, err := wal.LastIndex() if err != nil { return errors.Wrap(err, "read wal last index failed") @@ -305,7 +309,15 @@ func (t *MultiTree) CatchupWAL(wal *wal.Log) error { return nil } - for i := firstIndex; i <= lastIndex; i++ { + endIndex := lastIndex + if endVersion != 0 { + endIndex = walIndex(endVersion, t.initialVersion) + if endIndex > lastIndex || endIndex < firstIndex { + return fmt.Errorf("endIndex %d not in valid range: [%d, %d]", endIndex, firstIndex, lastIndex) + } + } + + for i := firstIndex; i <= endIndex; i++ { bz, err := wal.Read(i) if err != nil { return errors.Wrap(err, "read wal log failed") diff --git a/memiavl/tree_test.go b/memiavl/tree_test.go index 329c5817e2..e2d33836f6 100644 --- a/memiavl/tree_test.go +++ b/memiavl/tree_test.go @@ -11,8 +11,9 @@ import ( ) var ( - ChangeSets []iavl.ChangeSet - RefHashes [][]byte + ChangeSets []iavl.ChangeSet + RefHashes [][]byte + ExpectItems [][]pair ) func mockKVPairs(kvPairs ...string) []*iavl.KVPair { @@ -72,6 +73,66 @@ func init() { } RefHashes = append(RefHashes, refHash) } + + ExpectItems = [][]pair{ + {}, + {{[]byte("hello"), []byte("world")}}, + { + {[]byte("hello"), []byte("world1")}, + {[]byte("hello1"), []byte("world1")}, + }, + { + {[]byte("hello"), []byte("world1")}, + {[]byte("hello1"), []byte("world1")}, + {[]byte("hello2"), []byte("world1")}, + {[]byte("hello3"), []byte("world1")}, + }, + { + {[]byte("hello"), []byte("world1")}, + {[]byte("hello00"), []byte("world1")}, + {[]byte("hello1"), []byte("world1")}, + {[]byte("hello2"), []byte("world1")}, + {[]byte("hello3"), []byte("world1")}, + }, + { + {[]byte("hello00"), []byte("world1")}, + {[]byte("hello1"), []byte("world1")}, + {[]byte("hello2"), []byte("world1")}, + {[]byte("hello3"), []byte("world1")}, + }, + { + {[]byte("aello00"), []byte("world1")}, + {[]byte("aello01"), []byte("world1")}, + {[]byte("aello02"), []byte("world1")}, + {[]byte("aello03"), []byte("world1")}, + {[]byte("aello04"), []byte("world1")}, + {[]byte("aello05"), []byte("world1")}, + {[]byte("aello06"), []byte("world1")}, + {[]byte("aello07"), []byte("world1")}, + {[]byte("aello08"), []byte("world1")}, + {[]byte("aello09"), []byte("world1")}, + {[]byte("aello10"), []byte("world1")}, + {[]byte("aello11"), []byte("world1")}, + {[]byte("aello12"), []byte("world1")}, + {[]byte("aello13"), []byte("world1")}, + {[]byte("aello14"), []byte("world1")}, + {[]byte("aello15"), []byte("world1")}, + {[]byte("aello16"), []byte("world1")}, + {[]byte("aello17"), []byte("world1")}, + {[]byte("aello18"), []byte("world1")}, + {[]byte("aello19"), []byte("world1")}, + {[]byte("aello20"), []byte("world1")}, + {[]byte("hello00"), []byte("world1")}, + {[]byte("hello1"), []byte("world1")}, + {[]byte("hello2"), []byte("world1")}, + {[]byte("hello3"), []byte("world1")}, + }, + { + {[]byte("hello1"), []byte("world1")}, + {[]byte("hello2"), []byte("world1")}, + {[]byte("hello3"), []byte("world1")}, + }, + } } func applyChangeSetRef(t *iavl.MutableTree, changes iavl.ChangeSet) error { diff --git a/store/memiavlstore/store.go b/store/memiavlstore/store.go index 4c5dbbc6d5..374c685634 100644 --- a/store/memiavlstore/store.go +++ b/store/memiavlstore/store.go @@ -2,22 +2,29 @@ package memiavlstore import ( "bytes" + "fmt" "io" + ics23 "github.com/confio/ics23/go" "github.com/cosmos/cosmos-sdk/store/tracekv" "github.com/cosmos/iavl" "github.com/crypto-org-chain/cronos/memiavl" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" + tmcrypto "github.com/tendermint/tendermint/proto/tendermint/crypto" pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" "github.com/cosmos/cosmos-sdk/store/cachekv" "github.com/cosmos/cosmos-sdk/store/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/kv" ) var ( _ types.KVStore = (*Store)(nil) _ types.CommitStore = (*Store)(nil) _ types.CommitKVStore = (*Store)(nil) + _ types.Queryable = (*Store)(nil) ) // Store Implements types.KVStore and CommitKVStore. @@ -119,3 +126,76 @@ func (st *Store) PopChangeSet() iavl.ChangeSet { st.changeSet = iavl.ChangeSet{} return cs } + +func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) { + if req.Height > 0 && req.Height != st.tree.Version() { + return sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrInvalidHeight, "invalid height"), false) + } + + res.Height = st.tree.Version() + + switch req.Path { + case "/key": // get by key + res.Key = req.Data // data holds the key bytes + res.Value = st.tree.Get(res.Key) + + if !req.Prove { + break + } + + // get proof from tree and convert to merkle.Proof before adding to result + res.ProofOps = getProofFromTree(st.tree, req.Data, res.Value != nil) + case "/subspace": + pairs := kv.Pairs{ + Pairs: make([]kv.Pair, 0), + } + + subspace := req.Data + res.Key = subspace + + iterator := types.KVStorePrefixIterator(st, subspace) + for ; iterator.Valid(); iterator.Next() { + pairs.Pairs = append(pairs.Pairs, kv.Pair{Key: iterator.Key(), Value: iterator.Value()}) + } + iterator.Close() + + bz, err := pairs.Marshal() + if err != nil { + panic(fmt.Errorf("failed to marshal KV pairs: %w", err)) + } + + res.Value = bz + default: + return sdkerrors.QueryResult(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unexpected query path: %v", req.Path), false) + } + return +} + +// Takes a MutableTree, a key, and a flag for creating existence or absence proof and returns the +// appropriate merkle.Proof. Since this must be called after querying for the value, this function should never error +// Thus, it will panic on error rather than returning it +func getProofFromTree(tree *memiavl.Tree, key []byte, exists bool) *tmcrypto.ProofOps { + var ( + commitmentProof *ics23.CommitmentProof + err error + ) + + if exists { + // value was found + commitmentProof, err = tree.GetMembershipProof(key) + if err != nil { + // sanity check: If value was found, membership proof must be creatable + panic(fmt.Sprintf("unexpected value for empty proof: %s", err.Error())) + } + } else { + // value wasn't found + commitmentProof, err = tree.GetNonMembershipProof(key) + if err != nil { + // sanity check: If value wasn't found, nonmembership proof must be creatable + panic(fmt.Sprintf("unexpected error for nonexistence proof: %s", err.Error())) + } + } + + op := types.NewIavlCommitmentOp(key, commitmentProof) + return &tmcrypto.ProofOps{Ops: []tmcrypto.ProofOp{op.ProofOp()}} +} diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index a61872e448..49c2c784da 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -3,12 +3,16 @@ package rootmulti import ( "fmt" "io" + "math" "sort" + "strings" "github.com/cosmos/cosmos-sdk/store/listenkv" + "github.com/cosmos/cosmos-sdk/store/rootmulti" "github.com/crypto-org-chain/cronos/memiavl" "github.com/crypto-org-chain/cronos/store/memiavlstore" "github.com/pkg/errors" + abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" @@ -17,13 +21,17 @@ import ( "github.com/cosmos/cosmos-sdk/store/mem" "github.com/cosmos/cosmos-sdk/store/transient" "github.com/cosmos/cosmos-sdk/store/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" protoio "github.com/gogo/protobuf/io" dbm "github.com/tendermint/tm-db" ) const CommitInfoFileName = "commit_infos" -var _ types.CommitMultiStore = (*Store)(nil) +var ( + _ types.CommitMultiStore = (*Store)(nil) + _ types.Queryable = (*Store)(nil) +) type Store struct { dir string @@ -54,23 +62,12 @@ func NewStore(dir string, logger log.Logger) *Store { // Implements interface Committer func (rs *Store) Commit() types.CommitID { var changeSets []*memiavl.NamedChangeSet - var extraStoreInfos []types.StoreInfo for key, store := range rs.stores { if memiavlStore, ok := store.(*memiavlstore.Store); ok { changeSets = append(changeSets, &memiavl.NamedChangeSet{ Name: key.Name(), Changeset: memiavlStore.PopChangeSet(), }) - } else { - commitID := store.Commit() - // to keep the root hash compatible with cosmos-sdk 0.46 - if store.GetStoreType() != types.StoreTypeTransient { - si := types.StoreInfo{ - Name: key.Name(), - CommitId: commitID, - } - extraStoreInfos = append(extraStoreInfos, si) - } } } sort.SliceStable(changeSets, func(i, j int) bool { @@ -80,7 +77,7 @@ func (rs *Store) Commit() types.CommitID { if err != nil { panic(err) } - rs.lastCommitInfo = mergeStoreInfos(rs.db.LastCommitInfo(), extraStoreInfos) + rs.lastCommitInfo = amendCommitInfo(rs.db.LastCommitInfo(), rs.storesParams) return rs.lastCommitInfo.CommitID() } @@ -215,12 +212,21 @@ func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore { // Implements interface CommitMultiStore // used by normal node startup. func (rs *Store) LoadLatestVersion() error { - return rs.LoadLatestVersionAndUpgrade(nil) + return rs.LoadVersionAndUpgrade(0, nil) } // Implements interface CommitMultiStore -// used by node startup with UpgradeStoreLoader func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) error { + return rs.LoadVersionAndUpgrade(0, upgrades) +} + +// Implements interface CommitMultiStore +// used by node startup with UpgradeStoreLoader +func (rs *Store) LoadVersionAndUpgrade(version int64, upgrades *types.StoreUpgrades) error { + if version > math.MaxUint32 { + return fmt.Errorf("version overflows uint32: %d", version) + } + storesKeys := make([]types.StoreKey, 0, len(rs.storesParams)) for key := range rs.storesParams { storesKeys = append(storesKeys, key) @@ -248,6 +254,7 @@ func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) erro db, err := memiavl.Load(rs.dir, memiavl.Options{ CreateIfMissing: true, InitialStores: initialStores, + TargetVersion: uint32(version), }) if err != nil { return errors.Wrapf(err, "fail to load memiavl at %s", rs.dir) @@ -281,7 +288,7 @@ func (rs *Store) LoadLatestVersionAndUpgrade(upgrades *types.StoreUpgrades) erro rs.stores = newStores // to keep the root hash compatible with cosmos-sdk 0.46 if db.Version() != 0 { - rs.lastCommitInfo = mergeStoreInfos(db.LastCommitInfo(), extraStoreInfos) + rs.lastCommitInfo = amendCommitInfo(db.LastCommitInfo(), rs.storesParams) } else { rs.lastCommitInfo = &types.CommitInfo{} } @@ -320,19 +327,10 @@ func (rs *Store) loadCommitStoreFromParams(db *memiavl.DB, key types.StoreKey, p } } -// Implements interface CommitMultiStore -// not used in sdk -func (rs *Store) LoadVersionAndUpgrade(ver int64, upgrades *types.StoreUpgrades) error { - panic("rootmulti store don't support LoadVersionAndUpgrade") -} - // Implements interface CommitMultiStore // used by export cmd func (rs *Store) LoadVersion(ver int64) error { - if ver != 0 { - return errors.New("rootmulti store only support load the latest version") - } - return rs.LoadLatestVersion() + return rs.LoadVersionAndUpgrade(ver, nil) } // Implements interface CommitMultiStore @@ -379,6 +377,84 @@ func (rs *Store) AddListeners(key types.StoreKey, listeners []types.WriteListene } } +// getStoreByName performs a lookup of a StoreKey given a store name typically +// provided in a path. The StoreKey is then used to perform a lookup and return +// a Store. If the Store is wrapped in an inter-block cache, it will be unwrapped +// prior to being returned. If the StoreKey does not exist, nil is returned. +func (rs *Store) GetStoreByName(name string) types.Store { + key := rs.keysByName[name] + if key == nil { + return nil + } + + return rs.GetCommitKVStore(key) +} + +// Implements interface Queryable +func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery { + version := req.Height + if version == 0 { + version = rs.db.Version() + } + + db := rs.db + if version != rs.lastCommitInfo.Version { + var err error + db, err = memiavl.Load(rs.dir, memiavl.Options{TargetVersion: uint32(version)}) + if err != nil { + return sdkerrors.QueryResult(err, false) + } + } + + path := req.Path + storeName, subpath, err := parsePath(path) + if err != nil { + return sdkerrors.QueryResult(err, false) + } + + store := types.Queryable(memiavlstore.New(db.TreeByName(storeName), rs.logger)) + + // trim the path and make the query + req.Path = subpath + res := store.Query(req) + + if !req.Prove || !rootmulti.RequireProof(subpath) { + return res + } + + if res.ProofOps == nil || len(res.ProofOps.Ops) == 0 { + return sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "proof is unexpectedly empty; ensure height has not been pruned"), false) + } + + // If the request's height is the latest height we've committed, then utilize + // the store's lastCommitInfo as this commit info may not be flushed to disk. + // Otherwise, we query for the commit info from disk. + commitInfo := amendCommitInfo(db.LastCommitInfo(), rs.storesParams) + + // Restore origin path and append proof op. + res.ProofOps.Ops = append(res.ProofOps.Ops, commitInfo.ProofOp(storeName)) + + return res +} + +// parsePath expects a format like /[/] +// Must start with /, subpath may be empty +// Returns error if it doesn't start with / +func parsePath(path string) (storeName string, subpath string, err error) { + if !strings.HasPrefix(path, "/") { + return storeName, subpath, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "invalid path: %s", path) + } + + paths := strings.SplitN(path[1:], "/", 2) + storeName = paths[0] + + if len(paths) == 2 { + subpath = "/" + paths[1] + } + + return storeName, subpath, nil +} + type storeParams struct { key types.StoreKey typ types.StoreType @@ -403,3 +479,18 @@ func mergeStoreInfos(commitInfo *types.CommitInfo, storeInfos []types.StoreInfo) StoreInfos: infos, } } + +// amendCommitInfo add mem stores commit infos to keep it compatible with cosmos-sdk 0.46 +func amendCommitInfo(commitInfo *types.CommitInfo, storeParams map[types.StoreKey]storeParams) *types.CommitInfo { + var extraStoreInfos []types.StoreInfo + for key := range storeParams { + typ := storeParams[key].typ + if typ != types.StoreTypeIAVL && typ != types.StoreTypeTransient { + extraStoreInfos = append(extraStoreInfos, types.StoreInfo{ + Name: key.Name(), + CommitId: types.CommitID{}, + }) + } + } + return mergeStoreInfos(commitInfo, extraStoreInfos) +} From ed16eb5ba8d3c58a17324c6069b6c6578dce9384 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 18 Apr 2023 15:27:10 +0800 Subject: [PATCH 17/30] implement Restore --- memiavl/import.go | 116 ++++++++++++++++++++++++++++++++++++++- store/rootmulti/store.go | 8 ++- 2 files changed, 120 insertions(+), 4 deletions(-) diff --git a/memiavl/import.go b/memiavl/import.go index 3368b6ef6c..0f224eb658 100644 --- a/memiavl/import.go +++ b/memiavl/import.go @@ -1,14 +1,126 @@ package memiavl import ( + "fmt" + "io" "math" + "os" + "path/filepath" "github.com/cosmos/iavl" + protoio "github.com/gogo/protobuf/io" "github.com/pkg/errors" + + snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) -// Import a stream of `iavl.ExportNode`s into a new snapshot. -func Import(dir string, version int64, nodes <-chan *iavl.ExportNode, writeHashIndex bool) (returnErr error) { +// Import restore memiavl db from state-sync snapshot stream +func Import( + dir string, height uint64, format uint32, protoReader protoio.Reader, +) (snapshottypes.SnapshotItem, error) { + if height > math.MaxUint32 { + return snapshottypes.SnapshotItem{}, fmt.Errorf("version overflows uint32: %d", height) + } + snapshotDir := snapshotPath(dir, uint32(height)) + + // Import nodes into stores. The first item is expected to be a SnapshotItem containing + // a SnapshotStoreItem, telling us which store to import into. The following items will contain + // SnapshotNodeItem (i.e. ExportNode) until we reach the next SnapshotStoreItem or EOF. + var importer *TreeImporter + var snapshotItem snapshottypes.SnapshotItem +loop: + for { + snapshotItem = snapshottypes.SnapshotItem{} + err := protoReader.ReadMsg(&snapshotItem) + if err == io.EOF { + break + } else if err != nil { + return snapshottypes.SnapshotItem{}, sdkerrors.Wrap(err, "invalid protobuf message") + } + + switch item := snapshotItem.Item.(type) { + case *snapshottypes.SnapshotItem_Store: + if importer != nil { + importer.Close() + } + importer := NewTreeImporter(filepath.Join(snapshotDir, item.Store.Name), int64(height)) + defer importer.Close() + case *snapshottypes.SnapshotItem_IAVL: + if importer == nil { + return snapshottypes.SnapshotItem{}, sdkerrors.Wrap(sdkerrors.ErrLogic, "received IAVL node item before store item") + } + if item.IAVL.Height > math.MaxInt8 { + return snapshottypes.SnapshotItem{}, sdkerrors.Wrapf(sdkerrors.ErrLogic, "node height %v cannot exceed %v", + item.IAVL.Height, math.MaxInt8) + } + node := &iavl.ExportNode{ + Key: item.IAVL.Key, + Value: item.IAVL.Value, + Height: int8(item.IAVL.Height), + Version: item.IAVL.Version, + } + // Protobuf does not differentiate between []byte{} as nil, but fortunately IAVL does + // not allow nil keys nor nil values for leaf nodes, so we can always set them to empty. + if node.Key == nil { + node.Key = []byte{} + } + if node.Height == 0 && node.Value == nil { + node.Value = []byte{} + } + importer.Add(node) + default: + break loop + } + } + + if importer != nil { + if err := importer.Close(); err != nil { + return snapshottypes.SnapshotItem{}, err + } + } + + tmpLink := currentTmpPath(dir) + if err := os.Symlink(filepath.Base(snapshotDir), tmpLink); err != nil { + return snapshottypes.SnapshotItem{}, err + } + + if err := os.Rename(tmpLink, currentPath(dir)); err != nil { + return snapshottypes.SnapshotItem{}, err + } + return snapshotItem, nil +} + +// TreeImporter import a single memiavl tree from state-sync snapshot +type TreeImporter struct { + nodesChan chan *iavl.ExportNode + quitChan chan error +} + +func NewTreeImporter(dir string, version int64) *TreeImporter { + nodesChan := make(chan *iavl.ExportNode) + quitChan := make(chan error) + go func() { + defer close(quitChan) + quitChan <- doImport(dir, version, nodesChan, false) + }() + return &TreeImporter{nodesChan, quitChan} +} + +func (ai *TreeImporter) Add(node *iavl.ExportNode) { + ai.nodesChan <- node +} + +func (ai *TreeImporter) Close() error { + close(ai.nodesChan) + err := <-ai.quitChan + ai.nodesChan = nil + ai.quitChan = nil + return err +} + +// doImport a stream of `iavl.ExportNode`s into a new snapshot. +func doImport(dir string, version int64, nodes <-chan *iavl.ExportNode, writeHashIndex bool) (returnErr error) { if version > int64(math.MaxUint32) { return errors.New("version overflows uint32") } diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 49c2c784da..1e7d2cbae0 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -170,8 +170,12 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error { // Implements interface Snapshotter func (rs *Store) Restore(height uint64, format uint32, protoReader protoio.Reader) (snapshottypes.SnapshotItem, error) { - // TODO - return snapshottypes.SnapshotItem{}, nil + item, err := memiavl.Import(rs.dir, height, format, protoReader) + if err != nil { + return item, err + } + + return item, rs.LoadLatestVersion() } // Implements interface Snapshotter From 8207434e9a796cecb252917f834db53fc986f971 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 18 Apr 2023 16:00:07 +0800 Subject: [PATCH 18/30] fix unit test --- memiavl/snapshot_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memiavl/snapshot_test.go b/memiavl/snapshot_test.go index 3770c3ed8a..013fd39130 100644 --- a/memiavl/snapshot_test.go +++ b/memiavl/snapshot_test.go @@ -113,7 +113,7 @@ func TestSnapshotImportExport(t *testing.T) { }() snapshotDir2 := t.TempDir() - err = Import(snapshotDir2, tree.Version(), ch, true) + err = doImport(snapshotDir2, tree.Version(), ch, true) require.NoError(t, err) snapshot2, err := OpenSnapshot(snapshotDir2) From 04662a1ee8e48c26aa7d53841318048f4234ad17 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 18 Apr 2023 17:07:59 +0800 Subject: [PATCH 19/30] integrate snapshot --- memiavl/export.go | 52 ++++++++++++++++++++++++++++++++++++++++ store/rootmulti/store.go | 5 ++-- 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/memiavl/export.go b/memiavl/export.go index 868b496202..f1d583b4aa 100644 --- a/memiavl/export.go +++ b/memiavl/export.go @@ -1,9 +1,61 @@ package memiavl import ( + "fmt" + "math" + + snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" "github.com/cosmos/iavl" + protoio "github.com/gogo/protobuf/io" ) +func (db *DB) Snapshot(height uint64, protoWriter protoio.Writer) error { + if height > math.MaxUint32 { + return fmt.Errorf("height overflows uint32: %d", height) + } + + mtree, err := LoadMultiTree(snapshotPath(db.dir, uint32(height))) + if err != nil { + return err + } + + for _, tree := range mtree.trees { + if err := protoWriter.WriteMsg(&snapshottypes.SnapshotItem{ + Item: &snapshottypes.SnapshotItem_Store{ + Store: &snapshottypes.SnapshotStoreItem{ + Name: tree.name, + }, + }, + }); err != nil { + return err + } + + exporter := tree.tree.snapshot.Export() + for { + node, err := exporter.Next() + if err == iavl.ExportDone { + break + } else if err != nil { + return err + } + if err := protoWriter.WriteMsg(&snapshottypes.SnapshotItem{ + Item: &snapshottypes.SnapshotItem_IAVL{ + IAVL: &snapshottypes.SnapshotIAVLItem{ + Key: node.Key, + Value: node.Value, + Height: int32(node.Height), + Version: node.Version, + }, + }, + }); err != nil { + return err + } + } + } + + return nil +} + type Exporter struct { snapshot *Snapshot i uint32 diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 1e7d2cbae0..09f76b6c0a 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -163,9 +163,10 @@ func (rs *Store) LatestVersion() int64 { } // Implements interface Snapshotter +// +// Make sure the height is a valid snapshot height func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error { - // TODO - return nil + return rs.db.Snapshot(height, protoWriter) } // Implements interface Snapshotter From 14f1514c3283da3e3debd0cf1ba33650dd5dfbfc Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 18 Apr 2023 17:42:01 +0800 Subject: [PATCH 20/30] commit the other stores --- store/rootmulti/store.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 09f76b6c0a..5767ccc6c8 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -68,6 +68,8 @@ func (rs *Store) Commit() types.CommitID { Name: key.Name(), Changeset: memiavlStore.PopChangeSet(), }) + } else { + _ = store.Commit() } } sort.SliceStable(changeSets, func(i, j int) bool { From fbc5c3fdb002b0d6360329ec9d95a6a8992b6769 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 18 Apr 2023 18:10:09 +0800 Subject: [PATCH 21/30] fix lint --- memiavl/import.go | 15 ++++++++------- store/memiavlstore/store.go | 5 +++-- store/rootmulti/store.go | 6 ++++-- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/memiavl/import.go b/memiavl/import.go index 0f224eb658..e61b3d7030 100644 --- a/memiavl/import.go +++ b/memiavl/import.go @@ -1,15 +1,16 @@ package memiavl import ( + stderrors "errors" "fmt" "io" "math" "os" "path/filepath" + "cosmossdk.io/errors" "github.com/cosmos/iavl" protoio "github.com/gogo/protobuf/io" - "github.com/pkg/errors" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -36,7 +37,7 @@ loop: if err == io.EOF { break } else if err != nil { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrap(err, "invalid protobuf message") + return snapshottypes.SnapshotItem{}, errors.Wrap(err, "invalid protobuf message") } switch item := snapshotItem.Item.(type) { @@ -48,10 +49,10 @@ loop: defer importer.Close() case *snapshottypes.SnapshotItem_IAVL: if importer == nil { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrap(sdkerrors.ErrLogic, "received IAVL node item before store item") + return snapshottypes.SnapshotItem{}, errors.Wrap(sdkerrors.ErrLogic, "received IAVL node item before store item") } if item.IAVL.Height > math.MaxInt8 { - return snapshottypes.SnapshotItem{}, sdkerrors.Wrapf(sdkerrors.ErrLogic, "node height %v cannot exceed %v", + return snapshottypes.SnapshotItem{}, errors.Wrapf(sdkerrors.ErrLogic, "node height %v cannot exceed %v", item.IAVL.Height, math.MaxInt8) } node := &iavl.ExportNode{ @@ -122,7 +123,7 @@ func (ai *TreeImporter) Close() error { // doImport a stream of `iavl.ExportNode`s into a new snapshot. func doImport(dir string, version int64, nodes <-chan *iavl.ExportNode, writeHashIndex bool) (returnErr error) { if version > int64(math.MaxUint32) { - return errors.New("version overflows uint32") + return stderrors.New("version overflows uint32") } return writeSnapshot(dir, uint32(version), writeHashIndex, func(w *snapshotWriter) (uint32, error) { @@ -142,7 +143,7 @@ func doImport(dir string, version int64, nodes <-chan *iavl.ExportNode, writeHas case 1: return i.indexStack[0], nil default: - return 0, errors.Errorf("invalid node structure, found stack size %v after imported", len(i.indexStack)) + return 0, fmt.Errorf("invalid node structure, found stack size %v after imported", len(i.indexStack)) } }) } @@ -156,7 +157,7 @@ type importer struct { func (i *importer) Add(n *iavl.ExportNode) error { if n.Version > int64(math.MaxUint32) { - return errors.New("version overflows uint32") + return stderrors.New("version overflows uint32") } if n.Height == 0 { diff --git a/store/memiavlstore/store.go b/store/memiavlstore/store.go index 374c685634..f609c1ec09 100644 --- a/store/memiavlstore/store.go +++ b/store/memiavlstore/store.go @@ -5,6 +5,7 @@ import ( "fmt" "io" + "cosmossdk.io/errors" ics23 "github.com/confio/ics23/go" "github.com/cosmos/cosmos-sdk/store/tracekv" "github.com/cosmos/iavl" @@ -129,7 +130,7 @@ func (st *Store) PopChangeSet() iavl.ChangeSet { func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) { if req.Height > 0 && req.Height != st.tree.Version() { - return sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrInvalidHeight, "invalid height"), false) + return sdkerrors.QueryResult(errors.Wrap(sdkerrors.ErrInvalidHeight, "invalid height"), false) } res.Height = st.tree.Version() @@ -166,7 +167,7 @@ func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) { res.Value = bz default: - return sdkerrors.QueryResult(sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unexpected query path: %v", req.Path), false) + return sdkerrors.QueryResult(errors.Wrapf(sdkerrors.ErrUnknownRequest, "unexpected query path: %v", req.Path), false) } return } diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 5767ccc6c8..44240b0909 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -7,6 +7,8 @@ import ( "sort" "strings" + "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/store/listenkv" "github.com/cosmos/cosmos-sdk/store/rootmulti" "github.com/crypto-org-chain/cronos/memiavl" @@ -430,7 +432,7 @@ func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery { } if res.ProofOps == nil || len(res.ProofOps.Ops) == 0 { - return sdkerrors.QueryResult(sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "proof is unexpectedly empty; ensure height has not been pruned"), false) + return sdkerrors.QueryResult(errors.Wrap(sdkerrors.ErrInvalidRequest, "proof is unexpectedly empty; ensure height has not been pruned"), false) } // If the request's height is the latest height we've committed, then utilize @@ -449,7 +451,7 @@ func (rs *Store) Query(req abci.RequestQuery) abci.ResponseQuery { // Returns error if it doesn't start with / func parsePath(path string) (storeName string, subpath string, err error) { if !strings.HasPrefix(path, "/") { - return storeName, subpath, sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "invalid path: %s", path) + return storeName, subpath, errors.Wrapf(sdkerrors.ErrUnknownRequest, "invalid path: %s", path) } paths := strings.SplitN(path[1:], "/", 2) From d8ba041ee77dad802db46aa7febe357e96a20f0f Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 18 Apr 2023 20:54:50 +0800 Subject: [PATCH 22/30] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4bb1a9a3e0..a3eb22b85b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - [#904](https://github.com/crypto-org-chain/cronos/pull/904) Enable "dynamic-level-bytes" on new `application.db`. - [#924](https://github.com/crypto-org-chain/cronos/pull/924) memiavl support `Export` API. - [#934](https://github.com/crypto-org-chain/cronos/pull/934) Add pebbledb backend. +- [#950](https://github.com/crypto-org-chain/cronos/pull/950) Implement memiavl and integrate with state machine. *Feb 09, 2022* From 2ba093d5e1272971ce5bff63bc2e020a1c44dbea Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 18 Apr 2023 20:56:39 +0800 Subject: [PATCH 23/30] fix build --- memiavl/go.mod | 2 +- store/go.mod | 15 +- store/go.sum | 374 ++++++++++++++++++++++++++++++++++++++- store/rootmulti/store.go | 18 +- 4 files changed, 395 insertions(+), 14 deletions(-) diff --git a/memiavl/go.mod b/memiavl/go.mod index 11199494b5..3c90c376b2 100644 --- a/memiavl/go.mod +++ b/memiavl/go.mod @@ -3,6 +3,7 @@ module github.com/crypto-org-chain/cronos/memiavl go 1.20 require ( + cosmossdk.io/errors v1.0.0-beta.7 github.com/confio/ics23/go v0.9.0 github.com/cosmos/cosmos-sdk v0.46.12 github.com/cosmos/gogoproto v1.4.7 @@ -21,7 +22,6 @@ require ( ) require ( - cosmossdk.io/errors v1.0.0-beta.7 // indirect github.com/DataDog/zstd v1.4.5 // indirect github.com/VictoriaMetrics/metrics v1.23.1 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/store/go.mod b/store/go.mod index d7a376ce05..3119bd5ee7 100644 --- a/store/go.mod +++ b/store/go.mod @@ -3,23 +3,24 @@ module github.com/crypto-org-chain/cronos/store go 1.20 require ( + cosmossdk.io/errors v1.0.0-beta.7 + github.com/confio/ics23/go v0.9.0 github.com/cosmos/cosmos-sdk v0.46.12 github.com/cosmos/iavl v0.19.6-0.20230410112350-e1e212a3a3aa github.com/crypto-org-chain/cronos/memiavl v0.0.1 github.com/gogo/protobuf v1.3.2 - github.com/pkg/errors v0.9.1 github.com/tendermint/tendermint v0.34.27 github.com/tendermint/tm-db v0.6.7 ) require ( - cosmossdk.io/errors v1.0.0-beta.7 // indirect github.com/VictoriaMetrics/metrics v1.23.1 // indirect + github.com/armon/go-metrics v0.4.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/confio/ics23/go v0.9.0 // indirect github.com/cosmos/gogoproto v1.4.7 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -37,15 +38,23 @@ require ( github.com/google/btree v1.1.2 // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-immutable-radix v1.3.1 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect + github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/klauspost/compress v1.15.11 // indirect github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263 // indirect github.com/ledgerwatch/log/v3 v3.7.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect 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 + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/stretchr/testify v1.8.1 // indirect diff --git a/store/go.sum b/store/go.sum index 49cb86c65f..34fc6e2a9b 100644 --- a/store/go.sum +++ b/store/go.sum @@ -1,25 +1,68 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.105.0 h1:DNtEKRBAAzeS4KyIory52wWHuClNaXJ5x1F7xa4q+5Y= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/compute v1.15.1 h1:7UGq3QknM33pw5xATlpzeoomNxsacIVvTqTTvbfajmE= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/iam v0.8.0 h1:E2osAkZzxI/+8pZcxVLcDtAQx/u+hZXVryUaYQ5O0Kk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.27.0 h1:YOO045NZI9RKfCj1c5A/ZtuuENUc8OAW+gHdGnDgyMQ= cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= cosmossdk.io/math v1.0.0-beta.3 h1:TbZxSopz2LqjJ7aXYfn7nJSb8vNaBklW6BLpcei1qwM= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/VictoriaMetrics/metrics v1.23.1 h1:/j8DzeJBxSpL2qSIdqnRFLvQQhbJyJbbEi22yMm7oL0= github.com/VictoriaMetrics/metrics v1.23.1/go.mod h1:rAr/llLpEnAdTehiNlUxKgnjcOuROSzpw0GvjpEbvFc= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= +github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/aws/aws-sdk-go v1.40.45 h1:QN1nsY27ssD/JmW4s83qmSb+uL6DG4GmCDzjmJB4xUI= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= @@ -32,9 +75,15 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= @@ -88,11 +137,22 @@ github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8S github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.12.0 h1:e4o3o3IsBfAKQh5Qbbiqyfu97Ku7jrO/JbohvztANh4= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-kit/log v0.2.0/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= @@ -100,40 +160,72 @@ github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/googleapis/enterprise-certificate-proxy v0.2.0 h1:y8Yozv7SZtlU//QXbezB6QkpuE6jMD2/gfzk4AftXjs= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= @@ -146,28 +238,51 @@ github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uM github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-getter v1.6.1 h1:NASsgP4q6tL94WH6nJxKWj8As2H/2kop/bB1d8JMyRY= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= +github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= +github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -186,14 +301,23 @@ github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovk github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -203,29 +327,60 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw= +github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/regen-network/protobuf v1.3.3-alpha.regen.1 h1:OHEc+q5iIAXpqiqFKeLpu5NwTIkVXUs48vFMwzqpqY4= github.com/regen-network/protobuf v1.3.3-alpha.regen.1/go.mod h1:2DjTFR1HhMQhiWC5sZ4OhQ3+NtdbZ6oBDKQwq5Ou+FI= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= @@ -242,6 +397,7 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.13.0 h1:BWSJ/M+f+3nmdz9bxB+bWX28kkALN2ok11D0rSo8EJU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= @@ -272,6 +428,7 @@ github.com/tidwall/wal v1.1.7 h1:emc1TRjIVsdKKSnpwGBAcsAGg0767SvUk8+ygx7Bb+4= github.com/tidwall/wal v1.1.7/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= github.com/torquem-ch/mdbx-go v0.27.5 h1:bbhXQGFCmoxbRDXKYEJwxSOOTeBKwoD4pFBUpK9+V1g= github.com/torquem-ch/mdbx-go v0.27.5/go.mod h1:T2fsoJDVppxfAPTLd1svUgH1kpPmeXdPESmroSHcL1E= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8= @@ -279,105 +436,303 @@ github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002 github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zondax/hid v0.9.1 h1:gQe66rtmyZ8VeGFcOpbuH3r7erYtNEAezCAYu8LdkJo= github.com/zondax/ledger-go v0.14.1 h1:Pip65OOl4iJ84WTpA4BKChvOufMhhbxED3BaihoZN4c= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20230206171751-46f607a40771 h1:xP7rWLUr1e1n2xkK5YB4LI0hPEy3LJC6Wk+D4pGlOJg= golang.org/x/exp v0.0.0-20230206171751-46f607a40771/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/api v0.102.0 h1:JxJl2qQ85fRMPNvlZY/enexbxpCjLwGhZUtgfGeQ51I= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 h1:vArvWooPH749rNHpBGgVl+U9B9dATjiEhJzcWGlovNs= google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc= google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -385,20 +740,29 @@ google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.29.1 h1:7QBf+IK2gx70Ap/hDsOmam3GE0v9HicjfEdAxE62UoM= google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -406,6 +770,14 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 44240b0909..079d1c615f 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -1,6 +1,7 @@ package rootmulti import ( + stderrors "errors" "fmt" "io" "math" @@ -8,24 +9,23 @@ import ( "strings" "cosmossdk.io/errors" - - "github.com/cosmos/cosmos-sdk/store/listenkv" - "github.com/cosmos/cosmos-sdk/store/rootmulti" - "github.com/crypto-org-chain/cronos/memiavl" - "github.com/crypto-org-chain/cronos/store/memiavlstore" - "github.com/pkg/errors" + protoio "github.com/gogo/protobuf/io" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" + dbm "github.com/tendermint/tm-db" pruningtypes "github.com/cosmos/cosmos-sdk/pruning/types" snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types" "github.com/cosmos/cosmos-sdk/store/cachemulti" + "github.com/cosmos/cosmos-sdk/store/listenkv" "github.com/cosmos/cosmos-sdk/store/mem" + "github.com/cosmos/cosmos-sdk/store/rootmulti" "github.com/cosmos/cosmos-sdk/store/transient" "github.com/cosmos/cosmos-sdk/store/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - protoio "github.com/gogo/protobuf/io" - dbm "github.com/tendermint/tm-db" + + "github.com/crypto-org-chain/cronos/memiavl" + "github.com/crypto-org-chain/cronos/store/memiavlstore" ) const CommitInfoFileName = "commit_infos" @@ -366,7 +366,7 @@ func (rs *Store) SetLazyLoading(lazyLoading bool) { // Implements interface CommitMultiStore func (rs *Store) RollbackToVersion(version int64) error { - return errors.New("rootmulti store don't support rollback") + return stderrors.New("rootmulti store don't support rollback") } // Implements interface CommitMultiStore From d1830a08f3d9464e9c575e9707532246a0dea8db Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 18 Apr 2023 20:59:52 +0800 Subject: [PATCH 24/30] fix lint --- store/memiavlstore/store.go | 3 ++- store/rootmulti/store.go | 11 +---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/store/memiavlstore/store.go b/store/memiavlstore/store.go index f609c1ec09..018ae6bd98 100644 --- a/store/memiavlstore/store.go +++ b/store/memiavlstore/store.go @@ -169,7 +169,8 @@ func (st *Store) Query(req abci.RequestQuery) (res abci.ResponseQuery) { default: return sdkerrors.QueryResult(errors.Wrapf(sdkerrors.ErrUnknownRequest, "unexpected query path: %v", req.Path), false) } - return + + return res } // Takes a MutableTree, a key, and a flag for creating existence or absence proof and returns the diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 079d1c615f..e862362b2a 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -246,18 +246,9 @@ func (rs *Store) LoadVersionAndUpgrade(version int64, upgrades *types.StoreUpgra }) initialStores := make([]string, 0, len(storesKeys)) - var extraStoreInfos []types.StoreInfo for _, key := range storesKeys { - switch rs.storesParams[key].typ { - case types.StoreTypeIAVL: + if rs.storesParams[key].typ == types.StoreTypeIAVL { initialStores = append(initialStores, key.Name()) - case types.StoreTypeTransient: - continue - default: - extraStoreInfos = append(extraStoreInfos, types.StoreInfo{ - Name: key.Name(), - CommitId: types.CommitID{}, - }) } } db, err := memiavl.Load(rs.dir, memiavl.Options{ From 2aa0f7f60a9913aa7ae2b9226099c84ffd75ea36 Mon Sep 17 00:00:00 2001 From: yihuang Date: Tue, 18 Apr 2023 21:48:35 +0800 Subject: [PATCH 25/30] Update memiavl/import.go Co-authored-by: mmsqe Signed-off-by: yihuang --- memiavl/import.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memiavl/import.go b/memiavl/import.go index e61b3d7030..9991114be2 100644 --- a/memiavl/import.go +++ b/memiavl/import.go @@ -45,7 +45,7 @@ loop: if importer != nil { importer.Close() } - importer := NewTreeImporter(filepath.Join(snapshotDir, item.Store.Name), int64(height)) + importer = NewTreeImporter(filepath.Join(snapshotDir, item.Store.Name), int64(height)) defer importer.Close() case *snapshottypes.SnapshotItem_IAVL: if importer == nil { From 3ff692559aac6e22989d24e13aba6ebae24cb7ac Mon Sep 17 00:00:00 2001 From: HuangYi Date: Tue, 18 Apr 2023 21:10:20 +0800 Subject: [PATCH 26/30] cleanup --- memiavl/multitree.go | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/memiavl/multitree.go b/memiavl/multitree.go index 9fbf41d074..6dda8b970d 100644 --- a/memiavl/multitree.go +++ b/memiavl/multitree.go @@ -20,7 +20,7 @@ import ( const MetadataFileName = "__metadata" -type NamedTree struct { +type namedTree struct { tree *Tree name string } @@ -45,7 +45,7 @@ type MultiTree struct { // it always corresponds to the wal entry with index 1. initialVersion uint32 - trees []NamedTree + trees []namedTree treesByName map[string]int // reversed index of the trees lastCommitInfo storetypes.CommitInfo @@ -99,11 +99,11 @@ func LoadMultiTree(dir string) (*MultiTree, error) { sort.Strings(treeNames) - trees := make([]NamedTree, len(treeNames)) + trees := make([]namedTree, len(treeNames)) treesByName := make(map[string]int, len(trees)) for i, name := range treeNames { tree := treeMap[name] - trees[i] = NamedTree{tree: tree, name: name} + trees[i] = namedTree{tree: tree, name: name} treesByName[name] = i } @@ -118,10 +118,6 @@ func LoadMultiTree(dir string) (*MultiTree, error) { return mtree, nil } -func (t *MultiTree) Trees() []NamedTree { - return t.trees -} - func (t *MultiTree) TreeByName(name string) *Tree { return t.trees[t.treesByName[name]].tree } @@ -154,11 +150,11 @@ func (t *MultiTree) setInitialVersion(initialVersion int64) { // Copy returns a snapshot of the tree which won't be corrupted by further modifications on the main tree. func (t *MultiTree) Copy() *MultiTree { - trees := make([]NamedTree, len(t.trees)) + trees := make([]namedTree, len(t.trees)) treesByName := make(map[string]int, len(t.trees)) for i, entry := range t.trees { tree := entry.tree.Copy() - trees[i] = NamedTree{tree: tree, name: entry.name} + trees[i] = namedTree{tree: tree, name: entry.name} treesByName[entry.name] = i } @@ -191,7 +187,7 @@ func (t *MultiTree) ApplyUpgrades(upgrades []*TreeNameUpgrade) error { for _, upgrade := range upgrades { switch { case upgrade.Delete: - i := slices.IndexFunc(t.trees, func(entry NamedTree) bool { + i := slices.IndexFunc(t.trees, func(entry namedTree) bool { return entry.name == upgrade.Name }) if i < 0 { @@ -202,7 +198,7 @@ func (t *MultiTree) ApplyUpgrades(upgrades []*TreeNameUpgrade) error { t.trees = t.trees[:len(t.trees)-1] case upgrade.RenameFrom != "": // rename tree - i := slices.IndexFunc(t.trees, func(entry NamedTree) bool { + i := slices.IndexFunc(t.trees, func(entry namedTree) bool { return entry.name == upgrade.RenameFrom }) if i < 0 { @@ -212,7 +208,7 @@ func (t *MultiTree) ApplyUpgrades(upgrades []*TreeNameUpgrade) error { default: // add tree tree := NewWithInitialVersion(uint32(nextVersion(t.Version(), t.initialVersion))) - t.trees = append(t.trees, NamedTree{tree: tree, name: upgrade.Name}) + t.trees = append(t.trees, namedTree{tree: tree, name: upgrade.Name}) } } @@ -296,7 +292,7 @@ func (t *MultiTree) UpdateCommitInfo() []byte { return t.lastCommitInfo.Hash() } -// CatchupWAL replay the new entries in the WAL on the tree to catch-up to the latest state. +// CatchupWAL replay the new entries in the WAL on the tree to catch-up to the target or latest version. func (t *MultiTree) CatchupWAL(wal *wal.Log, endVersion int64) error { lastIndex, err := wal.LastIndex() if err != nil { From 6c3d5c5aa13f723e5011e032702189cd90112c48 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 19 Apr 2023 09:16:04 +0800 Subject: [PATCH 27/30] reuse code --- memiavl/db.go | 27 +++++++++++++++------------ memiavl/import.go | 12 +++--------- 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/memiavl/db.go b/memiavl/db.go index 950f763d03..f6cde2e4c2 100644 --- a/memiavl/db.go +++ b/memiavl/db.go @@ -227,19 +227,15 @@ func (db *DB) Copy() *DB { // RewriteSnapshot writes the current version of memiavl into a snapshot, and update the `current` symlink. func (db *DB) RewriteSnapshot() error { version := uint32(db.lastCommitInfo.Version) - snapshotDir := snapshotPath(db.dir, version) - if err := os.MkdirAll(snapshotDir, os.ModePerm); err != nil { + snapshotDir := snapshotName(version) + snapshotPath := filepath.Join(db.dir, snapshotDir) + if err := os.MkdirAll(snapshotPath, os.ModePerm); err != nil { return err } - if err := db.WriteSnapshot(snapshotDir); err != nil { + if err := db.WriteSnapshot(snapshotPath); err != nil { return err } - tmpLink := currentTmpPath(db.dir) - if err := os.Symlink(filepath.Base(snapshotDir), tmpLink); err != nil { - return err - } - // assuming file renaming operation is atomic - return os.Rename(tmpLink, currentPath(db.dir)) + return updateCurrentSymlink(db.dir, snapshotDir) } func (db *DB) Reload() error { @@ -339,13 +335,20 @@ func walPath(root string) string { // ``` func initEmptyDB(dir string, initialVersion uint32) error { tmp := NewEmptyMultiTree(initialVersion) - snapshotDir := snapshotPath(dir, 0) - if err := tmp.WriteSnapshot(snapshotDir); err != nil { + snapshotDir := snapshotName(0) + if err := tmp.WriteSnapshot(filepath.Join(dir, snapshotDir)); err != nil { return err } + return updateCurrentSymlink(dir, snapshotDir) +} + +// updateCurrentSymlink creates or replace the current symblic link atomically. +// it could fail under concurrent usage for tmp file conflicts. +func updateCurrentSymlink(dir, snapshot string) error { tmpPath := currentTmpPath(dir) - if err := os.Symlink(filepath.Base(snapshotDir), tmpPath); err != nil { + if err := os.Symlink(snapshot, tmpPath); err != nil { return err } + // assuming file renaming operation is atomic return os.Rename(tmpPath, currentPath(dir)) } diff --git a/memiavl/import.go b/memiavl/import.go index 9991114be2..574a983f4b 100644 --- a/memiavl/import.go +++ b/memiavl/import.go @@ -5,7 +5,6 @@ import ( "fmt" "io" "math" - "os" "path/filepath" "cosmossdk.io/errors" @@ -23,7 +22,7 @@ func Import( if height > math.MaxUint32 { return snapshottypes.SnapshotItem{}, fmt.Errorf("version overflows uint32: %d", height) } - snapshotDir := snapshotPath(dir, uint32(height)) + snapshotDir := snapshotName(uint32(height)) // Import nodes into stores. The first item is expected to be a SnapshotItem containing // a SnapshotStoreItem, telling us which store to import into. The following items will contain @@ -45,7 +44,7 @@ loop: if importer != nil { importer.Close() } - importer = NewTreeImporter(filepath.Join(snapshotDir, item.Store.Name), int64(height)) + importer = NewTreeImporter(filepath.Join(dir, snapshotDir, item.Store.Name), int64(height)) defer importer.Close() case *snapshottypes.SnapshotItem_IAVL: if importer == nil { @@ -81,12 +80,7 @@ loop: } } - tmpLink := currentTmpPath(dir) - if err := os.Symlink(filepath.Base(snapshotDir), tmpLink); err != nil { - return snapshottypes.SnapshotItem{}, err - } - - if err := os.Rename(tmpLink, currentPath(dir)); err != nil { + if err := updateCurrentSymlink(dir, snapshotDir); err != nil { return snapshottypes.SnapshotItem{}, err } return snapshotItem, nil From 9dc9441709c14c8642d06ff4e1fbf13642483a5c Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 19 Apr 2023 09:37:57 +0800 Subject: [PATCH 28/30] cleanup errors --- memiavl/db.go | 5 ++--- memiavl/export.go | 3 ++- memiavl/go.mod | 2 +- memiavl/multitree.go | 2 +- memiavl/proof.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/memiavl/db.go b/memiavl/db.go index f6cde2e4c2..b161247c89 100644 --- a/memiavl/db.go +++ b/memiavl/db.go @@ -1,7 +1,7 @@ package memiavl import ( - stderrors "errors" + "errors" "fmt" "os" "path/filepath" @@ -9,7 +9,6 @@ import ( "strings" "sync" - "github.com/pkg/errors" "github.com/tidwall/wal" ) @@ -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 { diff --git a/memiavl/export.go b/memiavl/export.go index f1d583b4aa..6c98f51ab6 100644 --- a/memiavl/export.go +++ b/memiavl/export.go @@ -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" @@ -16,7 +17,7 @@ func (db *DB) Snapshot(height uint64, protoWriter protoio.Writer) error { mtree, err := LoadMultiTree(snapshotPath(db.dir, uint32(height))) if err != nil { - return err + return errors.Wrapf(err, "invalid snapshot height: %d", height) } for _, tree := range mtree.trees { diff --git a/memiavl/go.mod b/memiavl/go.mod index 3c90c376b2..83ea1e2c81 100644 --- a/memiavl/go.mod +++ b/memiavl/go.mod @@ -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 @@ -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 diff --git a/memiavl/multitree.go b/memiavl/multitree.go index 6dda8b970d..defec98782 100644 --- a/memiavl/multitree.go +++ b/memiavl/multitree.go @@ -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" diff --git a/memiavl/proof.go b/memiavl/proof.go index 212be4e847..be94200bef 100644 --- a/memiavl/proof.go +++ b/memiavl/proof.go @@ -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" ) /* From 3836457ea34992ff7e9a1306121510d796d22f3a Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 19 Apr 2023 09:42:02 +0800 Subject: [PATCH 29/30] handle error return --- memiavl/import.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memiavl/import.go b/memiavl/import.go index 574a983f4b..860ae62adb 100644 --- a/memiavl/import.go +++ b/memiavl/import.go @@ -42,7 +42,9 @@ loop: switch item := snapshotItem.Item.(type) { case *snapshottypes.SnapshotItem_Store: if importer != nil { - importer.Close() + if err := importer.Close(); err != nil { + return snapshottypes.SnapshotItem{}, err + } } importer = NewTreeImporter(filepath.Join(dir, snapshotDir, item.Store.Name), int64(height)) defer importer.Close() From 2cd0a4142a8a976c8dd0c868d3f651a4000855b4 Mon Sep 17 00:00:00 2001 From: HuangYi Date: Wed, 19 Apr 2023 16:52:32 +0800 Subject: [PATCH 30/30] try fix unittest in CI --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f977988fc7..7100615bc5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,6 +83,9 @@ jobs: export PKG_CONFIG_PATH=$HOME/.nix-profile/lib/pkgconfig export CGO_CFLAGS="$(pkg-config --cflags rocksdb)" CGO_LDFLAGS="$(pkg-config --libs rocksdb)" export LD_LIBRARY_PATH=$HOME/.nix-profile/lib + export GLIBC="$(nix build nixpkgs#stdenv.cc.libc.out --no-link --print-out-paths)" + export CGO_LDFLAGS="$CGO_LDFLAGS -Wl,--dynamic-linker=$GLIBC/lib/ld-linux-x86-64.so.2" + echo $CGO_LDFLAGS cd ./versiondb go test -v -mod=readonly ./... -tags rocksdb,grocksdb_clean_link -coverprofile=coverage.txt if: steps.changed-files.outputs.any_changed == 'true'