From f456191787f90d1b6cf8f0e76f7b246f844c6569 Mon Sep 17 00:00:00 2001 From: evgeniy-scherbina Date: Thu, 27 Jun 2024 14:01:20 -0400 Subject: [PATCH] Use our own DBProvider instead of default one --- go.mod | 2 +- go.sum | 4 +- gomod2nix.toml | 235 ++++++++++++++++++++++-------------------- server/indexer_cmd.go | 2 +- server/start.go | 49 +++++---- 5 files changed, 156 insertions(+), 136 deletions(-) diff --git a/go.mod b/go.mod index a0e07d717e..98b2ed176e 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/math v1.3.0 cosmossdk.io/simapp v0.0.0-20230608160436-666c345ad23d cosmossdk.io/tools/rosetta v0.2.1 - github.com/Kava-Labs/opendb v0.0.0-20240627151936-ee065ee47c6f + github.com/Kava-Labs/opendb v0.0.0-20240702134349-56aabfd80204 github.com/armon/go-metrics v0.4.1 github.com/btcsuite/btcd v0.23.4 github.com/btcsuite/btcd/btcutil v1.1.3 diff --git a/go.sum b/go.sum index d80d763fce..d65038267b 100644 --- a/go.sum +++ b/go.sum @@ -226,8 +226,8 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/zstd v1.5.0/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/Kava-Labs/opendb v0.0.0-20240627151936-ee065ee47c6f h1:WPCRvyScW9cuBMRG8xPz8Izv84lA0Cnrg9HOA0gqRWY= -github.com/Kava-Labs/opendb v0.0.0-20240627151936-ee065ee47c6f/go.mod h1:RUKcXpMI4wEearEySB7XEMnhXd4+fCPZzybTLNUM1RQ= +github.com/Kava-Labs/opendb v0.0.0-20240702134349-56aabfd80204 h1:AgXfuSAjDPn/fxJxFIfDsrA2Yiefj2gh+eWmm/N08X4= +github.com/Kava-Labs/opendb v0.0.0-20240702134349-56aabfd80204/go.mod h1:RUKcXpMI4wEearEySB7XEMnhXd4+fCPZzybTLNUM1RQ= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= diff --git a/gomod2nix.toml b/gomod2nix.toml index bbf33beca6..f67d017867 100644 --- a/gomod2nix.toml +++ b/gomod2nix.toml @@ -2,20 +2,20 @@ schema = 3 [mod] [mod."cloud.google.com/go"] - version = "v0.111.0" - hash = "sha256-i8tQyny5W/PcPY5W5h2Zo6wKDKgYHpQlK77QU9TUdI4=" + version = "v0.112.0" + hash = "sha256-lmNLoqmLURfxu+a6V/SeoP8xVn0Wi2SD7uxxAtSjm+o=" [mod."cloud.google.com/go/compute"] - version = "v1.23.3" - hash = "sha256-WwlTw/x9GSM6B4nHm9FDvHZ1Pd4KN0wxk650CosJnpQ=" + version = "v1.24.0" + hash = "sha256-icDjR0uxYeazRbhsBgl8Dx7z/oRZJ/iqK6CGjCtsaQQ=" [mod."cloud.google.com/go/compute/metadata"] version = "v0.2.3" hash = "sha256-kYB1FTQRdTDqCqJzSU/jJYbVUGyxbkASUKbEs36FUyU=" [mod."cloud.google.com/go/iam"] - version = "v1.1.5" - hash = "sha256-nETSf8U75kLNXk82JdQaJz394z8cXMbpNYSm1KE03GA=" + version = "v1.1.6" + hash = "sha256-u91oZdyy/wgk3J8Z+4mWmn+YliSBIATu6kpyH20Dd8k=" [mod."cloud.google.com/go/storage"] - version = "v1.30.1" - hash = "sha256-4lC0XaLSQDnVBmNLIauiWnGXq+Ax57r8fcMxXFMCCNE=" + version = "v1.36.0" + hash = "sha256-dRKH1NEyAfEpVo5Mma677L7z0JO9Mfd1bv1lr1uFngI=" [mod."cosmossdk.io/api"] version = "v0.3.1" hash = "sha256-yQUn04n0/s3DpNWu7TF3NG+awWKxgvRpV9CYIV+dR7k=" @@ -54,8 +54,11 @@ schema = 3 version = "v1.0.0" hash = "sha256-atJ2waz124m0DVHjol8v3NfCLKidU3fYu5AgzT9xCBA=" [mod."github.com/DataDog/zstd"] - version = "v1.5.2" - hash = "sha256-LVkZHLG8O4CzmqyQVbGn+0r6AKIMABej8a4HKMFw/xo=" + version = "v1.5.5" + hash = "sha256-tSw0aq0pPyroZtQYYb9lWOtPVNaQOt8skYQ4TMXGvAQ=" + [mod."github.com/Kava-Labs/opendb"] + version = "v0.0.0-20240702134349-56aabfd80204" + hash = "sha256-aLeyxfHzN9KNkAVxknPByRaARFB5uVieKD9j4r6gd/s=" [mod."github.com/StackExchange/wmi"] version = "v0.0.0-20180116203802-5d049714c4a6" hash = "sha256-0yUxhZB3v3ZE3QY36zHs2cJ1S4GXptXIhyAi6sI2nOo=" @@ -96,8 +99,8 @@ schema = 3 version = "v1.1.0" hash = "sha256-nVDTtXH9PC3yJ0THaQZEN243UP9xgLi/clt5xRqj3+M=" [mod."github.com/cespare/xxhash/v2"] - version = "v2.2.0" - hash = "sha256-nPufwYQfTkyrEkbBrpqM3C2vnMxfIz6tAaBmiUP7vd4=" + version = "v2.3.0" + hash = "sha256-7hRlwSR+fos1kx4VZmJ/7snR7zHh8ZFKX+qqqqGcQpY=" [mod."github.com/chzyer/readline"] version = "v1.5.1" hash = "sha256-6wKd6/JZ9/O7FwSyNKE3KOt8fVPZEunqbTHQUxlOUNc=" @@ -105,17 +108,20 @@ schema = 3 version = "v2.0.2" hash = "sha256-UrPHkvqVF8V78+kXKmjTHl79XsgDBnqFsje5BMYh0E4=" [mod."github.com/cockroachdb/errors"] - version = "v1.10.0" - hash = "sha256-l6CCw3FKGNaGlwzLfAaF0cruf3E9MZr6GK1GZ+vQm2c=" + version = "v1.11.1" + hash = "sha256-ufKtavyfW/i3ZemiqDqKGc0JM+f0IBi6bZWkZyb/jdc=" [mod."github.com/cockroachdb/logtags"] version = "v0.0.0-20230118201751-21c54148d20b" hash = "sha256-7dQH6j1o99fuxHKkw0RhNC5wJKkvRLMDJpUiVnDx6h8=" [mod."github.com/cockroachdb/pebble"] - version = "v0.0.0-20230226194802-02d779ffbc46" - hash = "sha256-BYbaz4nJ6JeyiCWLye5Zvk/sI7EqXejK2hWLsZweB00=" + version = "v1.1.0" + hash = "sha256-igtoXdKzENNqaL3mLSUzZvqaSAmkNlrWN/ZnVTwA7Bk=" [mod."github.com/cockroachdb/redact"] version = "v1.1.5" hash = "sha256-0rtT7LRO0wxf9XovOK8GXRrhmx8OcbdPK/mXOKbJdog=" + [mod."github.com/cockroachdb/tokenbucket"] + version = "v0.0.0-20230807174530-cc333fc44b06" + hash = "sha256-yZdBXkTVzPxRYntI9I2Gu4gkI11m52Nwl8RNNdlXSrA=" [mod."github.com/coinbase/rosetta-sdk-go"] version = "v0.7.9" hash = "sha256-ZWIXIXcHGjeCNgMrpXymry8/8esDDauGFfF/+gEoO1Y=" @@ -132,14 +138,14 @@ schema = 3 version = "v1.0.5" hash = "sha256-t572Sr5iiHcuMKLMWa2i+LBAt192oa+G1oA371tG/eI=" [mod."github.com/cosmos/cosmos-db"] - version = "v1.0.0" - hash = "sha256-3EL4xQsSpovTy/V3gwulybqSDHvuu7bPodBZib9JKAk=" + version = "v1.0.2" + hash = "sha256-WjDoB2AGoIyEW30LlGcQX5JVACJbs0jWSY58IuJHz0M=" [mod."github.com/cosmos/cosmos-proto"] - version = "v1.0.0-beta.4" - hash = "sha256-5Kn82nsZfiEtuwhhLZqmMxdAY1tX/Fi3HJ0/MEaRohw=" + version = "v1.0.0-beta.5" + hash = "sha256-Fy/PbsOsd6iq0Njy3DVWK6HqWsogI+MkE8QslHGWyVg=" [mod."github.com/cosmos/cosmos-sdk"] - version = "v0.47.10-kava.2" - hash = "sha256-kIq7aJFgZpPQu9RW+QJhe9Xx5w16k/T0052GDzPmJxM=" + version = "v0.47.10-iavl-v1-kava.1" + hash = "sha256-NB9G0ZVMJbnB5AY60nn67MyLZrxhKHqwxO9bMcoTgP4=" replaced = "github.com/kava-labs/cosmos-sdk" [mod."github.com/cosmos/go-bip39"] version = "v1.0.0" @@ -151,8 +157,8 @@ schema = 3 version = "v1.4.10" hash = "sha256-Anm4O3bUONsN7J9Psg9E+oQasmUyoGc7UE1aaHJaehE=" [mod."github.com/cosmos/iavl"] - version = "v1.0.0" - hash = "sha256-Zm1TfR7vBJ7zMT0whznStO42S0t6hyrwpbUnDmM3MlI=" + version = "v1.1.2" + hash = "sha256-fhh5fN1BMDxbF4PobERMQdIb9vIrxaSl0tRXas0WKmc=" [mod."github.com/cosmos/ibc-go/v7"] version = "v7.3.1" hash = "sha256-5lRAQaQRscTMVKeKlsiWtLFauK/gjL9cD7gTJgUbddQ=" @@ -160,8 +166,8 @@ schema = 3 version = "v0.10.0" hash = "sha256-KYEv727BO/ht63JO02xiKFGFAddg41Ve9l2vSSZZBq0=" [mod."github.com/cosmos/ledger-cosmos-go"] - version = "v0.13.1" - hash = "sha256-UDRTBG1VPLQOA3tJjfen5tRmIBde7Cqc4UDUPXL3+c4=" + version = "v0.13.3" + hash = "sha256-4f73odipfgWku0/gK2UtXbrBXvj8kT9sg4IhnfAP/S0=" [mod."github.com/cosmos/rosetta-sdk-go"] version = "v0.10.0" hash = "sha256-WmLq9E9mYV+ms6Tdb43lCoAy6cowkDnK4bvX/ApDzLY=" @@ -172,14 +178,14 @@ schema = 3 version = "v1.1.2" hash = "sha256-Nnklfg12vmWCOhELGyoRqEF4w4srp0WbPwreaChYLKs=" [mod."github.com/davecgh/go-spew"] - version = "v1.1.1" - hash = "sha256-nhzSUrE1fCkN0+RL04N4h8jWmRFPPPWbCuDc7Ss0akI=" + version = "v1.1.2-0.20180830191138-d8f796af33cc" + hash = "sha256-fV9oI51xjHdOmEx6+dlq7Ku2Ag+m/bmbzPo6A4Y74qc=" [mod."github.com/deckarep/golang-set"] version = "v1.8.0" hash = "sha256-ELJKphksU9AOYwV3BtjvwPtUpbZvX9YMmo7eIiauQSc=" [mod."github.com/decred/dcrd/dcrec/secp256k1/v4"] - version = "v4.1.0" - hash = "sha256-cS4ZrKz1B4G7+vqih6B7C/WNkcMvRKmvR6S8aw7PotY=" + version = "v4.2.0" + hash = "sha256-Mw+axGW3RzaRFzcYc7/9/gpqZgWXZHeyT2c4USFtAQA=" [mod."github.com/desertbit/timer"] version = "v0.0.0-20180107155436-c41aec40b27f" hash = "sha256-abLOtEcomAqCWLphd2X6WkD/ED764w6sa6unox4BXss=" @@ -208,26 +214,26 @@ schema = 3 version = "v1.0.0" hash = "sha256-k1DYvCqO3BKNcGEve/nMW0RxzMkK2tGfXbUbycqcVSo=" [mod."github.com/emicklei/dot"] - version = "v1.4.2" - hash = "sha256-g9MC558WBelvkVbOZMGrPz2B4OnYwrOWWkC7OHfc8TI=" + version = "v1.6.1" + hash = "sha256-zOpoaepCfPLmU9iQji/Ait+SVEHI9eF3rwtW0h/8lho=" [mod."github.com/ethereum/go-ethereum"] version = "v1.10.26" hash = "sha256-gkMEwJ4rOgn12amD4QpZ4th/10uyTTeoFmpseuKDQPs=" [mod."github.com/felixge/httpsnoop"] - version = "v1.0.2" - hash = "sha256-hj6FZQ1fDAV+1wGIViAt8XaAkWZ1I5vJzgjIJa7XRBA=" + version = "v1.0.4" + hash = "sha256-c1JKoRSndwwOyOxq9ddCe+8qn7mG9uRq2o/822x5O/c=" [mod."github.com/fsnotify/fsnotify"] - version = "v1.6.0" - hash = "sha256-DQesOCweQPEwmAn6s7DCP/Dwy8IypC+osbpfsvpkdP0=" + version = "v1.7.0" + hash = "sha256-MdT2rQyQHspPJcx6n9ozkLbsktIOJutOqDuKpNAtoZY=" [mod."github.com/gballet/go-libpcsclite"] version = "v0.0.0-20190607065134-2772fd86a8ff" hash = "sha256-Nr5ocU9s1F2Lhx/Zq6/nIo+KkKEqMjDYOEs3yWRC48g=" [mod."github.com/getsentry/sentry-go"] - version = "v0.23.0" - hash = "sha256-VR6IL+yIc+BV5xBGfPJ7ixsAVzJ/hzuvXmkkAn1cTk4=" + version = "v0.27.0" + hash = "sha256-PTkTzVNogqFA/5rc6INLY6RxK5uR1AoJFOO+pOPdE7Q=" [mod."github.com/go-kit/kit"] - version = "v0.12.0" - hash = "sha256-5RkXo6s0oye8etgD5qy+AvkkkNsQ6jc0kWJj6flA4GM=" + version = "v0.13.0" + hash = "sha256-EncDzq0JVtY+NLlW5lD+nbVewNYTTrfzlOxI4PuwREw=" [mod."github.com/go-kit/log"] version = "v0.2.1" hash = "sha256-puLJ+up45X2j9E3lXvBPKqHPKOA/sFAhfCqGxsITW/Y=" @@ -235,8 +241,8 @@ schema = 3 version = "v0.6.0" hash = "sha256-RtIG2qARd5sT10WQ7F3LR8YJhS8exs+KiuUiVf75bWg=" [mod."github.com/go-logr/logr"] - version = "v1.2.4" - hash = "sha256-+FhzmqKsAnsra5p8LuxENXJBHSeuWjQG8Tzhpyd/ps4=" + version = "v1.4.1" + hash = "sha256-WM4badoqxXlBmqCRrnmtNce63dLlr/FJav3BJSYHvaY=" [mod."github.com/go-logr/stdr"] version = "v1.2.2" hash = "sha256-rRweAP7XIb4egtT1f2gkz4sYOu7LDHmcJ5iNsJUd0sE=" @@ -262,8 +268,8 @@ schema = 3 version = "v1.3.2" hash = "sha256-pogILFrrk+cAtb0ulqn9+gRZJ7sGnnLLdtqITvxvG6c=" [mod."github.com/golang/glog"] - version = "v1.1.2" - hash = "sha256-sxvf1xMel10gNBqyGIFGFcyjupdM+nVMKUQ/lMLh3Ak=" + version = "v1.2.0" + hash = "sha256-eCWkUlsWbHSjsuTw8HcNpj3KxT+QPvW5SSIv88hAsxA=" [mod."github.com/golang/groupcache"] version = "v0.0.0-20210331224755-41bb18bfe9da" hash = "sha256-7Gs7CS9gEYZkbu5P4hqPGBpeGZWC64VDwraSKFF+VR0=" @@ -271,8 +277,8 @@ schema = 3 version = "v1.6.0" hash = "sha256-fWdnMQisRbiRzGT3ISrUHovquzLRHWvcv1JEsJFZRno=" [mod."github.com/golang/protobuf"] - version = "v1.5.3" - hash = "sha256-svogITcP4orUIsJFjMtp+Uv1+fKJv2Q5Zwf2dMqnpOQ=" + version = "v1.5.4" + hash = "sha256-N3+Lv9lEZjrdOWdQhFj6Y3Iap4rVLEQeI8/eFFyAMZ0=" [mod."github.com/golang/snappy"] version = "v0.0.4" hash = "sha256-Umx+5xHAQCN/Gi4HbtMhnDCSPFAXSsjVbXd8n5LhjAA=" @@ -292,8 +298,8 @@ schema = 3 version = "v0.1.7" hash = "sha256-E+SX/3VmRI5qN7SbnRP4Tt+gQTq93pScpY9U2tTmIU0=" [mod."github.com/google/uuid"] - version = "v1.4.0" - hash = "sha256-FU0gzLmS48Ik9T+quGg5z/7ESGMPSXM3SY+rdJtG+5w=" + version = "v1.6.0" + hash = "sha256-VWl9sqUzdOuhW0KzQlv0gwwUQClYkmZwSydHG2sALYw=" [mod."github.com/googleapis/enterprise-certificate-proxy"] version = "v0.3.2" hash = "sha256-wVuR3QC0mYFl5LNeKdRXdKdod7BGP5sv2h6VVib85v8=" @@ -340,8 +346,8 @@ schema = 3 version = "v1.6.0" hash = "sha256-UV0equpmW6BiJnp4W3TZlSJ+PTHuTA+CdOs2JTeHhjs=" [mod."github.com/hashicorp/golang-lru"] - version = "v0.5.5-0.20210104140557-80c98217689d" - hash = "sha256-w5utLMR7p5pF9xX+mI3N9NyfQ8ixNXNTgfXDu8fudmc=" + version = "v1.0.2" + hash = "sha256-yy+5botc6T5wXgOe2mfNXJP3wr+MkVlUZ2JBkmmrA48=" [mod."github.com/hashicorp/hcl"] version = "v1.0.0" hash = "sha256-xsRCmYyBfglMxeWUvTZqkaRLSW+V2FvNodEDjTGg1WA=" @@ -376,8 +382,8 @@ schema = 3 version = "v1.0.0" hash = "sha256-xEd0mDBeq3eR/GYeXjoTVb2sPs8sTCosn5ayWkcgENI=" [mod."github.com/klauspost/compress"] - version = "v1.16.7" - hash = "sha256-8miX/lnXyNLPSqhhn5BesLauaIAxETpQpWtr1cu2f+0=" + version = "v1.17.7" + hash = "sha256-UkW+tAFEZYj067z9gXDQjQx0dCF8noCn5OSw/APh4oo=" [mod."github.com/kr/pretty"] version = "v0.3.1" hash = "sha256-DlER7XM+xiaLjvebcIPiB12oVNjyZHuJHoRGITzzpKU=" @@ -391,8 +397,8 @@ schema = 3 version = "v0.1.0" hash = "sha256-wQqGTtRWsfR9n0O/SXHVgECebbnNmHddxJIbG63OJBQ=" [mod."github.com/linxGnu/grocksdb"] - version = "v1.8.6" - hash = "sha256-QOiVB6QU3AKNuuw1dbslszl+CwCF52f0hfb3YXDvLq8=" + version = "v1.8.13" + hash = "sha256-Fkqr0WKMAOtG0SbWzeuxO8Tg+i5/Oi+mLC791AShT0g=" [mod."github.com/magiconair/properties"] version = "v1.8.7" hash = "sha256-XQ2bnc2s7/IH3WxEO4GishZurMyKwEclZy1DXg+2xXc=" @@ -439,29 +445,29 @@ schema = 3 version = "v1.27.4" hash = "sha256-Fhltm/e6KVXdwfUl65cE8PD1MLyXJa7OH0lg4Bvewv0=" [mod."github.com/pelletier/go-toml/v2"] - version = "v2.0.8" - hash = "sha256-wWxswr/lTq+McYbScmJM1ECKQ6eNJ5m44SM7TmrHThM=" + version = "v2.1.0" + hash = "sha256-0u6oV8YMM26y2bw1oe3gLmEJc/whpNaFtEe4yOkN24c=" [mod."github.com/petermattis/goid"] - version = "v0.0.0-20230317030725-371a4b8eda08" - hash = "sha256-Qv2rrenuLtrrW+fCd6L4pwXoyYC3znd0ndhzYS4REOM=" + version = "v0.0.0-20231207134359-e60b3f734c67" + hash = "sha256-73DbyhUTwYhqmvbcI96CNblTrfl6uz9OvM6z/h8j5TM=" [mod."github.com/pkg/errors"] version = "v0.9.1" hash = "sha256-mNfQtcrQmu3sNg/7IwiieKWOgFQOVVe2yXgKBpe/wZw=" [mod."github.com/pmezard/go-difflib"] - version = "v1.0.0" - hash = "sha256-/FtmHnaGjdvEIKAJtrUfEhV7EVo5A/eYrtdnUkuxLDA=" + version = "v1.0.1-0.20181226105442-5d4384ee4fb2" + hash = "sha256-XA4Oj1gdmdV/F/+8kMI+DBxKPthZ768hbKsO3d9Gx90=" [mod."github.com/prometheus/client_golang"] version = "v1.14.0" hash = "sha256-dpgGV8C30ZCn7b9mQ+Ye2AfPXTIuHLQbl2olMKzJKxA=" [mod."github.com/prometheus/client_model"] - version = "v0.3.0" - hash = "sha256-vP+miJfsoK5UG9eug8z/bhAMj3bwg66T2vIh8WHoOKU=" + version = "v0.6.1" + hash = "sha256-rIDyUzNfxRA934PIoySR0EhuBbZVRK/25Jlc/r8WODw=" [mod."github.com/prometheus/common"] version = "v0.42.0" hash = "sha256-dJqoPZKtY2umWFWwMeRYY9I2JaFlpcMX4atkEcN5+hs=" [mod."github.com/prometheus/procfs"] - version = "v0.9.0" - hash = "sha256-imZN+1HRpMvgmrot2V+AK5ueYLmsp49vZfHtx2N6Wek=" + version = "v0.13.0" + hash = "sha256-J31K36TkIiQU2EGOcmqDa+dkoKXiVuxafPVT4rKbEsg=" [mod."github.com/prometheus/tsdb"] version = "v0.7.1" hash = "sha256-BPz7YJbfMZgeR+u9YaeWeipVzHIS73EdgXD7VSJSLbA=" @@ -475,8 +481,8 @@ schema = 3 version = "v0.9.1" hash = "sha256-YLGNrHHM+mN4ElW/XWuylOnFrA/VjSY+eBuC4LN//5c=" [mod."github.com/rogpeppe/go-internal"] - version = "v1.11.0" - hash = "sha256-BucSndJVnqX9e6p5PfA6Z8N2bGfIeRfxAxYLUDXTbIo=" + version = "v1.12.0" + hash = "sha256-qvDNCe3l84/LgrA8X4O15e1FeDcazyX91m9LmXGXX6M=" [mod."github.com/rs/cors"] version = "v1.8.3" hash = "sha256-VgVB4HKAhPSjNg96mIEUN1bt5ZQng8Fi3ZABy3CDWQE=" @@ -490,14 +496,14 @@ schema = 3 version = "v3.21.4-0.20210419000835-c7a38de76ee5+incompatible" hash = "sha256-oqIqyFquWabIE6DID6uTEc8oFEmM1rVu2ATn3toiCEg=" [mod."github.com/spf13/afero"] - version = "v1.9.5" - hash = "sha256-+XECQxkx0P+ZaQDm4dQ6ItMtHMj+2uNemEC18dsdor0=" + version = "v1.11.0" + hash = "sha256-+rV3cDZr13N8E0rJ7iHmwsKYKH+EhV+IXBut+JbBiIE=" [mod."github.com/spf13/cast"] - version = "v1.5.1" - hash = "sha256-/tQNGGQv+Osp+2jepQaQe6GlncZbqdxzSR82FieiUBU=" + version = "v1.6.0" + hash = "sha256-hxioqRZfXE0AE5099wmn3YG0AZF8Wda2EB4c7zHF6zI=" [mod."github.com/spf13/cobra"] - version = "v1.7.0" - hash = "sha256-bom9Zpnz8XPwx9IVF+GAodd3NVQ1dM1Uwxn8sy4Gmzs=" + version = "v1.8.0" + hash = "sha256-oAE+fEaRfZPE541IPWE0GMeBBYgH2DMhtZNxzp7DFlY=" [mod."github.com/spf13/jwalterweatherman"] version = "v1.1.0" hash = "sha256-62BQtqTLF/eVrTOr7pUXE7AiHRjOVC8jQs3/Ehmflfs=" @@ -511,14 +517,14 @@ schema = 3 version = "v0.2.0" hash = "sha256-UUiGmlgaIZDeMUJv3fdZBoQ9hJeSsg2ixRGmm6TgHug=" [mod."github.com/stretchr/objx"] - version = "v0.5.0" - hash = "sha256-nY4mvP0f0Ry1IKMKQAYNuioA5h4red4mmQqeGZw6EF0=" + version = "v0.5.2" + hash = "sha256-VKYxrrFb1nkX6Wu3tE5DoP9+fCttwSl9pgLN6567nck=" [mod."github.com/stretchr/testify"] - version = "v1.8.4" - hash = "sha256-MoOmRzbz9QgiJ+OOBo5h5/LbilhJfRUryvzHJmXAWjo=" + version = "v1.9.0" + hash = "sha256-uUp/On+1nK+lARkTVtb5RxlW15zxtw2kaAFuIASA+J0=" [mod."github.com/subosito/gotenv"] - version = "v1.4.2" - hash = "sha256-LnrDR1k/AoCFWBMcU7vQsoQLkZ65evT2hoQHLDudTsg=" + version = "v1.6.0" + hash = "sha256-LspbjTniiq2xAICSXmgqP7carwlNaLqnCTQfw2pa80A=" [mod."github.com/syndtr/goleveldb"] version = "v1.0.1-0.20210819022825-2ae1ddf74ef7" hash = "sha256-36a4hgVQfwtS2zhylKpQuFhrjdc/Y8pF0dxc26jcZIU=" @@ -527,8 +533,8 @@ schema = 3 version = "v0.16.0" hash = "sha256-JW4zO/0vMzf1dXLePOqaMtiLUZgNbuIseh9GV+jQlf0=" [mod."github.com/tidwall/btree"] - version = "v1.6.0" - hash = "sha256-H4S46Yk3tVfOtrEhVWUrF4S1yWYmzU43W80HlzS9rcY=" + version = "v1.7.0" + hash = "sha256-bnr6c7a0nqo2HyGqxHk0kEZCEsjLYkPbAVY9WzaZ30o=" [mod."github.com/tklauser/go-sysconf"] version = "v0.3.10" hash = "sha256-Zf2NsgM9+HeM949vCce4HQtSbfUiFpeiQ716yKcFyx4=" @@ -553,63 +559,72 @@ schema = 3 [mod."go.opencensus.io"] version = "v0.24.0" hash = "sha256-4H+mGZgG2c9I1y0m8avF4qmt8LUKxxVsTqR8mKgP4yo=" + [mod."go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"] + version = "v0.47.0" + hash = "sha256-D+bP2jEZcB4S8AprlDM3qAghYtxhqc8fSKZNac6WVFs=" + [mod."go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"] + version = "v0.47.0" + hash = "sha256-Pv1X0oIWYXyVxEaDQmgYcw+49I9+65N9Y+1wbxoXOog=" [mod."go.opentelemetry.io/otel"] - version = "v1.19.0" - hash = "sha256-y51fwO/y73QBdwwRnCp+wrvVuWLeqfSnU/I8i4mBK84=" + version = "v1.22.0" + hash = "sha256-4K70RPjaPzPpTO/VkE9ueoSo9EANuNXneDR6jEiUaJQ=" [mod."go.opentelemetry.io/otel/metric"] - version = "v1.19.0" - hash = "sha256-eYeeR8XUPjoF6lY3Yg1VUL0dPum/18KAcpo5k6zY67E=" + version = "v1.22.0" + hash = "sha256-Lb4wdlZNmz6Ut6CljBAePSUA8X0RBEOEDyOl2oO+pL8=" [mod."go.opentelemetry.io/otel/trace"] - version = "v1.19.0" - hash = "sha256-EVsShx1IO0zpMztSfqYQ32Gm+hV4wrVM8wWkEfHOaoM=" + version = "v1.22.0" + hash = "sha256-38zzkmcoOzYYeDN+rC44HmwmdnalIcEpObCS6tIvMO8=" [mod."golang.org/x/crypto"] - version = "v0.16.0" - hash = "sha256-DgSVOnXRK8GF01p5rLtq4qPBcglwEoOk8qhW2EGfJfA=" + version = "v0.22.0" + hash = "sha256-2+u9nd32+Bi7EEv7QFc12CRTbfV7DApNv+yKIr7+lTw=" [mod."golang.org/x/exp"] version = "v0.0.0-20230711153332-06a737ee72cb" hash = "sha256-Cbw10ZJ+jATPV232G47xZrn6ExO1FDtiT6nlMRCH7EI=" [mod."golang.org/x/net"] - version = "v0.19.0" - hash = "sha256-3M5rKEvJx4cO/q+06cGjR5sxF5JpnUWY0+fQttrWdT4=" + version = "v0.24.0" + hash = "sha256-w1c21ljta5wNIyel9CSIn/crPzwOCRofNKhqmfs4aEQ=" [mod."golang.org/x/oauth2"] - version = "v0.13.0" - hash = "sha256-mEmRQrh6FMsenT7x406HbZCynBJCHJ4e9u0M3hpG3m4=" + version = "v0.17.0" + hash = "sha256-M2ZZQZt449RJL18YpzGiAiqfGsDVMsr1IVWbYp/G/go=" [mod."golang.org/x/sync"] - version = "v0.4.0" - hash = "sha256-VCl5IerUva6XZqGXHa0J/r/ewsbOIIP7EBqyh1JGsXY=" + version = "v0.6.0" + hash = "sha256-LLims/wjDZtIqlYCVHREewcUOX4hwRwplEuZKPOJ/HI=" [mod."golang.org/x/sys"] - version = "v0.16.0" - hash = "sha256-ZkGclbp2S7NQYhbuGji6XokCn2Qi1BJy8dwyAOTV8sY=" + version = "v0.19.0" + hash = "sha256-cmuL31TYLJmDm/fDnI2Sn0wB88cpdOHV1+urorsJWx4=" [mod."golang.org/x/term"] - version = "v0.15.0" - hash = "sha256-rsvtsE7sKmBwtR+mhJ8iUq93ZT8fV2LU+Pd69sh2es8=" + version = "v0.19.0" + hash = "sha256-wFwEMwhtsr0C4mqjxukjMM7lxJLYPvb7gAPO95xyhyg=" [mod."golang.org/x/text"] version = "v0.14.0" hash = "sha256-yh3B0tom1RfzQBf1RNmfdNWF1PtiqxV41jW1GVS6JAg=" + [mod."golang.org/x/time"] + version = "v0.5.0" + hash = "sha256-W6RgwgdYTO3byIPOFxrP2IpAZdgaGowAaVfYby7AULU=" [mod."golang.org/x/tools"] version = "v0.7.0" hash = "sha256-ZEjfFulQd6U9r4mEJ5RZOnW49NZnQnrCFLMKCgLg7go=" [mod."google.golang.org/api"] - version = "v0.149.0" - hash = "sha256-nR3mk7wAsjvMEGsOiPKvqQwt789m6a+BDThpfTx0doA=" + version = "v0.162.0" + hash = "sha256-+AsT4DPjefEmPPelZoSHuQ8nCHhmhhUWU4UGnJ/8+fg=" [mod."google.golang.org/appengine"] version = "v1.6.8" hash = "sha256-decMa0MiWfW/Bzr8QPPzzpeya0YWGHhZAt4Cr/bD1wQ=" [mod."google.golang.org/genproto"] - version = "v0.0.0-20240102182953-50ed04b92917" - hash = "sha256-iTzbVZIeGfcI/ZnDJqJZDxBCJ2J6vlYVdpE7wJX0sXI=" + version = "v0.0.0-20240227224415-6ceb2ff114de" + hash = "sha256-G+tvsCTXxzk3sS6HbBxPN1DYaN1tPOqKsa60mI05Feg=" [mod."google.golang.org/genproto/googleapis/api"] - version = "v0.0.0-20231212172506-995d672761c0" - hash = "sha256-K85oYmTXZlQ+dOtyL4k1Oy6Qql2uqRUBOk+9TvRlPpE=" + version = "v0.0.0-20240227224415-6ceb2ff114de" + hash = "sha256-H3d2ZhPJI9RH5EK9NsxUAFmT6tr2DgGV9SjZgqJ80r4=" [mod."google.golang.org/genproto/googleapis/rpc"] - version = "v0.0.0-20240108191215-35c7eff3a6b1" - hash = "sha256-bwWoFG+H827aJ3VunK7emdQz3BQlTTjWlM513kTZqSo=" + version = "v0.0.0-20240401170217-c3f982113cda" + hash = "sha256-P5SBku16dYnK4koUQxTeGwPxAAWH8rxbDm2pOzFLo/Q=" [mod."google.golang.org/grpc"] - version = "v1.60.1" - hash = "sha256-JJ3X6DTUZWYtM8i8izWTH9nDvCydzea31iZt6ULDvsw=" + version = "v1.63.2" + hash = "sha256-RmtVjYLam97k7IHTHU7Gn16xNX+GvA9AiLKlQwOiZXU=" [mod."google.golang.org/protobuf"] - version = "v1.32.0" - hash = "sha256-GJuTkMGHCzHbyK4yD5kY4oMn8wQWqgkeBK//yVDqHJk=" + version = "v1.33.0" + hash = "sha256-cWwQjtUwSIEkAlAadrlxK1PYZXTRrV4NKzt7xDpJgIU=" [mod."gopkg.in/ini.v1"] version = "v1.67.0" hash = "sha256-V10ahGNGT+NLRdKUyRg1dos5RxLBXBk1xutcnquc/+4=" diff --git a/server/indexer_cmd.go b/server/indexer_cmd.go index 2d19489232..e4cd56dda7 100644 --- a/server/indexer_cmd.go +++ b/server/indexer_cmd.go @@ -55,7 +55,7 @@ func NewIndexTxCmd() *cobra.Command { cfg := serverCtx.Config home := cfg.RootDir logger := serverCtx.Logger - idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(serverCtx.Viper)) + idxDB, err := OpenIndexerDB(serverCtx.Viper, home, server.GetAppDBBackend(serverCtx.Viper)) if err != nil { logger.Error("failed to open evm indexer DB", "error", err.Error()) return err diff --git a/server/start.go b/server/start.go index 823bfc99f0..150bfcea4e 100644 --- a/server/start.go +++ b/server/start.go @@ -26,15 +26,10 @@ import ( "runtime/pprof" "time" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/telemetry" - - "github.com/spf13/cobra" - - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" - + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/tools/rosetta" + crgserver "cosmossdk.io/tools/rosetta/lib/server" + "github.com/Kava-Labs/opendb" dbm "github.com/cometbft/cometbft-db" abciserver "github.com/cometbft/cometbft/abci/server" tcmd "github.com/cometbft/cometbft/cmd/cometbft/commands" @@ -43,24 +38,23 @@ import ( "github.com/cometbft/cometbft/p2p" pvm "github.com/cometbft/cometbft/privval" "github.com/cometbft/cometbft/proxy" - "github.com/cometbft/cometbft/rpc/client/local" - - "cosmossdk.io/tools/rosetta" - crgserver "cosmossdk.io/tools/rosetta/lib/server" - - ethmetricsexp "github.com/ethereum/go-ethereum/metrics/exp" - - errorsmod "cosmossdk.io/errors" - _ "github.com/Kava-Labs/opendb" rpcclient "github.com/cometbft/cometbft/rpc/client" + "github.com/cometbft/cometbft/rpc/client/local" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/server" "github.com/cosmos/cosmos-sdk/server/api" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servergrpc "github.com/cosmos/cosmos-sdk/server/grpc" "github.com/cosmos/cosmos-sdk/server/types" pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types" + "github.com/cosmos/cosmos-sdk/telemetry" + ethmetricsexp "github.com/ethereum/go-ethereum/metrics/exp" + "github.com/spf13/cobra" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" "github.com/evmos/ethermint/indexer" ethdebug "github.com/evmos/ethermint/rpc/namespaces/ethereum/debug" @@ -296,6 +290,16 @@ func startStandAlone(ctx *server.Context, opts StartOptions) error { return server.WaitForQuitSignals() } +// DBProviderFromAppOpts returns a database using the DBBackend and DBDir specified in the ctx.Config. +// It uses opendb package which takes into account appOpts and provides configurability and observability. +func DBProviderFromAppOpts(appOpts types.AppOptions) node.DBProvider { + return func(ctx *node.DBContext) (dbm.DB, error) { + dbType := dbm.BackendType(ctx.Config.DBBackend) + + return opendb.OpenDB(appOpts, ctx.Config.DBDir(), ctx.ID, dbType) + } +} + // legacyAminoCdc is used for the legacy REST API func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOptions) (err error) { cfg := ctx.Config @@ -386,7 +390,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt nodeKey, proxy.NewLocalClientCreator(app), genDocProvider, - node.DefaultDBProvider, + DBProviderFromAppOpts(ctx.Viper), node.DefaultMetricsProvider(cfg.Instrumentation), ctx.Logger.With("server", "node"), ) @@ -431,7 +435,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, opts StartOpt var idxer ethermint.EVMTxIndexer if config.JSONRPC.EnableIndexer { - idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(ctx.Viper)) + idxDB, err := OpenIndexerDB(ctx.Viper, home, server.GetAppDBBackend(ctx.Viper)) if err != nil { logger.Error("failed to open evm indexer DB", "error", err.Error()) return err @@ -649,9 +653,10 @@ func openDB(_ types.AppOptions, rootDir string, backendType dbm.BackendType) (db } // OpenIndexerDB opens the custom eth indexer db, using the same db backend as the main app -func OpenIndexerDB(rootDir string, backendType dbm.BackendType) (dbm.DB, error) { +func OpenIndexerDB(appOpts types.AppOptions, rootDir string, backendType dbm.BackendType) (dbm.DB, error) { dataDir := filepath.Join(rootDir, "data") - return dbm.NewDB("evmindexer", backendType, dataDir) + + return opendb.OpenDB(appOpts, dataDir, "evmindexer", backendType) } func openTraceWriter(traceWriterFile string) (w io.Writer, err error) {