diff --git a/app/app.go b/app/app.go index c69e14b3..9fabc628 100644 --- a/app/app.go +++ b/app/app.go @@ -121,6 +121,10 @@ import ( gasestimatekeeper "github.com/ojo-network/ojo/x/gasestimate/keeper" gasestimatetypes "github.com/ojo-network/ojo/x/gasestimate/types" + "github.com/ojo-network/ojo/x/symbiotic" + symbiotickeeper "github.com/ojo-network/ojo/x/symbiotic/keeper" + symbiotictypes "github.com/ojo-network/ojo/x/symbiotic/types" + "github.com/ojo-network/ojo/x/airdrop" airdropkeeper "github.com/ojo-network/ojo/x/airdrop/keeper" airdroptypes "github.com/ojo-network/ojo/x/airdrop/types" @@ -150,6 +154,7 @@ var ( oracletypes.ModuleName: {authtypes.Minter}, gmptypes.ModuleName: {authtypes.Minter}, gasestimatetypes.ModuleName: {authtypes.Burner}, + symbiotictypes.ModuleName: {authtypes.Minter}, airdroptypes.ModuleName: {authtypes.Minter}, } ) @@ -208,6 +213,7 @@ type App struct { GmpKeeper gmpkeeper.Keeper GasEstimateKeeper gasestimatekeeper.Keeper AirdropKeeper airdropkeeper.Keeper + SymbioticKeeper symbiotickeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper // make scoped keepers public for test purposes @@ -270,7 +276,7 @@ func New( govtypes.StoreKey, paramstypes.StoreKey, ibcexported.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, consensusparamtypes.StoreKey, group.StoreKey, oracletypes.StoreKey, gmptypes.StoreKey, - gasestimatetypes.ModuleName, airdroptypes.StoreKey, + gasestimatetypes.ModuleName, airdroptypes.StoreKey, symbiotictypes.StoreKey, ) tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := storetypes.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) @@ -421,6 +427,13 @@ func New( authtypes.NewModuleAddress(govtypes.ModuleName).String(), ) + app.SymbioticKeeper = symbiotickeeper.NewKeeper( + appCodec, + keys[symbiotictypes.ModuleName], + app.StakingKeeper, + authtypes.NewModuleAddress(govtypes.ModuleName).String(), + ) + app.OracleKeeper = oraclekeeper.NewKeeper( appCodec, keys[oracletypes.ModuleName], @@ -430,6 +443,7 @@ func New( app.DistrKeeper, app.StakingKeeper, app.GasEstimateKeeper, + app.SymbioticKeeper, distrtypes.ModuleName, cast.ToBool(appOpts.Get("telemetry.enabled")), authtypes.NewModuleAddress(govtypes.ModuleName).String(), @@ -596,6 +610,7 @@ func New( oracle.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper), gmp.NewAppModule(appCodec, app.GmpKeeper, app.OracleKeeper), gasestimate.NewAppModule(appCodec, app.GasEstimateKeeper), + symbiotic.NewAppModule(appCodec, app.SymbioticKeeper), airdrop.NewAppModule(appCodec, app.AirdropKeeper, app.AccountKeeper, app.BankKeeper), consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper), ) @@ -632,6 +647,7 @@ func New( distrtypes.ModuleName, slashingtypes.ModuleName, evidencetypes.ModuleName, + symbiotictypes.ModuleName, stakingtypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, @@ -655,6 +671,7 @@ func New( app.mm.SetOrderEndBlockers( crisistypes.ModuleName, govtypes.ModuleName, + symbiotictypes.ModuleName, stakingtypes.ModuleName, ibctransfertypes.ModuleName, ibcexported.ModuleName, @@ -685,12 +702,12 @@ func New( // so that other modules that want to create or claim capabilities afterwards in InitChain // can do so safely. genesisModuleOrder := []string{ - capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, - distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, - minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, ibctransfertypes.ModuleName, - ibcexported.ModuleName, evidencetypes.ModuleName, authz.ModuleName, feegrant.ModuleName, - group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, - oracletypes.ModuleName, gmptypes.ModuleName, gasestimatetypes.ModuleName, + capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, + symbiotictypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, + govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, + ibctransfertypes.ModuleName, ibcexported.ModuleName, evidencetypes.ModuleName, authz.ModuleName, + feegrant.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName, + vestingtypes.ModuleName, oracletypes.ModuleName, gmptypes.ModuleName, gasestimatetypes.ModuleName, airdroptypes.ModuleName, consensusparamtypes.ModuleName, } app.mm.SetOrderInitGenesis(genesisModuleOrder...) @@ -1011,6 +1028,7 @@ func initParamsKeeper( paramsKeeper.Subspace(crisistypes.ModuleName) paramsKeeper.Subspace(oracletypes.ModuleName) paramsKeeper.Subspace(gasestimatetypes.ModuleName) + paramsKeeper.Subspace(symbiotictypes.ModuleName) // register the key tables for legacy param subspaces keyTable := ibcclienttypes.ParamKeyTable() diff --git a/app/preblocker.go b/app/preblocker.go index 0df1c144..479e0d74 100644 --- a/app/preblocker.go +++ b/app/preblocker.go @@ -10,6 +10,7 @@ import ( "github.com/ojo-network/ojo/x/oracle/types" gasestimatetypes "github.com/ojo-network/ojo/x/gasestimate/types" + symbiotictypes "github.com/ojo-network/ojo/x/symbiotic/types" ) // PreBlocker is run before finalize block to update the aggregrate exchange rate votes on the oracle module @@ -67,6 +68,13 @@ func (app *App) PreBlocker(ctx sdk.Context, req *cometabci.RequestFinalizeBlock) }) } app.Logger().Info("gas estimates updated", "gasestimates", injectedVoteExtTx.GasEstimateMedians) + + currentBlockHash := app.OracleKeeper.SymbioticKeeper.TallyBlockHashVotes(ctx, injectedVoteExtTx.BlockHashVotes) + cachedBlockHash := symbiotictypes.CachedBlockHash{ + BlockHash: currentBlockHash, + Height: req.Height, + } + app.OracleKeeper.SymbioticKeeper.SetCachedBlockHash(ctx, cachedBlockHash) } app.Logger().Info( diff --git a/go.mod b/go.mod index 153dd59a..18d25865 100644 --- a/go.mod +++ b/go.mod @@ -18,15 +18,15 @@ require ( cosmossdk.io/x/upgrade v0.1.2 github.com/armon/go-metrics v0.4.1 github.com/bufbuild/buf v1.31.0 - github.com/cometbft/cometbft v0.38.7 + github.com/cometbft/cometbft v0.38.15 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/cosmos-sdk v0.50.6 github.com/cosmos/go-bip39 v1.0.0 - github.com/cosmos/gogoproto v1.4.12 + github.com/cosmos/gogoproto v1.7.0 github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/v8 v8.2.1 - github.com/ethereum/go-ethereum v1.14.2 + github.com/ethereum/go-ethereum v1.14.11 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.4 github.com/golangci/golangci-lint v1.60.3 @@ -41,14 +41,14 @@ require ( github.com/rs/zerolog v1.32.0 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.1 - github.com/spf13/viper v1.18.2 + github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 golang.org/x/sync v0.8.0 golang.org/x/tools v0.24.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f - google.golang.org/grpc v1.64.1 + google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 + google.golang.org/grpc v1.67.1 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 - google.golang.org/protobuf v1.34.2 + google.golang.org/protobuf v1.35.1 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.1 mvdan.cc/gofumpt v0.7.0 @@ -84,10 +84,11 @@ require ( github.com/DataDog/zstd v1.5.5 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect - github.com/Masterminds/semver/v3 v3.2.1 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect + github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect + github.com/StackExchange/wmi v1.2.1 // indirect github.com/alecthomas/go-check-sumtype v0.1.4 // indirect github.com/alexkohler/nakedret/v2 v2.0.4 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect @@ -99,13 +100,13 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect - github.com/bits-and-blooms/bitset v1.10.0 // indirect + github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/bkielbasa/cyclop v1.2.1 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect github.com/bombsimon/wsl/v4 v4.4.1 // indirect github.com/breml/bidichk v0.2.7 // indirect github.com/breml/errchkjson v0.3.6 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 // indirect github.com/bufbuild/protocompile v0.9.0 // indirect github.com/bufbuild/protovalidate-go v0.6.2 // indirect @@ -115,19 +116,21 @@ require ( github.com/catenacyber/perfsprint v0.7.1 // indirect github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/ckaznocha/intrange v0.1.2 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.11.1 // indirect + github.com/cockroachdb/errors v1.11.3 // indirect + github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v1.1.0 // indirect + github.com/cockroachdb/pebble v1.1.2 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft-db v0.11.0 // indirect + github.com/cometbft/cometbft-db v0.14.1 // indirect + github.com/consensys/bavard v0.1.13 // indirect + github.com/consensys/gnark-crypto v0.12.1 // indirect github.com/containerd/continuity v0.4.1 // indirect github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -136,18 +139,20 @@ require ( github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c // indirect + github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/creachadair/atomicfile v0.3.1 // indirect github.com/creachadair/tomledit v0.0.24 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/daixiang0/gci v0.13.4 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/denis-tingaikin/go-header v0.5.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect - github.com/dgraph-io/badger/v2 v2.2007.4 // indirect + github.com/dgraph-io/badger/v4 v4.2.0 // indirect github.com/dgraph-io/ristretto v0.1.1 // indirect - github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/distribution/reference v0.6.0 // indirect github.com/docker/cli v26.1.0+incompatible // indirect github.com/docker/distribution v2.8.3+incompatible // indirect @@ -158,6 +163,8 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.1 // indirect + github.com/ethereum/c-kzg-4844 v1.0.0 // indirect + github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 // indirect github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/color v1.17.0 // indirect github.com/fatih/structtag v1.2.0 // indirect @@ -177,6 +184,7 @@ require ( github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.15.0 // indirect @@ -194,7 +202,7 @@ require ( github.com/gofrs/flock v0.12.1 // indirect github.com/gofrs/uuid/v5 v5.1.0 // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang/glog v1.2.0 // indirect + github.com/golang/glog v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/mock v1.6.0 // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect @@ -205,8 +213,9 @@ require ( github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/golangci/revgrep v0.5.3 // indirect github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect - github.com/google/btree v1.1.2 // indirect + github.com/google/btree v1.1.3 // indirect github.com/google/cel-go v0.20.1 // indirect + github.com/google/flatbuffers v1.12.1 // indirect github.com/google/go-cmp v0.6.0 // indirect github.com/google/go-containerregistry v0.19.1 // indirect github.com/google/orderedcode v0.0.1 // indirect @@ -218,7 +227,7 @@ require ( github.com/googleapis/gax-go/v2 v2.13.0 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gorilla/handlers v1.5.2 // indirect - github.com/gorilla/websocket v1.5.1 // indirect + github.com/gorilla/websocket v1.5.3 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect @@ -234,11 +243,12 @@ require ( github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect - github.com/holiman/uint256 v1.2.4 // indirect + github.com/holiman/uint256 v1.3.1 // indirect github.com/huandu/skiplist v1.2.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect @@ -255,7 +265,7 @@ require ( github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect github.com/kisielk/errcheck v1.7.0 // indirect github.com/kkHAIKE/contextcheck v1.1.5 // indirect - github.com/klauspost/compress v1.17.8 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -268,7 +278,6 @@ require ( github.com/leodido/go-urn v1.2.4 // indirect github.com/leonklingele/grouper v1.1.2 // indirect github.com/lib/pq v1.10.9 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/lufeee/execinquery v1.2.1 // indirect github.com/macabu/inamedparam v0.1.3 // indirect @@ -281,14 +290,16 @@ require ( github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517 // indirect - github.com/minio/highwayhash v1.0.2 // indirect + github.com/minio/highwayhash v1.0.3 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.5.0 // indirect github.com/moricho/tparallel v0.3.2 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/mtibben/percent v0.2.1 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect @@ -301,16 +312,16 @@ require ( github.com/opencontainers/image-spec v1.1.0 // indirect github.com/opencontainers/runc v1.1.12 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect - github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect + github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.7.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/polyfloyd/go-errorlint v1.6.0 // indirect - github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.52.2 // indirect - github.com/prometheus/procfs v0.13.0 // indirect + github.com/prometheus/common v0.60.1 // indirect + github.com/prometheus/procfs v0.15.1 // indirect github.com/quasilyte/go-ruleguard v0.4.2 // indirect github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect @@ -319,7 +330,7 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect - github.com/rs/cors v1.10.1 // indirect + github.com/rs/cors v1.11.1 // indirect github.com/rs/xid v1.5.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/ryancurrah/gomodguard v1.3.3 // indirect @@ -328,11 +339,12 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect - github.com/sasha-s/go-deadlock v0.3.1 // indirect + github.com/sasha-s/go-deadlock v0.3.5 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect github.com/securego/gosec/v2 v2.20.1-0.20240822074752-ab3f6c1c83a0 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect + github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect github.com/sivchari/tenv v1.10.0 // indirect @@ -346,6 +358,7 @@ require ( github.com/stoewer/go-strcase v1.3.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.6.0 // indirect + github.com/supranational/blst v0.3.13 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect github.com/tendermint/go-amino v0.16.0 // indirect @@ -353,6 +366,8 @@ require ( github.com/tidwall/btree v1.7.0 // indirect github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect + github.com/tklauser/go-sysconf v0.3.12 // indirect + github.com/tklauser/numcpus v0.6.1 // indirect github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ulikunitz/xz v0.5.11 // indirect @@ -372,7 +387,7 @@ require ( gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.12.2 // indirect go-simpler.org/sloglint v0.7.2 // indirect - go.etcd.io/bbolt v1.3.8 // indirect + go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.51.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.51.0 // indirect @@ -385,25 +400,26 @@ require ( go.uber.org/automaxprocs v1.5.3 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.26.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect golang.org/x/mod v0.20.0 // indirect - golang.org/x/net v0.28.0 // indirect - golang.org/x/oauth2 v0.22.0 // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect + golang.org/x/net v0.30.0 // indirect + golang.org/x/oauth2 v0.23.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.6.0 // indirect google.golang.org/api v0.192.0 // indirect google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect honnef.co/go/tools v0.5.1 // indirect mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect nhooyr.io/websocket v1.8.7 // indirect pgregory.net/rapid v1.1.0 // indirect + rsc.io/tmplfunc v0.0.3 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) diff --git a/go.sum b/go.sum index 83957dfc..e00d1b82 100644 --- a/go.sum +++ b/go.sum @@ -262,22 +262,25 @@ github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5H github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0/go.mod h1:ONJg5sxcbsdQQ4pOW8TGdTidT2TMAUy/2Xhr8mrYaao= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= -github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= -github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= +github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= +github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= +github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= -github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= -github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= +github.com/adlio/schema v1.3.6 h1:k1/zc2jNfeiZBA5aFTRy37jlBIuCkXCm0XmvpzCKI9I= +github.com/adlio/schema v1.3.6/go.mod h1:qkxwLgPBd1FgLRHYVCmQT/rrBr3JH38J9LjmVzWNudg= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= @@ -302,7 +305,6 @@ github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9 github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= 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= @@ -328,8 +330,8 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= -github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.13.0 h1:bAQ9OPNFYbGHV6Nez0tmNI0RiEu7/hxlYJRUA0wFAVE= +github.com/bits-and-blooms/bitset v1.13.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJY= github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= @@ -340,10 +342,10 @@ github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= -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.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= -github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcutil v1.1.6 h1:zFL2+c3Lb9gEgqKNzowKUPQNb8jV7v5Oaodi/AYFd6c= +github.com/btcsuite/btcd/btcutil v1.1.6/go.mod h1:9dFymx8HpuLqBnsPELrImQeTQfKBQqzqGbbV3jK55aE= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 h1:KdUfX2zKommPRa+PD0sWZUyXe9w277ABlgELO7H04IM= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bufbuild/buf v1.31.0 h1:YHLGIr8bjcLaTCIw0+/bCAvJLiR8u46QTwKvn7miSEg= @@ -369,7 +371,6 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= 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.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -411,29 +412,33 @@ github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOG github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= -github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/errors v1.11.3 h1:5bA+k2Y6r+oz/6Z/RFlNeVCesGARKuC6YymtcDrbC/I= +github.com/cockroachdb/errors v1.11.3/go.mod h1:m4UIW4CDjx+R5cybPsNrRbreomiFqt8o1h1wUVazSd8= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/esnpM7Geqxka4WSqI1SZc7sMJFd3y4= +github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= -github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA= +github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= -github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= -github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= -github.com/cometbft/cometbft-db v0.11.0/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc= +github.com/cometbft/cometbft v0.38.15 h1:5veFd8k1uXM27PBg9sMO3hAfRJ3vbh4OmmLf6cVrqXg= +github.com/cometbft/cometbft v0.38.15/go.mod h1:+wh6ap6xctVG+JOHwbl8pPKZ0GeqdPYqISu7F4b43cQ= +github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= +github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= +github.com/consensys/bavard v0.1.13 h1:oLhMLOFGTLdlda/kma4VOJazblc7IM5y5QPd2A/YjhQ= +github.com/consensys/bavard v0.1.13/go.mod h1:9ItSMtA/dXMAiL7BG6bqW2m3NdSEObYWoH223nGHukI= +github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= +github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/containerd/continuity v0.4.1 h1:wQnVrjIyQ8vhU2sgOiL5T07jo+ouqc2bnKsv5/EqGhU= github.com/containerd/continuity v0.4.1/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/stargz-snapshotter/estargz v0.15.1 h1:eXJjw9RbkLFgioVaTG+G/ZW/0kEe2oEKCdS/ZxIyoCU= github.com/containerd/stargz-snapshotter/estargz v0.15.1/go.mod h1:gr2RNwukQ/S9Nv33Lt6UC7xEx58C+LHRdoqbEKjz1Kk= -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/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -451,8 +456,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= -github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro= +github.com/cosmos/gogoproto v1.7.0/go.mod h1:yWChEv5IUEYURQasfyBW5ffkMHR/90hiHgbNgrtp4j0= github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ibc-go/modules/capability v1.0.0 h1:r/l++byFtn7jHYa09zlAdSeevo8ci1mVZNO9+V0xsLE= @@ -463,10 +468,13 @@ github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZD github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= github.com/cosmos/ledger-cosmos-go v0.13.3/go.mod h1:HENcEP+VtahZFw38HZ3+LS3Iv5XV6svsnkk9vdJtLr8= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= +github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= +github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creachadair/atomicfile v0.3.1 h1:yQORkHjSYySh/tv5th1dkKcn02NEW5JleB84sjt+W4Q= github.com/creachadair/atomicfile v0.3.1/go.mod h1:mwfrkRxFKwpNAflYZzytbSwxvbK6fdGRRlp0KEQc0qU= github.com/creachadair/tomledit v0.0.24 h1:5Xjr25R2esu1rKCbQEmjZYlrhFkDspoAbAKb6QKQDhQ= @@ -485,17 +493,18 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= -github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= -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/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= +github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -539,10 +548,14 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= -github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= -github.com/ethereum/go-ethereum v1.14.2 h1:3ketymsXTLiXmtnCrXab/EUsV+X8KhwUqv572TriDaU= -github.com/ethereum/go-ethereum v1.14.2/go.mod h1:1STrq471D0BQbCX9He0hUj4bHxX2k6mt5nOQJhDNOJ8= +github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM= +github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4= +github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= +github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/go-ethereum v1.14.11 h1:8nFDCUUE67rPc6AKxFj7JKaOa2W/W1Rse3oS6LvvxEY= +github.com/ethereum/go-ethereum v1.14.11/go.mod h1:+l/fr42Mma+xBnhefL/+z11/hcmJ2egl+ScIVPjhc7E= +github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9 h1:8NfxH2iXvJ60YRB8ChToFTUzl8awsc3cJ8CbLjGIl/A= +github.com/ethereum/go-verkle v0.1.1-0.20240829091221-dffa7562dbe9/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -572,6 +585,8 @@ github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= +github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= @@ -610,6 +625,9 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= @@ -679,9 +697,11 @@ github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFG github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.2 h1:1+mZ9upx1Dh6FmUTFR1naJ77miKiXgALjWOZ3NVFPmY= +github.com/golang/glog v1.2.2/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= 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= @@ -741,10 +761,12 @@ github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNF github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= 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/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/cel-go v0.20.1 h1:nDx9r8S3L4pE61eDdt8igGj8rf5kjYR3ILxWIpWNi84= github.com/google/cel-go v0.20.1/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= +github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= 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= @@ -800,6 +822,7 @@ github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM= github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= +github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -834,8 +857,8 @@ github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= -github.com/gorilla/websocket v1.5.1/go.mod h1:x3kM2JMyaluk02fnUJpQuwD2dCS5NDG2ZHL0uE0tcaY= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= @@ -863,6 +886,8 @@ github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NM github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-bexpr v0.1.10 h1:9kuI5PFotCboP3dkDYFr/wi0gg0QVbSNz5oFRpxn4uE= +github.com/hashicorp/go-bexpr v0.1.10/go.mod h1:oxlubA2vC/gFVfX1A6JGp7ls7uCDlfJn732ehYYg+g0= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= @@ -900,6 +925,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= 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/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -912,14 +939,20 @@ github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7H github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= -github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= +github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= +github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= +github.com/holiman/uint256 v1.3.1 h1:JfTzmih28bittyHM8z360dCjIA9dbPIBlcTI6lmctQs= +github.com/holiman/uint256 v1.3.1/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw= github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= +github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -932,6 +965,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= +github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus= +github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ= github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8= github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= @@ -980,10 +1015,9 @@ github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LX github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= -github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -1000,6 +1034,8 @@ github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= github.com/lasiar/canonicalheader v1.1.1 h1:wC+dY9ZfiqiPwAexUApFush/csSPXeIi4QqyxXmng8I= @@ -1008,6 +1044,8 @@ github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJ github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= +github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= +github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= @@ -1016,8 +1054,6 @@ github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84Yrj github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= @@ -1027,7 +1063,6 @@ github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xq github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= @@ -1065,8 +1100,8 @@ github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfp github.com/mgechev/revive v1.3.9 h1:18Y3R4a2USSBF+QZKFQwVkBROUda7uoBlkEuBD+YD1A= github.com/mgechev/revive v1.3.9/go.mod h1:+uxEIr5UH0TjXWHTno3xh4u7eg6jDpXKzQccA9UGhHU= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= -github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD6Q= +github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -1080,6 +1115,11 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A= +github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= +github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY= +github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU= +github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU= github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= @@ -1097,6 +1137,8 @@ github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= +github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= 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 h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -1178,13 +1220,11 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= -github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= -github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= +github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -1213,8 +1253,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= 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.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1229,16 +1269,16 @@ github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt2 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.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= -github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= +github.com/prometheus/common v0.60.1 h1:FUas6GcOw66yB/73KC+BOZoFJmbo/1pojoILArPAaSc= +github.com/prometheus/common v0.60.1/go.mod h1:h0LYf1R1deLSKtD4Vdg8gy4RuOvENW2J/h19V5NADQw= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/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.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= -github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= +github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= +github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/quasilyte/go-ruleguard v0.4.2 h1:htXcXDK6/rO12kiTHKfHuqR4kr3Y4M0J0rOL6CH/BYs= github.com/quasilyte/go-ruleguard v0.4.2/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= @@ -1263,13 +1303,12 @@ github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/f github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= -github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/rs/cors v1.11.1 h1:eU3gRzXLRK57F5rKMGMZURNdIG4EoAmX8k94r9wXWHA= +github.com/rs/cors v1.11.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1287,8 +1326,8 @@ github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/ github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= -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/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= +github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= @@ -1298,6 +1337,8 @@ github.com/securego/gosec/v2 v2.20.1-0.20240822074752-ab3f6c1c83a0 h1:VqD4JMoqwu github.com/securego/gosec/v2 v2.20.1-0.20240822074752-ab3f6c1c83a0/go.mod h1:iyeMMRw8QEmueUSZ2VqmkQMiDyDcobfPnG00CV/NWdE= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= +github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -1322,28 +1363,22 @@ github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIK github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= 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.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -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/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= -github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= +github.com/spf13/viper v1.19.0 h1:RWq5SEjt8o25SROyN3z2OrDB9l7RPd3lwTWU8EcEdcI= +github.com/spf13/viper v1.19.0/go.mod h1:GQUN9bilAbhU/jgc1bKs99f/suXKeUMct8Adx5+Ntkg= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= +github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= +github.com/status-im/keycard-go v0.2.0/go.mod h1:wlp8ZLbsmrF6g6WjugPAx+IzoLrkdf9+mHxBEeo3Hbg= github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= @@ -1373,6 +1408,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= +github.com/supranational/blst v0.3.13 h1:AYeSxdOMacwu7FBmpfloBz5pbFXDmJL33RuwnKtmTjk= +github.com/supranational/blst v0.3.13/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw= 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/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= @@ -1391,15 +1428,20 @@ github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+n github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= +github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= +github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= +github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= +github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= @@ -1412,6 +1454,9 @@ github.com/ultraware/whitespace v0.1.1 h1:bTPOGejYFulW3PkcrqkeQwOd6NKOOXvmGD9bo/ github.com/ultraware/whitespace v0.1.1/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/urfave/cli v1.22.12 h1:igJgVw1JdKH+trcLWLeLwZjU9fEfPesQ+9/e4MQ44S8= +github.com/urfave/cli/v2 v2.25.7 h1:VAzn5oq403l5pHjc4OhD54+XGO9cdKVL/7lDjF+iKUs= +github.com/urfave/cli/v2 v2.25.7/go.mod h1:8qnjx1vcq5s2/wpsqoZFndg2CE5tNFyrTvS6SinrnYQ= github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= @@ -1426,7 +1471,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRTfdpNzjtPYqr8smhKouy9mxVdGPU= +github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= @@ -1453,8 +1499,8 @@ go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S go-simpler.org/sloglint v0.7.2 h1:Wc9Em/Zeuu7JYpl+oKoYOsQSy2X560aVueCW/m6IijY= go-simpler.org/sloglint v0.7.2/go.mod h1:US+9C80ppl7VsThQclkM7BkCHQAzuz8kHLsW3ppuluo= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.8 h1:xs88BrvEv273UsB79e0hcVrlUWmS0a8upikMFhSyAtA= -go.etcd.io/bbolt v1.3.8/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5 h1:qxen9oVGzDdIRP6ejyAJc760RwW4SnVDiTYTzwnXuxo= +go.etcd.io/bbolt v1.4.0-alpha.0.0.20240404170359-43604f3112c5/go.mod h1:eW0HG9/oHQhvRCvb1/pIXW4cOvtDqeQK+XSi3TnwaXY= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -1512,7 +1558,6 @@ go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/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= @@ -1522,8 +1567,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= 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= @@ -1637,8 +1682,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= 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= @@ -1664,8 +1709,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA= -golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= +golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= 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= @@ -1691,8 +1736,6 @@ golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-20181122145206-62eef0e2fa9b/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-20190130150945-aca44879d564/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= @@ -1701,10 +1744,10 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w 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-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/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-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1787,17 +1830,20 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= 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= @@ -1810,8 +1856,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= @@ -2074,10 +2120,10 @@ google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf h1:OqdXDEakZCVtDiZTjcxfwbHPCT11ycCEsTKesBVKvyY= google.golang.org/genproto v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:mCr1K1c8kX+1iSBREvU3Juo11CB+QOEWxbRS01wWl5M= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f h1:b1Ln/PG8orm0SsBbHZWke8dDp2lrCD4jSmfglFpTZbk= -google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 h1:wKguEg1hsxI2/L3hUYrpo1RVi48K+uTyzKqprwLXsb8= +google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -2119,8 +2165,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= -google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 h1:rNBFJjBCOgVr9pWD7rs/knKL4FRTKgpZmsRfV214zcA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0/go.mod h1:Dk1tviKTvMCz5tvh7t+fh94dhmQVHuCt2OzJB3CTW9Y= @@ -2140,8 +2186,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFytA= +google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= 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= @@ -2156,6 +2202,8 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= 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= @@ -2198,6 +2246,8 @@ pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= 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= +rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU= +rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/proto/ojo/oracle/v1/abci.proto b/proto/ojo/oracle/v1/abci.proto index 88605425..bde0cb22 100644 --- a/proto/ojo/oracle/v1/abci.proto +++ b/proto/ojo/oracle/v1/abci.proto @@ -18,6 +18,7 @@ message OracleVoteExtension { (gogoproto.nullable) = false ]; repeated GasEstimate gas_estimates = 3 [(gogoproto.nullable) = false]; + string block_hash = 4; } // InjectedVoteExtensionTx defines the vote extension tx injected by the prepare @@ -28,6 +29,7 @@ message InjectedVoteExtensionTx { ]; bytes extended_commit_info = 2; repeated GasEstimate gas_estimate_medians = 3 [(gogoproto.nullable) = false]; + repeated BlockHashVote block_hash_votes = 4 [(gogoproto.nullable) = false]; } // GasEstimate defines a gas estimate for a given network. @@ -35,3 +37,11 @@ message GasEstimate { int64 gas_estimation = 1; string network = 2; } + +// Struct for voting on the block hash to store. +message BlockHashVote { + // Block hash of cached block on chain. + string block_hash = 1; + // Validator address proposing block hash. + string voter = 2; +} diff --git a/proto/ojo/symbiotic/v1/genesis.proto b/proto/ojo/symbiotic/v1/genesis.proto new file mode 100644 index 00000000..7d8f3761 --- /dev/null +++ b/proto/ojo/symbiotic/v1/genesis.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package ojo.symbiotic.v1; + +import "gogoproto/gogo.proto"; +import "ojo/symbiotic/v1/symbiotic.proto"; + +option go_package = "github.com/ojo-network/ojo/x/symbiotic/types"; + +// GenesisState represents the genesis state of the symbiotic module. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/ojo/symbiotic/v1/query.proto b/proto/ojo/symbiotic/v1/query.proto new file mode 100644 index 00000000..ecc23f02 --- /dev/null +++ b/proto/ojo/symbiotic/v1/query.proto @@ -0,0 +1,37 @@ +syntax = "proto3"; +package ojo.symbiotic.v1; + +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "ojo/symbiotic/v1/symbiotic.proto"; + +option go_package = "github.com/ojo-network/ojo/x/symbiotic/types"; + +// Query defines the gRPC querier service for the symbiotic module +service Query { + // Params queries all parameters. + rpc Params(ParamsRequest) returns (ParamsResponse) { + option (google.api.http).get = "/ojo/symbiotic/v1/params"; + } + // CachedBlockHashes queries all cached block hashes. + rpc CachedBlockHashes(CachedBlockHashesRequest) returns (CachedBlockHashesResponse) { + option (google.api.http).get = "/ojo/symbiotic/v1/cachedblockhashes"; + } +} + +// ParamsRequest is the request type for the Query/Params RPC method. +message ParamsRequest {} + +// ParamsResponse is the response type for the Query/Params RPC method. +message ParamsResponse { + // params defines the parameters of the module. + Params params = 1 [(gogoproto.nullable) = false]; +} + +// CachedBlockHashesRequest is the request type for the Query/CachedBlockHashes RPC method. +message CachedBlockHashesRequest {} + +// CachedBlockHashesResponse is the response type for the Query/CachedBlockHashes RPC method. +message CachedBlockHashesResponse { + repeated CachedBlockHash cached_block_hashes = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/ojo/symbiotic/v1/symbiotic.proto b/proto/ojo/symbiotic/v1/symbiotic.proto new file mode 100644 index 00000000..b8ecadc9 --- /dev/null +++ b/proto/ojo/symbiotic/v1/symbiotic.proto @@ -0,0 +1,26 @@ +syntax = "proto3"; +package ojo.symbiotic.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/ojo-network/ojo/x/symbiotic/types"; + +option (gogoproto.goproto_getters_all) = false; + +// Params defines the parameters for the symbiotic module. +message Params { + // address of the ojo middleware contract + string middleware_address = 1; + // block period for syncing with the symbiotic network on Ethereum + int64 symbiotic_sync_period = 2; + // maximum amount of cached block hashes in the store + uint64 maximum_cached_block_hashes = 3; +} + +// Cached block hash and height of block hash from the chain the ojo middleware is on. +message CachedBlockHash { + // Block hash of cached block on chain. + string block_hash = 1; + // Block height of block hash. + int64 height = 2; +} diff --git a/proto/ojo/symbiotic/v1/tx.proto b/proto/ojo/symbiotic/v1/tx.proto new file mode 100644 index 00000000..0c46c277 --- /dev/null +++ b/proto/ojo/symbiotic/v1/tx.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package ojo.symbiotic.v1; + +import "gogoproto/gogo.proto"; +import "ojo/symbiotic/v1/symbiotic.proto"; +import "cosmos_proto/cosmos.proto"; +import "cosmos/msg/v1/msg.proto"; + +option go_package = "github.com/ojo-network/ojo/x/symbiotic/types"; + +// Msg defines the symbiotic Msg service. +service Msg { + // SetParams sets the parameters for the symbiotic module. + rpc SetParams(MsgSetParams) returns (MsgSetParamsResponse); +} + +// MsgSetParams defines the SetParams message type. +message MsgSetParams { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // params defines the symbiotic parameters to update. + Params params = 2; +} + +// MsgSetParamsResponse defines the SetParams response type. +message MsgSetParamsResponse {} diff --git a/util/block_period.go b/util/block_period.go new file mode 100644 index 00000000..b187e878 --- /dev/null +++ b/util/block_period.go @@ -0,0 +1,10 @@ +package util + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// IsPeriodLastBlock returns true if we are at the last block of the period +func IsPeriodLastBlock(ctx sdk.Context, blocksPerPeriod uint64) bool { + return (SafeInt64ToUint64(ctx.BlockHeight())+1)%blocksPerPeriod == 0 +} diff --git a/x/gasestimate/types/gasestimate.pb.go b/x/gasestimate/types/gasestimate.pb.go index f3976235..a4195b37 100644 --- a/x/gasestimate/types/gasestimate.pb.go +++ b/x/gasestimate/types/gasestimate.pb.go @@ -66,7 +66,7 @@ func (m *Params) XXX_DiscardUnknown() { var xxx_messageInfo_Params proto.InternalMessageInfo -// Contract defines a contract that we +// Contract defines a contract at a specific address and network that we send gasestimate messages to. type Contract struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Network string `protobuf:"bytes,2,opt,name=network,proto3" json:"network,omitempty"` diff --git a/x/oracle/abci/endblocker.go b/x/oracle/abci/endblocker.go index 00c59f4b..66d165d8 100644 --- a/x/oracle/abci/endblocker.go +++ b/x/oracle/abci/endblocker.go @@ -44,13 +44,13 @@ func EndBlocker(ctx context.Context, k keeper.Keeper) error { // Set all current active validators into the ValidatorRewardSet at // the beginning of a new Slash Window. - if k.IsPeriodLastBlock(sdkCtx, params.SlashWindow+1) { + if util.IsPeriodLastBlock(sdkCtx, params.SlashWindow+1) { if err := k.SetValidatorRewardSet(sdkCtx); err != nil { return err } } - if k.IsPeriodLastBlock(sdkCtx, params.VotePeriod) { + if util.IsPeriodLastBlock(sdkCtx, params.VotePeriod) { if k.PriceFeeder.Oracle != nil && k.PriceFeeder.AppConfig.Enable { // Update price feeder oracle with latest params. k.PriceFeeder.Oracle.ParamCache.UpdateParamCache(sdkCtx.BlockHeight(), k.GetParams(sdkCtx), nil) @@ -69,7 +69,7 @@ func EndBlocker(ctx context.Context, k keeper.Keeper) error { // Slash oracle providers who missed voting over the threshold and reset // miss counters of all validators at the last block of slash window. - if k.IsPeriodLastBlock(sdkCtx, params.SlashWindow) { + if util.IsPeriodLastBlock(sdkCtx, params.SlashWindow) { k.SlashAndResetMissCounters(sdkCtx) } k.PruneAllPrices(sdkCtx) @@ -145,12 +145,12 @@ func CalcPrices(ctx sdk.Context, params types.Params, k keeper.Keeper) error { return err } - if k.IsPeriodLastBlock(ctx, params.HistoricStampPeriod) { + if util.IsPeriodLastBlock(ctx, params.HistoricStampPeriod) { k.AddHistoricPrice(ctx, ballotDenom.Denom, exchangeRate) } // Calculate and stamp median/median deviation if median stamp period has passed - if k.IsPeriodLastBlock(ctx, params.MedianStampPeriod) { + if util.IsPeriodLastBlock(ctx, params.MedianStampPeriod) { if err = k.CalcAndSetHistoricMedian(ctx, ballotDenom.Denom); err != nil { return err } diff --git a/x/oracle/abci/proposal.go b/x/oracle/abci/proposal.go index 5bc1db7c..a1c0e06f 100644 --- a/x/oracle/abci/proposal.go +++ b/x/oracle/abci/proposal.go @@ -77,10 +77,15 @@ func (h *ProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler { if err != nil { return &cometabci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, err } + blockHashVotes, err := h.generateBlockHashVotes(ctx, req.LocalLastCommit) + if err != nil { + return &cometabci.ResponsePrepareProposal{Txs: make([][]byte, 0)}, err + } injectedVoteExtTx := oracletypes.InjectedVoteExtensionTx{ ExchangeRateVotes: exchangeRateVotes, ExtendedCommitInfo: extendedCommitInfoBz, GasEstimateMedians: medianGasEstimates, + BlockHashVotes: blockHashVotes, } bz, err := injectedVoteExtTx.Marshal() @@ -184,6 +189,14 @@ func (h *ProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHandler { if err := h.verifyMedianGasEstimations(injectedVoteExtTx.GasEstimateMedians, gasEstimateMedians); err != nil { return &cometabci.ResponseProcessProposal{Status: cometabci.ResponseProcessProposal_REJECT}, err } + // Verify proposer's block hash votes by computing the same ballot. + blockHashVotes, err := h.generateBlockHashVotes(ctx, extendedCommitInfo) + if err != nil { + return &cometabci.ResponseProcessProposal{Status: cometabci.ResponseProcessProposal_REJECT}, err + } + if err := h.verifyBlockHashVotes(injectedVoteExtTx.BlockHashVotes, blockHashVotes); err != nil { + return &cometabci.ResponseProcessProposal{Status: cometabci.ResponseProcessProposal_REJECT}, err + } } h.logger.Info( @@ -360,3 +373,77 @@ func (h *ProposalHandler) verifyMedianGasEstimations( return nil } + +func (h *ProposalHandler) generateBlockHashVotes( + ctx sdk.Context, + ci cometabci.ExtendedCommitInfo, +) (blockHashVotes []oracletypes.BlockHashVote, err error) { + for _, vote := range ci.Votes { + if vote.BlockIdFlag != cmtproto.BlockIDFlagCommit { + continue + } + + var voteExt oracletypes.OracleVoteExtension + if err := voteExt.Unmarshal(vote.VoteExtension); err != nil { + h.logger.Error( + "failed to decode vote extension", + "err", err, + ) + return nil, err + } + + var valConsAddr sdk.ConsAddress + if err := valConsAddr.Unmarshal(vote.Validator.Address); err != nil { + h.logger.Error( + "failed to unmarshal validator consensus address", + "err", err, + ) + return nil, err + } + val, err := h.stakingKeeper.GetValidatorByConsAddr(ctx, valConsAddr) + if err != nil { + h.logger.Error( + "failed to get consensus validator from staking keeper", + "err", err, + ) + return nil, err + } + valAddr, err := sdk.ValAddressFromBech32(val.OperatorAddress) + if err != nil { + return nil, err + } + + blockHashVote := oracletypes.BlockHashVote{ + BlockHash: voteExt.BlockHash, + Voter: valAddr.String(), + } + blockHashVotes = append(blockHashVotes, blockHashVote) + } + + // sort votes so they are verified in the same order in ProcessProposalHandler + sort.Slice(blockHashVotes, func(i, j int) bool { + return blockHashVotes[i].Voter < blockHashVotes[j].Voter + }) + + return blockHashVotes, nil +} + +func (h *ProposalHandler) verifyBlockHashVotes( + injectedVotes []oracletypes.BlockHashVote, + generatedVotes []oracletypes.BlockHashVote, +) error { + if len(injectedVotes) != len(generatedVotes) { + return oracletypes.ErrNonEqualInjVotesLen + } + + for i := range injectedVotes { + injectedVote := injectedVotes[i] + generatedVote := generatedVotes[i] + + if injectedVote.Voter != generatedVote.Voter || injectedVote.BlockHash != generatedVote.BlockHash { + return oracletypes.ErrNonEqualInjVotesBlockHash + } + } + + return nil +} diff --git a/x/oracle/abci/voteextension.go b/x/oracle/abci/voteextension.go index e4da6a30..4b8ce3ed 100644 --- a/x/oracle/abci/voteextension.go +++ b/x/oracle/abci/voteextension.go @@ -101,10 +101,22 @@ func (h *VoteExtensionHandler) ExtendVoteHandler() sdk.ExtendVoteHandler { }) } + var blockHash string + symbioticParams := h.oracleKeeper.SymbioticKeeper.GetParams(ctx) + if req.Height%symbioticParams.SymbioticSyncPeriod == 0 { + blockHash, err = h.oracleKeeper.SymbioticKeeper.GetFinalizedBlockHash(ctx) + h.logger.Error( + "height", req.Height, + err.Error(), + ) + return &cometabci.ResponseExtendVote{VoteExtension: []byte{}}, err + } + voteExt := types.OracleVoteExtension{ Height: req.Height, ExchangeRates: filteredDecCoins, GasEstimates: gasEstimates, + BlockHash: blockHash, } bz, err := voteExt.Marshal() diff --git a/x/oracle/keeper/end_blocker.go b/x/oracle/keeper/end_blocker.go index f99707c2..8e3dce6c 100644 --- a/x/oracle/keeper/end_blocker.go +++ b/x/oracle/keeper/end_blocker.go @@ -12,13 +12,13 @@ func (k *Keeper) PruneAllPrices(ctx sdk.Context) { params := k.GetParams(ctx) blockHeight := util.SafeInt64ToUint64(ctx.BlockHeight()) - if k.IsPeriodLastBlock(ctx, params.HistoricStampPeriod) { + if util.IsPeriodLastBlock(ctx, params.HistoricStampPeriod) { pruneHistoricPeriod := params.HistoricStampPeriod * params.MaximumPriceStamps if pruneHistoricPeriod < blockHeight { k.PruneHistoricPricesBeforeBlock(ctx, blockHeight-pruneHistoricPeriod) } - if k.IsPeriodLastBlock(ctx, params.MedianStampPeriod) { + if util.IsPeriodLastBlock(ctx, params.MedianStampPeriod) { pruneMedianPeriod := params.MedianStampPeriod * params.MaximumMedianStamps if pruneMedianPeriod < blockHeight { k.PruneMediansBeforeBlock(ctx, blockHeight-pruneMedianPeriod) @@ -28,11 +28,6 @@ func (k *Keeper) PruneAllPrices(ctx sdk.Context) { } } -// IsPeriodLastBlock returns true if we are at the last block of the period -func (k *Keeper) IsPeriodLastBlock(ctx sdk.Context, blocksPerPeriod uint64) bool { - return (util.SafeInt64ToUint64(ctx.BlockHeight())+1)%blocksPerPeriod == 0 -} - // RecordEndBlockMetrics records miss counter and price metrics at the end of the block func (k *Keeper) RecordEndBlockMetrics(ctx sdk.Context) { if !k.telemetryEnabled { diff --git a/x/oracle/keeper/keeper.go b/x/oracle/keeper/keeper.go index 05a9fbc8..4ab6a5d9 100644 --- a/x/oracle/keeper/keeper.go +++ b/x/oracle/keeper/keeper.go @@ -30,6 +30,7 @@ type Keeper struct { distrKeeper types.DistributionKeeper StakingKeeper types.StakingKeeper GasEstimateKeeper types.GasEstimateKeeper + SymbioticKeeper types.SymbioticKeeper PriceFeeder *pricefeeder.PriceFeeder @@ -50,6 +51,7 @@ func NewKeeper( distrKeeper types.DistributionKeeper, stakingKeeper types.StakingKeeper, gasEstimateKeeper types.GasEstimateKeeper, + symbioticKeeper types.SymbioticKeeper, distrName string, telemetryEnabled bool, authority string, @@ -73,6 +75,7 @@ func NewKeeper( distrKeeper: distrKeeper, StakingKeeper: stakingKeeper, GasEstimateKeeper: gasEstimateKeeper, + SymbioticKeeper: symbioticKeeper, PriceFeeder: &pricefeeder.PriceFeeder{}, distrName: distrName, telemetryEnabled: telemetryEnabled, diff --git a/x/oracle/types/abci.pb.go b/x/oracle/types/abci.pb.go index e74a793c..d2a0976e 100644 --- a/x/oracle/types/abci.pb.go +++ b/x/oracle/types/abci.pb.go @@ -31,6 +31,7 @@ type OracleVoteExtension struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` ExchangeRates github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,2,rep,name=exchange_rates,json=exchangeRates,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"exchange_rates"` GasEstimates []GasEstimate `protobuf:"bytes,3,rep,name=gas_estimates,json=gasEstimates,proto3" json:"gas_estimates"` + BlockHash string `protobuf:"bytes,4,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` } func (m *OracleVoteExtension) Reset() { *m = OracleVoteExtension{} } @@ -72,6 +73,7 @@ type InjectedVoteExtensionTx struct { ExchangeRateVotes []AggregateExchangeRateVote `protobuf:"bytes,1,rep,name=exchange_rate_votes,json=exchangeRateVotes,proto3" json:"exchange_rate_votes"` ExtendedCommitInfo []byte `protobuf:"bytes,2,opt,name=extended_commit_info,json=extendedCommitInfo,proto3" json:"extended_commit_info,omitempty"` GasEstimateMedians []GasEstimate `protobuf:"bytes,3,rep,name=gas_estimate_medians,json=gasEstimateMedians,proto3" json:"gas_estimate_medians"` + BlockHashVotes []BlockHashVote `protobuf:"bytes,4,rep,name=block_hash_votes,json=blockHashVotes,proto3" json:"block_hash_votes"` } func (m *InjectedVoteExtensionTx) Reset() { *m = InjectedVoteExtensionTx{} } @@ -146,45 +148,92 @@ func (m *GasEstimate) XXX_DiscardUnknown() { var xxx_messageInfo_GasEstimate proto.InternalMessageInfo +// Struct for voting on the block hash to store. +type BlockHashVote struct { + // Block hash of cached block on chain. + BlockHash string `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // Validator address proposing block hash. + Voter string `protobuf:"bytes,2,opt,name=voter,proto3" json:"voter,omitempty"` +} + +func (m *BlockHashVote) Reset() { *m = BlockHashVote{} } +func (m *BlockHashVote) String() string { return proto.CompactTextString(m) } +func (*BlockHashVote) ProtoMessage() {} +func (*BlockHashVote) Descriptor() ([]byte, []int) { + return fileDescriptor_a17fd58ec0319b85, []int{3} +} +func (m *BlockHashVote) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockHashVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockHashVote.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BlockHashVote) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockHashVote.Merge(m, src) +} +func (m *BlockHashVote) XXX_Size() int { + return m.Size() +} +func (m *BlockHashVote) XXX_DiscardUnknown() { + xxx_messageInfo_BlockHashVote.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockHashVote proto.InternalMessageInfo + func init() { proto.RegisterType((*OracleVoteExtension)(nil), "ojo.oracle.v1.OracleVoteExtension") proto.RegisterType((*InjectedVoteExtensionTx)(nil), "ojo.oracle.v1.InjectedVoteExtensionTx") proto.RegisterType((*GasEstimate)(nil), "ojo.oracle.v1.GasEstimate") + proto.RegisterType((*BlockHashVote)(nil), "ojo.oracle.v1.BlockHashVote") } func init() { proto.RegisterFile("ojo/oracle/v1/abci.proto", fileDescriptor_a17fd58ec0319b85) } var fileDescriptor_a17fd58ec0319b85 = []byte{ - // 463 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xe3, 0x16, 0x15, 0xb1, 0x6d, 0x2a, 0xb1, 0x8d, 0xc0, 0x8a, 0x90, 0x1b, 0x45, 0x42, - 0x0a, 0x42, 0x5d, 0x13, 0xfa, 0x04, 0xa4, 0x44, 0x55, 0x0f, 0x80, 0x64, 0x21, 0x0e, 0x1c, 0xb0, - 0xd6, 0xf6, 0x74, 0xb3, 0x29, 0xde, 0xa9, 0xbc, 0x4b, 0x30, 0x6f, 0xc1, 0x73, 0xf0, 0x24, 0x39, - 0xf6, 0xc8, 0x89, 0x3f, 0xc9, 0x9d, 0x57, 0x00, 0xed, 0xda, 0x56, 0x9c, 0x9e, 0x38, 0x79, 0x77, - 0xbf, 0x99, 0xf9, 0x7d, 0xe3, 0x19, 0xe2, 0xe3, 0x1c, 0x43, 0x2c, 0x78, 0xfa, 0x11, 0xc2, 0xc5, - 0x38, 0xe4, 0x49, 0x2a, 0xd9, 0x75, 0x81, 0x06, 0x69, 0x17, 0xe7, 0xc8, 0x2a, 0x85, 0x2d, 0xc6, - 0xfd, 0x9e, 0x40, 0x81, 0x4e, 0x09, 0xed, 0xa9, 0x0a, 0xea, 0x07, 0x29, 0xea, 0x1c, 0x75, 0x98, - 0x70, 0x6d, 0xf3, 0x13, 0x30, 0x7c, 0x1c, 0xa6, 0x28, 0x55, 0xad, 0xf7, 0xb7, 0xcb, 0xd7, 0xe5, - 0x9c, 0x36, 0xfc, 0xe3, 0x91, 0xa3, 0x37, 0xee, 0xe1, 0x1d, 0x1a, 0x98, 0x96, 0x06, 0x94, 0x96, - 0xa8, 0xe8, 0x03, 0xb2, 0x37, 0x03, 0x29, 0x66, 0xc6, 0xf7, 0x06, 0xde, 0x68, 0x37, 0xaa, 0x6f, - 0xb4, 0x24, 0x87, 0x50, 0xa6, 0x33, 0xae, 0x04, 0xc4, 0x05, 0x37, 0xa0, 0xfd, 0x9d, 0xc1, 0xee, - 0x68, 0xff, 0xf9, 0x23, 0x56, 0x99, 0x60, 0xd6, 0x04, 0xab, 0x4d, 0xb0, 0x97, 0x90, 0x9e, 0xa1, - 0x54, 0x93, 0xd3, 0xe5, 0x8f, 0xe3, 0xce, 0xb7, 0x9f, 0xc7, 0x4f, 0x85, 0x34, 0xb3, 0x4f, 0x09, - 0x4b, 0x31, 0x0f, 0x6b, 0xd3, 0xd5, 0xe7, 0x44, 0x67, 0x57, 0xa1, 0xf9, 0x72, 0x0d, 0xba, 0xc9, - 0xd1, 0x51, 0xb7, 0x01, 0x45, 0x96, 0x43, 0xa7, 0xa4, 0x2b, 0xb8, 0x8e, 0x41, 0x1b, 0x99, 0x3b, - 0xf0, 0xae, 0x03, 0xf7, 0xd9, 0xd6, 0x2f, 0x62, 0xe7, 0x5c, 0x4f, 0xeb, 0x90, 0xc9, 0x1d, 0x8b, - 0x8d, 0x0e, 0xc4, 0xe6, 0x49, 0x0f, 0xff, 0x7a, 0xe4, 0xe1, 0x85, 0x9a, 0x43, 0x6a, 0x20, 0xdb, - 0x6a, 0xf9, 0x6d, 0x49, 0x3f, 0x90, 0xa3, 0xad, 0xe6, 0xe2, 0x05, 0x5a, 0x90, 0xe7, 0x40, 0xa3, - 0x5b, 0xa0, 0x17, 0x42, 0x14, 0x20, 0xb8, 0xad, 0xb0, 0xb1, 0x69, 0x2b, 0xd6, 0xd8, 0xfb, 0x70, - 0xeb, 0x5d, 0xd3, 0x67, 0xa4, 0x07, 0x16, 0x97, 0x41, 0x16, 0xa7, 0x98, 0xe7, 0xd2, 0xc4, 0x52, - 0x5d, 0xa2, 0xbf, 0x33, 0xf0, 0x46, 0x07, 0x11, 0x6d, 0xb4, 0x33, 0x27, 0x5d, 0xa8, 0x4b, 0xa4, - 0x11, 0xe9, 0xb5, 0x9b, 0x8e, 0x73, 0xc8, 0x24, 0x57, 0xff, 0xdf, 0x3b, 0x6d, 0xf5, 0xfe, 0xaa, - 0xca, 0x1d, 0xbe, 0x26, 0xfb, 0xad, 0x40, 0xfa, 0x98, 0x1c, 0xb6, 0x10, 0x12, 0x55, 0x3d, 0xf1, - 0xee, 0x26, 0xd5, 0x2e, 0x84, 0x4f, 0xee, 0x2a, 0x30, 0x9f, 0xb1, 0xb8, 0x72, 0x76, 0xef, 0x45, - 0xcd, 0x75, 0x72, 0xbe, 0xfc, 0x1d, 0x74, 0x96, 0xab, 0xc0, 0xbb, 0x59, 0x05, 0xde, 0xaf, 0x55, - 0xe0, 0x7d, 0x5d, 0x07, 0x9d, 0x9b, 0x75, 0xd0, 0xf9, 0xbe, 0x0e, 0x3a, 0xef, 0x9f, 0xb4, 0x46, - 0x8e, 0x73, 0x3c, 0xa9, 0xb3, 0xec, 0x39, 0x2c, 0x9b, 0xad, 0x74, 0x93, 0x4f, 0xf6, 0xdc, 0x4a, - 0x9e, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xff, 0x98, 0x69, 0xf4, 0x0f, 0x03, 0x00, 0x00, + // 529 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xdd, 0x6e, 0xd3, 0x30, + 0x14, 0x6e, 0xda, 0x32, 0x54, 0x6f, 0xad, 0xc0, 0xab, 0x20, 0xaa, 0x20, 0xab, 0x2a, 0x21, 0x15, + 0xa1, 0x25, 0x94, 0x3d, 0x01, 0xdd, 0xaa, 0x31, 0x89, 0x1f, 0x29, 0x42, 0x5c, 0x70, 0x41, 0xe4, + 0xa4, 0x5e, 0xe2, 0x76, 0xf1, 0x99, 0x62, 0x53, 0xca, 0x43, 0x20, 0xf1, 0x1c, 0x3c, 0x49, 0x6f, + 0x90, 0x76, 0xc9, 0x15, 0x3f, 0xed, 0x8b, 0x20, 0x3b, 0x8e, 0x9a, 0xf4, 0x6a, 0x57, 0x89, 0xcf, + 0xb1, 0xbf, 0x3f, 0x1f, 0x23, 0x1b, 0x66, 0xe0, 0x41, 0x46, 0xa2, 0x2b, 0xea, 0x2d, 0x46, 0x1e, + 0x09, 0x23, 0xe6, 0x5e, 0x67, 0x20, 0x01, 0xb7, 0x61, 0x06, 0x6e, 0xde, 0x71, 0x17, 0xa3, 0x5e, + 0x37, 0x86, 0x18, 0x74, 0xc7, 0x53, 0x7f, 0xf9, 0xa6, 0x9e, 0x13, 0x81, 0x48, 0x41, 0x78, 0x21, + 0x11, 0xea, 0x7c, 0x48, 0x25, 0x19, 0x79, 0x11, 0x30, 0x6e, 0xfa, 0xbd, 0x2a, 0xbc, 0x81, 0xd3, + 0xbd, 0xc1, 0xb7, 0x3a, 0x3a, 0x7c, 0xa7, 0x0b, 0x1f, 0x40, 0xd2, 0xc9, 0x52, 0x52, 0x2e, 0x18, + 0x70, 0xfc, 0x00, 0xed, 0x25, 0x94, 0xc5, 0x89, 0xb4, 0xad, 0xbe, 0x35, 0x6c, 0xf8, 0x66, 0x85, + 0x97, 0xa8, 0x43, 0x97, 0x51, 0x42, 0x78, 0x4c, 0x83, 0x8c, 0x48, 0x2a, 0xec, 0x7a, 0xbf, 0x31, + 0xdc, 0x7f, 0xf1, 0xc8, 0xcd, 0x45, 0xb8, 0x4a, 0x84, 0x6b, 0x44, 0xb8, 0x67, 0x34, 0x3a, 0x05, + 0xc6, 0xc7, 0x27, 0xab, 0xdf, 0x47, 0xb5, 0x1f, 0x7f, 0x8e, 0x9e, 0xc5, 0x4c, 0x26, 0x9f, 0x43, + 0x37, 0x82, 0xd4, 0x33, 0xa2, 0xf3, 0xcf, 0xb1, 0x98, 0xce, 0x3d, 0xf9, 0xf5, 0x9a, 0x8a, 0xe2, + 0x8c, 0xf0, 0xdb, 0x05, 0x91, 0xaf, 0x78, 0xf0, 0x04, 0xb5, 0x63, 0x22, 0x02, 0x2a, 0x24, 0x4b, + 0x35, 0x71, 0x43, 0x13, 0xf7, 0xdc, 0x4a, 0x44, 0xee, 0x39, 0x11, 0x13, 0xb3, 0x65, 0xdc, 0x54, + 0xb4, 0xfe, 0x41, 0xbc, 0x2d, 0x09, 0xfc, 0x18, 0xa1, 0xf0, 0x0a, 0xa2, 0x79, 0x90, 0x10, 0x91, + 0xd8, 0xcd, 0xbe, 0x35, 0x6c, 0xf9, 0x2d, 0x5d, 0x79, 0x45, 0x44, 0x32, 0xf8, 0x59, 0x47, 0x0f, + 0x2f, 0xf8, 0x8c, 0x46, 0x92, 0x4e, 0x2b, 0x89, 0xbc, 0x5f, 0xe2, 0x4f, 0xe8, 0xb0, 0xe2, 0x3d, + 0x58, 0x80, 0xd2, 0x61, 0x69, 0x1d, 0xc3, 0x1d, 0x1d, 0x2f, 0xe3, 0x38, 0xa3, 0x31, 0x51, 0x08, + 0x5b, 0x17, 0x0a, 0xd1, 0xa8, 0xba, 0x4f, 0x77, 0xea, 0x02, 0x3f, 0x47, 0x5d, 0xaa, 0xe8, 0xa6, + 0x74, 0x1a, 0x44, 0x90, 0xa6, 0x4c, 0x06, 0x8c, 0x5f, 0x82, 0x5d, 0xef, 0x5b, 0xc3, 0x03, 0x1f, + 0x17, 0xbd, 0x53, 0xdd, 0xba, 0xe0, 0x97, 0x80, 0x7d, 0xd4, 0x2d, 0x67, 0x12, 0xa4, 0x74, 0xca, + 0x08, 0xbf, 0x7d, 0x34, 0xb8, 0x14, 0xcd, 0x9b, 0xfc, 0x2c, 0x7e, 0x8d, 0xee, 0x6d, 0x03, 0x32, + 0x16, 0x9b, 0xe6, 0x8e, 0xab, 0x78, 0xe3, 0x22, 0xb5, 0x92, 0xad, 0x4e, 0x58, 0x2e, 0x8a, 0xc1, + 0x5b, 0xb4, 0x5f, 0xa2, 0xc5, 0x4f, 0x50, 0xa7, 0x24, 0x98, 0x01, 0x37, 0xe3, 0xd5, 0xde, 0x0a, + 0x51, 0xd3, 0x67, 0xa3, 0xbb, 0x9c, 0xca, 0x2f, 0x90, 0xcd, 0xb5, 0xf9, 0x96, 0x5f, 0x2c, 0x07, + 0x67, 0xa8, 0x5d, 0xa1, 0xdd, 0xb9, 0x4f, 0x6b, 0xe7, 0x3e, 0x71, 0x17, 0xdd, 0x51, 0x16, 0x32, + 0x83, 0x93, 0x2f, 0xc6, 0xe7, 0xab, 0x7f, 0x4e, 0x6d, 0xb5, 0x76, 0xac, 0x9b, 0xb5, 0x63, 0xfd, + 0x5d, 0x3b, 0xd6, 0xf7, 0x8d, 0x53, 0xbb, 0xd9, 0x38, 0xb5, 0x5f, 0x1b, 0xa7, 0xf6, 0xf1, 0x69, + 0x69, 0x4a, 0x61, 0x06, 0xc7, 0x86, 0x5b, 0xfd, 0x7b, 0xcb, 0xe2, 0x21, 0xe9, 0x61, 0x0d, 0xf7, + 0xf4, 0x2b, 0x3a, 0xf9, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x77, 0xe1, 0x6e, 0xc2, 0x03, 0x00, + 0x00, } func (m *OracleVoteExtension) Marshal() (dAtA []byte, err error) { @@ -207,6 +256,13 @@ func (m *OracleVoteExtension) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintAbci(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0x22 + } if len(m.GasEstimates) > 0 { for iNdEx := len(m.GasEstimates) - 1; iNdEx >= 0; iNdEx-- { { @@ -263,6 +319,20 @@ func (m *InjectedVoteExtensionTx) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if len(m.BlockHashVotes) > 0 { + for iNdEx := len(m.BlockHashVotes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BlockHashVotes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAbci(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } if len(m.GasEstimateMedians) > 0 { for iNdEx := len(m.GasEstimateMedians) - 1; iNdEx >= 0; iNdEx-- { { @@ -336,6 +406,43 @@ func (m *GasEstimate) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *BlockHashVote) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BlockHashVote) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockHashVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Voter) > 0 { + i -= len(m.Voter) + copy(dAtA[i:], m.Voter) + i = encodeVarintAbci(dAtA, i, uint64(len(m.Voter))) + i-- + dAtA[i] = 0x12 + } + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintAbci(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintAbci(dAtA []byte, offset int, v uint64) int { offset -= sovAbci(v) base := offset @@ -368,6 +475,10 @@ func (m *OracleVoteExtension) Size() (n int) { n += 1 + l + sovAbci(uint64(l)) } } + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } return n } @@ -393,6 +504,12 @@ func (m *InjectedVoteExtensionTx) Size() (n int) { n += 1 + l + sovAbci(uint64(l)) } } + if len(m.BlockHashVotes) > 0 { + for _, e := range m.BlockHashVotes { + l = e.Size() + n += 1 + l + sovAbci(uint64(l)) + } + } return n } @@ -412,6 +529,23 @@ func (m *GasEstimate) Size() (n int) { return n } +func (m *BlockHashVote) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + l = len(m.Voter) + if l > 0 { + n += 1 + l + sovAbci(uint64(l)) + } + return n +} + func sovAbci(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -534,6 +668,38 @@ func (m *OracleVoteExtension) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAbci(dAtA[iNdEx:]) @@ -686,6 +852,40 @@ func (m *InjectedVoteExtensionTx) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHashVotes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHashVotes = append(m.BlockHashVotes, BlockHashVote{}) + if err := m.BlockHashVotes[len(m.BlockHashVotes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAbci(dAtA[iNdEx:]) @@ -808,6 +1008,120 @@ func (m *GasEstimate) Unmarshal(dAtA []byte) error { } return nil } +func (m *BlockHashVote) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BlockHashVote: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockHashVote: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Voter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAbci + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAbci + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAbci + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Voter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAbci(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAbci + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipAbci(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/oracle/types/block_hash_vote.go b/x/oracle/types/block_hash_vote.go new file mode 100644 index 00000000..ab1254f4 --- /dev/null +++ b/x/oracle/types/block_hash_vote.go @@ -0,0 +1 @@ +package types diff --git a/x/oracle/types/errors.go b/x/oracle/types/errors.go index 9a7d0062..a0c79648 100644 --- a/x/oracle/types/errors.go +++ b/x/oracle/types/errors.go @@ -9,33 +9,34 @@ import ( // Oracle sentinel errors var ( - ErrInvalidExchangeRate = errors.Register(ModuleName, 2, "invalid exchange rate") - ErrNoPrevote = errors.Register(ModuleName, 3, "no prevote") - ErrNoVote = errors.Register(ModuleName, 4, "no vote") - ErrNoVotingPermission = errors.Register(ModuleName, 5, "unauthorized voter") - ErrInvalidHash = errors.Register(ModuleName, 6, "invalid hash") - ErrInvalidHashLength = errors.Register(ModuleName, 7, fmt.Sprintf("invalid hash length; should equal %d", tmhash.TruncatedSize)) //nolint: lll - ErrVerificationFailed = errors.Register(ModuleName, 8, "hash verification failed") - ErrRevealPeriodMissMatch = errors.Register(ModuleName, 9, "reveal period of submitted vote does not match with registered prevote") //nolint: lll - ErrInvalidSaltLength = errors.Register(ModuleName, 10, "invalid salt length; must be 64") - ErrInvalidSaltFormat = errors.Register(ModuleName, 11, "invalid salt format") - ErrNoAggregatePrevote = errors.Register(ModuleName, 12, "no aggregate prevote") - ErrNoAggregateVote = errors.Register(ModuleName, 13, "no aggregate vote") - ErrUnknownDenom = errors.Register(ModuleName, 14, "unknown denom") - ErrNegativeOrZeroRate = errors.Register(ModuleName, 15, "invalid exchange rate; should be positive") - ErrExistingPrevote = errors.Register(ModuleName, 16, "prevote already submitted for this voting period") - ErrBallotNotSorted = errors.Register(ModuleName, 17, "ballot must be sorted before this operation") - ErrInvalidOraclePrice = errors.Register(ModuleName, 18, "invalid or unavailable oracle price") - ErrNoHistoricPrice = errors.Register(ModuleName, 19, "no historic price for this denom at this block") - ErrNoMedian = errors.Register(ModuleName, 20, "no median for this denom at this block") - ErrNoMedianDeviation = errors.Register(ModuleName, 21, "no median deviation for this denom at this block") - ErrNoRewardBand = errors.Register(ModuleName, 22, "unable to find the reward band the given asset") - ErrNoValidatorRewardSet = errors.Register(ModuleName, 23, "unable to find the latest validator reward set") - ErrNoGovAuthority = errors.Register(ModuleName, 24, "invalid gov authority to perform these changes") - ErrInvalidRequest = errors.Register(ModuleName, 25, "invalid request") - ErrInvalidParamValue = errors.Register(ModuleName, 26, "invalid oracle param value") - ErrEncodeInjVoteExt = errors.Register(ModuleName, 27, "failed to encode injected vote extension tx") - ErrNonEqualInjVotesLen = errors.Register(ModuleName, 28, "number of exchange rate votes in vote extension and extended commit info are not equal") //nolint: lll - ErrNonEqualInjVotesRates = errors.Register(ModuleName, 29, "injected exchange rate votes and generated exchange votes are not equal") //nolint: lll - ErrNoCommitInfo = errors.Register(ModuleName, 30, "no commit info in process proposal request") + ErrInvalidExchangeRate = errors.Register(ModuleName, 2, "invalid exchange rate") + ErrNoPrevote = errors.Register(ModuleName, 3, "no prevote") + ErrNoVote = errors.Register(ModuleName, 4, "no vote") + ErrNoVotingPermission = errors.Register(ModuleName, 5, "unauthorized voter") + ErrInvalidHash = errors.Register(ModuleName, 6, "invalid hash") + ErrInvalidHashLength = errors.Register(ModuleName, 7, fmt.Sprintf("invalid hash length; should equal %d", tmhash.TruncatedSize)) //nolint: lll + ErrVerificationFailed = errors.Register(ModuleName, 8, "hash verification failed") + ErrRevealPeriodMissMatch = errors.Register(ModuleName, 9, "reveal period of submitted vote does not match with registered prevote") //nolint: lll + ErrInvalidSaltLength = errors.Register(ModuleName, 10, "invalid salt length; must be 64") + ErrInvalidSaltFormat = errors.Register(ModuleName, 11, "invalid salt format") + ErrNoAggregatePrevote = errors.Register(ModuleName, 12, "no aggregate prevote") + ErrNoAggregateVote = errors.Register(ModuleName, 13, "no aggregate vote") + ErrUnknownDenom = errors.Register(ModuleName, 14, "unknown denom") + ErrNegativeOrZeroRate = errors.Register(ModuleName, 15, "invalid exchange rate; should be positive") + ErrExistingPrevote = errors.Register(ModuleName, 16, "prevote already submitted for this voting period") + ErrBallotNotSorted = errors.Register(ModuleName, 17, "ballot must be sorted before this operation") + ErrInvalidOraclePrice = errors.Register(ModuleName, 18, "invalid or unavailable oracle price") + ErrNoHistoricPrice = errors.Register(ModuleName, 19, "no historic price for this denom at this block") + ErrNoMedian = errors.Register(ModuleName, 20, "no median for this denom at this block") + ErrNoMedianDeviation = errors.Register(ModuleName, 21, "no median deviation for this denom at this block") + ErrNoRewardBand = errors.Register(ModuleName, 22, "unable to find the reward band the given asset") + ErrNoValidatorRewardSet = errors.Register(ModuleName, 23, "unable to find the latest validator reward set") + ErrNoGovAuthority = errors.Register(ModuleName, 24, "invalid gov authority to perform these changes") + ErrInvalidRequest = errors.Register(ModuleName, 25, "invalid request") + ErrInvalidParamValue = errors.Register(ModuleName, 26, "invalid oracle param value") + ErrEncodeInjVoteExt = errors.Register(ModuleName, 27, "failed to encode injected vote extension tx") + ErrNonEqualInjVotesLen = errors.Register(ModuleName, 28, "number of exchange rate votes in vote extension and extended commit info are not equal") //nolint: lll + ErrNonEqualInjVotesRates = errors.Register(ModuleName, 29, "injected exchange rate votes and generated exchange votes are not equal") //nolint: lll + ErrNonEqualInjVotesBlockHash = errors.Register(ModuleName, 30, "injected block hash votes and generated block hash votes are not equal") //nolint: lll + ErrNoCommitInfo = errors.Register(ModuleName, 31, "no commit info in process proposal request") ) diff --git a/x/oracle/types/expected_keeper.go b/x/oracle/types/expected_keeper.go index 9e3879ad..d1125b7e 100644 --- a/x/oracle/types/expected_keeper.go +++ b/x/oracle/types/expected_keeper.go @@ -9,6 +9,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" gasestimatetypes "github.com/ojo-network/ojo/x/gasestimate/types" + symbiotictypes "github.com/ojo-network/ojo/x/symbiotic/types" ) // StakingKeeper defines the expected interface contract defined by the x/staking @@ -54,3 +55,10 @@ type BankKeeper interface { type GasEstimateKeeper interface { GetParams(ctx sdk.Context) (params gasestimatetypes.Params) } + +type SymbioticKeeper interface { + SetCachedBlockHash(ctx sdk.Context, cachedBlockHash symbiotictypes.CachedBlockHash) + GetParams(ctx sdk.Context) (params symbiotictypes.Params) + GetFinalizedBlockHash(ctx context.Context) (string, error) + TallyBlockHashVotes(ctx sdk.Context, blockHashVotes []BlockHashVote) string +} diff --git a/x/symbiotic/abci.go b/x/symbiotic/abci.go new file mode 100644 index 00000000..60caabb5 --- /dev/null +++ b/x/symbiotic/abci.go @@ -0,0 +1,31 @@ +package symbiotic + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ojo-network/ojo/util" + "github.com/ojo-network/ojo/x/symbiotic/keeper" +) + +// EndBlocker is called at the end of every block +func EndBlocker(ctx context.Context, k keeper.Keeper) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + params := k.GetParams(sdkCtx) + blockHeight := util.SafeInt64ToUint64(sdkCtx.BlockHeight()) + syncPeriod := util.SafeInt64ToUint64(params.SymbioticSyncPeriod) + + if util.IsPeriodLastBlock(sdkCtx, syncPeriod) { + prunePeriod := params.MaximumCachedBlockHashes * syncPeriod + if prunePeriod < blockHeight { + k.PruneBlockHashesBeforeBlock(sdkCtx, blockHeight-prunePeriod) + } + } + + if err := k.SymbioticUpdateValidatorsPower(ctx); err != nil { + k.Logger(sdkCtx).With(err).Error("Symbiotic val update error") + } + + return nil +} diff --git a/x/symbiotic/client/cli/query.go b/x/symbiotic/client/cli/query.go new file mode 100644 index 00000000..a2c3c432 --- /dev/null +++ b/x/symbiotic/client/cli/query.go @@ -0,0 +1,74 @@ +package cli + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/ojo-network/ojo/util/cli" + "github.com/ojo-network/ojo/x/symbiotic/types" + "github.com/spf13/cobra" +) + +func GetQueryCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + GetCmdQueryParams(), + GetCmdQueryCachedBlockHashes(), + ) + + return cmd +} + +// GetCmdQueryParams implements the query params command. +func GetCmdQueryParams() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Args: cobra.NoArgs, + Short: "Query the current symbiotic params", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Params(cmd.Context(), &types.ParamsRequest{}) + return cli.PrintOrErr(res, err, clientCtx) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetCmdQueryParams implements the query cached block hashes command. +func GetCmdQueryCachedBlockHashes() *cobra.Command { + cmd := &cobra.Command{ + Use: "cached block hashes", + Args: cobra.NoArgs, + Short: "Query the current cached block hashes", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.CachedBlockHashes(cmd.Context(), &types.CachedBlockHashesRequest{}) + return cli.PrintOrErr(res, err, clientCtx) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/symbiotic/client/cli/tx.go b/x/symbiotic/client/cli/tx.go new file mode 100644 index 00000000..707f44ac --- /dev/null +++ b/x/symbiotic/client/cli/tx.go @@ -0,0 +1,23 @@ +package cli + +import ( + "fmt" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/ojo-network/ojo/x/gmp/types" + "github.com/spf13/cobra" +) + +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Transaction commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand() + + return cmd +} diff --git a/x/symbiotic/genesis.go b/x/symbiotic/genesis.go new file mode 100644 index 00000000..bf0659fa --- /dev/null +++ b/x/symbiotic/genesis.go @@ -0,0 +1,21 @@ +package symbiotic + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ojo-network/ojo/x/symbiotic/keeper" + "github.com/ojo-network/ojo/x/symbiotic/types" +) + +// InitGenesis initializes the x/symbiotic module's state from a provided genesis +// state. +func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, genState types.GenesisState) { + keeper.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the x/symbiotic module's exported genesis. +func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { + genesisState := types.DefaultGenesisState() + genesisState.Params = keeper.GetParams(ctx) + return genesisState +} diff --git a/x/symbiotic/genesis_test.go b/x/symbiotic/genesis_test.go new file mode 100644 index 00000000..be1f47df --- /dev/null +++ b/x/symbiotic/genesis_test.go @@ -0,0 +1 @@ +package symbiotic diff --git a/x/symbiotic/keeper/grpc_query.go b/x/symbiotic/keeper/grpc_query.go new file mode 100644 index 00000000..07e8a149 --- /dev/null +++ b/x/symbiotic/keeper/grpc_query.go @@ -0,0 +1,42 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ojo-network/ojo/x/symbiotic/types" +) + +var _ types.QueryServer = querier{} + +// Querier implements a QueryServer for the x/symbiotic module. +type querier struct { + Keeper +} + +// NewQuerier returns an implementation of the symbiotic QueryServer interface +// for the provided Keeper. +func NewQuerier(keeper Keeper) types.QueryServer { + return &querier{Keeper: keeper} +} + +// Params queries params of x/symbiotic module. +func (q querier) Params( + goCtx context.Context, + _ *types.ParamsRequest, +) (*types.ParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + params := q.GetParams(ctx) + return &types.ParamsResponse{Params: params}, nil +} + +// Cached Block Hashes currently in the store. +func (q querier) CachedBlockHashes( + goCtx context.Context, + _ *types.CachedBlockHashesRequest, +) (*types.CachedBlockHashesResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + cachedBlockHashes := q.GetAllCachedBlockHashes(ctx) + return &types.CachedBlockHashesResponse{CachedBlockHashes: cachedBlockHashes}, nil +} diff --git a/x/symbiotic/keeper/keeper.go b/x/symbiotic/keeper/keeper.go new file mode 100644 index 00000000..f89cfe82 --- /dev/null +++ b/x/symbiotic/keeper/keeper.go @@ -0,0 +1,149 @@ +package keeper + +import ( + "fmt" + + "cosmossdk.io/log" + + sdk "github.com/cosmos/cosmos-sdk/types" + + storetypes "cosmossdk.io/store/types" + "github.com/cosmos/cosmos-sdk/codec" + oracletypes "github.com/ojo-network/ojo/x/oracle/types" + "github.com/ojo-network/ojo/x/symbiotic/types" +) + +type Keeper struct { + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + apiUrls types.ApiUrls + + StakingKeeper types.StakingKeeper + + // the address capable of executing a MsgSetParams message. Typically, this + // should be the x/gov module account. + authority string +} + +// NewKeeper constructs a new keeper for gmp module. +func NewKeeper( + cdc codec.BinaryCodec, + storeKey storetypes.StoreKey, + stakingKeeper types.StakingKeeper, + authority string, +) Keeper { + return Keeper{ + cdc: cdc, + storeKey: storeKey, + apiUrls: types.NewApiUrls(), + StakingKeeper: stakingKeeper, + authority: authority, + } +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +func (k Keeper) SetCachedBlockHash( + ctx sdk.Context, + cachedBlockHash types.CachedBlockHash, +) { + store := ctx.KVStore(k.storeKey) + + bz := k.cdc.MustMarshal(&cachedBlockHash) + store.Set(types.CachedBlockHashKey(uint64(cachedBlockHash.Height)), bz) +} + +func (k Keeper) DeleteCachedBlockHash( + ctx sdk.Context, + cachedBlockHash types.CachedBlockHash, +) { + store := ctx.KVStore(k.storeKey) + store.Delete(types.CachedBlockHashKey(uint64(cachedBlockHash.Height))) +} + +func (k Keeper) GetCachedBlockHash( + ctx sdk.Context, + blockHeight uint64, +) (types.CachedBlockHash, error) { + store := ctx.KVStore(k.storeKey) + + bz := store.Get(types.CachedBlockHashKey(blockHeight)) + cachedBlockHash := types.CachedBlockHash{} + k.cdc.MustUnmarshal(bz, &cachedBlockHash) + return cachedBlockHash, nil +} + +func (k Keeper) IterateAllCachedBlockHashes( + ctx sdk.Context, + handler func(types.CachedBlockHash) bool, +) { + store := ctx.KVStore(k.storeKey) + iter := storetypes.KVStorePrefixIterator(store, types.CachedBlockHashPrefix) + defer iter.Close() + + for ; iter.Valid(); iter.Next() { + cachedBlockHash := types.CachedBlockHash{} + k.cdc.MustUnmarshal(iter.Value(), &cachedBlockHash) + if handler(cachedBlockHash) { + break + } + } +} + +func (k Keeper) GetAllCachedBlockHashes( + ctx sdk.Context, +) []types.CachedBlockHash { + cachedBlockHashes := []types.CachedBlockHash{} + k.IterateAllCachedBlockHashes(ctx, func(cachedBlockHash types.CachedBlockHash) (stop bool) { + cachedBlockHashes = append(cachedBlockHashes, cachedBlockHash) + return false + }) + return cachedBlockHashes +} + +func (k Keeper) PruneBlockHashesBeforeBlock( + ctx sdk.Context, + blockNum uint64, +) { + k.IterateAllCachedBlockHashes(ctx, func(cachedBlockHash types.CachedBlockHash) (stop bool) { + if cachedBlockHash.Height <= int64(blockNum) { + k.DeleteCachedBlockHash(ctx, cachedBlockHash) + } + return false + }) +} + +func (k Keeper) TallyBlockHashVotes( + ctx sdk.Context, + blockHashVotes []oracletypes.BlockHashVote, +) string { + votePower := make(map[string]int64) + powerReduction := k.StakingKeeper.PowerReduction(ctx) + + for _, vote := range blockHashVotes { + voterAddr := sdk.ValAddress(vote.Voter) + + validator, err := k.StakingKeeper.GetValidator(ctx, voterAddr) + if err != nil { + continue + } + + power := validator.GetConsensusPower(powerReduction) + votePower[vote.BlockHash] += power + } + + var maxHash string + var maxPower int64 + + for hash, power := range votePower { + if power > maxPower { + maxPower = power + maxHash = hash + } + } + + return maxHash +} diff --git a/x/symbiotic/keeper/keeper_suite_test.go b/x/symbiotic/keeper/keeper_suite_test.go new file mode 100644 index 00000000..41d6524b --- /dev/null +++ b/x/symbiotic/keeper/keeper_suite_test.go @@ -0,0 +1,37 @@ +package keeper_test + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/suite" + + ojoapp "github.com/ojo-network/ojo/app" + appparams "github.com/ojo-network/ojo/app/params" + "github.com/ojo-network/ojo/tests/integration" + "github.com/ojo-network/ojo/x/symbiotic/keeper" + "github.com/ojo-network/ojo/x/symbiotic/types" +) + +const ( + displayDenom string = appparams.DisplayDenom + bondDenom string = appparams.BondDenom +) + +type IntegrationTestSuite struct { + suite.Suite + + ctx sdk.Context + app *ojoapp.App + keys []integration.TestValidatorKey + msgServer types.MsgServer +} + +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +} + +func (s *IntegrationTestSuite) SetupSuite() { + s.app, s.ctx, s.keys = integration.SetupAppWithContext(s.T()) + s.msgServer = keeper.NewMsgServerImpl(s.app.SymbioticKeeper) +} diff --git a/x/symbiotic/keeper/msg_server.go b/x/symbiotic/keeper/msg_server.go new file mode 100644 index 00000000..0dd3ce6c --- /dev/null +++ b/x/symbiotic/keeper/msg_server.go @@ -0,0 +1,44 @@ +package keeper + +import ( + "context" + + "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/ojo-network/ojo/x/symbiotic/types" +) + +type msgServer struct { + keeper Keeper +} + +// NewMsgServerImpl returns an implementation of the symbiotic MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{keeper: keeper} +} + +// SetParams implements MsgServer.SetParams method. +// It defines a method to update the x/symbiotic module parameters. +func (ms msgServer) SetParams(goCtx context.Context, msg *types.MsgSetParams) (*types.MsgSetParamsResponse, error) { + if ms.keeper.authority != msg.Authority { + err := errors.Wrapf( + govtypes.ErrInvalidSigner, + "invalid authority; expected %s, got %s", + ms.keeper.authority, + msg.Authority, + ) + return nil, err + } + + if err := msg.Params.Validate(); err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(goCtx) + ms.keeper.SetParams(ctx, *msg.Params) + + return &types.MsgSetParamsResponse{}, nil +} diff --git a/x/symbiotic/keeper/msg_server_test.go b/x/symbiotic/keeper/msg_server_test.go new file mode 100644 index 00000000..78e07f8e --- /dev/null +++ b/x/symbiotic/keeper/msg_server_test.go @@ -0,0 +1,43 @@ +package keeper_test + +import ( + "cosmossdk.io/math" + "github.com/cometbft/cometbft/crypto/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" + appparams "github.com/ojo-network/ojo/app/params" + "github.com/ojo-network/ojo/x/symbiotic/types" +) + +var ( + pubKey = secp256k1.GenPrivKey().PubKey() + addr = sdk.AccAddress(pubKey.Address()) + initCoins = sdk.NewCoins(sdk.NewCoin(appparams.BondDenom, math.NewInt(1000000000000000000))) +) + +func (s *IntegrationTestSuite) TestMsgServer_SetParams() { + SetParams(s, "0x0000000000000000000000000000000000000000", int64(10), uint64(10)) + + params := types.DefaultParams() + + s.Require().Equal(params, s.app.GasEstimateKeeper.GetParams(s.ctx)) +} + +// SetParams sets the gasestimate module params +func SetParams( + s *IntegrationTestSuite, + middlewareAddress string, + symbioticSyncPeriod int64, + maximumCachedBlockHashes uint64, +) { + authority := s.app.GovKeeper.GetGovernanceAccount(s.ctx).GetAddress().String() + + msg := types.NewMsgSetParams( + authority, + middlewareAddress, + symbioticSyncPeriod, + maximumCachedBlockHashes, + ) + + _, err := s.msgServer.SetParams(s.ctx, msg) + s.Require().NoError(err) +} diff --git a/x/symbiotic/keeper/network_state_change.go b/x/symbiotic/keeper/network_state_change.go new file mode 100644 index 00000000..50388e5c --- /dev/null +++ b/x/symbiotic/keeper/network_state_change.go @@ -0,0 +1,383 @@ +package keeper + +import ( + "context" + "cosmossdk.io/math" + "encoding/json" + "errors" + "fmt" + "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + "io/ioutil" + "math/big" + "net/http" + "strconv" + "strings" + "time" + + "github.com/ojo-network/ojo/util" + + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + symbiotictypes "github.com/ojo-network/ojo/x/symbiotic/types" +) + +// Struct to unmarshal the response from the Beacon Chain API +type Block struct { + Finalized bool `json:"finalized"` + Data struct { + Message struct { + Body struct { + ExecutionPayload struct { + BlockHash string `json:"block_hash"` + } `json:"execution_payload"` + } `json:"body"` + } `json:"message"` + } `json:"data"` +} + +type RPCRequest struct { + Jsonrpc string `json:"jsonrpc"` + Method string `json:"method"` + Params []interface{} `json:"params"` + ID int `json:"id"` +} + +type RPCResponse struct { + Jsonrpc string `json:"jsonrpc"` + ID int `json:"id"` + Result json.RawMessage `json:"result"` + Error *RPCError `json:"error,omitempty"` +} + +type RPCError struct { + Code int `json:"code"` + Message string `json:"message"` +} + +type Validator struct { + Stake *big.Int + ConsAddr [32]byte +} + +const ( + SLEEP_ON_RETRY = 200 + RETRIES = 5 + BEACON_GENESIS_TIMESTAMP = 1695902400 + SLOTS_IN_EPOCH = 32 + SLOT_DURATION = 12 + INVALID_BLOCKHASH = "invalid" + BLOCK_PATH = "/eth/v2/beacon/blocks/" + GET_VALIDATOR_SET_FUNCTION_NAME = "getValidatorSet" + GET_CURRENT_EPOCH_FUNCTION_NAME = "getCurrentEpoch" + CONTRACT_ABI = `[ + { + "type": "function", + "name": "getCurrentEpoch", + "outputs": [ + { + "name": "epoch", + "type": "uint48", + "internalType": "uint48" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getValidatorSet", + "inputs": [ + { + "name": "epoch", + "type": "uint48", + "internalType": "uint48" + } + ], + "outputs": [ + { + "name": "validatorsData", + "type": "tuple[]", + "internalType": "struct SimpleMiddleware.ValidatorData[]", + "components": [ + { + "name": "stake", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "consAddr", + "type": "bytes32", + "internalType": "bytes32" + } + ] + } + ], + "stateMutability": "view" + } + ]` +) + +func (k Keeper) SymbioticUpdateValidatorsPower(ctx context.Context) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + params := k.GetParams(sdkCtx) + + if params.MiddlewareAddress == "" { + panic("middleware address is not set") + } + + height := sdkCtx.BlockHeight() + + if height%params.SymbioticSyncPeriod != 0 { + return nil + } + + cachedBlockHash, err := k.GetCachedBlockHash(sdkCtx, util.SafeInt64ToUint64(height)) + if err != nil { + return err + } + + if cachedBlockHash.BlockHash == INVALID_BLOCKHASH { + return nil + } + + var validators []Validator + + for i := 0; i < RETRIES; i++ { + validators, err = k.getSymbioticValidatorSet(ctx, cachedBlockHash.BlockHash) + if err == nil { + break + } + + if strings.HasSuffix(err.Error(), "is not currently canonical") { + k.Logger(sdkCtx).Warn("not canonical block hash", "hash", cachedBlockHash.BlockHash) + err = nil + break + } + + k.apiUrls.RotateEthUrl() + time.Sleep(time.Millisecond * SLEEP_ON_RETRY) + } + + if err != nil { + return err + } + + for _, v := range validators { + val, err := k.StakingKeeper.GetValidatorByConsAddr(ctx, v.ConsAddr[:20]) + if err != nil { + if errors.Is(err, stakingtypes.ErrNoValidatorFound) { + continue + } + return err + } + tokens := math.NewIntFromBigInt(v.Stake) + + if tokens.GT(val.GetTokens()) { + k.StakingKeeper.AddValidatorTokensAndShares(ctx, val, tokens.Sub(val.GetTokens())) + } else { + k.StakingKeeper.RemoveValidatorTokens(ctx, val, val.GetTokens().Sub(tokens)) + } + } + + return nil +} + +func (k Keeper) GetFinalizedBlockHash(ctx context.Context) (string, error) { + var err error + var block Block + + for i := 0; i < RETRIES; i++ { + slot := k.getSlot(ctx) + block, err = k.parseBlock(ctx, slot) + + for errors.Is(err, symbiotictypes.ErrSymbioticNotFound) { // some slots on api may be omitted + for i := 1; i < SLOTS_IN_EPOCH; i++ { + block, err = k.parseBlock(ctx, slot-i) + if err == nil { + break + } + if !errors.Is(err, symbiotictypes.ErrSymbioticNotFound) { + return "", err + } + } + } + + if err == nil { + break + } + + k.apiUrls.RotateBeaconUrl() + time.Sleep(time.Millisecond * SLEEP_ON_RETRY) + } + + if err != nil { + return "", err + } + + if !block.Finalized { + return INVALID_BLOCKHASH, nil + } + + return block.Data.Message.Body.ExecutionPayload.BlockHash, nil +} + +func (k Keeper) GetBlockByHash(ctx context.Context, blockHash string) (*types.Block, error) { + var block *types.Block + client, err := ethclient.Dial(k.apiUrls.GetEthApiUrl()) + if err != nil { + return nil, err + } + defer client.Close() + + for i := 0; i < RETRIES; i++ { + block, err = client.BlockByHash(ctx, common.HexToHash(blockHash)) + if err == nil { + break + } + + k.apiUrls.RotateEthUrl() + time.Sleep(time.Millisecond * SLEEP_ON_RETRY) + } + + if err != nil { + return nil, err + } + + return block, nil +} + +func (k Keeper) GetBlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) { + var block *types.Block + client, err := ethclient.Dial(k.apiUrls.GetEthApiUrl()) + if err != nil { + return nil, err + } + defer client.Close() + + for i := 0; i < RETRIES; i++ { + block, err = client.BlockByNumber(ctx, number) + if err == nil { + break + } + + k.apiUrls.RotateEthUrl() + time.Sleep(time.Millisecond * SLEEP_ON_RETRY) + } + + if err != nil { + return nil, err + } + + return block, nil +} + +func (k Keeper) GetMinBlockTimestamp(ctx context.Context) uint64 { + return uint64(k.getSlot(ctx)-SLOTS_IN_EPOCH)*12 + BEACON_GENESIS_TIMESTAMP +} + +func (k Keeper) getSymbioticValidatorSet(ctx context.Context, blockHash string) ([]Validator, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + params := k.GetParams(sdkCtx) + + client, err := ethclient.Dial(k.apiUrls.GetEthApiUrl()) + if err != nil { + k.Logger(sdkCtx).With(err).Error("rpc error: ethclient dial error", "url", k.apiUrls.GetEthApiUrl()) + return nil, err + } + defer client.Close() + + contractABI, err := abi.JSON(strings.NewReader(CONTRACT_ABI)) + if err != nil { + return nil, err + } + + contractAddress := common.HexToAddress(params.MiddlewareAddress) + + data, err := contractABI.Pack(GET_CURRENT_EPOCH_FUNCTION_NAME) + if err != nil { + return nil, err + } + + query := ethereum.CallMsg{ + To: &contractAddress, + Data: data, + } + result, err := client.CallContractAtHash(ctx, query, common.HexToHash(blockHash)) + if err != nil { + k.Logger(sdkCtx).With(err).Error("rpc error: eth_call error", "url", k.apiUrls.GetEthApiUrl()) + return nil, err + } + + currentEpoch := new(big.Int).SetBytes(result) + + data, err = contractABI.Pack(GET_VALIDATOR_SET_FUNCTION_NAME, currentEpoch) + if err != nil { + return nil, err + } + + query = ethereum.CallMsg{ + To: &contractAddress, + Data: data, + } + result, err = client.CallContractAtHash(ctx, query, common.HexToHash(blockHash)) + if err != nil { + k.Logger(sdkCtx).With(err).Error("rpc error: eth_call error", "url", k.apiUrls.GetEthApiUrl()) + return nil, err + } + + var validators []Validator + err = contractABI.UnpackIntoInterface(&validators, GET_VALIDATOR_SET_FUNCTION_NAME, result) + if err != nil { + return nil, err + } + + return validators, nil +} + +func (k Keeper) getSlot(ctx context.Context) int { + sdkCtx := sdk.UnwrapSDKContext(ctx) + slot := (sdkCtx.BlockHeader().Time.Unix() - BEACON_GENESIS_TIMESTAMP) / SLOT_DURATION // get beacon slot + slot = slot / SLOTS_IN_EPOCH * SLOTS_IN_EPOCH // first slot of epoch + slot -= 3 * SLOTS_IN_EPOCH // get finalized slot + return int(slot) +} + +func (k Keeper) parseBlock(ctx context.Context, slot int) (Block, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + url := k.apiUrls.GetBeaconApiUrl() + BLOCK_PATH + strconv.Itoa(slot) + + var block Block + resp, err := http.Get(url) + if err != nil { + k.Logger(sdkCtx).With(err).Error("rpc error: beacon rpc call error", "url", url, "err", err) + return block, fmt.Errorf("error making HTTP request: %v", err) + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + k.Logger(sdkCtx).Error("rpc error: beacon rpc call error", "url", k.apiUrls.GetEthApiUrl(), "err", "no err", "status", resp.StatusCode) + } + + if resp.StatusCode == http.StatusNotFound { + return block, symbiotictypes.ErrSymbioticNotFound + } + + if resp.StatusCode != http.StatusOK { + return block, fmt.Errorf("unexpected status code: %d", resp.StatusCode) + } + + body, err := ioutil.ReadAll(resp.Body) + if err != nil { + return block, fmt.Errorf("error reading response body: %v", err) + } + + err = json.Unmarshal(body, &block) + if err != nil { + return block, fmt.Errorf("error unmarshaling JSON: %v", err) + } + + return block, nil +} diff --git a/x/symbiotic/keeper/network_state_change_test.go b/x/symbiotic/keeper/network_state_change_test.go new file mode 100644 index 00000000..9231d9f4 --- /dev/null +++ b/x/symbiotic/keeper/network_state_change_test.go @@ -0,0 +1,80 @@ +package keeper_test + +import ( + "time" + + "cosmossdk.io/math" + + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + sdk "github.com/cosmos/cosmos-sdk/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + stakingtestutil "github.com/cosmos/cosmos-sdk/x/staking/testutil" + appparams "github.com/ojo-network/ojo/app/params" + "github.com/ojo-network/ojo/x/symbiotic/types" +) + +const ( + ojoMiddlewareAddress = "0x127E303D6604C48f3bA0010EbEa57e09324A4dF6" + secret = "fixed_seed_value" +) + +func (s *IntegrationTestSuite) TestSymbioticUpdateValidatorsPower() { + app, ctx := s.app, s.ctx + ctx = ctx. + WithBlockHeight(10). + WithBlockTime(time.Now()) + + sh := stakingtestutil.NewHelper(s.T(), ctx, app.StakingKeeper) + sh.Denom = appparams.BondDenom + privKey := secp256k1.GenPrivKeyFromSecret([]byte(secret)) + pubKey := privKey.PubKey() + + initTokens := sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction) + initCoins := sdk.NewCoins(sdk.NewCoin(appparams.BondDenom, initTokens)) + + s.app.BankKeeper.MintCoins(s.ctx, minttypes.ModuleName, initCoins) + s.app.BankKeeper.SendCoinsFromModuleToAccount(s.ctx, minttypes.ModuleName, sdk.AccAddress(pubKey.Address()), initCoins) + + sh.CreateValidatorWithValPower( + sdk.ValAddress(pubKey.Address()), + pubKey, + 1000, + true, + ) + val, err := app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(pubKey.Address())) + s.Require().Equal(val.GetTokens(), math.NewInt(1000000000)) + + params := app.SymbioticKeeper.GetParams(ctx) + params.MiddlewareAddress = ojoMiddlewareAddress + app.SymbioticKeeper.SetParams(ctx, params) + + blockHash, err := app.SymbioticKeeper.GetFinalizedBlockHash(ctx) + s.Require().NoError(err) + + cachedBlockHash := types.CachedBlockHash{ + BlockHash: blockHash, + Height: ctx.BlockHeight(), + } + + app.SymbioticKeeper.SetCachedBlockHash(ctx, cachedBlockHash) + + err = app.SymbioticKeeper.SymbioticUpdateValidatorsPower(ctx) + s.Require().NoError(err) + + val, err = app.StakingKeeper.GetValidator(ctx, sdk.ValAddress(pubKey.Address())) + s.Require().NoError(err) + s.Require().Equal(val.GetTokens(), math.NewInt(0)) +} + +func (s *IntegrationTestSuite) TestFinalizedBlockHash() { + app, ctx := s.app, s.ctx + ctx = ctx. + WithBlockHeight(10). + WithBlockTime(time.Now()) + + blockHash, err := app.SymbioticKeeper.GetFinalizedBlockHash(ctx) + s.Require().NoError(err) + + _, err = app.SymbioticKeeper.GetBlockByHash(ctx, blockHash) + s.Require().NoError(err) +} diff --git a/x/symbiotic/keeper/params.go b/x/symbiotic/keeper/params.go new file mode 100644 index 00000000..85b884e7 --- /dev/null +++ b/x/symbiotic/keeper/params.go @@ -0,0 +1,20 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ojo-network/ojo/x/symbiotic/types" +) + +// SetParams sets the symbiotic module's parameters. +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + store := ctx.KVStore(k.storeKey) + store.Set(types.ParamsKey, k.cdc.MustMarshal(¶ms)) +} + +// GetParams gets the symbiotic module's parameters. +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + store := ctx.KVStore(k.storeKey) + bz := store.Get(types.ParamsKey) + k.cdc.MustUnmarshal(bz, ¶ms) + return +} diff --git a/x/symbiotic/module.go b/x/symbiotic/module.go new file mode 100644 index 00000000..aec0bace --- /dev/null +++ b/x/symbiotic/module.go @@ -0,0 +1,181 @@ +package symbiotic + +import ( + "context" + "encoding/json" + "fmt" + + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/ojo-network/ojo/x/symbiotic/client/cli" + "github.com/ojo-network/ojo/x/symbiotic/keeper" + "github.com/ojo-network/ojo/x/symbiotic/types" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleSimulation = AppModule{} +) + +// AppModuleBasic implements the AppModuleBasic interface for the x/symbiotic module. +type AppModuleBasic struct { + cdc codec.Codec +} + +// RegisterLegacyAminoCodec registers the x/symbiotic module's types with a legacy +// Amino codec. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(cdc) +} + +func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the x/symbiotic module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// IsOnePerModuleType implements the module.AppModule interface. +func (am AppModule) IsOnePerModuleType() {} + +// IsAppModule implements the module.AppModule interface. +func (am AppModule) IsAppModule() {} + +func (AppModuleBasic) ConsensusVersion() uint64 { + return 1 +} + +// RegisterInterfaces registers the x/symbiotic module's interface types. +func (AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the x/symbiotic module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the x/symbiotic module. +func (AppModuleBasic) ValidateGenesis( + cdc codec.JSONCodec, + _ client.TxEncodingConfig, + bz json.RawMessage, +) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return nil +} + +// Deprecated: RegisterRESTRoutes performs a no-op. Querying is delegated to the +// gRPC service. +func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the x/symbiotic +// module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// GetTxCmd returns the x/symbiotic module's root tx command. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the x/symbiotic module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +// AppModule implements the AppModule interface for the x/symbiotic module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + } +} + +// Name returns the x/symbiotic module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// QuerierRoute returns the x/symbiotic module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// RegisterServices registers gRPC services. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), keeper.NewQuerier(am.keeper)) +} + +// RegisterInvariants registers the x/symbiotic module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the x/symbiotic module's genesis initialization. It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + + cdc.MustUnmarshalJSON(gs, &genState) + InitGenesis(ctx, am.keeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the x/symbiotic module's exported genesis state as raw +// JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// BeginBlock executes all ABCI BeginBlock logic respective to the x/symbiotic module. +func (am AppModule) BeginBlock(_ context.Context) {} + +// EndBlock will process price update payments during price deviation events. +func (am AppModule) EndBlock(goCtx context.Context) ([]abci.ValidatorUpdate, error) { + return []abci.ValidatorUpdate{}, nil +} + +// GenerateGenesisState currently is a no-op. +func (AppModule) GenerateGenesisState(_ *module.SimulationState) {} + +// WeightedOperations currently is a no-op. +func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { + return []simtypes.WeightedOperation{} +} + +// ProposalContents returns all the symbiotic content functions used to +// simulate governance proposals. +func (am AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalMsg { + return []simtypes.WeightedProposalMsg{} +} + +// RegisterStoreDecoder currently is a no-op. +func (am AppModule) RegisterStoreDecoder(_ simtypes.StoreDecoderRegistry) {} diff --git a/x/symbiotic/types/api_urls.go b/x/symbiotic/types/api_urls.go new file mode 100644 index 00000000..192432d5 --- /dev/null +++ b/x/symbiotic/types/api_urls.go @@ -0,0 +1,57 @@ +package types + +import ( + "os" + "strings" +) + +type ApiUrls struct { + beaconApiUrls []string + ethApiUrls []string + currentBeaconId int + currentEthId int +} + +func NewApiUrls() ApiUrls { + // USE ONLY YOUR LOCAL BEACON CLIENT FOR SAFETY!!! + beaconApiUrls := strings.Split(os.Getenv("BEACON_API_URLS"), ",") + if len(beaconApiUrls) == 1 && beaconApiUrls[0] == "" { + beaconApiUrls[0] = "https://eth-holesky-beacon.public.blastapi.io" + beaconApiUrls = append(beaconApiUrls, "http://unstable.holesky.beacon-api.nimbus.team") + beaconApiUrls = append(beaconApiUrls, "https://ethereum-holesky-beacon-api.publicnode.com") + } + + ethApiUrls := strings.Split(os.Getenv("ETH_API_URLS"), ",") + + if len(ethApiUrls) == 1 && ethApiUrls[0] == "" { + ethApiUrls[0] = "https://rpc.ankr.com/eth_holesky" + ethApiUrls = append(ethApiUrls, "https://ethereum-holesky.blockpi.network/v1/rpc/public") + ethApiUrls = append(ethApiUrls, "https://eth-holesky.public.blastapi.io") + ethApiUrls = append(ethApiUrls, "https://ethereum-holesky.gateway.tatum.io") + ethApiUrls = append(ethApiUrls, "https://holesky.gateway.tenderly.co") + } + + return ApiUrls{beaconApiUrls: beaconApiUrls, ethApiUrls: ethApiUrls} +} + +func (au ApiUrls) GetEthApiUrl() string { + return au.ethApiUrls[au.currentEthId] +} + +func (au ApiUrls) GetBeaconApiUrl() string { + return au.beaconApiUrls[au.currentBeaconId] +} + +func (au *ApiUrls) RotateEthUrl() { + au.currentEthId++ + if au.currentEthId == len(au.ethApiUrls) { + au.currentEthId = 0 + } +} + +func (au *ApiUrls) RotateBeaconUrl() { + au.currentBeaconId++ + if au.currentBeaconId == len(au.beaconApiUrls) { + au.currentBeaconId = 0 + } +} diff --git a/x/symbiotic/types/api_urls_test.go b/x/symbiotic/types/api_urls_test.go new file mode 100644 index 00000000..83a9915c --- /dev/null +++ b/x/symbiotic/types/api_urls_test.go @@ -0,0 +1,28 @@ +package types + +import ( + "os" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestApiUrls(t *testing.T) { + // No environment variables set + os.Unsetenv("BEACON_API_URLS") + os.Unsetenv("ETH_API_URLS") + + apiUrls := NewApiUrls() + + require.Len(t, apiUrls.beaconApiUrls, 3, "Expected 3 default beacon API URLs") + require.Len(t, apiUrls.ethApiUrls, 5, "Expected 5 default ETH API URLs") + + // Environment variables set + os.Setenv("BEACON_API_URLS", "http://example.com") + os.Setenv("ETH_API_URLS", "http://example-eth.com,http://example-eth2.com") + + apiUrls = NewApiUrls() + + require.Len(t, apiUrls.beaconApiUrls, 1, "Expected 1 beacon API URL") + require.Len(t, apiUrls.ethApiUrls, 2, "Expected 2 ETH API URLs") +} diff --git a/x/symbiotic/types/codec.go b/x/symbiotic/types/codec.go new file mode 100644 index 00000000..44cd42e7 --- /dev/null +++ b/x/symbiotic/types/codec.go @@ -0,0 +1,40 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +var ( + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global x/symbiotic module codec. Note, the codec should + // ONLY be used in certain instances of tests and for JSON encoding as Amino is + // still used for that purpose. + // + // The actual codec used for serialization should be provided to x/staking and + // defined at the application level. + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + amino.Seal() +} + +// RegisterLegacyAminoCodec registers the necessary x/symbiotic interfaces and concrete types +// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + +} + +// RegisterInterfaces registers the x/symbiotic interfaces types with the interface registry +func RegisterInterfaces(registry codectypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil)) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/symbiotic/types/errors.go b/x/symbiotic/types/errors.go new file mode 100644 index 00000000..54328e6e --- /dev/null +++ b/x/symbiotic/types/errors.go @@ -0,0 +1,8 @@ +package types + +import "cosmossdk.io/errors" + +var ( + ErrSymbioticValUpdate = errors.Register(ModuleName, 1, "symbiotic validator update error") + ErrSymbioticNotFound = errors.Register(ModuleName, 2, "symbiotic not found") +) diff --git a/x/symbiotic/types/expected_keeper.go b/x/symbiotic/types/expected_keeper.go new file mode 100644 index 00000000..6dfef8e0 --- /dev/null +++ b/x/symbiotic/types/expected_keeper.go @@ -0,0 +1,23 @@ +package types + +import ( + "context" + + sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" +) + +// StakingKeeper defines the expected interface contract defined by the x/staking +// module. +type StakingKeeper interface { + GetValidator(ctx context.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, err error) + GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (validator stakingtypes.Validator, err error) + AddValidatorTokensAndShares(ctx context.Context, validator stakingtypes.Validator, + tokensToAdd sdkmath.Int, + ) (valOut stakingtypes.Validator, addedShares sdkmath.LegacyDec, err error) + RemoveValidatorTokens(ctx context.Context, + validator stakingtypes.Validator, tokensToRemove sdkmath.Int, + ) (stakingtypes.Validator, error) + PowerReduction(ctx context.Context) (res sdkmath.Int) +} diff --git a/x/symbiotic/types/genesis.go b/x/symbiotic/types/genesis.go new file mode 100644 index 00000000..ba181c25 --- /dev/null +++ b/x/symbiotic/types/genesis.go @@ -0,0 +1,15 @@ +package types + +func NewGenesisState( + params Params, +) *GenesisState { + return &GenesisState{ + Params: params, + } +} + +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + } +} diff --git a/x/symbiotic/types/genesis.pb.go b/x/symbiotic/types/genesis.pb.go new file mode 100644 index 00000000..5fc46b93 --- /dev/null +++ b/x/symbiotic/types/genesis.pb.go @@ -0,0 +1,321 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ojo/symbiotic/v1/genesis.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + _ "github.com/gogo/protobuf/gogoproto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState represents the genesis state of the symbiotic module. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_97409d5df9cd90f8, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "ojo.symbiotic.v1.GenesisState") +} + +func init() { proto.RegisterFile("ojo/symbiotic/v1/genesis.proto", fileDescriptor_97409d5df9cd90f8) } + +var fileDescriptor_97409d5df9cd90f8 = []byte{ + // 202 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcb, 0xcf, 0xca, 0xd7, + 0x2f, 0xae, 0xcc, 0x4d, 0xca, 0xcc, 0x2f, 0xc9, 0x4c, 0xd6, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, + 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xc8, 0xcf, 0xca, 0xd7, + 0x83, 0xcb, 0xeb, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf5, 0x41, 0x2c, + 0x88, 0x3a, 0x29, 0x05, 0x0c, 0x73, 0x10, 0x9a, 0xc0, 0x2a, 0x94, 0xdc, 0xb8, 0x78, 0xdc, 0x21, + 0x46, 0x07, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x99, 0x71, 0xb1, 0x15, 0x24, 0x16, 0x25, 0xe6, 0x16, + 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x49, 0xe8, 0xa1, 0x5b, 0xa5, 0x17, 0x00, 0x96, 0x77, + 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0xda, 0xc9, 0xed, 0xc4, 0x23, 0x39, 0xc6, 0x0b, + 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, + 0x1b, 0x8f, 0xe5, 0x18, 0xa2, 0x74, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, + 0xf5, 0xf3, 0xb3, 0xf2, 0x75, 0xf3, 0x52, 0x4b, 0xca, 0xf3, 0x8b, 0xb2, 0x41, 0x6c, 0xfd, 0x0a, + 0x24, 0xc7, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x9d, 0x65, 0x0c, 0x08, 0x00, 0x00, + 0xff, 0xff, 0x0e, 0xb2, 0x74, 0x42, 0x02, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/symbiotic/types/keys.go b/x/symbiotic/types/keys.go new file mode 100644 index 00000000..dddbfbf2 --- /dev/null +++ b/x/symbiotic/types/keys.go @@ -0,0 +1,36 @@ +package types + +import ( + "github.com/ojo-network/ojo/util" +) + +const ( + // ModuleName is the name of the symbiotic module + ModuleName = "symbiotic" + + // StoreKey is the string store representation + StoreKey = ModuleName + + // RouterKey is the message route + RouterKey = ModuleName + + // QuerierRoute is the query router key for the symbiotic module + QuerierRoute = ModuleName +) + +// KVStore key prefixes +var ( + ParamsKey = []byte{0x01} + CachedBlockHashPrefix = []byte{0x02} + CachedHeaderInfoPrefix = []byte{0x03} +) + +// CachedBlockHashKey returns the store key for a CachedBlockHash +func CachedBlockHashKey(blockHeight uint64) (key []byte) { + return util.ConcatBytes(0, CachedBlockHashPrefix, util.UintWithNullPrefix(blockHeight)) +} + +// CachedHeaderInfoKey returns the store key for a CachedHeaderInfo +func CachedHeaderInfoKey(blockHeight uint64) (key []byte) { + return util.ConcatBytes(0, CachedHeaderInfoPrefix, util.UintWithNullPrefix(blockHeight)) +} diff --git a/x/symbiotic/types/msgs.go b/x/symbiotic/types/msgs.go new file mode 100644 index 00000000..371a3fe6 --- /dev/null +++ b/x/symbiotic/types/msgs.go @@ -0,0 +1,40 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/ojo-network/ojo/util/checkers" +) + +var _ sdk.Msg = &MsgSetParams{} + +func NewMsgSetParams( + govAddress string, + middlewareAddress string, + symbioticSyncPeriod int64, + maximumCachedBlockHashes uint64, +) *MsgSetParams { + params := &Params{ + MiddlewareAddress: middlewareAddress, + SymbioticSyncPeriod: symbioticSyncPeriod, + MaximumCachedBlockHashes: maximumCachedBlockHashes, + } + return &MsgSetParams{ + Params: params, + Authority: govAddress, + } +} + +// Type implements LegacyMsg interface +func (msg MsgSetParams) Type() string { return sdk.MsgTypeURL(&msg) } + +// GetSigners implements sdk.Msg +func (msg MsgSetParams) GetSigners() []sdk.AccAddress { + return checkers.Signers(msg.Authority) +} + +// ValidateBasic Implements sdk.Msg +func (msg MsgSetParams) ValidateBasic() error { + // TODO validate params + return nil +} diff --git a/x/symbiotic/types/params.go b/x/symbiotic/types/params.go new file mode 100644 index 00000000..e87b11f7 --- /dev/null +++ b/x/symbiotic/types/params.go @@ -0,0 +1,29 @@ +package types + +import ( + "fmt" +) + +var ( + DefaultMiddlewareAddress = "0x0000000000000000000000000000000000000000" + DefaultSymbioticSyncPeriod = int64(10) + DefaultMaximumCachedBlockHashes = uint64(10) +) + +func DefaultParams() Params { + return Params{ + MiddlewareAddress: DefaultMiddlewareAddress, + SymbioticSyncPeriod: DefaultSymbioticSyncPeriod, + MaximumCachedBlockHashes: DefaultMaximumCachedBlockHashes, + } +} + +func (p Params) Validate() error { + if len(p.MiddlewareAddress) != 42 { + return fmt.Errorf("middleware address must be a valid ethereum address") + } + if p.SymbioticSyncPeriod < 1 { + return fmt.Errorf("symbiotic sync period value must be positive and nonzero") + } + return nil +} diff --git a/x/symbiotic/types/query.pb.go b/x/symbiotic/types/query.pb.go new file mode 100644 index 00000000..aacfad57 --- /dev/null +++ b/x/symbiotic/types/query.pb.go @@ -0,0 +1,881 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ojo/symbiotic/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "github.com/gogo/protobuf/gogoproto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ParamsRequest is the request type for the Query/Params RPC method. +type ParamsRequest struct { +} + +func (m *ParamsRequest) Reset() { *m = ParamsRequest{} } +func (m *ParamsRequest) String() string { return proto.CompactTextString(m) } +func (*ParamsRequest) ProtoMessage() {} +func (*ParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_28a56573e0029829, []int{0} +} +func (m *ParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ParamsRequest.Merge(m, src) +} +func (m *ParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *ParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ParamsRequest proto.InternalMessageInfo + +// ParamsResponse is the response type for the Query/Params RPC method. +type ParamsResponse struct { + // params defines the parameters of the module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *ParamsResponse) Reset() { *m = ParamsResponse{} } +func (m *ParamsResponse) String() string { return proto.CompactTextString(m) } +func (*ParamsResponse) ProtoMessage() {} +func (*ParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_28a56573e0029829, []int{1} +} +func (m *ParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ParamsResponse.Merge(m, src) +} +func (m *ParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *ParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ParamsResponse proto.InternalMessageInfo + +func (m *ParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// CachedBlockHashesRequest is the request type for the Query/CachedBlockHashes RPC method. +type CachedBlockHashesRequest struct { +} + +func (m *CachedBlockHashesRequest) Reset() { *m = CachedBlockHashesRequest{} } +func (m *CachedBlockHashesRequest) String() string { return proto.CompactTextString(m) } +func (*CachedBlockHashesRequest) ProtoMessage() {} +func (*CachedBlockHashesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_28a56573e0029829, []int{2} +} +func (m *CachedBlockHashesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CachedBlockHashesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CachedBlockHashesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CachedBlockHashesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CachedBlockHashesRequest.Merge(m, src) +} +func (m *CachedBlockHashesRequest) XXX_Size() int { + return m.Size() +} +func (m *CachedBlockHashesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CachedBlockHashesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CachedBlockHashesRequest proto.InternalMessageInfo + +// CachedBlockHashesResponse is the response type for the Query/CachedBlockHashes RPC method. +type CachedBlockHashesResponse struct { + CachedBlockHashes []CachedBlockHash `protobuf:"bytes,1,rep,name=cached_block_hashes,json=cachedBlockHashes,proto3" json:"cached_block_hashes"` +} + +func (m *CachedBlockHashesResponse) Reset() { *m = CachedBlockHashesResponse{} } +func (m *CachedBlockHashesResponse) String() string { return proto.CompactTextString(m) } +func (*CachedBlockHashesResponse) ProtoMessage() {} +func (*CachedBlockHashesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_28a56573e0029829, []int{3} +} +func (m *CachedBlockHashesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CachedBlockHashesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CachedBlockHashesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CachedBlockHashesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CachedBlockHashesResponse.Merge(m, src) +} +func (m *CachedBlockHashesResponse) XXX_Size() int { + return m.Size() +} +func (m *CachedBlockHashesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CachedBlockHashesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CachedBlockHashesResponse proto.InternalMessageInfo + +func (m *CachedBlockHashesResponse) GetCachedBlockHashes() []CachedBlockHash { + if m != nil { + return m.CachedBlockHashes + } + return nil +} + +func init() { + proto.RegisterType((*ParamsRequest)(nil), "ojo.symbiotic.v1.ParamsRequest") + proto.RegisterType((*ParamsResponse)(nil), "ojo.symbiotic.v1.ParamsResponse") + proto.RegisterType((*CachedBlockHashesRequest)(nil), "ojo.symbiotic.v1.CachedBlockHashesRequest") + proto.RegisterType((*CachedBlockHashesResponse)(nil), "ojo.symbiotic.v1.CachedBlockHashesResponse") +} + +func init() { proto.RegisterFile("ojo/symbiotic/v1/query.proto", fileDescriptor_28a56573e0029829) } + +var fileDescriptor_28a56573e0029829 = []byte{ + // 375 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x4e, 0xc2, 0x40, + 0x18, 0xc4, 0x5b, 0x54, 0x0e, 0x4b, 0xfc, 0xc3, 0xea, 0xa1, 0x36, 0xa4, 0xd4, 0x1a, 0x13, 0x22, + 0xda, 0x06, 0x4c, 0x7c, 0x00, 0x4c, 0x0c, 0x47, 0xe5, 0x62, 0xe2, 0x85, 0xb4, 0x75, 0xd3, 0x16, + 0x68, 0xbf, 0xd2, 0x5d, 0x50, 0xae, 0x3e, 0x81, 0xd1, 0x93, 0x6f, 0xc4, 0x91, 0xc4, 0x8b, 0x27, + 0x63, 0xc0, 0x07, 0x31, 0xdd, 0x56, 0x34, 0x54, 0xa2, 0x37, 0xb2, 0x33, 0xcc, 0xfc, 0xbe, 0x49, + 0x51, 0x09, 0x3a, 0x60, 0xd0, 0x91, 0x6f, 0x79, 0xc0, 0x3c, 0xdb, 0x18, 0xd6, 0x8c, 0xfe, 0x80, + 0x44, 0x23, 0x3d, 0x8c, 0x80, 0x01, 0xde, 0x82, 0x0e, 0xe8, 0x73, 0x55, 0x1f, 0xd6, 0xe4, 0x1d, + 0x07, 0x1c, 0xe0, 0xa2, 0x11, 0xff, 0x4a, 0x7c, 0x72, 0xc9, 0x01, 0x70, 0x7a, 0xc4, 0x30, 0x43, + 0xcf, 0x30, 0x83, 0x00, 0x98, 0xc9, 0x3c, 0x08, 0x68, 0xaa, 0xaa, 0x99, 0x8e, 0xef, 0x48, 0xee, + 0xd0, 0x36, 0xd1, 0xfa, 0x85, 0x19, 0x99, 0x3e, 0x6d, 0x91, 0xfe, 0x80, 0x50, 0xa6, 0x35, 0xd1, + 0xc6, 0xd7, 0x03, 0x0d, 0x21, 0xa0, 0x04, 0x9f, 0xa2, 0x7c, 0xc8, 0x5f, 0x24, 0x51, 0x15, 0x2b, + 0x85, 0xba, 0xa4, 0x2f, 0xb2, 0xe9, 0xc9, 0x3f, 0x1a, 0xab, 0xe3, 0xb7, 0xb2, 0xd0, 0x4a, 0xdd, + 0x9a, 0x8c, 0xa4, 0x33, 0xd3, 0x76, 0xc9, 0x4d, 0xa3, 0x07, 0x76, 0xb7, 0x69, 0x52, 0x97, 0xcc, + 0x5b, 0x18, 0xda, 0xfd, 0x45, 0x4b, 0x0b, 0xaf, 0xd0, 0xb6, 0xcd, 0xc5, 0xb6, 0x15, 0xab, 0x6d, + 0x97, 0xcb, 0x92, 0xa8, 0xae, 0x54, 0x0a, 0xf5, 0xbd, 0x6c, 0xfb, 0x42, 0x52, 0x8a, 0x51, 0xb4, + 0x17, 0x0b, 0xea, 0x8f, 0x39, 0xb4, 0x76, 0x19, 0x8f, 0x8c, 0x7d, 0x94, 0x4f, 0x98, 0x71, 0x79, + 0xd9, 0x35, 0x29, 0xaa, 0xac, 0x2e, 0x37, 0x24, 0xbc, 0x9a, 0x7a, 0xff, 0xf2, 0xf1, 0x94, 0x93, + 0xb1, 0x64, 0x64, 0xe6, 0x4e, 0xa6, 0xc0, 0xcf, 0x22, 0x2a, 0x66, 0xee, 0xc5, 0x87, 0x7f, 0x9e, + 0x32, 0x1f, 0x4c, 0xae, 0xfe, 0xcb, 0x9b, 0x02, 0x55, 0x39, 0xd0, 0x01, 0xde, 0xcf, 0x02, 0x25, + 0xa3, 0xf0, 0x5d, 0x93, 0x59, 0x1b, 0xe7, 0xe3, 0xa9, 0x22, 0x4e, 0xa6, 0x8a, 0xf8, 0x3e, 0x55, + 0xc4, 0x87, 0x99, 0x22, 0x4c, 0x66, 0x8a, 0xf0, 0x3a, 0x53, 0x84, 0xeb, 0x23, 0xc7, 0x63, 0xee, + 0xc0, 0xd2, 0x6d, 0xf0, 0xe3, 0xa0, 0xe3, 0x80, 0xb0, 0x5b, 0x88, 0xba, 0x3c, 0xf4, 0xee, 0x47, + 0x2c, 0x1b, 0x85, 0x84, 0x5a, 0x79, 0xfe, 0x41, 0x9d, 0x7c, 0x06, 0x00, 0x00, 0xff, 0xff, 0x41, + 0x3d, 0xfa, 0x1d, 0xd8, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Params queries all parameters. + Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) + // CachedBlockHashes queries all cached block hashes. + CachedBlockHashes(ctx context.Context, in *CachedBlockHashesRequest, opts ...grpc.CallOption) (*CachedBlockHashesResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, error) { + out := new(ParamsResponse) + err := c.cc.Invoke(ctx, "/ojo.symbiotic.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) CachedBlockHashes(ctx context.Context, in *CachedBlockHashesRequest, opts ...grpc.CallOption) (*CachedBlockHashesResponse, error) { + out := new(CachedBlockHashesResponse) + err := c.cc.Invoke(ctx, "/ojo.symbiotic.v1.Query/CachedBlockHashes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params queries all parameters. + Params(context.Context, *ParamsRequest) (*ParamsResponse, error) + // CachedBlockHashes queries all cached block hashes. + CachedBlockHashes(context.Context, *CachedBlockHashesRequest) (*CachedBlockHashesResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *ParamsRequest) (*ParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) CachedBlockHashes(ctx context.Context, req *CachedBlockHashesRequest) (*CachedBlockHashesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CachedBlockHashes not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ojo.symbiotic.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*ParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_CachedBlockHashes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CachedBlockHashesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).CachedBlockHashes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ojo.symbiotic.v1.Query/CachedBlockHashes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).CachedBlockHashes(ctx, req.(*CachedBlockHashesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ojo.symbiotic.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "CachedBlockHashes", + Handler: _Query_CachedBlockHashes_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ojo/symbiotic/v1/query.proto", +} + +func (m *ParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *CachedBlockHashesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CachedBlockHashesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CachedBlockHashesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *CachedBlockHashesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CachedBlockHashesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CachedBlockHashesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.CachedBlockHashes) > 0 { + for iNdEx := len(m.CachedBlockHashes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.CachedBlockHashes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *CachedBlockHashesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *CachedBlockHashesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.CachedBlockHashes) > 0 { + for _, e := range m.CachedBlockHashes { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CachedBlockHashesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CachedBlockHashesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CachedBlockHashesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CachedBlockHashesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CachedBlockHashesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CachedBlockHashesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CachedBlockHashes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CachedBlockHashes = append(m.CachedBlockHashes, CachedBlockHash{}) + if err := m.CachedBlockHashes[len(m.CachedBlockHashes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/symbiotic/types/query.pb.gw.go b/x/symbiotic/types/query.pb.gw.go new file mode 100644 index 00000000..d0fc57e4 --- /dev/null +++ b/x/symbiotic/types/query.pb.gw.go @@ -0,0 +1,218 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: ojo/symbiotic/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage +var _ = metadata.Join + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_CachedBlockHashes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CachedBlockHashesRequest + var metadata runtime.ServerMetadata + + msg, err := client.CachedBlockHashes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_CachedBlockHashes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CachedBlockHashesRequest + var metadata runtime.ServerMetadata + + msg, err := server.CachedBlockHashes(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CachedBlockHashes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_CachedBlockHashes_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CachedBlockHashes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_CachedBlockHashes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_CachedBlockHashes_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_CachedBlockHashes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ojo", "symbiotic", "v1", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_CachedBlockHashes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ojo", "symbiotic", "v1", "cachedblockhashes"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_CachedBlockHashes_0 = runtime.ForwardResponseMessage +) diff --git a/x/symbiotic/types/symbiotic.pb.go b/x/symbiotic/types/symbiotic.pb.go new file mode 100644 index 00000000..0867875a --- /dev/null +++ b/x/symbiotic/types/symbiotic.pb.go @@ -0,0 +1,571 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ojo/symbiotic/v1/symbiotic.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + _ "github.com/gogo/protobuf/gogoproto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the parameters for the symbiotic module. +type Params struct { + // address of the ojo middleware contract + MiddlewareAddress string `protobuf:"bytes,1,opt,name=middleware_address,json=middlewareAddress,proto3" json:"middleware_address,omitempty"` + // block period for syncing with the symbiotic network on Ethereum + SymbioticSyncPeriod int64 `protobuf:"varint,2,opt,name=symbiotic_sync_period,json=symbioticSyncPeriod,proto3" json:"symbiotic_sync_period,omitempty"` + // maximum amount of cached block hashes in the store + MaximumCachedBlockHashes uint64 `protobuf:"varint,3,opt,name=maximum_cached_block_hashes,json=maximumCachedBlockHashes,proto3" json:"maximum_cached_block_hashes,omitempty"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_4008c10d1c664ed5, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +// Cached block hash and height of block hash from the chain the ojo middleware is on. +type CachedBlockHash struct { + // Block hash of cached block on chain. + BlockHash string `protobuf:"bytes,1,opt,name=block_hash,json=blockHash,proto3" json:"block_hash,omitempty"` + // Block height of block hash. + Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *CachedBlockHash) Reset() { *m = CachedBlockHash{} } +func (m *CachedBlockHash) String() string { return proto.CompactTextString(m) } +func (*CachedBlockHash) ProtoMessage() {} +func (*CachedBlockHash) Descriptor() ([]byte, []int) { + return fileDescriptor_4008c10d1c664ed5, []int{1} +} +func (m *CachedBlockHash) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CachedBlockHash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CachedBlockHash.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CachedBlockHash) XXX_Merge(src proto.Message) { + xxx_messageInfo_CachedBlockHash.Merge(m, src) +} +func (m *CachedBlockHash) XXX_Size() int { + return m.Size() +} +func (m *CachedBlockHash) XXX_DiscardUnknown() { + xxx_messageInfo_CachedBlockHash.DiscardUnknown(m) +} + +var xxx_messageInfo_CachedBlockHash proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "ojo.symbiotic.v1.Params") + proto.RegisterType((*CachedBlockHash)(nil), "ojo.symbiotic.v1.CachedBlockHash") +} + +func init() { proto.RegisterFile("ojo/symbiotic/v1/symbiotic.proto", fileDescriptor_4008c10d1c664ed5) } + +var fileDescriptor_4008c10d1c664ed5 = []byte{ + // 302 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x90, 0xcd, 0x4e, 0x32, 0x31, + 0x14, 0x86, 0xa7, 0x1f, 0x5f, 0x48, 0xe8, 0x46, 0x1d, 0x7f, 0x32, 0xd1, 0xd8, 0x4c, 0x58, 0xb1, + 0x10, 0x26, 0xe8, 0xda, 0x85, 0xb8, 0x21, 0xae, 0x08, 0xee, 0xdc, 0x34, 0x9d, 0xb6, 0x99, 0x16, + 0x28, 0x87, 0xb4, 0xe5, 0x67, 0xee, 0xc2, 0xeb, 0xf0, 0x4a, 0x58, 0xb2, 0x74, 0xa9, 0x70, 0x23, + 0x86, 0x61, 0xc2, 0x18, 0x77, 0xe7, 0x9c, 0xe7, 0xc9, 0xc9, 0x9b, 0x17, 0xc7, 0x30, 0x82, 0xc4, + 0xe5, 0x26, 0xd5, 0xe0, 0x35, 0x4f, 0x16, 0xdd, 0x6a, 0xe9, 0xcc, 0x2c, 0x78, 0x08, 0x4f, 0x61, + 0x04, 0x9d, 0xea, 0xb8, 0xe8, 0x5e, 0x5f, 0x64, 0x90, 0x41, 0x01, 0x93, 0xfd, 0x74, 0xf0, 0x9a, + 0x1f, 0x08, 0xd7, 0x07, 0xcc, 0x32, 0xe3, 0xc2, 0x36, 0x0e, 0x8d, 0x16, 0x62, 0x22, 0x97, 0xcc, + 0x4a, 0xca, 0x84, 0xb0, 0xd2, 0xb9, 0x08, 0xc5, 0xa8, 0xd5, 0x18, 0x9e, 0x55, 0xe4, 0xe9, 0x00, + 0xc2, 0x7b, 0x7c, 0x79, 0xfc, 0x4f, 0x5d, 0x3e, 0xe5, 0x74, 0x26, 0xad, 0x06, 0x11, 0xfd, 0x8b, + 0x51, 0xab, 0x36, 0x3c, 0x3f, 0xc2, 0xd7, 0x7c, 0xca, 0x07, 0x05, 0x0a, 0x1f, 0xf1, 0x8d, 0x61, + 0x2b, 0x6d, 0xe6, 0x86, 0x72, 0xc6, 0x95, 0x14, 0x34, 0x9d, 0x00, 0x1f, 0x53, 0xc5, 0x9c, 0x92, + 0x2e, 0xaa, 0xc5, 0xa8, 0xf5, 0x7f, 0x18, 0x95, 0xca, 0x73, 0x61, 0xf4, 0xf6, 0x42, 0xbf, 0xe0, + 0xcd, 0x3e, 0x3e, 0xf9, 0x73, 0x0c, 0x6f, 0x31, 0xae, 0x5e, 0x94, 0x61, 0x1b, 0xe9, 0x11, 0x5f, + 0xe1, 0xba, 0x92, 0x3a, 0x53, 0xbe, 0x4c, 0x55, 0x6e, 0xbd, 0x97, 0xf5, 0x37, 0x09, 0xd6, 0x5b, + 0x82, 0x36, 0x5b, 0x82, 0xbe, 0xb6, 0x04, 0xbd, 0xef, 0x48, 0xb0, 0xd9, 0x91, 0xe0, 0x73, 0x47, + 0x82, 0xb7, 0xbb, 0x4c, 0x7b, 0x35, 0x4f, 0x3b, 0x1c, 0x4c, 0x02, 0x23, 0x68, 0x4f, 0xa5, 0x5f, + 0x82, 0x1d, 0xef, 0xe7, 0x64, 0xf5, 0xab, 0x77, 0x9f, 0xcf, 0xa4, 0x4b, 0xeb, 0x45, 0x93, 0x0f, + 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x01, 0x76, 0x64, 0x1d, 0x95, 0x01, 0x00, 0x00, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.MaximumCachedBlockHashes != 0 { + i = encodeVarintSymbiotic(dAtA, i, uint64(m.MaximumCachedBlockHashes)) + i-- + dAtA[i] = 0x18 + } + if m.SymbioticSyncPeriod != 0 { + i = encodeVarintSymbiotic(dAtA, i, uint64(m.SymbioticSyncPeriod)) + i-- + dAtA[i] = 0x10 + } + if len(m.MiddlewareAddress) > 0 { + i -= len(m.MiddlewareAddress) + copy(dAtA[i:], m.MiddlewareAddress) + i = encodeVarintSymbiotic(dAtA, i, uint64(len(m.MiddlewareAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CachedBlockHash) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CachedBlockHash) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CachedBlockHash) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintSymbiotic(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.BlockHash) > 0 { + i -= len(m.BlockHash) + copy(dAtA[i:], m.BlockHash) + i = encodeVarintSymbiotic(dAtA, i, uint64(len(m.BlockHash))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSymbiotic(dAtA []byte, offset int, v uint64) int { + offset -= sovSymbiotic(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.MiddlewareAddress) + if l > 0 { + n += 1 + l + sovSymbiotic(uint64(l)) + } + if m.SymbioticSyncPeriod != 0 { + n += 1 + sovSymbiotic(uint64(m.SymbioticSyncPeriod)) + } + if m.MaximumCachedBlockHashes != 0 { + n += 1 + sovSymbiotic(uint64(m.MaximumCachedBlockHashes)) + } + return n +} + +func (m *CachedBlockHash) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BlockHash) + if l > 0 { + n += 1 + l + sovSymbiotic(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovSymbiotic(uint64(m.Height)) + } + return n +} + +func sovSymbiotic(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSymbiotic(x uint64) (n int) { + return sovSymbiotic(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MiddlewareAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSymbiotic + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSymbiotic + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MiddlewareAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SymbioticSyncPeriod", wireType) + } + m.SymbioticSyncPeriod = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SymbioticSyncPeriod |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaximumCachedBlockHashes", wireType) + } + m.MaximumCachedBlockHashes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaximumCachedBlockHashes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSymbiotic(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSymbiotic + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CachedBlockHash) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CachedBlockHash: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CachedBlockHash: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSymbiotic + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSymbiotic + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHash = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipSymbiotic(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSymbiotic + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSymbiotic(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSymbiotic + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSymbiotic + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSymbiotic + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSymbiotic + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSymbiotic = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSymbiotic = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSymbiotic = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/symbiotic/types/tx.pb.go b/x/symbiotic/types/tx.pb.go new file mode 100644 index 00000000..cf9a9f06 --- /dev/null +++ b/x/symbiotic/types/tx.pb.go @@ -0,0 +1,583 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: ojo/symbiotic/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "github.com/gogo/protobuf/gogoproto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgSetParams defines the SetParams message type. +type MsgSetParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the symbiotic parameters to update. + Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *MsgSetParams) Reset() { *m = MsgSetParams{} } +func (m *MsgSetParams) String() string { return proto.CompactTextString(m) } +func (*MsgSetParams) ProtoMessage() {} +func (*MsgSetParams) Descriptor() ([]byte, []int) { + return fileDescriptor_ac6eef546d864118, []int{0} +} +func (m *MsgSetParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetParams.Merge(m, src) +} +func (m *MsgSetParams) XXX_Size() int { + return m.Size() +} +func (m *MsgSetParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetParams proto.InternalMessageInfo + +// MsgSetParamsResponse defines the SetParams response type. +type MsgSetParamsResponse struct { +} + +func (m *MsgSetParamsResponse) Reset() { *m = MsgSetParamsResponse{} } +func (m *MsgSetParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetParamsResponse) ProtoMessage() {} +func (*MsgSetParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ac6eef546d864118, []int{1} +} +func (m *MsgSetParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSetParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetParamsResponse.Merge(m, src) +} +func (m *MsgSetParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgSetParams)(nil), "ojo.symbiotic.v1.MsgSetParams") + proto.RegisterType((*MsgSetParamsResponse)(nil), "ojo.symbiotic.v1.MsgSetParamsResponse") +} + +func init() { proto.RegisterFile("ojo/symbiotic/v1/tx.proto", fileDescriptor_ac6eef546d864118) } + +var fileDescriptor_ac6eef546d864118 = []byte{ + // 319 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0xcf, 0xca, 0xd7, + 0x2f, 0xae, 0xcc, 0x4d, 0xca, 0xcc, 0x2f, 0xc9, 0x4c, 0xd6, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0xc8, 0xcf, 0xca, 0xd7, 0x83, 0x4b, 0xe9, 0x95, 0x19, + 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf5, 0x41, 0x2c, 0x88, 0x3a, 0x29, 0x05, 0x0c, + 0x23, 0x10, 0x9a, 0x20, 0x2a, 0x24, 0x93, 0xf3, 0x8b, 0x73, 0xf3, 0x8b, 0xe3, 0x21, 0x5a, 0x21, + 0x1c, 0xa8, 0x94, 0x38, 0x84, 0xa7, 0x9f, 0x5b, 0x9c, 0x0e, 0xd2, 0x99, 0x5b, 0x9c, 0x0e, 0x91, + 0x50, 0x9a, 0xc0, 0xc8, 0xc5, 0xe3, 0x5b, 0x9c, 0x1e, 0x9c, 0x5a, 0x12, 0x90, 0x58, 0x94, 0x98, + 0x5b, 0x2c, 0x64, 0xc6, 0xc5, 0x99, 0x58, 0x5a, 0x92, 0x91, 0x5f, 0x94, 0x59, 0x52, 0x29, 0xc1, + 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0x71, 0x69, 0x8b, 0xae, 0x08, 0xd4, 0x38, 0xc7, 0x94, 0x94, + 0xa2, 0xd4, 0xe2, 0xe2, 0xe0, 0x92, 0xa2, 0xcc, 0xbc, 0xf4, 0x20, 0x84, 0x52, 0x21, 0x03, 0x2e, + 0xb6, 0x02, 0xb0, 0x09, 0x12, 0x4c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x12, 0x7a, 0xe8, 0xfe, 0xd2, + 0x83, 0xd8, 0x10, 0x04, 0x55, 0x67, 0x25, 0xd6, 0xb1, 0x40, 0x9e, 0xe1, 0xc5, 0x02, 0x79, 0x86, + 0xa6, 0xe7, 0x1b, 0xb4, 0x10, 0x26, 0x29, 0x89, 0x71, 0x89, 0x20, 0xbb, 0x28, 0x28, 0xb5, 0xb8, + 0x20, 0x3f, 0xaf, 0x38, 0xd5, 0x28, 0x8a, 0x8b, 0xd9, 0xb7, 0x38, 0x5d, 0x28, 0x98, 0x8b, 0x13, + 0xe1, 0x5a, 0x39, 0x4c, 0x5b, 0x90, 0xf5, 0x4a, 0xa9, 0xe1, 0x97, 0x87, 0x99, 0xed, 0xe4, 0x76, + 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, + 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x3a, 0xe9, 0x99, 0x25, 0x19, 0xa5, + 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xf9, 0x59, 0xf9, 0xba, 0x79, 0xa9, 0x25, 0xe5, 0xf9, 0x45, + 0xd9, 0x20, 0xb6, 0x7e, 0x05, 0x52, 0x7c, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x43, + 0xd5, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x27, 0x8d, 0x66, 0xf5, 0xf0, 0x01, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // SetParams sets the parameters for the symbiotic module. + SetParams(ctx context.Context, in *MsgSetParams, opts ...grpc.CallOption) (*MsgSetParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SetParams(ctx context.Context, in *MsgSetParams, opts ...grpc.CallOption) (*MsgSetParamsResponse, error) { + out := new(MsgSetParamsResponse) + err := c.cc.Invoke(ctx, "/ojo.symbiotic.v1.Msg/SetParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // SetParams sets the parameters for the symbiotic module. + SetParams(context.Context, *MsgSetParams) (*MsgSetParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SetParams(ctx context.Context, req *MsgSetParams) (*MsgSetParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SetParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ojo.symbiotic.v1.Msg/SetParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetParams(ctx, req.(*MsgSetParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "ojo.symbiotic.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetParams", + Handler: _Msg_SetParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "ojo/symbiotic/v1/tx.proto", +} + +func (m *MsgSetParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSetParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgSetParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSetParams) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +)