From c7ed82b4f4423ccb406db02bdd4feacfe5c7d03f Mon Sep 17 00:00:00 2001 From: Solovyov1796 Date: Tue, 21 May 2024 18:15:02 +0800 Subject: [PATCH] remove das module --- app/app.go | 5 - go.mod | 23 +- go.sum | 34 + helper/da/client/client.go | 61 -- helper/da/client/pool.go | 101 -- helper/da/go.mod | 26 - helper/da/go.sum | 60 -- helper/da/light/light.pb.go | 397 -------- helper/da/light/light_grpc.pb.go | 141 --- helper/da/main.go | 89 -- helper/da/proto/light.proto | 33 - helper/da/service/handler.go | 186 ---- helper/da/types/dasreq.go | 8 - helper/da/types/keys.go | 10 - helper/da/utils/sizedw8grp/sizedw8grp.go | 51 - proto/zgc/das/v1/genesis.proto | 37 - proto/zgc/das/v1/query.proto | 24 - proto/zgc/das/v1/tx.proto | 35 - proto/zgc/dasigners/v1/tx.proto | 1 - x/das/v1/client/cli/query.go | 57 -- x/das/v1/client/cli/tx.go | 103 -- x/das/v1/genesis.go | 39 - x/das/v1/keeper/grpc_query.go | 22 - x/das/v1/keeper/keeper.go | 198 ---- x/das/v1/keeper/msg_server.go | 49 - x/das/v1/module.go | 180 ---- x/das/v1/types/codec.go | 47 - x/das/v1/types/errors.go | 8 - x/das/v1/types/events.go | 11 - x/das/v1/types/genesis.go | 28 - x/das/v1/types/genesis.pb.go | 1191 ---------------------- x/das/v1/types/interfaces.go | 10 - x/das/v1/types/keys.go | 44 - x/das/v1/types/msg.go | 57 -- x/das/v1/types/query.pb.go | 511 ---------- x/das/v1/types/query.pb.gw.go | 153 --- x/das/v1/types/tx.pb.go | 1110 -------------------- x/dasigners/v1/client/cli/tx.go | 2 +- x/dasigners/v1/types/tx.pb.go | 46 +- 39 files changed, 78 insertions(+), 5110 deletions(-) delete mode 100644 helper/da/client/client.go delete mode 100644 helper/da/client/pool.go delete mode 100644 helper/da/go.mod delete mode 100644 helper/da/go.sum delete mode 100644 helper/da/light/light.pb.go delete mode 100644 helper/da/light/light_grpc.pb.go delete mode 100644 helper/da/main.go delete mode 100644 helper/da/proto/light.proto delete mode 100644 helper/da/service/handler.go delete mode 100644 helper/da/types/dasreq.go delete mode 100644 helper/da/types/keys.go delete mode 100644 helper/da/utils/sizedw8grp/sizedw8grp.go delete mode 100644 proto/zgc/das/v1/genesis.proto delete mode 100644 proto/zgc/das/v1/query.proto delete mode 100644 proto/zgc/das/v1/tx.proto delete mode 100644 x/das/v1/client/cli/query.go delete mode 100644 x/das/v1/client/cli/tx.go delete mode 100644 x/das/v1/genesis.go delete mode 100644 x/das/v1/keeper/grpc_query.go delete mode 100644 x/das/v1/keeper/keeper.go delete mode 100644 x/das/v1/keeper/msg_server.go delete mode 100644 x/das/v1/module.go delete mode 100644 x/das/v1/types/codec.go delete mode 100644 x/das/v1/types/errors.go delete mode 100644 x/das/v1/types/events.go delete mode 100644 x/das/v1/types/genesis.go delete mode 100644 x/das/v1/types/genesis.pb.go delete mode 100644 x/das/v1/types/interfaces.go delete mode 100644 x/das/v1/types/keys.go delete mode 100644 x/das/v1/types/msg.go delete mode 100644 x/das/v1/types/query.pb.go delete mode 100644 x/das/v1/types/query.pb.gw.go delete mode 100644 x/das/v1/types/tx.pb.go diff --git a/app/app.go b/app/app.go index 50f5c081..1ae5ace6 100644 --- a/app/app.go +++ b/app/app.go @@ -122,9 +122,6 @@ import ( council "github.com/0glabs/0g-chain/x/council/v1" councilkeeper "github.com/0glabs/0g-chain/x/council/v1/keeper" counciltypes "github.com/0glabs/0g-chain/x/council/v1/types" - das "github.com/0glabs/0g-chain/x/das/v1" - daskeeper "github.com/0glabs/0g-chain/x/das/v1/keeper" - dastypes "github.com/0glabs/0g-chain/x/das/v1/types" dasigners "github.com/0glabs/0g-chain/x/dasigners/v1" dasignerskeeper "github.com/0glabs/0g-chain/x/dasigners/v1/keeper" dasignerstypes "github.com/0glabs/0g-chain/x/dasigners/v1/types" @@ -184,7 +181,6 @@ var ( evmutil.AppModuleBasic{}, mint.AppModuleBasic{}, council.AppModuleBasic{}, - das.AppModuleBasic{}, dasigners.AppModuleBasic{}, ) @@ -739,7 +735,6 @@ func NewApp( app.CouncilKeeper = councilkeeper.NewKeeper( keys[counciltypes.StoreKey], appCodec, app.stakingKeeper, ) - app.DasKeeper = daskeeper.NewKeeper(keys[dastypes.StoreKey], appCodec, app.stakingKeeper) // create the module manager (Note: Any module instantiated in the module manager that is later modified // must be passed by reference here.) diff --git a/go.mod b/go.mod index 31db3609..3a19f4b4 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/subosito/gotenv v1.6.0 github.com/tendermint/tendermint v0.34.27 github.com/tendermint/tm-db v0.6.7 - golang.org/x/crypto v0.14.0 + golang.org/x/crypto v0.23.0 google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 google.golang.org/grpc v1.58.3 google.golang.org/protobuf v1.31.0 @@ -64,6 +64,7 @@ require ( github.com/StackExchange/wmi v1.2.1 // indirect github.com/VictoriaMetrics/fastcache v1.6.0 // indirect github.com/allegro/bigcache v1.2.1 // indirect + github.com/andybalholm/brotli v1.1.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect github.com/aws/aws-sdk-go v1.44.203 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -102,12 +103,14 @@ require ( github.com/dgraph-io/ristretto v0.1.0 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 // indirect + github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 // indirect github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf // indirect github.com/dustin/go-humanize v1.0.0 // indirect github.com/dvsekhvalnov/jose2go v1.5.0 // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect github.com/getsentry/sentry-go v0.23.0 // indirect github.com/go-kit/log v0.2.1 // indirect @@ -160,6 +163,8 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/klauspost/compress v1.17.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.17.8 // indirect + github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/magiconair/properties v1.8.7 // indirect @@ -186,11 +191,13 @@ require ( github.com/prometheus/procfs v0.9.0 // indirect github.com/prometheus/tsdb v0.7.1 // indirect github.com/rakyll/statik v0.1.7 // indirect + github.com/raviqqe/liche v0.0.0-20200229003944-f57a5d1c5be4 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rjeczalik/notify v0.9.1 // indirect github.com/rogpeppe/go-internal v1.11.0 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.32.0 // indirect + github.com/rs/zerolog v1.30.0 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect @@ -211,6 +218,18 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.opencensus.io v0.24.0 // indirect + github.com/ugorji/go/codec v1.2.7 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasthttp v1.53.0 // indirect + go.etcd.io/bbolt v1.3.7 // indirect + go.opencensus.io v0.24.0 // indirect + golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/oauth2 v0.10.0 // indirect + golang.org/x/sync v0.3.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/term v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect go.uber.org/multierr v1.10.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect diff --git a/go.sum b/go.sum index 81bb24fe..3baaa665 100644 --- a/go.sum +++ b/go.sum @@ -256,6 +256,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M= +github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -488,6 +490,8 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= +github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf h1:Yt+4K30SdjOkRoRRm3vYNQgR+/ZIy0RmeUDZo7Y8zeQ= github.com/dop251/goja v0.0.0-20220405120441-9037c2b61cbf/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk= github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y= @@ -517,6 +521,9 @@ github.com/evmos/go-ethereum v1.10.26-evmos-rc2 h1:tYghk1ZZ8X4/OQ4YI9hvtm8aSN8OS github.com/evmos/go-ethereum v1.10.26-evmos-rc2/go.mod h1:/6CsT5Ceen2WPLI/oCA3xMcZ5sWMF/D46SjM/ayY0Oo= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o= github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -893,6 +900,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= 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= @@ -904,9 +913,13 @@ github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJw github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw= github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4= +github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU= +github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= +github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg= github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -950,6 +963,7 @@ github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GW github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -1138,6 +1152,8 @@ github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= +github.com/raviqqe/liche v0.0.0-20200229003944-f57a5d1c5be4 h1:/24Dsgxxv7UMTvubnE6eJmyHRcTSum60viriQokArAQ= +github.com/raviqqe/liche v0.0.0-20200229003944-f57a5d1c5be4/go.mod h1:MPBuzBAJcp9B/3xrqfgR+ieBgpMzDqTeieaRP3ESJhk= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1296,9 +1312,14 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/urfave/cli/v2 v2.10.2 h1:x3p8awjp/2arX+Nl/G2040AZpOCHS/eMJJ1/a+mye4Y= github.com/urfave/cli/v2 v2.10.2/go.mod h1:f8iq5LtQ/bLxafbdBSLPPNsgaW0l/2fYYEHhAyPlwvo= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.9.1-0.20200228200348-695f713fcf59/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w= +github.com/valyala/fasthttp v1.53.0 h1:lW/+SUkOxCx2vlIu0iaImv4JLrVRnbbkpCoaawvA4zc= +github.com/valyala/fasthttp v1.53.0/go.mod h1:6dt4/8olwq9QARP/TDuPmWyWcl4byhpvTJ4AAtcz+QM= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/willf/bitset v1.1.3/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= @@ -1388,6 +1409,8 @@ golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1457,6 +1480,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1510,6 +1535,8 @@ golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= 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= @@ -1668,8 +1695,11 @@ golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= 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= @@ -1682,6 +1712,8 @@ golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= 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= @@ -1699,6 +1731,8 @@ golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= 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= diff --git a/helper/da/client/client.go b/helper/da/client/client.go deleted file mode 100644 index 0d760d6b..00000000 --- a/helper/da/client/client.go +++ /dev/null @@ -1,61 +0,0 @@ -package client - -import ( - "context" - "time" - - "github.com/0glabs/0g-chain/helper/da/light" - - "github.com/pkg/errors" -) - -type DaLightRpcClient interface { - Sample(ctx context.Context, streamId, headerHash []byte, blobIdx, times uint32) (bool, error) - Destroy() - GetInstanceCount() int -} - -type daLightClient struct { - maxInstance int - pool ConnectionPool -} - -func NewDaLightClient(address string, instanceLimit int) DaLightRpcClient { - return &daLightClient{ - maxInstance: instanceLimit, - pool: NewConnectionPool(address, instanceLimit, 10*time.Minute), - } -} - -func (c *daLightClient) Sample(ctx context.Context, streamId, headerHash []byte, blobIdx, times uint32) (bool, error) { - connection, err := c.pool.GetConnection() - if err != nil { - return false, errors.Wrap(err, "failed to connect to da light server") - } - defer c.pool.ReleaseConnection(connection) - - req := &light.SampleRequest{ - StreamId: streamId, - BatchHeaderHash: headerHash, - BlobIndex: blobIdx, - Times: times, - } - client := light.NewLightClient(connection) - reply, err := client.Sample(ctx, req) - if err != nil { - return false, errors.Wrap(err, "failed to sample from da light server") - } - - return reply.Success, nil -} - -func (c *daLightClient) Destroy() { - if c.pool != nil { - c.pool.Close() - c.pool = nil - } -} - -func (c *daLightClient) GetInstanceCount() int { - return c.maxInstance -} diff --git a/helper/da/client/pool.go b/helper/da/client/pool.go deleted file mode 100644 index 887704a0..00000000 --- a/helper/da/client/pool.go +++ /dev/null @@ -1,101 +0,0 @@ -package client - -import ( - "errors" - "sync" - "time" - - "google.golang.org/grpc" - "google.golang.org/grpc/backoff" - "google.golang.org/grpc/credentials/insecure" -) - -type ConnectionPool interface { - GetConnection() (*grpc.ClientConn, error) - ReleaseConnection(*grpc.ClientConn) - Close() -} - -type connectionPoolImpl struct { - address string - maxSize int - timeout time.Duration - param grpc.ConnectParams - - mu sync.Mutex - pool []*grpc.ClientConn -} - -func NewConnectionPool(address string, maxSize int, timeout time.Duration) ConnectionPool { - return &connectionPoolImpl{ - address: address, - maxSize: maxSize, - timeout: timeout, - param: grpc.ConnectParams{ - Backoff: backoff.Config{ - BaseDelay: 1.0 * time.Second, - Multiplier: 1.5, - Jitter: 0.2, - MaxDelay: 30 * time.Second, - }, - MinConnectTimeout: 30 * time.Second, - }, - pool: make([]*grpc.ClientConn, 0, maxSize), - } -} - -func (p *connectionPoolImpl) GetConnection() (*grpc.ClientConn, error) { - p.mu.Lock() - defer p.mu.Unlock() - - if p.pool == nil { - return nil, errors.New("connection pool is closed") - } - - // Check if there's any available connection in the pool - if len(p.pool) > 0 { - conn := p.pool[0] - p.pool = p.pool[1:] - return conn, nil - } - - // If the pool is empty, create a new connection - conn, err := grpc.Dial(p.address, grpc.WithBlock(), - grpc.WithConnectParams(p.param), - grpc.WithTransportCredentials(insecure.NewCredentials())) - if err != nil { - return nil, err - } - return conn, nil -} - -func (p *connectionPoolImpl) ReleaseConnection(conn *grpc.ClientConn) { - p.mu.Lock() - defer p.mu.Unlock() - - if p.pool != nil { - // If the pool is full, close the connection - if len(p.pool) >= p.maxSize { - conn.Close() - return - } - - // Add the connection back to the pool - p.pool = append(p.pool, conn) - } else { - conn.Close() - } -} - -func (p *connectionPoolImpl) Close() { - p.mu.Lock() - defer p.mu.Unlock() - - if p.pool != nil { - for _, conn := range p.pool { - conn.Close() - } - - p.pool = nil - } -} diff --git a/helper/da/go.mod b/helper/da/go.mod deleted file mode 100644 index c42d6564..00000000 --- a/helper/da/go.mod +++ /dev/null @@ -1,26 +0,0 @@ -module github.com/0glabs/0g-chain/helper/da - -go 1.20 - -require ( - github.com/json-iterator/go v1.1.12 - github.com/lesismal/nbio v1.5.4 - github.com/pkg/errors v0.9.1 - github.com/rs/zerolog v1.32.0 - google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.33.0 -) - -require ( - github.com/lesismal/llib v1.1.13 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.19 // indirect - github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/stretchr/testify v1.8.4 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect -) diff --git a/helper/da/go.sum b/helper/da/go.sum deleted file mode 100644 index cc3cf3ca..00000000 --- a/helper/da/go.sum +++ /dev/null @@ -1,60 +0,0 @@ -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/lesismal/llib v1.1.13 h1:+w1+t0PykXpj2dXQck0+p6vdC9/mnbEXHgUy/HXDGfE= -github.com/lesismal/llib v1.1.13/go.mod h1:70tFXXe7P1FZ02AU9l8LgSOK7d7sRrpnkUr3rd3gKSg= -github.com/lesismal/nbio v1.5.4 h1:fZ6FOVZOBm7nFuudYsq+WyHJuM2UNuPdlvF/1LVa6lo= -github.com/lesismal/nbio v1.5.4/go.mod h1:mvfYBAA1jmrafXf2XvkM28jWkMTfA5jGks+HKDBMmOc= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= -github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/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/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -golang.org/x/crypto v0.0.0-20210513122933-cd7d49e622d5/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de h1:cZGRis4/ot9uVm639a+rHCUaG0JJHEsdyzSQTMX+suY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= -google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= -google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/helper/da/light/light.pb.go b/helper/da/light/light.pb.go deleted file mode 100644 index 60c987f2..00000000 --- a/helper/da/light/light.pb.go +++ /dev/null @@ -1,397 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v4.25.3 -// source: light/light.proto - -package light - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// SampleRequest contains the blob to sample (by batch and blob index) and required sample times -type SampleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StreamId []byte `protobuf:"bytes,1,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` - BatchHeaderHash []byte `protobuf:"bytes,2,opt,name=batch_header_hash,json=batchHeaderHash,proto3" json:"batch_header_hash,omitempty"` - BlobIndex uint32 `protobuf:"varint,3,opt,name=blob_index,json=blobIndex,proto3" json:"blob_index,omitempty"` - Times uint32 `protobuf:"varint,4,opt,name=times,proto3" json:"times,omitempty"` -} - -func (x *SampleRequest) Reset() { - *x = SampleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_light_light_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SampleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SampleRequest) ProtoMessage() {} - -func (x *SampleRequest) ProtoReflect() protoreflect.Message { - mi := &file_light_light_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SampleRequest.ProtoReflect.Descriptor instead. -func (*SampleRequest) Descriptor() ([]byte, []int) { - return file_light_light_proto_rawDescGZIP(), []int{0} -} - -func (x *SampleRequest) GetStreamId() []byte { - if x != nil { - return x.StreamId - } - return nil -} - -func (x *SampleRequest) GetBatchHeaderHash() []byte { - if x != nil { - return x.BatchHeaderHash - } - return nil -} - -func (x *SampleRequest) GetBlobIndex() uint32 { - if x != nil { - return x.BlobIndex - } - return 0 -} - -func (x *SampleRequest) GetTimes() uint32 { - if x != nil { - return x.Times - } - return 0 -} - -// SampleReply contains the sample result -type SampleReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` -} - -func (x *SampleReply) Reset() { - *x = SampleReply{} - if protoimpl.UnsafeEnabled { - mi := &file_light_light_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SampleReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SampleReply) ProtoMessage() {} - -func (x *SampleReply) ProtoReflect() protoreflect.Message { - mi := &file_light_light_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SampleReply.ProtoReflect.Descriptor instead. -func (*SampleReply) Descriptor() ([]byte, []int) { - return file_light_light_proto_rawDescGZIP(), []int{1} -} - -func (x *SampleReply) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -type RetrieveRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BatchHeaderHash []byte `protobuf:"bytes,1,opt,name=batch_header_hash,json=batchHeaderHash,proto3" json:"batch_header_hash,omitempty"` - BlobIndex uint32 `protobuf:"varint,2,opt,name=blob_index,json=blobIndex,proto3" json:"blob_index,omitempty"` -} - -func (x *RetrieveRequest) Reset() { - *x = RetrieveRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_light_light_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RetrieveRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RetrieveRequest) ProtoMessage() {} - -func (x *RetrieveRequest) ProtoReflect() protoreflect.Message { - mi := &file_light_light_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RetrieveRequest.ProtoReflect.Descriptor instead. -func (*RetrieveRequest) Descriptor() ([]byte, []int) { - return file_light_light_proto_rawDescGZIP(), []int{2} -} - -func (x *RetrieveRequest) GetBatchHeaderHash() []byte { - if x != nil { - return x.BatchHeaderHash - } - return nil -} - -func (x *RetrieveRequest) GetBlobIndex() uint32 { - if x != nil { - return x.BlobIndex - } - return 0 -} - -type RetrieveReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Status bool `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` -} - -func (x *RetrieveReply) Reset() { - *x = RetrieveReply{} - if protoimpl.UnsafeEnabled { - mi := &file_light_light_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RetrieveReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RetrieveReply) ProtoMessage() {} - -func (x *RetrieveReply) ProtoReflect() protoreflect.Message { - mi := &file_light_light_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RetrieveReply.ProtoReflect.Descriptor instead. -func (*RetrieveReply) Descriptor() ([]byte, []int) { - return file_light_light_proto_rawDescGZIP(), []int{3} -} - -func (x *RetrieveReply) GetStatus() bool { - if x != nil { - return x.Status - } - return false -} - -func (x *RetrieveReply) GetData() []byte { - if x != nil { - return x.Data - } - return nil -} - -var File_light_light_proto protoreflect.FileDescriptor - -var file_light_light_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x22, 0x8d, 0x01, 0x0a, 0x0d, 0x53, - 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, - 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, - 0x08, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x74, - 0x63, 0x68, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x49, - 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x22, 0x27, 0x0a, 0x0b, 0x53, 0x61, - 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x22, 0x5c, 0x0a, 0x0f, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x62, 0x61, 0x74, 0x63, 0x68, 0x5f, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0f, 0x62, 0x61, 0x74, 0x63, 0x68, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x48, 0x61, - 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x62, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x22, 0x3b, 0x0a, 0x0d, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x32, 0x79, - 0x0a, 0x05, 0x4c, 0x69, 0x67, 0x68, 0x74, 0x12, 0x34, 0x0a, 0x06, 0x53, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x12, 0x14, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x2e, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x2e, - 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3a, 0x0a, - 0x08, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x12, 0x16, 0x2e, 0x6c, 0x69, 0x67, 0x68, - 0x74, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x14, 0x2e, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x72, 0x69, 0x65, - 0x76, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x30, 0x5a, 0x2e, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x30, 0x67, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x30, - 0x67, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2d, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x2f, 0x72, 0x75, 0x6e, - 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_light_light_proto_rawDescOnce sync.Once - file_light_light_proto_rawDescData = file_light_light_proto_rawDesc -) - -func file_light_light_proto_rawDescGZIP() []byte { - file_light_light_proto_rawDescOnce.Do(func() { - file_light_light_proto_rawDescData = protoimpl.X.CompressGZIP(file_light_light_proto_rawDescData) - }) - return file_light_light_proto_rawDescData -} - -var file_light_light_proto_msgTypes = make([]protoimpl.MessageInfo, 4) -var file_light_light_proto_goTypes = []interface{}{ - (*SampleRequest)(nil), // 0: light.SampleRequest - (*SampleReply)(nil), // 1: light.SampleReply - (*RetrieveRequest)(nil), // 2: light.RetrieveRequest - (*RetrieveReply)(nil), // 3: light.RetrieveReply -} -var file_light_light_proto_depIdxs = []int32{ - 0, // 0: light.Light.Sample:input_type -> light.SampleRequest - 2, // 1: light.Light.Retrieve:input_type -> light.RetrieveRequest - 1, // 2: light.Light.Sample:output_type -> light.SampleReply - 3, // 3: light.Light.Retrieve:output_type -> light.RetrieveReply - 2, // [2:4] is the sub-list for method output_type - 0, // [0:2] is the sub-list for method input_type - 0, // [0:0] is the sub-list for extension type_name - 0, // [0:0] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_light_light_proto_init() } -func file_light_light_proto_init() { - if File_light_light_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_light_light_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SampleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_light_light_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SampleReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_light_light_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RetrieveRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_light_light_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RetrieveReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_light_light_proto_rawDesc, - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_light_light_proto_goTypes, - DependencyIndexes: file_light_light_proto_depIdxs, - MessageInfos: file_light_light_proto_msgTypes, - }.Build() - File_light_light_proto = out.File - file_light_light_proto_rawDesc = nil - file_light_light_proto_goTypes = nil - file_light_light_proto_depIdxs = nil -} diff --git a/helper/da/light/light_grpc.pb.go b/helper/da/light/light_grpc.pb.go deleted file mode 100644 index 0586c987..00000000 --- a/helper/da/light/light_grpc.pb.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc v4.25.3 -// source: light/light.proto - -package light - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 - -// LightClient is the client API for Light service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type LightClient interface { - Sample(ctx context.Context, in *SampleRequest, opts ...grpc.CallOption) (*SampleReply, error) - Retrieve(ctx context.Context, in *RetrieveRequest, opts ...grpc.CallOption) (*RetrieveReply, error) -} - -type lightClient struct { - cc grpc.ClientConnInterface -} - -func NewLightClient(cc grpc.ClientConnInterface) LightClient { - return &lightClient{cc} -} - -func (c *lightClient) Sample(ctx context.Context, in *SampleRequest, opts ...grpc.CallOption) (*SampleReply, error) { - out := new(SampleReply) - err := c.cc.Invoke(ctx, "/light.Light/Sample", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *lightClient) Retrieve(ctx context.Context, in *RetrieveRequest, opts ...grpc.CallOption) (*RetrieveReply, error) { - out := new(RetrieveReply) - err := c.cc.Invoke(ctx, "/light.Light/Retrieve", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// LightServer is the server API for Light service. -// All implementations must embed UnimplementedLightServer -// for forward compatibility -type LightServer interface { - Sample(context.Context, *SampleRequest) (*SampleReply, error) - Retrieve(context.Context, *RetrieveRequest) (*RetrieveReply, error) - mustEmbedUnimplementedLightServer() -} - -// UnimplementedLightServer must be embedded to have forward compatible implementations. -type UnimplementedLightServer struct { -} - -func (UnimplementedLightServer) Sample(context.Context, *SampleRequest) (*SampleReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Sample not implemented") -} -func (UnimplementedLightServer) Retrieve(context.Context, *RetrieveRequest) (*RetrieveReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Retrieve not implemented") -} -func (UnimplementedLightServer) mustEmbedUnimplementedLightServer() {} - -// UnsafeLightServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to LightServer will -// result in compilation errors. -type UnsafeLightServer interface { - mustEmbedUnimplementedLightServer() -} - -func RegisterLightServer(s grpc.ServiceRegistrar, srv LightServer) { - s.RegisterService(&Light_ServiceDesc, srv) -} - -func _Light_Sample_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SampleRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightServer).Sample(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/light.Light/Sample", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightServer).Sample(ctx, req.(*SampleRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Light_Retrieve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RetrieveRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(LightServer).Retrieve(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/light.Light/Retrieve", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(LightServer).Retrieve(ctx, req.(*RetrieveRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// Light_ServiceDesc is the grpc.ServiceDesc for Light service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var Light_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "light.Light", - HandlerType: (*LightServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Sample", - Handler: _Light_Sample_Handler, - }, - { - MethodName: "Retrieve", - Handler: _Light_Retrieve_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "light/light.proto", -} diff --git a/helper/da/main.go b/helper/da/main.go deleted file mode 100644 index 247f4e16..00000000 --- a/helper/da/main.go +++ /dev/null @@ -1,89 +0,0 @@ -package main - -import ( - "context" - "flag" - "fmt" - "io" - "log" - "net/url" - "os" - "os/signal" - "time" - - "github.com/0glabs/0g-chain/helper/da/service" - "github.com/0glabs/0g-chain/helper/da/types" - - "github.com/lesismal/nbio/nbhttp" - "github.com/lesismal/nbio/nbhttp/websocket" -) - -const ( - subscribeMsg = "{\"jsonrpc\":\"2.0\",\"method\":\"subscribe\",\"id\":1,\"params\":{\"query\":\"tm.event='Tx'\"}}" -) - -var ( - rpcAddress = flag.String("rpc-address", "34.214.2.28:32001", "address of da-light rpc server") - wsAddress = flag.String("ws-address", "127.0.0.1:26657", "address of emvos ws server") - relativePath = flag.String("relative-path", "", "relative path of evmosd") - account = flag.String("account", "", "account to run evmosd cli") - keyring = flag.String("keyring", "", "keyring to run evmosd cli") - homePath = flag.String("home", "", "home path of evmosd node") -) - -func newUpgrader() *websocket.Upgrader { - u := websocket.NewUpgrader() - u.OnMessage(func(c *websocket.Conn, messageType websocket.MessageType, data []byte) { - log.Println("onEcho:", string(data)) - ctx := context.WithValue(context.Background(), types.DA_RPC_ADDRESS, *rpcAddress) - ctx = context.WithValue(ctx, types.NODE_CLI_RELATIVE_PATH, *relativePath) - ctx = context.WithValue(ctx, types.NODE_CLI_EXEC_ACCOUNT, *account) - ctx = context.WithValue(ctx, types.NODE_CLI_EXEC_KEYRING, *keyring) - ctx = context.WithValue(ctx, types.NODE_HOME_PATH, *homePath) - go func() { service.OnMessage(ctx, c, messageType, data) }() - }) - - u.OnClose(func(c *websocket.Conn, err error) { - fmt.Println("OnClose:", c.RemoteAddr().String(), err) - service.OnClose() - }) - - return u -} - -func main() { - flag.Parse() - engine := nbhttp.NewEngine(nbhttp.Config{}) - err := engine.Start() - if err != nil { - fmt.Printf("nbio.Start failed: %v\n", err) - return - } - - go func() { - u := url.URL{Scheme: "ws", Host: *wsAddress, Path: "/websocket"} - dialer := &websocket.Dialer{ - Engine: engine, - Upgrader: newUpgrader(), - DialTimeout: time.Second * 3, - } - c, res, err := dialer.Dial(u.String(), nil) - if err != nil { - if res != nil && res.Body != nil { - bReason, _ := io.ReadAll(res.Body) - fmt.Printf("dial failed: %v, reason: %v\n", err, string(bReason)) - } else { - fmt.Printf("dial failed: %v\n", err) - } - return - } - c.WriteMessage(websocket.TextMessage, []byte(subscribeMsg)) - }() - - interrupt := make(chan os.Signal, 1) - signal.Notify(interrupt, os.Interrupt) - <-interrupt - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() - engine.Shutdown(ctx) -} diff --git a/helper/da/proto/light.proto b/helper/da/proto/light.proto deleted file mode 100644 index f816b54f..00000000 --- a/helper/da/proto/light.proto +++ /dev/null @@ -1,33 +0,0 @@ -syntax = "proto3"; - -package light; - -option go_package = "proto/light"; - -service Light { - rpc Sample(SampleRequest) returns (SampleReply) {} - rpc Retrieve(RetrieveRequest) returns (RetrieveReply) {} -} - -// SampleRequest contains the blob to sample (by batch and blob index) and required sample times -message SampleRequest { - bytes stream_id = 1; - bytes batch_header_hash = 2; - uint32 blob_index = 3; - uint32 times = 4; -} - -// SampleReply contains the sample result -message SampleReply { - bool success = 1; -} - -message RetrieveRequest { - bytes batch_header_hash = 1; - uint32 blob_index = 2; -} - -message RetrieveReply { - bool status = 1; - bytes data = 2; -} \ No newline at end of file diff --git a/helper/da/service/handler.go b/helper/da/service/handler.go deleted file mode 100644 index 5a379bc8..00000000 --- a/helper/da/service/handler.go +++ /dev/null @@ -1,186 +0,0 @@ -package service - -import ( - "context" - "encoding/hex" - "os" - "os/exec" - "strconv" - "strings" - - "github.com/0glabs/0g-chain/helper/da/client" - "github.com/0glabs/0g-chain/helper/da/types" - "github.com/0glabs/0g-chain/helper/da/utils/sizedw8grp" - - jsoniter "github.com/json-iterator/go" - "github.com/lesismal/nbio/nbhttp/websocket" - "github.com/pkg/errors" - "github.com/rs/zerolog/log" -) - -const ( - defaultClientInstance = 10 -) - -var rpcClient client.DaLightRpcClient - -func OnMessage(ctx context.Context, c *websocket.Conn, messageType websocket.MessageType, data []byte) { - if messageType == websocket.TextMessage { - rawMsg := unwrapJsonRpc(data) - if verifyQuery(rawMsg) { - eventStr := jsoniter.Get(rawMsg, "events").ToString() - events := map[string][]string{} - if err := jsoniter.UnmarshalFromString(eventStr, &events); err == nil { - dasRequestMap := make(map[string]string, 4) - for key, val := range events { - if strings.HasPrefix(key, "das_request.") { - dasRequestMap[strings.ReplaceAll(key, "das_request.", "")] = val[0] - } - } - if len(dasRequestMap) == 4 { - rid, _ := strconv.ParseUint(dasRequestMap["request_id"], 10, 64) - numBlobs, _ := strconv.ParseUint(dasRequestMap["num_blobs"], 10, 64) - req := types.DASRequest{ - RequestId: rid, - StreamId: dasRequestMap["stream_id"], - BatchHeaderHash: dasRequestMap["batch_header_hash"], - NumBlobs: numBlobs, - } - err := handleDasRequest(ctx, req) - - if err != nil { - log.Err(err).Msgf("failed to handle das request: %v, %v", req, err) - } else { - log.Info().Msgf("successfully handled das request: %v", req) - } - } - } - } - } else { - // TODO: handle other message - } -} - -func OnClose() { - if rpcClient != nil { - rpcClient.Destroy() - rpcClient = nil - } -} - -func unwrapJsonRpc(data []byte) []byte { - result := jsoniter.Get(data, "result") - if 0 < len(result.Keys()) { - return []byte(result.ToString()) - } - return []byte{} -} - -func verifyQuery(data []byte) bool { - if len(data) > 0 { - return jsoniter.Get(data, "query").ToString() == "tm.event='Tx'" - } - return false -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func handleDasRequest(ctx context.Context, request types.DASRequest) error { - if rpcClient == nil { - addrVal := ctx.Value(types.DA_RPC_ADDRESS) - if addrVal == nil { - return errors.New("da light service address not found in context") - } - - limit := ctx.Value(types.INSTANCE_LIMIT) - if limit == nil { - limit = defaultClientInstance - } - - rpcClient = client.NewDaLightClient(addrVal.(string), limit.(int)) - } - - streamID, err := hex.DecodeString(request.StreamId) - if err != nil { - return err - } - - batchHeaderHash, err := hex.DecodeString(request.BatchHeaderHash) - if err != nil { - return err - } - - result := make(chan bool, request.NumBlobs) - taskCnt := min(rpcClient.GetInstanceCount(), int(request.NumBlobs)) - wg := sizedw8grp.New(taskCnt) - - for i := uint64(0); i < request.NumBlobs; i++ { - wg.Add() - go func(idx uint64) { - defer wg.Done() - ret, err := rpcClient.Sample(ctx, streamID, batchHeaderHash, uint32(idx), 1) - if err != nil { - log.Err(err).Msgf("failed to sample data availability with blob index %d", idx) - result <- false - } else { - log.Info().Msgf("sample result for blob index %d: %v", idx, ret) - result <- ret - } - }(i) - } - wg.Wait() - close(result) - - finalResult := true - for val := range result { - if !val { - finalResult = false - break - } - } - - return runEvmosdCliReportDasResult(ctx, request.RequestId, finalResult) -} - -func runEvmosdCliReportDasResult(ctx context.Context, requestId uint64, result bool) error { - relativePath := ctx.Value(types.NODE_CLI_RELATIVE_PATH) - if relativePath == nil { - return errors.New("relativePath not found in context") - } - - account := ctx.Value(types.NODE_CLI_EXEC_ACCOUNT) - if account == nil { - return errors.New("account not found in context") - } - - args := []string{ - "tx", - "das", - "report-das-result", - strconv.FormatUint(requestId, 10), - strconv.FormatBool(result), - "--from", account.(string), - "--gas-prices", "7678500neuron", // TODO: use args to set gas prices - } - - homePath := ctx.Value(types.NODE_HOME_PATH) - if len(homePath.(string)) > 0 { - args = append(args, "--home", homePath.(string)) - } - - keyring := ctx.Value(types.NODE_CLI_EXEC_KEYRING) - if len(keyring.(string)) > 0 { - args = append(args, "--keyring-backend", keyring.(string)) - } - - cmdStr := relativePath.(string) + "0gchaind" - cmd := exec.Command(cmdStr, append(args, "-y")...) - cmd.Stdout = os.Stdout - cmd.Stderr = os.Stderr - return cmd.Run() -} diff --git a/helper/da/types/dasreq.go b/helper/da/types/dasreq.go deleted file mode 100644 index 1c3b92e3..00000000 --- a/helper/da/types/dasreq.go +++ /dev/null @@ -1,8 +0,0 @@ -package types - -type DASRequest struct { - RequestId uint64 `json:"request_id"` - StreamId string `json:"stream_id"` - BatchHeaderHash string `json:"batch_header_hash"` - NumBlobs uint64 `json:"num_blobs"` -} diff --git a/helper/da/types/keys.go b/helper/da/types/keys.go deleted file mode 100644 index e824f793..00000000 --- a/helper/da/types/keys.go +++ /dev/null @@ -1,10 +0,0 @@ -package types - -const ( - DA_RPC_ADDRESS = "rpc_address" - INSTANCE_LIMIT = "instance_limit" - NODE_CLI_RELATIVE_PATH = "relative_path" - NODE_CLI_EXEC_ACCOUNT = "node_exec_account" - NODE_CLI_EXEC_KEYRING = "node_exec_keyring" - NODE_HOME_PATH = "home_path" -) diff --git a/helper/da/utils/sizedw8grp/sizedw8grp.go b/helper/da/utils/sizedw8grp/sizedw8grp.go deleted file mode 100644 index ac7348e6..00000000 --- a/helper/da/utils/sizedw8grp/sizedw8grp.go +++ /dev/null @@ -1,51 +0,0 @@ -package sizedw8grp - -import ( - "context" - "math" - "sync" -) - -type SizedWaitGroup struct { - Size int - - current chan struct{} - wg sync.WaitGroup -} - -func New(limit int) SizedWaitGroup { - size := math.MaxInt32 - if limit > 0 { - size = limit - } - return SizedWaitGroup{ - Size: size, - - current: make(chan struct{}, size), - wg: sync.WaitGroup{}, - } -} - -func (s *SizedWaitGroup) Add() { - _ = s.AddWithContext(context.Background()) -} - -func (s *SizedWaitGroup) AddWithContext(ctx context.Context) error { - select { - case <-ctx.Done(): - return ctx.Err() - case s.current <- struct{}{}: - break - } - s.wg.Add(1) - return nil -} - -func (s *SizedWaitGroup) Done() { - <-s.current - s.wg.Done() -} - -func (s *SizedWaitGroup) Wait() { - s.wg.Wait() -} diff --git a/proto/zgc/das/v1/genesis.proto b/proto/zgc/das/v1/genesis.proto deleted file mode 100644 index 9aae1faa..00000000 --- a/proto/zgc/das/v1/genesis.proto +++ /dev/null @@ -1,37 +0,0 @@ -syntax = "proto3"; -package zgc.das.v1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/0glabs/0g-chain/x/das/v1/types"; - -message Params {} - -// GenesisState defines the das module's genesis state. -message GenesisState { - option (gogoproto.goproto_getters) = false; - - Params params = 1 [(gogoproto.nullable) = false]; - uint64 next_request_id = 2 [(gogoproto.customname) = "NextRequestID"]; - repeated DASRequest requests = 3 [(gogoproto.nullable) = false]; - repeated DASResponse responses = 4 [(gogoproto.nullable) = false]; -} - -message DASRequest { - uint64 id = 1 [(gogoproto.customname) = "ID"]; - bytes stream_id = 2 [(gogoproto.customname) = "StreamID"]; - bytes batch_header_hash = 3; - uint32 num_blobs = 4; -} - -message DASResponse { - uint64 id = 1 [(gogoproto.customname) = "ID"]; - bytes sampler = 2 [ - (cosmos_proto.scalar) = "cosmos.AddressBytes", - (gogoproto.casttype) = "github.com/cosmos/cosmos-sdk/types.ValAddress" - ]; - repeated bool results = 3; -} diff --git a/proto/zgc/das/v1/query.proto b/proto/zgc/das/v1/query.proto deleted file mode 100644 index 371c50e8..00000000 --- a/proto/zgc/das/v1/query.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; -package zgc.das.v1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/0glabs/0g-chain/x/das/v1/types"; -option (gogoproto.goproto_getters_all) = false; - -// Query defines the gRPC querier service for the das module -service Query { - rpc NextRequestID(QueryNextRequestIDRequest) returns (QueryNextRequestIDResponse) { - option (google.api.http).get = "/0gchain/das/v1/next-request-id"; - } -} - -message QueryNextRequestIDRequest {} - -message QueryNextRequestIDResponse { - uint64 next_request_id = 1 [(gogoproto.customname) = "NextRequestID"]; -} diff --git a/proto/zgc/das/v1/tx.proto b/proto/zgc/das/v1/tx.proto deleted file mode 100644 index 482c4679..00000000 --- a/proto/zgc/das/v1/tx.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; -package zgc.das.v1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "zgc/das/v1/genesis.proto"; - -option go_package = "github.com/0glabs/0g-chain/x/das/v1/types"; -option (gogoproto.goproto_getters_all) = false; - -// Msg defines the das Msg service -service Msg { - rpc RequestDAS(MsgRequestDAS) returns (MsgRequestDASResponse); - rpc ReportDASResult(MsgReportDASResult) returns (MsgReportDASResultResponse); -} - -message MsgRequestDAS { - string requester = 1 [(gogoproto.moretags) = "Requester"]; - string stream_id = 2 [(gogoproto.customname) = "StreamID"]; - string batch_header_hash = 3; - uint32 num_blobs = 4; -} - -message MsgRequestDASResponse { - uint64 request_id = 1 [(gogoproto.customname) = "RequestID"]; -} - -message MsgReportDASResult { - uint64 request_id = 1 [(gogoproto.customname) = "RequestID"]; - string sampler = 2; - repeated bool results = 3; -} - -message MsgReportDASResultResponse {} diff --git a/proto/zgc/dasigners/v1/tx.proto b/proto/zgc/dasigners/v1/tx.proto index 9e5fd0e2..43651a81 100644 --- a/proto/zgc/dasigners/v1/tx.proto +++ b/proto/zgc/dasigners/v1/tx.proto @@ -4,7 +4,6 @@ package zgc.dasigners.v1; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/any.proto"; -import "zgc/das/v1/genesis.proto"; import "zgc/dasigners/v1/dasigners.proto"; option go_package = "github.com/0glabs/0g-chain/x/dasigners/v1/types"; diff --git a/x/das/v1/client/cli/query.go b/x/das/v1/client/cli/query.go deleted file mode 100644 index b7a715e3..00000000 --- a/x/das/v1/client/cli/query.go +++ /dev/null @@ -1,57 +0,0 @@ -package cli - -import ( - "context" - "fmt" - - "github.com/spf13/cobra" - - "github.com/0glabs/0g-chain/x/das/v1/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" -) - -// GetQueryCmd returns the cli query commands for the inflation module. -func GetQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the das module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand( - GetNextRequestID(), - ) - - return cmd -} - -func GetNextRequestID() *cobra.Command { - cmd := &cobra.Command{ - Use: "next-request-id", - Short: "Query the next request ID", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, _ []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - params := &types.QueryNextRequestIDRequest{} - res, err := queryClient.NextRequestID(context.Background(), params) - if err != nil { - return err - } - - return clientCtx.PrintString(fmt.Sprintf("%v\n", res.NextRequestID)) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/das/v1/client/cli/tx.go b/x/das/v1/client/cli/tx.go deleted file mode 100644 index 1a97c959..00000000 --- a/x/das/v1/client/cli/tx.go +++ /dev/null @@ -1,103 +0,0 @@ -package cli - -import ( - "encoding/hex" - "fmt" - "strconv" - - "github.com/0glabs/0g-chain/x/das/v1/types" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/cobra" -) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - cmd.AddCommand( - NewRequestDASCmd(), - NewReportDASResultCmd(), - ) - return cmd -} - -func NewRequestDASCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "request-das steram-id batch-header-hash num-blobs", - Short: "Request data-availability-sampling", - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - numBlobs, err := strconv.Atoi(args[2]) - if err != nil { - return err - } - - msg := types.NewMsgRequestDAS(clientCtx.GetFromAddress(), args[0], args[1], uint32(numBlobs)) - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd - -} - -func NewReportDASResultCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "report-das-result request-id results", - Short: "Report data-availability-sampling result", - Args: cobra.MinimumNArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - requestID, err := strconv.ParseUint(args[0], 10, 64) - if err != nil { - return err - } - - n := len(args) - 1 - results := make([]bool, n) - for i := 0; i < n; i++ { - var err error - results[i], err = strconv.ParseBool(args[i+1]) - if err != nil { - return err - } - } - - // get account name by address - accAddr := clientCtx.GetFromAddress() - - samplerAddr, err := sdk.ValAddressFromHex(hex.EncodeToString(accAddr.Bytes())) - if err != nil { - return err - } - - msg := &types.MsgReportDASResult{ - RequestID: requestID, - Sampler: samplerAddr.String(), - Results: results, - } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd -} diff --git a/x/das/v1/genesis.go b/x/das/v1/genesis.go deleted file mode 100644 index 4780b693..00000000 --- a/x/das/v1/genesis.go +++ /dev/null @@ -1,39 +0,0 @@ -package das - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/0glabs/0g-chain/x/das/v1/keeper" - "github.com/0glabs/0g-chain/x/das/v1/types" -) - -// InitGenesis initializes the store state from a genesis state. -func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, gs types.GenesisState) { - if err := gs.Validate(); err != nil { - panic(fmt.Sprintf("failed to validate %s genesis state: %s", types.ModuleName, err)) - } - - keeper.SetNextRequestID(ctx, gs.NextRequestID) - for _, req := range gs.Requests { - keeper.SetDASRequest(ctx, req) - } - for _, resp := range gs.Responses { - keeper.SetDASResponse(ctx, resp) - } -} - -// ExportGenesis returns a GenesisState for a given context and keeper. -func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) *types.GenesisState { - nextRequestID, err := keeper.GetNextRequestID(ctx) - if err != nil { - panic(err) - } - - return types.NewGenesisState( - nextRequestID, - keeper.GetDASRequests(ctx), - keeper.GetDASResponses(ctx), - ) -} diff --git a/x/das/v1/keeper/grpc_query.go b/x/das/v1/keeper/grpc_query.go deleted file mode 100644 index e4fddea2..00000000 --- a/x/das/v1/keeper/grpc_query.go +++ /dev/null @@ -1,22 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/0glabs/0g-chain/x/das/v1/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -var _ types.QueryServer = Keeper{} - -func (k Keeper) NextRequestID( - c context.Context, - _ *types.QueryNextRequestIDRequest, -) (*types.QueryNextRequestIDResponse, error) { - ctx := sdk.UnwrapSDKContext(c) - nextRequestID, err := k.GetNextRequestID(ctx) - if err != nil { - return nil, err - } - return &types.QueryNextRequestIDResponse{NextRequestID: nextRequestID}, nil -} diff --git a/x/das/v1/keeper/keeper.go b/x/das/v1/keeper/keeper.go deleted file mode 100644 index 52e515fa..00000000 --- a/x/das/v1/keeper/keeper.go +++ /dev/null @@ -1,198 +0,0 @@ -package keeper - -import ( - "encoding/hex" - "strconv" - - errorsmod "cosmossdk.io/errors" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/tendermint/tendermint/libs/log" - - "github.com/0glabs/0g-chain/x/das/v1/types" -) - -type Keeper struct { - storeKey storetypes.StoreKey - cdc codec.BinaryCodec - stakingKeeperRef types.StakingKeeperRef -} - -// NewKeeper creates a new das Keeper instance -func NewKeeper( - storeKey storetypes.StoreKey, - cdc codec.BinaryCodec, - stakingKeeper types.StakingKeeperRef, -) Keeper { - return Keeper{ - storeKey: storeKey, - cdc: cdc, - stakingKeeperRef: stakingKeeper, - } -} - -// Logger returns a module-specific logger. -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", "x/"+types.ModuleName) -} - -func (k Keeper) SetNextRequestID(ctx sdk.Context, id uint64) { - store := ctx.KVStore(k.storeKey) - store.Set(types.NextRequestIDKey, types.GetKeyFromID(id)) -} - -func (k Keeper) GetNextRequestID(ctx sdk.Context) (uint64, error) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.NextRequestIDKey) - if bz == nil { - return 0, errorsmod.Wrap(types.ErrInvalidGenesis, "next request ID not set at genesis") - } - return types.Uint64FromBytes(bz), nil -} - -func (k Keeper) IncrementNextRequestID(ctx sdk.Context) error { - id, err := k.GetNextRequestID(ctx) - if err != nil { - return err - } - k.SetNextRequestID(ctx, id+1) - return nil -} - -func (k Keeper) GetDASRequest(ctx sdk.Context, requestID uint64) (types.DASRequest, bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RequestKeyPrefix) - bz := store.Get(types.GetKeyFromID(requestID)) - if bz == nil { - return types.DASRequest{}, false - } - var req types.DASRequest - k.cdc.MustUnmarshal(bz, &req) - return req, true -} - -func (k Keeper) SetDASRequest(ctx sdk.Context, req types.DASRequest) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RequestKeyPrefix) - bz := k.cdc.MustMarshal(&req) - store.Set(types.GetKeyFromID(req.ID), bz) -} - -func (k Keeper) IterateDASRequest(ctx sdk.Context, cb func(req types.DASRequest) (stop bool)) { - iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.RequestKeyPrefix) - - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - var req types.DASRequest - k.cdc.MustUnmarshal(iterator.Value(), &req) - if cb(req) { - break - } - } -} - -func (k Keeper) GetDASRequests(ctx sdk.Context) []types.DASRequest { - results := []types.DASRequest{} - k.IterateDASRequest(ctx, func(req types.DASRequest) bool { - results = append(results, req) - return false - }) - return results -} - -func (k Keeper) StoreNewDASRequest( - ctx sdk.Context, - streamIDHexStr string, - batchHeaderHashHexStr string, - numBlobs uint32) (uint64, error) { - requestID, err := k.GetNextRequestID(ctx) - if err != nil { - return 0, err - } - - streamID, err := hex.DecodeString(streamIDHexStr) - if err != nil { - return 0, err - } - - batchHeaderHash, err := hex.DecodeString(batchHeaderHashHexStr) - if err != nil { - return 0, err - } - - req := types.DASRequest{ - ID: requestID, - StreamID: streamID, - BatchHeaderHash: batchHeaderHash, - NumBlobs: numBlobs, - } - k.SetDASRequest(ctx, req) - - ctx.EventManager().EmitEvent( - sdk.NewEvent( - types.EventTypeDASRequest, - sdk.NewAttribute(types.AttributeKeyRequestID, strconv.FormatUint(requestID, 10)), - sdk.NewAttribute(types.AttributeKeyStreamID, streamIDHexStr), - sdk.NewAttribute(types.AttributeKeyBatchHeaderHash, batchHeaderHashHexStr), - sdk.NewAttribute(types.AttributeKeyNumBlobs, strconv.FormatUint(uint64(numBlobs), 10)), - ), - ) - - return requestID, nil -} - -func (k Keeper) GetDASResponse( - ctx sdk.Context, requestID uint64, sampler sdk.ValAddress, -) (types.DASResponse, bool) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ResponseKeyPrefix) - bz := store.Get(types.GetResponseKey(requestID, sampler)) - if bz == nil { - return types.DASResponse{}, false - } - var vote types.DASResponse - k.cdc.MustUnmarshal(bz, &vote) - return vote, true -} - -func (k Keeper) SetDASResponse(ctx sdk.Context, resp types.DASResponse) { - store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ResponseKeyPrefix) - bz := k.cdc.MustMarshal(&resp) - store.Set(types.GetResponseKey(resp.ID, resp.Sampler), bz) -} - -func (k Keeper) IterateDASResponse(ctx sdk.Context, cb func(resp types.DASResponse) (stop bool)) { - iterator := sdk.KVStorePrefixIterator(ctx.KVStore(k.storeKey), types.ResponseKeyPrefix) - - defer iterator.Close() - for ; iterator.Valid(); iterator.Next() { - var resp types.DASResponse - k.cdc.MustUnmarshal(iterator.Value(), &resp) - if cb(resp) { - break - } - } -} - -func (k Keeper) GetDASResponses(ctx sdk.Context) []types.DASResponse { - results := []types.DASResponse{} - k.IterateDASResponse(ctx, func(resp types.DASResponse) bool { - results = append(results, resp) - return false - }) - return results -} - -func (k Keeper) StoreNewDASResponse( - ctx sdk.Context, requestID uint64, sampler sdk.ValAddress, results []bool) error { - if _, found := k.GetDASRequest(ctx, requestID); !found { - return errorsmod.Wrapf(types.ErrUnknownRequest, "%d", requestID) - } - - k.SetDASResponse(ctx, types.DASResponse{ - ID: requestID, - Sampler: sampler, - Results: results, - }) - - return nil -} diff --git a/x/das/v1/keeper/msg_server.go b/x/das/v1/keeper/msg_server.go deleted file mode 100644 index 4109f90a..00000000 --- a/x/das/v1/keeper/msg_server.go +++ /dev/null @@ -1,49 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/0glabs/0g-chain/x/das/v1/types" - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -var _ types.MsgServer = &Keeper{} - -// RequestDAS handles MsgRequestDAS messages -func (k Keeper) RequestDAS( - goCtx context.Context, msg *types.MsgRequestDAS, -) (*types.MsgRequestDASResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - requestID, err := k.StoreNewDASRequest(ctx, msg.StreamID, msg.BatchHeaderHash, msg.NumBlobs) - if err != nil { - return nil, err - } - k.IncrementNextRequestID(ctx) - return &types.MsgRequestDASResponse{ - RequestID: requestID, - }, nil -} - -// ReportDASResult handles MsgReportDASResult messages -func (k Keeper) ReportDASResult( - goCtx context.Context, msg *types.MsgReportDASResult, -) (*types.MsgReportDASResultResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - sampler, err := sdk.ValAddressFromBech32(msg.Sampler) - if err != nil { - return nil, err - } - - if _, found := k.stakingKeeperRef.GetValidator(ctx, sampler); !found { - return nil, stakingtypes.ErrNoValidatorFound - } - - if err := k.StoreNewDASResponse(ctx, msg.RequestID, sampler, msg.Results); err != nil { - return nil, err - } - - return &types.MsgReportDASResultResponse{}, nil -} diff --git a/x/das/v1/module.go b/x/das/v1/module.go deleted file mode 100644 index 03d8c644..00000000 --- a/x/das/v1/module.go +++ /dev/null @@ -1,180 +0,0 @@ -package das - -import ( - "context" - "encoding/json" - "fmt" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/gorilla/mux" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/tendermint/tendermint/abci/types" - - "github.com/0glabs/0g-chain/x/das/v1/client/cli" - "github.com/0glabs/0g-chain/x/das/v1/keeper" - "github.com/0glabs/0g-chain/x/das/v1/types" -) - -// consensusVersion defines the current x/council module consensus version. -const consensusVersion = 1 - -// type check to ensure the interface is properly implemented -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - // _ module.AppModuleSimulation = AppModule{} - _ module.BeginBlockAppModule = AppModule{} - _ module.EndBlockAppModule = AppModule{} -) - -// app module Basics object -type AppModuleBasic struct{} - -// Name returns the inflation module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -// RegisterLegacyAminoCodec registers the inflation module's types on the given LegacyAmino codec. -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {} - -// ConsensusVersion returns the consensus state-breaking version for the module. -func (AppModuleBasic) ConsensusVersion() uint64 { - return consensusVersion -} - -// RegisterInterfaces registers interfaces and implementations of the incentives -// module. -func (AppModuleBasic) RegisterInterfaces(interfaceRegistry codectypes.InterfaceRegistry) { - types.RegisterInterfaces(interfaceRegistry) -} - -// DefaultGenesis returns default genesis state as raw bytes for the incentives -// module. -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesisState()) -} - -// ValidateGenesis performs genesis state validation for the inflation module. -func (b AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { - var genesisState types.GenesisState - if err := cdc.UnmarshalJSON(bz, &genesisState); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - - return genesisState.Validate() -} - -// RegisterRESTRoutes performs a no-op as the inflation module doesn't expose REST -// endpoints -func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router) {} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the inflation module. -func (b AppModuleBasic) RegisterGRPCGatewayRoutes(c client.Context, serveMux *runtime.ServeMux) { - if err := types.RegisterQueryHandlerClient(context.Background(), serveMux, types.NewQueryClient(c)); err != nil { - panic(err) - } -} - -// GetTxCmd returns the root tx command for the inflation module. -func (AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - -// GetQueryCmd returns no root query command for the inflation module. -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd() -} - -// ___________________________________________________________________________ - -// AppModule implements an application module for the inflation module. -type AppModule struct { - AppModuleBasic - keeper keeper.Keeper -} - -// NewAppModule creates a new AppModule Object -func NewAppModule( - k keeper.Keeper, -) AppModule { - return AppModule{ - AppModuleBasic: AppModuleBasic{}, - keeper: k, - } -} - -// Name returns the inflation module's name. -func (AppModule) Name() string { - return types.ModuleName -} - -// Route returns evmutil module's message route. -func (am AppModule) Route() sdk.Route { return sdk.Route{} } - -// QuerierRoute returns evmutil module's query routing key. -func (AppModule) QuerierRoute() string { return "" } - -// LegacyQuerierHandler returns evmutil module's Querier. -func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { - return nil -} - -// RegisterInvariants registers the inflation module invariants. -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// RegisterServices registers a gRPC query service to respond to the -// module-specific gRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), am.keeper) - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) -} - -func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { - // am.keeper.BeginBlock(ctx, req) -} - -func (am AppModule) EndBlock(ctx sdk.Context, req abci.RequestEndBlock) []abci.ValidatorUpdate { - // am.keeper.EndBlock(ctx, req) - return []abci.ValidatorUpdate{} -} - -// InitGenesis performs genesis initialization for the inflation module. It returns -// no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - var genesisState types.GenesisState - - cdc.MustUnmarshalJSON(data, &genesisState) - InitGenesis(ctx, am.keeper, genesisState) - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the exported genesis state as raw bytes for the inflation -// module. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - gs := ExportGenesis(ctx, am.keeper) - return cdc.MustMarshalJSON(gs) -} - -// ___________________________________________________________________________ - -// AppModuleSimulation functions - -// GenerateGenesisState creates a randomized GenState of the inflation module. -func (am AppModule) GenerateGenesisState(_ *module.SimulationState) { -} - -// RegisterStoreDecoder registers a decoder for inflation module's types. -func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) { -} - -// WeightedOperations doesn't return any inflation module operation. -func (am AppModule) WeightedOperations(_ module.SimulationState) []simtypes.WeightedOperation { - return []simtypes.WeightedOperation{} -} diff --git a/x/das/v1/types/codec.go b/x/das/v1/types/codec.go deleted file mode 100644 index 883a699e..00000000 --- a/x/das/v1/types/codec.go +++ /dev/null @@ -1,47 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" -) - -var ( - amino = codec.NewLegacyAmino() - // ModuleCdc references the global evm module codec. Note, the codec should - // ONLY be used in certain instances of tests and for JSON encoding. - ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry()) - - // AminoCdc is a amino codec created to support amino JSON compatible msgs. - AminoCdc = codec.NewAminoCodec(amino) -) - -const ( - // Amino names - requestDASName = "evmos/das/MsgRequestDAS" - reportDASResultName = "evmos/das/MsgReportDASResult" -) - -// NOTE: This is required for the GetSignBytes function -func init() { - RegisterLegacyAminoCodec(amino) - amino.Seal() -} - -// RegisterInterfaces register implementations -func RegisterInterfaces(registry codectypes.InterfaceRegistry) { - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgRequestDAS{}, - &MsgReportDASResult{}, - ) - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} - -// RegisterLegacyAminoCodec required for EIP-712 -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgRequestDAS{}, requestDASName, nil) - cdc.RegisterConcrete(&MsgReportDASResult{}, reportDASResultName, nil) -} diff --git a/x/das/v1/types/errors.go b/x/das/v1/types/errors.go deleted file mode 100644 index 77469e4a..00000000 --- a/x/das/v1/types/errors.go +++ /dev/null @@ -1,8 +0,0 @@ -package types - -import errorsmod "cosmossdk.io/errors" - -var ( - ErrUnknownRequest = errorsmod.Register(ModuleName, 0, "request not found") - ErrInvalidGenesis = errorsmod.Register(ModuleName, 1, "invalid genesis") -) diff --git a/x/das/v1/types/events.go b/x/das/v1/types/events.go deleted file mode 100644 index 3a7159a4..00000000 --- a/x/das/v1/types/events.go +++ /dev/null @@ -1,11 +0,0 @@ -package types - -// Module event types -const ( - EventTypeDASRequest = "das_request" - - AttributeKeyRequestID = "request_id" - AttributeKeyStreamID = "stream_id" - AttributeKeyBatchHeaderHash = "batch_header_hash" - AttributeKeyNumBlobs = "num_blobs" -) diff --git a/x/das/v1/types/genesis.go b/x/das/v1/types/genesis.go deleted file mode 100644 index fd0c6fde..00000000 --- a/x/das/v1/types/genesis.go +++ /dev/null @@ -1,28 +0,0 @@ -package types - -const ( - DefaultNextRequestID = 0 -) - -// NewGenesisState returns a new genesis state object for the module. -func NewGenesisState(nextRequestID uint64, requests []DASRequest, responses []DASResponse) *GenesisState { - return &GenesisState{ - NextRequestID: nextRequestID, - Requests: requests, - Responses: responses, - } -} - -// DefaultGenesisState returns the default genesis state for the module. -func DefaultGenesisState() *GenesisState { - return NewGenesisState( - DefaultNextRequestID, - []DASRequest{}, - []DASResponse{}, - ) -} - -// Validate performs basic validation of genesis data. -func (gs GenesisState) Validate() error { - return nil -} diff --git a/x/das/v1/types/genesis.pb.go b/x/das/v1/types/genesis.pb.go deleted file mode 100644 index 6ebee372..00000000 --- a/x/das/v1/types/genesis.pb.go +++ /dev/null @@ -1,1191 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: zgc/das/v1/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/codec/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/protobuf/types/known/timestamppb" - 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 - -type Params struct { -} - -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_3f8b8b164973ed21, []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 - -// GenesisState defines the das module's genesis state. -type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - NextRequestID uint64 `protobuf:"varint,2,opt,name=next_request_id,json=nextRequestId,proto3" json:"next_request_id,omitempty"` - Requests []DASRequest `protobuf:"bytes,3,rep,name=requests,proto3" json:"requests"` - Responses []DASResponse `protobuf:"bytes,4,rep,name=responses,proto3" json:"responses"` -} - -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_3f8b8b164973ed21, []int{1} -} -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 - -type DASRequest struct { - ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - StreamID []byte `protobuf:"bytes,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` - BatchHeaderHash []byte `protobuf:"bytes,3,opt,name=batch_header_hash,json=batchHeaderHash,proto3" json:"batch_header_hash,omitempty"` - NumBlobs uint32 `protobuf:"varint,4,opt,name=num_blobs,json=numBlobs,proto3" json:"num_blobs,omitempty"` -} - -func (m *DASRequest) Reset() { *m = DASRequest{} } -func (m *DASRequest) String() string { return proto.CompactTextString(m) } -func (*DASRequest) ProtoMessage() {} -func (*DASRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_3f8b8b164973ed21, []int{2} -} -func (m *DASRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DASRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DASRequest.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 *DASRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_DASRequest.Merge(m, src) -} -func (m *DASRequest) XXX_Size() int { - return m.Size() -} -func (m *DASRequest) XXX_DiscardUnknown() { - xxx_messageInfo_DASRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_DASRequest proto.InternalMessageInfo - -func (m *DASRequest) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *DASRequest) GetStreamID() []byte { - if m != nil { - return m.StreamID - } - return nil -} - -func (m *DASRequest) GetBatchHeaderHash() []byte { - if m != nil { - return m.BatchHeaderHash - } - return nil -} - -func (m *DASRequest) GetNumBlobs() uint32 { - if m != nil { - return m.NumBlobs - } - return 0 -} - -type DASResponse struct { - ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Sampler github_com_cosmos_cosmos_sdk_types.ValAddress `protobuf:"bytes,2,opt,name=sampler,proto3,casttype=github.com/cosmos/cosmos-sdk/types.ValAddress" json:"sampler,omitempty"` - Results []bool `protobuf:"varint,3,rep,packed,name=results,proto3" json:"results,omitempty"` -} - -func (m *DASResponse) Reset() { *m = DASResponse{} } -func (m *DASResponse) String() string { return proto.CompactTextString(m) } -func (*DASResponse) ProtoMessage() {} -func (*DASResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_3f8b8b164973ed21, []int{3} -} -func (m *DASResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DASResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DASResponse.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 *DASResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_DASResponse.Merge(m, src) -} -func (m *DASResponse) XXX_Size() int { - return m.Size() -} -func (m *DASResponse) XXX_DiscardUnknown() { - xxx_messageInfo_DASResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_DASResponse proto.InternalMessageInfo - -func (m *DASResponse) GetID() uint64 { - if m != nil { - return m.ID - } - return 0 -} - -func (m *DASResponse) GetSampler() github_com_cosmos_cosmos_sdk_types.ValAddress { - if m != nil { - return m.Sampler - } - return nil -} - -func (m *DASResponse) GetResults() []bool { - if m != nil { - return m.Results - } - return nil -} - -func init() { - proto.RegisterType((*Params)(nil), "zgc.das.v1.Params") - proto.RegisterType((*GenesisState)(nil), "zgc.das.v1.GenesisState") - proto.RegisterType((*DASRequest)(nil), "zgc.das.v1.DASRequest") - proto.RegisterType((*DASResponse)(nil), "zgc.das.v1.DASResponse") -} - -func init() { proto.RegisterFile("zgc/das/v1/genesis.proto", fileDescriptor_3f8b8b164973ed21) } - -var fileDescriptor_3f8b8b164973ed21 = []byte{ - // 521 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xbd, 0x6e, 0xd3, 0x50, - 0x14, 0x8e, 0x93, 0x28, 0x75, 0x6e, 0x12, 0x55, 0x35, 0xa8, 0xb8, 0x45, 0xb2, 0xa3, 0x4c, 0x29, - 0x52, 0xec, 0xb4, 0x2c, 0xfc, 0x4c, 0x35, 0x91, 0x48, 0x16, 0x84, 0x1c, 0x89, 0x81, 0xc5, 0xba, - 0xf6, 0xbd, 0xd8, 0x16, 0xb6, 0xaf, 0xf1, 0xb9, 0xae, 0x92, 0x3e, 0x01, 0x23, 0x23, 0x23, 0x12, - 0xaf, 0xc0, 0x43, 0x74, 0xac, 0x98, 0x98, 0x22, 0xe4, 0xbc, 0x04, 0x62, 0x42, 0xb1, 0x6f, 0x48, - 0x04, 0xea, 0x94, 0x7c, 0x7f, 0x3e, 0xdf, 0x91, 0x8f, 0x91, 0x7a, 0xed, 0x7b, 0x26, 0xc1, 0x60, - 0x5e, 0x9d, 0x9b, 0x3e, 0x4d, 0x28, 0x84, 0x60, 0xa4, 0x19, 0xe3, 0x4c, 0x41, 0xd7, 0xbe, 0x67, - 0x10, 0x0c, 0xc6, 0xd5, 0xf9, 0xe9, 0x89, 0xc7, 0x20, 0x66, 0xe0, 0x94, 0x8a, 0x59, 0x81, 0xca, - 0x76, 0x7a, 0xdf, 0x67, 0x3e, 0xab, 0xf8, 0xcd, 0x3f, 0xc1, 0x9e, 0xf8, 0x8c, 0xf9, 0x11, 0x35, - 0x4b, 0xe4, 0xe6, 0xef, 0x4c, 0x9c, 0x2c, 0x85, 0xa4, 0xff, 0x2b, 0xf1, 0x30, 0xa6, 0xc0, 0x71, - 0x9c, 0x56, 0x86, 0x81, 0x8c, 0x5a, 0xaf, 0x71, 0x86, 0x63, 0x18, 0xfc, 0x92, 0x50, 0xf7, 0x65, - 0x55, 0x6a, 0xce, 0x31, 0xa7, 0xca, 0x18, 0xb5, 0xd2, 0x52, 0x52, 0xa5, 0xbe, 0x34, 0xec, 0x5c, - 0x28, 0xc6, 0xae, 0xa4, 0x51, 0x85, 0xac, 0xe6, 0xcd, 0x4a, 0xaf, 0xd9, 0xc2, 0xa7, 0x3c, 0x45, - 0x87, 0x09, 0x5d, 0x70, 0x27, 0xa3, 0x1f, 0x72, 0x0a, 0xdc, 0x09, 0x89, 0x5a, 0xef, 0x4b, 0xc3, - 0xa6, 0x75, 0x54, 0xac, 0xf4, 0xde, 0x2b, 0xba, 0xe0, 0x76, 0xa5, 0xcc, 0x26, 0x76, 0x2f, 0xd9, - 0x83, 0x44, 0x79, 0x82, 0x64, 0x91, 0x02, 0xb5, 0xd1, 0x6f, 0x0c, 0x3b, 0x17, 0xc7, 0xfb, 0xe3, - 0x26, 0x97, 0x73, 0xe1, 0x15, 0x23, 0xff, 0xba, 0x95, 0xe7, 0xa8, 0x9d, 0x51, 0x48, 0x59, 0x02, - 0x14, 0xd4, 0x66, 0x19, 0x7d, 0xf0, 0x5f, 0xb4, 0xd2, 0x45, 0x76, 0xe7, 0x7f, 0xd6, 0xfc, 0xf8, - 0x45, 0xaf, 0x0d, 0x3e, 0x4b, 0x08, 0xed, 0x26, 0x28, 0xc7, 0xa8, 0x1e, 0x92, 0x72, 0xe9, 0xa6, - 0xd5, 0x2a, 0x56, 0x7a, 0x7d, 0x36, 0xb1, 0xeb, 0x21, 0x51, 0xce, 0x50, 0x1b, 0x78, 0x46, 0x71, - 0xbc, 0x5d, 0xac, 0x6b, 0x75, 0x8b, 0x95, 0x2e, 0xcf, 0x4b, 0x72, 0x36, 0xb1, 0xe5, 0x4a, 0x9e, - 0x11, 0xe5, 0x11, 0x3a, 0x72, 0x31, 0xf7, 0x02, 0x27, 0xa0, 0x98, 0xd0, 0xcc, 0x09, 0x30, 0x04, - 0x6a, 0x63, 0x13, 0xb1, 0x0f, 0x4b, 0x61, 0x5a, 0xf2, 0x53, 0x0c, 0x81, 0xf2, 0x10, 0xb5, 0x93, - 0x3c, 0x76, 0xdc, 0x88, 0xb9, 0x9b, 0x05, 0xa4, 0x61, 0xcf, 0x96, 0x93, 0x3c, 0xb6, 0x36, 0x78, - 0xf0, 0x55, 0x42, 0x9d, 0xbd, 0x0d, 0xee, 0xec, 0xe6, 0xa2, 0x03, 0xc0, 0x71, 0x1a, 0xd1, 0x4c, - 0x34, 0x9b, 0xfe, 0x5e, 0xe9, 0x23, 0x3f, 0xe4, 0x41, 0xee, 0x1a, 0x1e, 0x8b, 0xc5, 0x1d, 0x89, - 0x9f, 0x11, 0x90, 0xf7, 0x26, 0x5f, 0xa6, 0x14, 0x8c, 0x37, 0x38, 0xba, 0x24, 0x24, 0xa3, 0x00, - 0xdf, 0xbf, 0x8d, 0xee, 0x89, 0x6b, 0x13, 0x8c, 0xb5, 0xe4, 0x14, 0xec, 0xed, 0x83, 0x15, 0x15, - 0x1d, 0x64, 0x14, 0xf2, 0x48, 0xbc, 0x22, 0xd9, 0xde, 0x42, 0xeb, 0xc5, 0x4d, 0xa1, 0x49, 0xb7, - 0x85, 0x26, 0xfd, 0x2c, 0x34, 0xe9, 0xd3, 0x5a, 0xab, 0xdd, 0xae, 0xb5, 0xda, 0x8f, 0xb5, 0x56, - 0x7b, 0x7b, 0xb6, 0x57, 0x61, 0xec, 0x47, 0xd8, 0x05, 0x73, 0xec, 0x8f, 0xbc, 0x00, 0x87, 0x89, - 0xb9, 0xd8, 0x7e, 0x0b, 0x65, 0x13, 0xb7, 0x55, 0x5e, 0xe4, 0xe3, 0x3f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x5b, 0x0e, 0xfc, 0x0d, 0x26, 0x03, 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 - return len(dAtA) - i, nil -} - -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 - if len(m.Responses) > 0 { - for iNdEx := len(m.Responses) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Responses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.Requests) > 0 { - for iNdEx := len(m.Requests) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Requests[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.NextRequestID != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.NextRequestID)) - i-- - dAtA[i] = 0x10 - } - { - 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 (m *DASRequest) 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 *DASRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DASRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumBlobs != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.NumBlobs)) - i-- - dAtA[i] = 0x20 - } - if len(m.BatchHeaderHash) > 0 { - i -= len(m.BatchHeaderHash) - copy(dAtA[i:], m.BatchHeaderHash) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.BatchHeaderHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.StreamID) > 0 { - i -= len(m.StreamID) - copy(dAtA[i:], m.StreamID) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.StreamID))) - i-- - dAtA[i] = 0x12 - } - if m.ID != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DASResponse) 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 *DASResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DASResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - i-- - if m.Results[iNdEx] { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - } - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Results))) - i-- - dAtA[i] = 0x1a - } - if len(m.Sampler) > 0 { - i -= len(m.Sampler) - copy(dAtA[i:], m.Sampler) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.Sampler))) - i-- - dAtA[i] = 0x12 - } - if m.ID != 0 { - i = encodeVarintGenesis(dAtA, i, uint64(m.ID)) - i-- - dAtA[i] = 0x8 - } - 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 *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -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)) - if m.NextRequestID != 0 { - n += 1 + sovGenesis(uint64(m.NextRequestID)) - } - if len(m.Requests) > 0 { - for _, e := range m.Requests { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - if len(m.Responses) > 0 { - for _, e := range m.Responses { - l = e.Size() - n += 1 + l + sovGenesis(uint64(l)) - } - } - return n -} - -func (m *DASRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovGenesis(uint64(m.ID)) - } - l = len(m.StreamID) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - l = len(m.BatchHeaderHash) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if m.NumBlobs != 0 { - n += 1 + sovGenesis(uint64(m.NumBlobs)) - } - return n -} - -func (m *DASResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ID != 0 { - n += 1 + sovGenesis(uint64(m.ID)) - } - l = len(m.Sampler) - if l > 0 { - n += 1 + l + sovGenesis(uint64(l)) - } - if len(m.Results) > 0 { - n += 1 + sovGenesis(uint64(len(m.Results))) + len(m.Results)*1 - } - 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 *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 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: 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 { - 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 (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 - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NextRequestID", wireType) - } - m.NextRequestID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NextRequestID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requests", 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 - } - m.Requests = append(m.Requests, DASRequest{}) - if err := m.Requests[len(m.Requests)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Responses", 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 - } - m.Responses = append(m.Responses, DASResponse{}) - if err := m.Responses[len(m.Responses)-1].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 (m *DASRequest) 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: DASRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DASRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StreamID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.StreamID = append(m.StreamID[:0], dAtA[iNdEx:postIndex]...) - if m.StreamID == nil { - m.StreamID = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BatchHeaderHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.BatchHeaderHash = append(m.BatchHeaderHash[:0], dAtA[iNdEx:postIndex]...) - if m.BatchHeaderHash == nil { - m.BatchHeaderHash = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumBlobs", wireType) - } - m.NumBlobs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumBlobs |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 (m *DASResponse) 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: DASResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DASResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - m.ID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sampler", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sampler = append(m.Sampler[:0], dAtA[iNdEx:postIndex]...) - if m.Sampler == nil { - m.Sampler = []byte{} - } - iNdEx = postIndex - case 3: - if wireType == 0 { - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Results = append(m.Results, bool(v != 0)) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen - if elementCount != 0 && len(m.Results) == 0 { - m.Results = make([]bool, 0, elementCount) - } - for iNdEx < postIndex { - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Results = append(m.Results, bool(v != 0)) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) - } - 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/das/v1/types/interfaces.go b/x/das/v1/types/interfaces.go deleted file mode 100644 index ff56b322..00000000 --- a/x/das/v1/types/interfaces.go +++ /dev/null @@ -1,10 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" -) - -type StakingKeeperRef interface { - GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool) -} diff --git a/x/das/v1/types/keys.go b/x/das/v1/types/keys.go deleted file mode 100644 index 06846cb9..00000000 --- a/x/das/v1/types/keys.go +++ /dev/null @@ -1,44 +0,0 @@ -package types - -import ( - "encoding/binary" - - sdk "github.com/cosmos/cosmos-sdk/types" -) - -const ( - // ModuleName The name that will be used throughout the module - ModuleName = "das" - - // StoreKey Top level store key where all module items will be stored - StoreKey = ModuleName -) - -// Key prefixes -var ( - RequestKeyPrefix = []byte{0x00} // prefix for keys that store requests - ResponseKeyPrefix = []byte{0x01} // prefix for keys that store responses - - NextRequestIDKey = []byte{0x02} -) - -// GetKeyFromID returns the bytes to use as a key for a uint64 id -func GetKeyFromID(id uint64) []byte { - return Uint64ToBytes(id) -} - -func GetResponseKey(requestID uint64, sampler sdk.ValAddress) []byte { - return append(GetKeyFromID(requestID), sampler.Bytes()...) -} - -// Uint64ToBytes converts a uint64 into fixed length bytes for use in store keys. -func Uint64ToBytes(id uint64) []byte { - bz := make([]byte, 8) - binary.BigEndian.PutUint64(bz, uint64(id)) - return bz -} - -// Uint64FromBytes converts some fixed length bytes back into a uint64. -func Uint64FromBytes(bz []byte) uint64 { - return binary.BigEndian.Uint64(bz) -} diff --git a/x/das/v1/types/msg.go b/x/das/v1/types/msg.go deleted file mode 100644 index f1c07ce4..00000000 --- a/x/das/v1/types/msg.go +++ /dev/null @@ -1,57 +0,0 @@ -package types - -import ( - "encoding/hex" - - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -var _, _ sdk.Msg = &MsgRequestDAS{}, &MsgReportDASResult{} - -func NewMsgRequestDAS(fromAddr sdk.AccAddress, streamID, hash string, numBlobs uint32) *MsgRequestDAS { - return &MsgRequestDAS{ - Requester: fromAddr.String(), - StreamID: streamID, - BatchHeaderHash: hash, - NumBlobs: numBlobs, - } -} - -func (msg MsgRequestDAS) GetSigners() []sdk.AccAddress { - from, err := sdk.AccAddressFromBech32(msg.Requester) - if err != nil { - panic(err) - } - return []sdk.AccAddress{from} -} - -func (msg MsgRequestDAS) ValidateBasic() error { - _, err := sdk.AccAddressFromBech32(msg.Requester) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid requester account address (%s)", err) - } - - return nil -} - -func (msg *MsgReportDASResult) GetSigners() []sdk.AccAddress { - samplerValAddr, err := sdk.ValAddressFromBech32(msg.Sampler) - if err != nil { - panic(err) - } - accAddr, err := sdk.AccAddressFromHexUnsafe(hex.EncodeToString(samplerValAddr.Bytes())) - if err != nil { - panic(err) - } - return []sdk.AccAddress{accAddr} -} - -func (msg *MsgReportDASResult) ValidateBasic() error { - _, err := sdk.ValAddressFromBech32(msg.Sampler) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sampler validator address (%s)", err) - } - return nil -} diff --git a/x/das/v1/types/query.pb.go b/x/das/v1/types/query.pb.go deleted file mode 100644 index 76f8bfd9..00000000 --- a/x/das/v1/types/query.pb.go +++ /dev/null @@ -1,511 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: zgc/das/v1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - _ "google.golang.org/protobuf/types/known/timestamppb" - 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 - -type QueryNextRequestIDRequest struct { -} - -func (m *QueryNextRequestIDRequest) Reset() { *m = QueryNextRequestIDRequest{} } -func (m *QueryNextRequestIDRequest) String() string { return proto.CompactTextString(m) } -func (*QueryNextRequestIDRequest) ProtoMessage() {} -func (*QueryNextRequestIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d404c1962bca645f, []int{0} -} -func (m *QueryNextRequestIDRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryNextRequestIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryNextRequestIDRequest.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 *QueryNextRequestIDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryNextRequestIDRequest.Merge(m, src) -} -func (m *QueryNextRequestIDRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryNextRequestIDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryNextRequestIDRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryNextRequestIDRequest proto.InternalMessageInfo - -type QueryNextRequestIDResponse struct { - NextRequestID uint64 `protobuf:"varint,1,opt,name=next_request_id,json=nextRequestId,proto3" json:"next_request_id,omitempty"` -} - -func (m *QueryNextRequestIDResponse) Reset() { *m = QueryNextRequestIDResponse{} } -func (m *QueryNextRequestIDResponse) String() string { return proto.CompactTextString(m) } -func (*QueryNextRequestIDResponse) ProtoMessage() {} -func (*QueryNextRequestIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d404c1962bca645f, []int{1} -} -func (m *QueryNextRequestIDResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryNextRequestIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryNextRequestIDResponse.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 *QueryNextRequestIDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryNextRequestIDResponse.Merge(m, src) -} -func (m *QueryNextRequestIDResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryNextRequestIDResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryNextRequestIDResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryNextRequestIDResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*QueryNextRequestIDRequest)(nil), "zgc.das.v1.QueryNextRequestIDRequest") - proto.RegisterType((*QueryNextRequestIDResponse)(nil), "zgc.das.v1.QueryNextRequestIDResponse") -} - -func init() { proto.RegisterFile("zgc/das/v1/query.proto", fileDescriptor_d404c1962bca645f) } - -var fileDescriptor_d404c1962bca645f = []byte{ - // 334 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x91, 0xbf, 0x4b, 0x03, 0x31, - 0x14, 0xc7, 0x2f, 0xa2, 0x0e, 0x81, 0x22, 0x1e, 0x22, 0xf6, 0x94, 0x54, 0x0b, 0xfe, 0x1a, 0x9a, - 0xb4, 0x3a, 0xb9, 0x16, 0x41, 0x5c, 0x04, 0x5d, 0x04, 0x97, 0x92, 0xbb, 0x8b, 0x69, 0xa0, 0x97, - 0x5c, 0x9b, 0x5c, 0x69, 0x3b, 0xba, 0xb8, 0x2a, 0xfe, 0x53, 0x1d, 0x0b, 0x2e, 0x4e, 0xa2, 0x57, - 0xff, 0x10, 0xe9, 0xe5, 0x0e, 0xad, 0x28, 0x6e, 0xef, 0xbd, 0xef, 0xf7, 0x7d, 0xf3, 0xe1, 0x05, - 0xae, 0x8f, 0x78, 0x40, 0x42, 0xaa, 0x49, 0xbf, 0x41, 0xba, 0x09, 0xeb, 0x0d, 0x71, 0xdc, 0x53, - 0x46, 0xb9, 0x70, 0xc4, 0x03, 0x1c, 0x52, 0x8d, 0xfb, 0x0d, 0xaf, 0x1c, 0x28, 0x1d, 0x29, 0xdd, - 0xca, 0x14, 0x62, 0x1b, 0x6b, 0xf3, 0xd6, 0xb8, 0xe2, 0xca, 0xce, 0x67, 0x55, 0x3e, 0xdd, 0xe2, - 0x4a, 0xf1, 0x0e, 0x23, 0x34, 0x16, 0x84, 0x4a, 0xa9, 0x0c, 0x35, 0x42, 0xc9, 0x62, 0xa7, 0x9c, - 0xab, 0x59, 0xe7, 0x27, 0xb7, 0x84, 0xca, 0xfc, 0x55, 0xaf, 0xf2, 0x53, 0x32, 0x22, 0x62, 0xda, - 0xd0, 0x28, 0xb6, 0x86, 0xea, 0x26, 0x2c, 0x5f, 0xce, 0x28, 0x2f, 0xd8, 0xc0, 0x5c, 0xb1, 0x6e, - 0xc2, 0xb4, 0x39, 0x3f, 0xcd, 0x8b, 0xea, 0x35, 0xf4, 0x7e, 0x13, 0x75, 0xac, 0xa4, 0x66, 0xee, - 0x09, 0x5c, 0x91, 0x6c, 0x60, 0x5a, 0x3d, 0xab, 0xb4, 0x44, 0xb8, 0x01, 0xb6, 0xc1, 0xc1, 0x62, - 0x73, 0x35, 0x7d, 0xad, 0x94, 0xe6, 0x77, 0x4a, 0xf2, 0x5b, 0x1b, 0x1e, 0x3d, 0x02, 0xb8, 0x94, - 0x25, 0xbb, 0xf7, 0x00, 0xce, 0x5b, 0xdd, 0x5d, 0xfc, 0x75, 0x29, 0xfc, 0x27, 0x9b, 0xb7, 0xf7, - 0x9f, 0xcd, 0x52, 0x56, 0xf7, 0xef, 0x9e, 0x3f, 0x9e, 0x16, 0x76, 0xdc, 0x0a, 0xa9, 0xf3, 0xa0, - 0x4d, 0x85, 0x2c, 0x3e, 0x67, 0x46, 0x54, 0xcb, 0xd9, 0x6b, 0x22, 0x6c, 0x9e, 0x8d, 0xdf, 0x91, - 0x33, 0x4e, 0x11, 0x98, 0xa4, 0x08, 0xbc, 0xa5, 0x08, 0x3c, 0x4c, 0x91, 0x33, 0x99, 0x22, 0xe7, - 0x65, 0x8a, 0x9c, 0x9b, 0x43, 0x2e, 0x4c, 0x3b, 0xf1, 0x71, 0xa0, 0x22, 0x52, 0xe7, 0x1d, 0xea, - 0x6b, 0x52, 0xe7, 0x35, 0x1b, 0x38, 0x28, 0x22, 0xcd, 0x30, 0x66, 0xda, 0x5f, 0xce, 0x2e, 0x7b, - 0xfc, 0x19, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x9e, 0xd6, 0x49, 0x0a, 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 { - NextRequestID(ctx context.Context, in *QueryNextRequestIDRequest, opts ...grpc.CallOption) (*QueryNextRequestIDResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) NextRequestID(ctx context.Context, in *QueryNextRequestIDRequest, opts ...grpc.CallOption) (*QueryNextRequestIDResponse, error) { - out := new(QueryNextRequestIDResponse) - err := c.cc.Invoke(ctx, "/zgc.das.v1.Query/NextRequestID", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - NextRequestID(context.Context, *QueryNextRequestIDRequest) (*QueryNextRequestIDResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) NextRequestID(ctx context.Context, req *QueryNextRequestIDRequest) (*QueryNextRequestIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NextRequestID not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_NextRequestID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryNextRequestIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).NextRequestID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/zgc.das.v1.Query/NextRequestID", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).NextRequestID(ctx, req.(*QueryNextRequestIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "zgc.das.v1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "NextRequestID", - Handler: _Query_NextRequestID_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "zgc/das/v1/query.proto", -} - -func (m *QueryNextRequestIDRequest) 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 *QueryNextRequestIDRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryNextRequestIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryNextRequestIDResponse) 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 *QueryNextRequestIDResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryNextRequestIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NextRequestID != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.NextRequestID)) - i-- - dAtA[i] = 0x8 - } - 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 *QueryNextRequestIDRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryNextRequestIDResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NextRequestID != 0 { - n += 1 + sovQuery(uint64(m.NextRequestID)) - } - 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 *QueryNextRequestIDRequest) 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: QueryNextRequestIDRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNextRequestIDRequest: 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 *QueryNextRequestIDResponse) 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: QueryNextRequestIDResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryNextRequestIDResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NextRequestID", wireType) - } - m.NextRequestID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NextRequestID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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/das/v1/types/query.pb.gw.go b/x/das/v1/types/query.pb.gw.go deleted file mode 100644 index 5567645e..00000000 --- a/x/das/v1/types/query.pb.gw.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: zgc/das/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_NextRequestID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryNextRequestIDRequest - var metadata runtime.ServerMetadata - - msg, err := client.NextRequestID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_NextRequestID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryNextRequestIDRequest - var metadata runtime.ServerMetadata - - msg, err := server.NextRequestID(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_NextRequestID_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_NextRequestID_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_NextRequestID_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_NextRequestID_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_NextRequestID_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_NextRequestID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_NextRequestID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"0gchain", "das", "v1", "next-request-id"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_NextRequestID_0 = runtime.ForwardResponseMessage -) diff --git a/x/das/v1/types/tx.pb.go b/x/das/v1/types/tx.pb.go deleted file mode 100644 index 9b814acb..00000000 --- a/x/das/v1/types/tx.pb.go +++ /dev/null @@ -1,1110 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: zgc/das/v1/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - _ "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" - proto "github.com/gogo/protobuf/proto" - 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 - -type MsgRequestDAS struct { - Requester string `protobuf:"bytes,1,opt,name=requester,proto3" json:"requester,omitempty" Requester` - StreamID string `protobuf:"bytes,2,opt,name=stream_id,json=streamId,proto3" json:"stream_id,omitempty"` - BatchHeaderHash string `protobuf:"bytes,3,opt,name=batch_header_hash,json=batchHeaderHash,proto3" json:"batch_header_hash,omitempty"` - NumBlobs uint32 `protobuf:"varint,4,opt,name=num_blobs,json=numBlobs,proto3" json:"num_blobs,omitempty"` -} - -func (m *MsgRequestDAS) Reset() { *m = MsgRequestDAS{} } -func (m *MsgRequestDAS) String() string { return proto.CompactTextString(m) } -func (*MsgRequestDAS) ProtoMessage() {} -func (*MsgRequestDAS) Descriptor() ([]byte, []int) { - return fileDescriptor_030259cfeac21931, []int{0} -} -func (m *MsgRequestDAS) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRequestDAS) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRequestDAS.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 *MsgRequestDAS) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRequestDAS.Merge(m, src) -} -func (m *MsgRequestDAS) XXX_Size() int { - return m.Size() -} -func (m *MsgRequestDAS) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRequestDAS.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRequestDAS proto.InternalMessageInfo - -type MsgRequestDASResponse struct { - RequestID uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` -} - -func (m *MsgRequestDASResponse) Reset() { *m = MsgRequestDASResponse{} } -func (m *MsgRequestDASResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRequestDASResponse) ProtoMessage() {} -func (*MsgRequestDASResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_030259cfeac21931, []int{1} -} -func (m *MsgRequestDASResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRequestDASResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRequestDASResponse.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 *MsgRequestDASResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRequestDASResponse.Merge(m, src) -} -func (m *MsgRequestDASResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRequestDASResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRequestDASResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRequestDASResponse proto.InternalMessageInfo - -type MsgReportDASResult struct { - RequestID uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` - Sampler string `protobuf:"bytes,2,opt,name=sampler,proto3" json:"sampler,omitempty"` - Results []bool `protobuf:"varint,3,rep,packed,name=results,proto3" json:"results,omitempty"` -} - -func (m *MsgReportDASResult) Reset() { *m = MsgReportDASResult{} } -func (m *MsgReportDASResult) String() string { return proto.CompactTextString(m) } -func (*MsgReportDASResult) ProtoMessage() {} -func (*MsgReportDASResult) Descriptor() ([]byte, []int) { - return fileDescriptor_030259cfeac21931, []int{2} -} -func (m *MsgReportDASResult) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgReportDASResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgReportDASResult.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 *MsgReportDASResult) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgReportDASResult.Merge(m, src) -} -func (m *MsgReportDASResult) XXX_Size() int { - return m.Size() -} -func (m *MsgReportDASResult) XXX_DiscardUnknown() { - xxx_messageInfo_MsgReportDASResult.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgReportDASResult proto.InternalMessageInfo - -type MsgReportDASResultResponse struct { -} - -func (m *MsgReportDASResultResponse) Reset() { *m = MsgReportDASResultResponse{} } -func (m *MsgReportDASResultResponse) String() string { return proto.CompactTextString(m) } -func (*MsgReportDASResultResponse) ProtoMessage() {} -func (*MsgReportDASResultResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_030259cfeac21931, []int{3} -} -func (m *MsgReportDASResultResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgReportDASResultResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgReportDASResultResponse.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 *MsgReportDASResultResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgReportDASResultResponse.Merge(m, src) -} -func (m *MsgReportDASResultResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgReportDASResultResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgReportDASResultResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgReportDASResultResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgRequestDAS)(nil), "zgc.das.v1.MsgRequestDAS") - proto.RegisterType((*MsgRequestDASResponse)(nil), "zgc.das.v1.MsgRequestDASResponse") - proto.RegisterType((*MsgReportDASResult)(nil), "zgc.das.v1.MsgReportDASResult") - proto.RegisterType((*MsgReportDASResultResponse)(nil), "zgc.das.v1.MsgReportDASResultResponse") -} - -func init() { proto.RegisterFile("zgc/das/v1/tx.proto", fileDescriptor_030259cfeac21931) } - -var fileDescriptor_030259cfeac21931 = []byte{ - // 452 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x4f, 0x6e, 0xd3, 0x40, - 0x14, 0xc6, 0x63, 0x52, 0x41, 0xf2, 0x44, 0x54, 0x31, 0x80, 0xe4, 0x18, 0xe4, 0x86, 0x2c, 0x50, - 0xca, 0x1f, 0x4f, 0x0b, 0x27, 0x20, 0x0a, 0xa2, 0x41, 0xea, 0x66, 0xba, 0x82, 0x8d, 0x35, 0xb6, - 0x87, 0x71, 0x24, 0xdb, 0x63, 0xfc, 0xec, 0xa8, 0xed, 0x29, 0x38, 0x08, 0x0b, 0x8e, 0xd1, 0x65, - 0x97, 0xac, 0x2a, 0x70, 0x6e, 0xc0, 0x09, 0x90, 0xc7, 0x76, 0xd2, 0x50, 0x81, 0xc4, 0x2e, 0xdf, - 0xf7, 0x9b, 0xf9, 0xe6, 0x7b, 0xf1, 0x83, 0xfb, 0xe7, 0xd2, 0xa7, 0x01, 0x47, 0xba, 0x3c, 0xa4, - 0xf9, 0xa9, 0x93, 0x66, 0x2a, 0x57, 0x04, 0xce, 0xa5, 0xef, 0x04, 0x1c, 0x9d, 0xe5, 0xa1, 0x35, - 0xf4, 0x15, 0xc6, 0x0a, 0x5d, 0x4d, 0x68, 0x2d, 0xea, 0x63, 0xd6, 0x03, 0xa9, 0xa4, 0xaa, 0xfd, - 0xea, 0x57, 0xe3, 0x0e, 0xa5, 0x52, 0x32, 0x12, 0x54, 0x2b, 0xaf, 0xf8, 0x44, 0x79, 0x72, 0xd6, - 0x20, 0xf3, 0xda, 0x63, 0x52, 0x24, 0x02, 0x17, 0x4d, 0xd4, 0xf8, 0x9b, 0x01, 0x83, 0x63, 0x94, - 0x4c, 0x7c, 0x2e, 0x04, 0xe6, 0xb3, 0x37, 0x27, 0xe4, 0x39, 0xf4, 0xb3, 0x5a, 0x89, 0xcc, 0x34, - 0x46, 0xc6, 0xa4, 0x3f, 0x1d, 0xfc, 0xba, 0xda, 0xeb, 0xb3, 0xd6, 0x64, 0x1b, 0x4e, 0xf6, 0xa1, - 0x8f, 0x79, 0x26, 0x78, 0xec, 0x2e, 0x02, 0xf3, 0x96, 0x3e, 0x7c, 0xb7, 0xbc, 0xda, 0xeb, 0x9d, - 0x68, 0x73, 0x3e, 0x63, 0xbd, 0x1a, 0xcf, 0x03, 0xf2, 0x0c, 0xee, 0x79, 0x3c, 0xf7, 0x43, 0x37, - 0x14, 0x3c, 0x10, 0x99, 0x1b, 0x72, 0x0c, 0xcd, 0x6e, 0x75, 0x85, 0xed, 0x6a, 0x70, 0xa4, 0xfd, - 0x23, 0x8e, 0x21, 0x79, 0x04, 0xfd, 0xa4, 0x88, 0x5d, 0x2f, 0x52, 0x1e, 0x9a, 0x3b, 0x23, 0x63, - 0x32, 0x60, 0xbd, 0xa4, 0x88, 0xa7, 0x95, 0x1e, 0xbf, 0x85, 0x87, 0x5b, 0x8d, 0x99, 0xc0, 0x54, - 0x25, 0x28, 0xc8, 0x0b, 0x80, 0xa6, 0x59, 0xd5, 0xa6, 0xaa, 0xbe, 0x33, 0x1d, 0x94, 0x9b, 0xea, - 0xf3, 0xd9, 0xba, 0xfa, 0x3c, 0x18, 0x2f, 0x81, 0xe8, 0x98, 0x54, 0x65, 0x4d, 0x4a, 0x11, 0xe5, - 0xff, 0x97, 0x41, 0x4c, 0xb8, 0x83, 0x3c, 0x4e, 0x23, 0x91, 0xd5, 0xc3, 0xb3, 0x56, 0x56, 0x24, - 0xd3, 0x89, 0x68, 0x76, 0x47, 0xdd, 0x49, 0x8f, 0xb5, 0x72, 0xfc, 0x18, 0xac, 0x9b, 0xef, 0xb6, - 0x33, 0xbc, 0xfa, 0x6a, 0x40, 0xf7, 0x18, 0x25, 0x79, 0x0f, 0x70, 0xed, 0x9b, 0x0c, 0x9d, 0xcd, - 0x62, 0x38, 0x5b, 0xc3, 0x5b, 0x4f, 0xfe, 0x8a, 0xd6, 0xff, 0xcb, 0x07, 0xd8, 0xfd, 0x73, 0x4c, - 0xfb, 0xc6, 0xad, 0x2d, 0x6e, 0x3d, 0xfd, 0x37, 0x6f, 0xa3, 0xa7, 0xef, 0x2e, 0x7e, 0xda, 0x9d, - 0x8b, 0xd2, 0x36, 0x2e, 0x4b, 0xdb, 0xf8, 0x51, 0xda, 0xc6, 0x97, 0x95, 0xdd, 0xb9, 0x5c, 0xd9, - 0x9d, 0xef, 0x2b, 0xbb, 0xf3, 0x71, 0x5f, 0x2e, 0xf2, 0xb0, 0xf0, 0x1c, 0x5f, 0xc5, 0xf4, 0x40, - 0x46, 0xdc, 0x43, 0x7a, 0x20, 0x5f, 0xfa, 0x21, 0x5f, 0x24, 0xf4, 0x74, 0xbd, 0xfc, 0x67, 0xa9, - 0x40, 0xef, 0xb6, 0x5e, 0xc7, 0xd7, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xc2, 0xba, 0x08, 0x98, - 0x17, 0x03, 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 { - RequestDAS(ctx context.Context, in *MsgRequestDAS, opts ...grpc.CallOption) (*MsgRequestDASResponse, error) - ReportDASResult(ctx context.Context, in *MsgReportDASResult, opts ...grpc.CallOption) (*MsgReportDASResultResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) RequestDAS(ctx context.Context, in *MsgRequestDAS, opts ...grpc.CallOption) (*MsgRequestDASResponse, error) { - out := new(MsgRequestDASResponse) - err := c.cc.Invoke(ctx, "/zgc.das.v1.Msg/RequestDAS", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) ReportDASResult(ctx context.Context, in *MsgReportDASResult, opts ...grpc.CallOption) (*MsgReportDASResultResponse, error) { - out := new(MsgReportDASResultResponse) - err := c.cc.Invoke(ctx, "/zgc.das.v1.Msg/ReportDASResult", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - RequestDAS(context.Context, *MsgRequestDAS) (*MsgRequestDASResponse, error) - ReportDASResult(context.Context, *MsgReportDASResult) (*MsgReportDASResultResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) RequestDAS(ctx context.Context, req *MsgRequestDAS) (*MsgRequestDASResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RequestDAS not implemented") -} -func (*UnimplementedMsgServer) ReportDASResult(ctx context.Context, req *MsgReportDASResult) (*MsgReportDASResultResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ReportDASResult not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_RequestDAS_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRequestDAS) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RequestDAS(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/zgc.das.v1.Msg/RequestDAS", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RequestDAS(ctx, req.(*MsgRequestDAS)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_ReportDASResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgReportDASResult) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).ReportDASResult(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/zgc.das.v1.Msg/ReportDASResult", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).ReportDASResult(ctx, req.(*MsgReportDASResult)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "zgc.das.v1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RequestDAS", - Handler: _Msg_RequestDAS_Handler, - }, - { - MethodName: "ReportDASResult", - Handler: _Msg_ReportDASResult_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "zgc/das/v1/tx.proto", -} - -func (m *MsgRequestDAS) 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 *MsgRequestDAS) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRequestDAS) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumBlobs != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.NumBlobs)) - i-- - dAtA[i] = 0x20 - } - if len(m.BatchHeaderHash) > 0 { - i -= len(m.BatchHeaderHash) - copy(dAtA[i:], m.BatchHeaderHash) - i = encodeVarintTx(dAtA, i, uint64(len(m.BatchHeaderHash))) - i-- - dAtA[i] = 0x1a - } - if len(m.StreamID) > 0 { - i -= len(m.StreamID) - copy(dAtA[i:], m.StreamID) - i = encodeVarintTx(dAtA, i, uint64(len(m.StreamID))) - i-- - dAtA[i] = 0x12 - } - if len(m.Requester) > 0 { - i -= len(m.Requester) - copy(dAtA[i:], m.Requester) - i = encodeVarintTx(dAtA, i, uint64(len(m.Requester))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRequestDASResponse) 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 *MsgRequestDASResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRequestDASResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.RequestID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.RequestID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgReportDASResult) 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 *MsgReportDASResult) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgReportDASResult) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Results) > 0 { - for iNdEx := len(m.Results) - 1; iNdEx >= 0; iNdEx-- { - i-- - if m.Results[iNdEx] { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - } - i = encodeVarintTx(dAtA, i, uint64(len(m.Results))) - i-- - dAtA[i] = 0x1a - } - if len(m.Sampler) > 0 { - i -= len(m.Sampler) - copy(dAtA[i:], m.Sampler) - i = encodeVarintTx(dAtA, i, uint64(len(m.Sampler))) - i-- - dAtA[i] = 0x12 - } - if m.RequestID != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.RequestID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *MsgReportDASResultResponse) 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 *MsgReportDASResultResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgReportDASResultResponse) 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 *MsgRequestDAS) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Requester) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.StreamID) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.BatchHeaderHash) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.NumBlobs != 0 { - n += 1 + sovTx(uint64(m.NumBlobs)) - } - return n -} - -func (m *MsgRequestDASResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RequestID != 0 { - n += 1 + sovTx(uint64(m.RequestID)) - } - return n -} - -func (m *MsgReportDASResult) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.RequestID != 0 { - n += 1 + sovTx(uint64(m.RequestID)) - } - l = len(m.Sampler) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if len(m.Results) > 0 { - n += 1 + sovTx(uint64(len(m.Results))) + len(m.Results)*1 - } - return n -} - -func (m *MsgReportDASResultResponse) 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 *MsgRequestDAS) 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: MsgRequestDAS: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRequestDAS: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Requester", 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.Requester = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StreamID", 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.StreamID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BatchHeaderHash", 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.BatchHeaderHash = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumBlobs", wireType) - } - m.NumBlobs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumBlobs |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 *MsgRequestDASResponse) 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: MsgRequestDASResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRequestDASResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestID", wireType) - } - m.RequestID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RequestID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 *MsgReportDASResult) 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: MsgReportDASResult: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgReportDASResult: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RequestID", wireType) - } - m.RequestID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RequestID |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sampler", 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.Sampler = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType == 0 { - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Results = append(m.Results, bool(v != 0)) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - elementCount = packedLen - if elementCount != 0 && len(m.Results) == 0 { - m.Results = make([]bool, 0, elementCount) - } - for iNdEx < postIndex { - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Results = append(m.Results, bool(v != 0)) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Results", wireType) - } - 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 *MsgReportDASResultResponse) 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: MsgReportDASResultResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgReportDASResultResponse: 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") -) diff --git a/x/dasigners/v1/client/cli/tx.go b/x/dasigners/v1/client/cli/tx.go index 0bfd045b..a723d87d 100644 --- a/x/dasigners/v1/client/cli/tx.go +++ b/x/dasigners/v1/client/cli/tx.go @@ -3,7 +3,7 @@ package cli import ( "fmt" - "github.com/0glabs/0g-chain/x/das/v1/types" + "github.com/0glabs/0g-chain/x/dasigners/v1/types" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" ) diff --git a/x/dasigners/v1/types/tx.pb.go b/x/dasigners/v1/types/tx.pb.go index 66132018..f4dcf891 100644 --- a/x/dasigners/v1/types/tx.pb.go +++ b/x/dasigners/v1/types/tx.pb.go @@ -6,7 +6,6 @@ package types import ( context "context" fmt "fmt" - _ "github.com/0glabs/0g-chain/x/das/v1/types" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/codec/types" _ "github.com/gogo/protobuf/gogoproto" @@ -265,33 +264,32 @@ func init() { func init() { proto.RegisterFile("zgc/dasigners/v1/tx.proto", fileDescriptor_8bfa0cc0bd2f98e0) } var fileDescriptor_8bfa0cc0bd2f98e0 = []byte{ - // 410 bytes of a gzipped FileDescriptorProto + // 399 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcf, 0xae, 0xd2, 0x40, - 0x18, 0xc5, 0x5b, 0x4c, 0x30, 0x8c, 0x44, 0xa5, 0x21, 0xda, 0x56, 0x32, 0xc1, 0x9a, 0x18, 0x8c, + 0x14, 0x87, 0x5b, 0x4c, 0x30, 0x8c, 0x44, 0xa5, 0x21, 0xda, 0x56, 0x32, 0xc1, 0x9a, 0x18, 0x8c, 0xb1, 0x03, 0xf8, 0x06, 0x1a, 0x97, 0x65, 0x51, 0xe2, 0xc6, 0x98, 0x98, 0x76, 0x18, 0x87, 0x06, 0xe8, 0x34, 0x9d, 0x29, 0x01, 0x9e, 0xc2, 0x87, 0xf1, 0x21, 0x58, 0xb2, 0x74, 0xe9, 0x85, 0x17, - 0xb9, 0x61, 0xfa, 0x07, 0x6e, 0x4b, 0xb8, 0xec, 0xe6, 0x9b, 0xef, 0xd7, 0x73, 0x4e, 0x4f, 0x5a, + 0xb9, 0x61, 0xfa, 0x07, 0x6e, 0x4b, 0xb8, 0xec, 0xe6, 0xcc, 0xf9, 0x7a, 0xbe, 0xd3, 0x5f, 0x5a, 0x60, 0x6c, 0x28, 0x46, 0x13, 0x8f, 0x07, 0x34, 0x24, 0x31, 0x47, 0xcb, 0x01, 0x12, 0x2b, 0x3b, - 0x8a, 0x99, 0x60, 0xda, 0xcb, 0x0d, 0xc5, 0x76, 0xb1, 0xb2, 0x97, 0x03, 0xd3, 0xc0, 0x8c, 0x2f, - 0x18, 0xff, 0x25, 0xf7, 0x28, 0x1d, 0x52, 0xd8, 0x6c, 0x53, 0x46, 0x59, 0x7a, 0x7f, 0x3c, 0x65, - 0xb7, 0x06, 0x65, 0x8c, 0xce, 0x09, 0x92, 0x93, 0x9f, 0xfc, 0x46, 0x5e, 0xb8, 0xce, 0x56, 0x7a, - 0x66, 0x7c, 0xb4, 0xa4, 0x24, 0x24, 0x3c, 0xc8, 0xa5, 0xba, 0x95, 0x48, 0xa7, 0x10, 0x92, 0xb0, - 0x30, 0x68, 0x39, 0x9c, 0xba, 0x84, 0x06, 0x5c, 0x90, 0x78, 0x2c, 0x77, 0x5a, 0x1f, 0xd4, 0x53, - 0x4a, 0x57, 0xbb, 0x6a, 0xef, 0xd9, 0x50, 0xb7, 0xcb, 0xf9, 0xed, 0x94, 0x74, 0x33, 0x4e, 0xeb, - 0x80, 0xc6, 0xf1, 0xe4, 0x89, 0x24, 0x26, 0x7a, 0xad, 0xab, 0xf6, 0x9a, 0xee, 0xe9, 0xc2, 0x7a, - 0x03, 0x8c, 0x8a, 0x89, 0x4b, 0x78, 0xc4, 0x42, 0x4e, 0xac, 0xaf, 0xe0, 0x85, 0xc3, 0xe9, 0xf7, - 0x68, 0xe2, 0x09, 0x32, 0x66, 0x78, 0x46, 0x84, 0xa6, 0x83, 0xa7, 0x1e, 0xc6, 0x2c, 0x09, 0x85, - 0x0c, 0xd0, 0x70, 0xf3, 0x51, 0x7b, 0x05, 0xea, 0x5c, 0x32, 0xd2, 0xa4, 0xe1, 0x66, 0x93, 0x65, - 0x80, 0xd7, 0x25, 0x91, 0x42, 0x7f, 0x04, 0xda, 0x67, 0xe6, 0x23, 0xb2, 0x12, 0xdf, 0x22, 0x86, - 0xa7, 0x57, 0x4c, 0xae, 0xbf, 0x0c, 0x04, 0x9d, 0x4b, 0x7a, 0xb9, 0xdf, 0xf0, 0x6f, 0x0d, 0x3c, - 0x71, 0x38, 0xd5, 0x7c, 0xf0, 0xbc, 0x54, 0xeb, 0xbb, 0x6a, 0x8d, 0x95, 0x5a, 0xcc, 0x8f, 0x37, - 0x40, 0xb9, 0x97, 0xf6, 0x13, 0x34, 0x1f, 0x14, 0xf7, 0xf6, 0xe2, 0xc3, 0xe7, 0x88, 0xf9, 0xe1, - 0x51, 0xa4, 0x50, 0x9f, 0x81, 0x56, 0xb5, 0xb6, 0xf7, 0x57, 0xf3, 0x15, 0x9c, 0x69, 0xdf, 0xc6, - 0xe5, 0x66, 0x5f, 0x9c, 0xed, 0x1d, 0x54, 0xb6, 0x7b, 0xa8, 0xee, 0xf6, 0x50, 0xfd, 0xbf, 0x87, - 0xea, 0x9f, 0x03, 0x54, 0x76, 0x07, 0xa8, 0xfc, 0x3b, 0x40, 0xe5, 0x07, 0xa2, 0x81, 0x98, 0x26, - 0xbe, 0x8d, 0xd9, 0x02, 0xf5, 0xe9, 0xdc, 0xf3, 0x39, 0xea, 0xd3, 0x4f, 0x78, 0xea, 0x05, 0x21, - 0x5a, 0x95, 0x7e, 0xba, 0x75, 0x44, 0xb8, 0x5f, 0x97, 0x9f, 0xf7, 0xe7, 0xfb, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xa3, 0x4c, 0x19, 0x64, 0x95, 0x03, 0x00, 0x00, + 0x8a, 0x99, 0x60, 0xda, 0xcb, 0x0d, 0xc5, 0x76, 0xd1, 0xb2, 0x97, 0x03, 0xd3, 0xc0, 0x8c, 0x2f, + 0x18, 0xff, 0x25, 0xfb, 0x28, 0x2d, 0x52, 0xd8, 0x6c, 0x53, 0x46, 0x59, 0x7a, 0x7f, 0x3c, 0x65, + 0xb7, 0x06, 0x65, 0x8c, 0xce, 0x09, 0x92, 0x95, 0x9f, 0xfc, 0x46, 0x5e, 0xb8, 0xce, 0x5a, 0xdd, + 0x8a, 0xf8, 0xa4, 0x92, 0x84, 0x85, 0x41, 0xcb, 0xe1, 0xd4, 0x25, 0x34, 0xe0, 0x82, 0xc4, 0x63, + 0xd9, 0xd3, 0xfa, 0xa0, 0x9e, 0x52, 0xba, 0xda, 0x55, 0x7b, 0xcf, 0x86, 0xba, 0x5d, 0xde, 0xd2, + 0x4e, 0x49, 0x37, 0xe3, 0xb4, 0x0e, 0x68, 0x1c, 0x4f, 0x9e, 0x48, 0x62, 0xa2, 0xd7, 0xba, 0x6a, + 0xaf, 0xe9, 0x9e, 0x2e, 0xac, 0x37, 0xc0, 0xa8, 0x48, 0x5c, 0xc2, 0x23, 0x16, 0x72, 0x62, 0x7d, + 0x05, 0x2f, 0x1c, 0x4e, 0xbf, 0x47, 0x13, 0x4f, 0x90, 0x31, 0xc3, 0x33, 0x22, 0x34, 0x1d, 0x3c, + 0xf5, 0x30, 0x66, 0x49, 0x28, 0xe4, 0x02, 0x0d, 0x37, 0x2f, 0xb5, 0x57, 0xa0, 0xce, 0x25, 0x23, + 0x25, 0x0d, 0x37, 0xab, 0x2c, 0x03, 0xbc, 0x2e, 0x0d, 0x29, 0xe6, 0x8f, 0x40, 0xfb, 0x4c, 0x3e, + 0x22, 0x2b, 0xf1, 0x2d, 0x62, 0x78, 0x7a, 0x45, 0x72, 0xfd, 0x65, 0x20, 0xe8, 0x5c, 0x9a, 0x97, + 0xfb, 0x86, 0x7f, 0x6b, 0xe0, 0x89, 0xc3, 0xa9, 0xe6, 0x83, 0xe7, 0xa5, 0x58, 0xdf, 0x55, 0x63, + 0xac, 0xc4, 0x62, 0x7e, 0xbc, 0x01, 0xca, 0x5d, 0xda, 0x4f, 0xd0, 0x7c, 0x10, 0xdc, 0xdb, 0x8b, + 0x0f, 0x9f, 0x23, 0xe6, 0x87, 0x47, 0x91, 0x62, 0xfa, 0x0c, 0xb4, 0xaa, 0xb1, 0xbd, 0xbf, 0xba, + 0x5f, 0xc1, 0x99, 0xf6, 0x6d, 0x5c, 0x2e, 0xfb, 0xe2, 0x6c, 0xef, 0xa0, 0xb2, 0xdd, 0x43, 0x75, + 0xb7, 0x87, 0xea, 0xff, 0x3d, 0x54, 0xff, 0x1c, 0xa0, 0xb2, 0x3b, 0x40, 0xe5, 0xdf, 0x01, 0x2a, + 0x3f, 0x10, 0x0d, 0xc4, 0x34, 0xf1, 0x6d, 0xcc, 0x16, 0xa8, 0x4f, 0xe7, 0x9e, 0xcf, 0x51, 0x9f, + 0x7e, 0xc2, 0x53, 0x2f, 0x08, 0xd1, 0xaa, 0xf4, 0x6b, 0xad, 0x23, 0xc2, 0xfd, 0xba, 0xfc, 0xbc, + 0x3f, 0xdf, 0x07, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x5a, 0xce, 0x9a, 0x7b, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used.