From 78b6ccb59ea33e86cd58bc3c7584d874d1d75bde Mon Sep 17 00:00:00 2001 From: TomL94 Date: Mon, 22 Aug 2022 18:30:37 +0300 Subject: [PATCH 1/6] Type switch instead of if elses --- x/compute/client/cli/query.go | 37 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/x/compute/client/cli/query.go b/x/compute/client/cli/query.go index 2ed05189a..1600a3a75 100644 --- a/x/compute/client/cli/query.go +++ b/x/compute/client/cli/query.go @@ -369,26 +369,27 @@ func GetQueryDecryptTxCmd() *cobra.Command { if len(txInputs) != 1 { return fmt.Errorf("can only decrypt txs with 1 input. Got %d", len(txInputs)) } - txInput, ok := txInputs[0].(*types.MsgExecuteContract) - if !ok { - txInput2, ok := txInputs[0].(*types.MsgInstantiateContract) - if !ok { - txInput3, ok := txInputs[0].(*types.MsgStoreCode) - if ok { - txInput3.WASMByteCode = nil - return clientCtx.PrintProto(txInput3) - } - return fmt.Errorf("TX is not a compute transaction") + switch txInput := txInputs[0].(type) { + case *types.MsgExecuteContract: + { + encryptedInput = txInput.Msg + dataOutputHexB64 = result.Data + answer.Type = "execute" } - encryptedInput = txInput2.InitMsg - dataOutputHexB64 = result.Data - answer.Type = "instantiate" - - } else { - encryptedInput = txInput.Msg - dataOutputHexB64 = result.Data - answer.Type = "execute" + case *types.MsgInstantiateContract: + { + encryptedInput = txInput.InitMsg + dataOutputHexB64 = result.Data + answer.Type = "instantiate" + } + case *types.MsgStoreCode: + { + txInput.WASMByteCode = nil + return clientCtx.PrintProto(txInput) + } + default: + return fmt.Errorf("TX is not a compute transaction") } // decrypt input From 0aff497a29b954aa5372745e5981070b1da189f4 Mon Sep 17 00:00:00 2001 From: TomL94 Date: Mon, 22 Aug 2022 18:54:15 +0300 Subject: [PATCH 2/6] parseEncryptedBlob() --- x/compute/client/cli/helpers.go | 15 +++++++++++++++ x/compute/client/cli/query.go | 17 ++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 x/compute/client/cli/helpers.go diff --git a/x/compute/client/cli/helpers.go b/x/compute/client/cli/helpers.go new file mode 100644 index 000000000..850afa5c7 --- /dev/null +++ b/x/compute/client/cli/helpers.go @@ -0,0 +1,15 @@ +package cli + +import "fmt" + +func parseEncryptedBlob(blob []byte) ([]byte, []byte, []byte, error) { + if len(blob) < 64 { + return nil, nil, nil, fmt.Errorf("input must be > 64 bytes. Got %d", len(blob)) + } + + nonce := blob[0:32] + originalTxSenderPubkey := blob[32:64] + ciphertextInput := blob[64:] + + return nonce, originalTxSenderPubkey, ciphertextInput, nil +} diff --git a/x/compute/client/cli/query.go b/x/compute/client/cli/query.go index 1600a3a75..dbf5af3ae 100644 --- a/x/compute/client/cli/query.go +++ b/x/compute/client/cli/query.go @@ -311,8 +311,7 @@ func CmdDecryptText() *cobra.Command { return fmt.Errorf("error while trying to decode the encrypted output data from base64: %w", err) } - nonce := dataCipherBz[0:32] - originalTxSenderPubkey := dataCipherBz[32:64] + nonce, originalTxSenderPubkey, ciphertextInput, err := parseEncryptedBlob(dataCipherBz) wasmCtx := wasmUtils.WASMContext{CLIContext: clientCtx} _, myPubkey, err := wasmCtx.GetTxSenderKeyPair() @@ -324,7 +323,7 @@ func CmdDecryptText() *cobra.Command { return fmt.Errorf("cannot decrypt, not original tx sender") } - dataPlaintextB64Bz, err := wasmCtx.Decrypt(dataCipherBz[64:], nonce) + dataPlaintextB64Bz, err := wasmCtx.Decrypt(ciphertextInput, nonce) if err != nil { return fmt.Errorf("error while trying to decrypt the output data: %w", err) } @@ -392,14 +391,11 @@ func GetQueryDecryptTxCmd() *cobra.Command { return fmt.Errorf("TX is not a compute transaction") } - // decrypt input - if len(encryptedInput) < 64 { - return fmt.Errorf("input must be > 64 bytes. Got %d", len(encryptedInput)) + nonce, originalTxSenderPubkey, ciphertextInput, err := parseEncryptedBlob(encryptedInput) + if err != nil { + return fmt.Errorf("can't parse encrypted blob: %w", err) } - nonce := encryptedInput[0:32] - originalTxSenderPubkey := encryptedInput[32:64] - wasmCtx := wasmUtils.WASMContext{CLIContext: clientCtx} _, myPubkey, err := wasmCtx.GetTxSenderKeyPair() if err != nil { @@ -410,7 +406,6 @@ func GetQueryDecryptTxCmd() *cobra.Command { return fmt.Errorf("cannot decrypt, not original tx sender") } - ciphertextInput := encryptedInput[64:] var plaintextInput []byte if len(ciphertextInput) > 0 { plaintextInput, err = wasmCtx.Decrypt(ciphertextInput, nonce) @@ -591,7 +586,7 @@ func QueryWithData(contractAddress sdk.AccAddress, queryData []byte, cliCtx clie if err != nil { return err } - nonce := queryData[:32] + nonce, _, _, _ := parseEncryptedBlob(queryData) // Ignoring error since we just encrypted it res, _, err := cliCtx.QueryWithData(route, queryData) if err != nil { From 182b27cc9eb8396fdf56683dc8d2a776b138e739 Mon Sep 17 00:00:00 2001 From: TomL94 Date: Wed, 7 Sep 2022 14:36:20 +0300 Subject: [PATCH 3/6] Change proto types to allow multiple messages decryption --- go.sum | 28 ++ proto/secret/compute/v1beta1/query.proto | 93 +++--- x/compute/internal/types/query.pb.go | 403 ++++++++++++++++------- 3 files changed, 372 insertions(+), 152 deletions(-) diff --git a/go.sum b/go.sum index f2560b858..b9ed8e146 100644 --- a/go.sum +++ b/go.sum @@ -25,6 +25,7 @@ cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aD cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= @@ -284,10 +285,12 @@ github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= +github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= +github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fatih/color v1.3.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= @@ -314,6 +317,7 @@ github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU= +github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -450,6 +454,7 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= @@ -487,6 +492,7 @@ github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIv github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= +github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= @@ -553,6 +559,7 @@ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1C github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jhump/protoreflect v1.9.0 h1:npqHz788dryJiR/l6K/RUQAyh2SwV91+d1dnh4RjO9w= +github.com/jhump/protoreflect v1.9.0/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= @@ -603,6 +610,7 @@ github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+ github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.4 h1:SO9z7FRPzA03QhHKJrH5BXA6HU1rS4V2nIVrrNC1iYk= github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.0.2 h1:QNK2iAFa8gjAe1SPz6mHSMuCcjs+X1wlHzeOSqcmlfs= @@ -697,6 +705,7 @@ github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -712,6 +721,7 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -744,6 +754,11 @@ github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= github.com/otiai10/copy v1.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ= +github.com/otiai10/copy v1.6.0/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.2/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= @@ -800,6 +815,7 @@ github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB8 github.com/prometheus/common v0.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= @@ -834,13 +850,16 @@ github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo= github.com/rs/zerolog v1.26.0 h1:ORM4ibhEZeTeQlCojCK2kPz1ogAY4bGs4tD+SaAdGaE= github.com/rs/zerolog v1.26.0/go.mod h1:yBiM87lvSqX8h0Ww4sdzNSkVYZ8dL2xjZJG1lAuGZEo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa h1:0U2s5loxrTy6/VgfVoLuVLFJcURKLH49ie0zSch7gh4= @@ -878,6 +897,7 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= +github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= github.com/spf13/cobra v1.4.0 h1:y+wJpx64xcgO1V+RcnwW0LEHxTKRi2ZDPSBjWnrg88Q= github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -891,6 +911,7 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= @@ -1330,8 +1351,10 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= @@ -1392,6 +1415,7 @@ google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqiv google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1466,8 +1490,11 @@ google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3 h1:q1kiSVscqoDeqTF27eQ2NnLLDmqF0I373qQNXYMy0fo= google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= @@ -1483,6 +1510,7 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= diff --git a/proto/secret/compute/v1beta1/query.proto b/proto/secret/compute/v1beta1/query.proto index 6b0824c78..cfe8f0556 100644 --- a/proto/secret/compute/v1beta1/query.proto +++ b/proto/secret/compute/v1beta1/query.proto @@ -14,40 +14,51 @@ option (gogoproto.equal_all) = true; // Query defines the gRPC querier service service Query { // Query contract info by address - rpc ContractInfo (QueryByContractAddressRequest) returns (QueryContractInfoResponse) { - option (google.api.http).get = "/compute/v1beta1/info/{contract_address}"; + rpc ContractInfo(QueryByContractAddressRequest) + returns (QueryContractInfoResponse) { + option (google.api.http).get = + "/compute/v1beta1/info/{contract_address}"; } // Query code info by id - rpc ContractsByCodeID (QueryByCodeIDRequest) returns (QueryContractsByCodeIDResponse) { + rpc ContractsByCodeID(QueryByCodeIDRequest) + returns (QueryContractsByCodeIDResponse) { option (google.api.http).get = "/compute/v1beta1/contracts/{code_id}"; } // Query secret contract - rpc QuerySecretContract (QuerySecretContractRequest) returns (QuerySecretContractResponse) { - option (google.api.http).get = "/compute/v1beta1/query/{contract_address}"; + rpc QuerySecretContract(QuerySecretContractRequest) + returns (QuerySecretContractResponse) { + option (google.api.http).get = + "/compute/v1beta1/query/{contract_address}"; } // Query a specific contract code by id - rpc Code (QueryByCodeIDRequest) returns (QueryCodeResponse) { + rpc Code(QueryByCodeIDRequest) returns (QueryCodeResponse) { option (google.api.http).get = "/compute/v1beta1/code/{code_id}"; } // Query all contract codes on-chain - rpc Codes (google.protobuf.Empty) returns (QueryCodesResponse) { + rpc Codes(google.protobuf.Empty) returns (QueryCodesResponse) { option (google.api.http).get = "/compute/v1beta1/codes"; } // Query code hash by contract address - rpc CodeHashByContractAddress (QueryByContractAddressRequest) returns (QueryCodeHashResponse) { - option (google.api.http).get = "/compute/v1beta1/code_hash/{contract_address}"; + rpc CodeHashByContractAddress(QueryByContractAddressRequest) + returns (QueryCodeHashResponse) { + option (google.api.http).get = + "/compute/v1beta1/code_hash/{contract_address}"; } // Query code hash by code id - rpc CodeHashByCodeID (QueryByCodeIDRequest) returns (QueryCodeHashResponse) { + rpc CodeHashByCodeID(QueryByCodeIDRequest) returns (QueryCodeHashResponse) { option (google.api.http).get = "/compute/v1beta1/code_hash/{code_id}"; } // Query contract label by address - rpc LabelByAddress(QueryByContractAddressRequest) returns (QueryContractLabelResponse) { - option (google.api.http).get = "/compute/v1beta1/label/{contract_address}"; + rpc LabelByAddress(QueryByContractAddressRequest) + returns (QueryContractLabelResponse) { + option (google.api.http).get = + "/compute/v1beta1/label/{contract_address}"; } // Query contract address by label - rpc AddressByLabel(QueryByLabelRequest) returns (QueryContractAddressResponse) { - option (google.api.http).get = "/compute/v1beta1/contract_address/{label}"; + rpc AddressByLabel(QueryByLabelRequest) + returns (QueryContractAddressResponse) { + option (google.api.http).get = + "/compute/v1beta1/contract_address/{label}"; } } @@ -57,39 +68,38 @@ message QuerySecretContractRequest { bytes query = 2; } -message QueryByLabelRequest { - string label = 1; -} +message QueryByLabelRequest { string label = 1; } message QueryByContractAddressRequest { // address is the bech32 human readable address of the contract string contract_address = 1; } -message QueryByCodeIDRequest { - uint64 code_id = 1; -} +message QueryByCodeIDRequest { uint64 code_id = 1; } -message QuerySecretContractResponse { - bytes data = 1; -} +message QuerySecretContractResponse { bytes data = 1; } -// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method +// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC +// method message QueryContractInfoResponse { // contract_address is the bech32 human readable address of the contract string contract_address = 1; - ContractInfo ContractInfo = 2 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""]; + ContractInfo ContractInfo = 2 + [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; } -// ContractInfoWithAddress adds the contract address to the ContractInfo representation +// ContractInfoWithAddress adds the contract address to the ContractInfo +// representation message ContractInfoWithAddress { // contract_address is the bech32 human readable address of the contract string contract_address = 1; - ContractInfo ContractInfo = 2 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""]; + ContractInfo ContractInfo = 2 + [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; } message QueryContractsByCodeIDResponse { - repeated ContractInfoWithAddress contract_infos = 1 [(gogoproto.nullable) = false]; + repeated ContractInfoWithAddress contract_infos = 1 + [ (gogoproto.nullable) = false ]; } message CodeInfoResponse { @@ -102,12 +112,13 @@ message CodeInfoResponse { } message QueryCodeResponse { - CodeInfoResponse code_info = 1 [(gogoproto.embed) = true, (gogoproto.jsontag) = ""]; + CodeInfoResponse code_info = 1 + [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; bytes wasm = 2; } message QueryCodesResponse { - repeated CodeInfoResponse code_infos = 1 [(gogoproto.nullable) = false]; + repeated CodeInfoResponse code_infos = 1 [ (gogoproto.nullable) = false ]; } message QueryContractAddressResponse { @@ -115,13 +126,9 @@ message QueryContractAddressResponse { string contract_address = 1; } -message QueryContractLabelResponse { - string label = 1; -} +message QueryContractLabelResponse { string label = 1; } -message QueryCodeHashResponse { - string code_hash = 1; -} +message QueryCodeHashResponse { string code_hash = 1; } // DecryptedAnswer is a struct that represents a decrypted tx-query message DecryptedAnswer { @@ -131,7 +138,15 @@ message DecryptedAnswer { string input = 2; string output_data = 3; string output_data_as_string = 4; - repeated cosmos.base.abci.v1beta1.StringEvent output_logs = 5 [(gogoproto.nullable) = false]; - bytes output_error = 6 [(gogoproto.casttype) = "encoding/json.RawMessage"]; - string plaintext_error = 7; +} + +message DecryptedAnswers { + option (gogoproto.equal) = false; + + repeated DecryptedAnswer answers = 1; + repeated cosmos.base.abci.v1beta1.StringEvent output_logs = 2 + [ (gogoproto.nullable) = false ]; + bytes output_error = 3 + [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; + string plaintext_error = 4; } \ No newline at end of file diff --git a/x/compute/internal/types/query.pb.go b/x/compute/internal/types/query.pb.go index c5498bed8..c046ac5ea 100644 --- a/x/compute/internal/types/query.pb.go +++ b/x/compute/internal/types/query.pb.go @@ -221,7 +221,8 @@ func (m *QuerySecretContractResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QuerySecretContractResponse proto.InternalMessageInfo -// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC method +// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC +// method type QueryContractInfoResponse struct { // contract_address is the bech32 human readable address of the contract ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` @@ -261,7 +262,8 @@ func (m *QueryContractInfoResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryContractInfoResponse proto.InternalMessageInfo -// ContractInfoWithAddress adds the contract address to the ContractInfo representation +// ContractInfoWithAddress adds the contract address to the ContractInfo +// representation type ContractInfoWithAddress struct { // contract_address is the bech32 human readable address of the contract ContractAddress string `protobuf:"bytes,1,opt,name=contract_address,json=contractAddress,proto3" json:"contract_address,omitempty"` @@ -569,13 +571,10 @@ var xxx_messageInfo_QueryCodeHashResponse proto.InternalMessageInfo // DecryptedAnswer is a struct that represents a decrypted tx-query type DecryptedAnswer struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Input string `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` - OutputData string `protobuf:"bytes,3,opt,name=output_data,json=outputData,proto3" json:"output_data,omitempty"` - OutputDataAsString string `protobuf:"bytes,4,opt,name=output_data_as_string,json=outputDataAsString,proto3" json:"output_data_as_string,omitempty"` - OutputLogs []types.StringEvent `protobuf:"bytes,5,rep,name=output_logs,json=outputLogs,proto3" json:"output_logs"` - OutputError encoding_json.RawMessage `protobuf:"bytes,6,opt,name=output_error,json=outputError,proto3,casttype=encoding/json.RawMessage" json:"output_error,omitempty"` - PlaintextError string `protobuf:"bytes,7,opt,name=plaintext_error,json=plaintextError,proto3" json:"plaintext_error,omitempty"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Input string `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` + OutputData string `protobuf:"bytes,3,opt,name=output_data,json=outputData,proto3" json:"output_data,omitempty"` + OutputDataAsString string `protobuf:"bytes,4,opt,name=output_data_as_string,json=outputDataAsString,proto3" json:"output_data_as_string,omitempty"` } func (m *DecryptedAnswer) Reset() { *m = DecryptedAnswer{} } @@ -611,6 +610,46 @@ func (m *DecryptedAnswer) XXX_DiscardUnknown() { var xxx_messageInfo_DecryptedAnswer proto.InternalMessageInfo +type DecryptedAnswers struct { + Answers []*DecryptedAnswer `protobuf:"bytes,1,rep,name=answers,proto3" json:"answers,omitempty"` + OutputLogs []types.StringEvent `protobuf:"bytes,2,rep,name=output_logs,json=outputLogs,proto3" json:"output_logs"` + OutputError encoding_json.RawMessage `protobuf:"bytes,3,opt,name=output_error,json=outputError,proto3,casttype=encoding/json.RawMessage" json:"output_error,omitempty"` + PlaintextError string `protobuf:"bytes,4,opt,name=plaintext_error,json=plaintextError,proto3" json:"plaintext_error,omitempty"` +} + +func (m *DecryptedAnswers) Reset() { *m = DecryptedAnswers{} } +func (m *DecryptedAnswers) String() string { return proto.CompactTextString(m) } +func (*DecryptedAnswers) ProtoMessage() {} +func (*DecryptedAnswers) Descriptor() ([]byte, []int) { + return fileDescriptor_7735281c5fa969d4, []int{15} +} +func (m *DecryptedAnswers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DecryptedAnswers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DecryptedAnswers.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 *DecryptedAnswers) XXX_Merge(src proto.Message) { + xxx_messageInfo_DecryptedAnswers.Merge(m, src) +} +func (m *DecryptedAnswers) XXX_Size() int { + return m.Size() +} +func (m *DecryptedAnswers) XXX_DiscardUnknown() { + xxx_messageInfo_DecryptedAnswers.DiscardUnknown(m) +} + +var xxx_messageInfo_DecryptedAnswers proto.InternalMessageInfo + func init() { proto.RegisterType((*QuerySecretContractRequest)(nil), "secret.compute.v1beta1.QuerySecretContractRequest") proto.RegisterType((*QueryByLabelRequest)(nil), "secret.compute.v1beta1.QueryByLabelRequest") @@ -627,6 +666,7 @@ func init() { proto.RegisterType((*QueryContractLabelResponse)(nil), "secret.compute.v1beta1.QueryContractLabelResponse") proto.RegisterType((*QueryCodeHashResponse)(nil), "secret.compute.v1beta1.QueryCodeHashResponse") proto.RegisterType((*DecryptedAnswer)(nil), "secret.compute.v1beta1.DecryptedAnswer") + proto.RegisterType((*DecryptedAnswers)(nil), "secret.compute.v1beta1.DecryptedAnswers") } func init() { @@ -634,79 +674,80 @@ func init() { } var fileDescriptor_7735281c5fa969d4 = []byte{ - // 1146 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0xdc, 0xc4, - 0x17, 0x5f, 0xa7, 0xbb, 0x49, 0x33, 0xc9, 0x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0xa8, - 0x65, 0x7b, 0x69, 0x00, 0x2e, 0xc4, 0x4a, 0xfa, 0x43, 0x50, 0x7d, 0x87, 0x1f, 0xe0, 0x81, 0x80, - 0x72, 0x8f, 0xf8, 0x2c, 0x44, 0x36, 0xb3, 0xf0, 0xe3, 0x08, 0x53, 0x06, 0x17, 0xc1, 0x05, 0x5b, - 0x2e, 0x6d, 0x20, 0xc7, 0x09, 0x31, 0xa5, 0xaa, 0x72, 0x55, 0x59, 0x18, 0xb7, 0xa6, 0x93, 0xf5, - 0xe5, 0x78, 0x19, 0xce, 0x80, 0x8a, 0xc8, 0x84, 0x3a, 0x72, 0x55, 0x59, 0x98, 0xb4, 0x62, 0x41, - 0x5f, 0x02, 0xff, 0x17, 0xee, 0x9b, 0xbb, 0xeb, 0xa8, 0x85, 0xdb, 0x89, 0xdf, 0x19, 0x50, 0x69, - 0x73, 0x59, 0x3a, 0x8b, 0x05, 0xfd, 0x4d, 0xf0, 0x9c, 0x54, 0xbe, 0x97, 0x77, 0x3e, 0x3c, 0x1c, - 0xdd, 0x04, 0x33, 0xa9, 0x2f, 0x07, 0xaf, 0xad, 0x24, 0x2e, 0x2e, 0x83, 0x31, 0x9b, 0x38, 0x78, - 0xc3, 0x73, 0x84, 0x65, 0xd9, 0x1a, 0xe5, 0xe2, 0x9a, 0xa3, 0xd7, 0xc1, 0x5c, 0x61, 0x22, 0x68, - 0x40, 0x7c, 0x8a, 0x21, 0x04, 0x65, 0x07, 0x31, 0x24, 0x8c, 0x26, 0x2d, 0xf1, 0xad, 0x7f, 0xa1, - 0x80, 0x2b, 0xc2, 0x26, 0xd1, 0x5e, 0xf3, 0x37, 0x49, 0x6a, 0x31, 0x44, 0xee, 0x2c, 0x30, 0x99, - 0x75, 0x21, 0x52, 0x38, 0xd1, 0xb8, 0x66, 0x14, 0x77, 0x93, 0x91, 0xd5, 0x6d, 0x9e, 0x3f, 0x38, - 0xac, 0x29, 0x7f, 0x1d, 0xd6, 0x4a, 0x56, 0xce,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 0x11, 0xfa, 0xa8, 0x1d, 0xff, 0xf5, 0xb4, 0x46, 0xc5, 0x7d, 0xbb, 0xfd, 0x4f, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xc2, 0xfa, 0x11, 0x81, 0x6e, 0x0d, 0x00, 0x00, + // 1167 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0x5e, 0xa7, 0x9b, 0xa6, 0x79, 0x09, 0x49, 0x3a, 0xa4, 0xe9, 0x76, 0x13, 0x76, 0x8b, 0x29, + 0x24, 0x69, 0x5a, 0x9b, 0xdd, 0xb6, 0x1c, 0xe0, 0x80, 0xb2, 0x4d, 0x24, 0x82, 0x52, 0x10, 0xee, + 0x01, 0x09, 0x51, 0x45, 0xb3, 0xf6, 0xc4, 0x31, 0xdd, 0xf5, 0xb8, 0x9e, 0xd9, 0x26, 0x51, 0x15, + 0x0e, 0x9c, 0x38, 0x22, 0x15, 0x24, 0x84, 0x84, 0xc4, 0x09, 0x10, 0x07, 0x24, 0x6e, 0xdc, 0xb8, + 0xe6, 0x18, 0x89, 0x0b, 0xa7, 0x08, 0x12, 0x0e, 0x88, 0x3f, 0x81, 0x13, 0x9a, 0xf1, 0xd8, 0xb1, + 0x13, 0x67, 0xb3, 0x5b, 0x0e, 0xdc, 0xfc, 0x66, 0xde, 0x8f, 0x6f, 0xbe, 0x37, 0xef, 0xbd, 0x31, + 0xe8, 0x8c, 0xd8, 0x21, 0xe1, 0xa6, 0x4d, 0xdb, 0x41, 0x87, 0x13, 0xf3, 0x71, 0xad, 0x49, 0x38, + 0xae, 0x99, 0x8f, 0x3a, 0x24, 0xdc, 0x36, 0x82, 0x90, 0x72, 0x8a, 0xa6, 0x22, 0x1d, 0x43, 0xe9, + 0x18, 0x4a, 0xa7, 0x3c, 0xe9, 0x52, 0x97, 0x4a, 0x15, 0x53, 0x7c, 0x45, 0xda, 0xe5, 0xd3, 0x3c, + 0xf2, 0xed, 0x80, 0x30, 0xa5, 0x33, 0xed, 0x52, 0xea, 0xb6, 0x88, 0x29, 0xa5, 0x66, 0x67, 0xdd, + 0x24, 0xed, 0x80, 0xab, 0x70, 0xe5, 0x19, 0xb5, 0x89, 0x03, 0xcf, 0xc4, 0xbe, 0x4f, 0x39, 0xe6, + 0x1e, 0xf5, 0x63, 0xd3, 0x97, 0x6c, 0xca, 0xda, 0x94, 0x99, 0x4d, 0xcc, 0x88, 0x89, 0x9b, 0xb6, + 0x97, 0x04, 0x10, 0x42, 0xa4, 0xa4, 0x3f, 0x80, 0xf2, 0x7b, 0xe2, 0x00, 0xf7, 0x25, 0x94, 0xbb, + 0xd4, 0xe7, 0x21, 0xb6, 0xb9, 0x45, 0x1e, 0x75, 0x08, 0xe3, 0x68, 0x1e, 0x26, 0x6c, 0xb5, 0xb4, + 0x86, 0x1d, 0x27, 0x24, 0x8c, 0x95, 0xb4, 0xab, 0xda, 0xdc, 0xb0, 0x35, 0x1e, 0xaf, 0x2f, 0x46, + 0xcb, 0x68, 0x12, 0x06, 0x25, 0x13, 0xa5, 0x81, 0xab, 0xda, 0xdc, 0xa8, 0x15, 0x09, 0xfa, 0x02, + 0x3c, 0x2f, 0xdd, 0x37, 0xb6, 0x57, 0x71, 0x93, 0xb4, 0x62, 0xbf, 0x93, 0x30, 0xd8, 0x12, 0xb2, + 0x72, 0x16, 0x09, 0xfa, 0xdb, 0xf0, 0x82, 0x52, 0xbe, 0x9b, 0x75, 0xde, 0x3f, 0x1c, 0xdd, 0x84, + 0xc9, 0xc4, 0x97, 0x43, 0x56, 0x96, 0x62, 0x17, 0x97, 0x61, 0xc8, 0xa6, 0x0e, 0x59, 0xf3, 0x1c, + 0x69, 0x59, 0xb4, 0xce, 0x0b, 0x71, 0xc5, 0xd1, 0x6b, 0x30, 0x9d, 0x4b, 0x04, 0x0b, 0xa8, 0xcf, + 0x08, 0x42, 0x50, 0x74, 0x30, 0xc7, 0xd2, 0x68, 0xd4, 0x92, 0xdf, 0xfa, 0x57, 0x1a, 0x5c, 0x91, + 0x36, 0xb1, 0xf6, 0x8a, 0xbf, 0x4e, 0x13, 0x8b, 0x3e, 0xb8, 0xb3, 0x60, 0x34, 0xed, 0x42, 0x52, + 0x38, 0x52, 0xbf, 0x66, 0xe4, 0xdf, 0x26, 0x23, 0xad, 0xdb, 0xb8, 0xb0, 0xb7, 0x5f, 0xd5, 0xfe, + 0xde, 0xaf, 0x16, 0xac, 0x8c, 0x0f, 0xfd, 0x4b, 0x0d, 0x2e, 0xa7, 0x17, 0xde, 0xf7, 0xf8, 0x46, + 0x1c, 0xef, 0x7f, 0x86, 0xf6, 0x31, 0x54, 0x32, 0xb4, 0xb1, 0xa3, 0x24, 0x29, 0xee, 0x3e, 0x84, + 0xb1, 0x04, 0xa0, 0xe7, 0xaf, 0x53, 0x01, 0xef, 0xdc, 0xdc, 0x48, 0xdd, 0xec, 0x25, 0x6e, 0xea, + 0xa4, 0x8d, 0xe2, 0xae, 0x08, 0xff, 0x9c, 0x9d, 0xda, 0x66, 0xfa, 0xe7, 0x1a, 0x4c, 0xc8, 0x80, + 0xe9, 0x74, 0x9d, 0x76, 0x31, 0x50, 0x09, 0x86, 0xec, 0x90, 0x60, 0x4e, 0x43, 0x79, 0xf8, 0x61, + 0x2b, 0x16, 0xd1, 0x34, 0x0c, 0x4b, 0x93, 0x0d, 0xcc, 0x36, 0x4a, 0xe7, 0xe4, 0xde, 0x05, 0xb1, + 0xf0, 0x16, 0x66, 0x1b, 0x68, 0x0a, 0xce, 0x33, 0xda, 0x09, 0x6d, 0x52, 0x2a, 0xca, 0x1d, 0x25, + 0x09, 0x77, 0xcd, 0x8e, 0xd7, 0x72, 0x48, 0x58, 0x1a, 0x8c, 0xdc, 0x29, 0x51, 0xdf, 0x82, 0x8b, + 0x8a, 0x16, 0x87, 0x24, 0xb0, 0xde, 0x55, 0x31, 0x04, 0x0b, 0x12, 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 0x89, 0xde, 0x05, 0xe8, 0x71, + 0x84, 0xe6, 0x13, 0x09, 0x7d, 0xa7, 0xf1, 0x60, 0xf7, 0x8f, 0x4a, 0xe1, 0xfb, 0x83, 0x8a, 0xb6, + 0x7b, 0x50, 0xd1, 0xf6, 0x0e, 0x2a, 0xda, 0xef, 0x07, 0x15, 0xed, 0xb3, 0xc3, 0x4a, 0x61, 0xef, + 0xb0, 0x52, 0xf8, 0xed, 0xb0, 0x52, 0xf8, 0xe0, 0x0d, 0xd7, 0xe3, 0x1b, 0x9d, 0xa6, 0x40, 0x62, + 0x12, 0xdf, 0x73, 0xdb, 0xb8, 0x1d, 0xd8, 0x66, 0xd4, 0x2e, 0xde, 0x21, 0x7c, 0x93, 0x86, 0x0f, + 0xcd, 0xad, 0x24, 0xa0, 0x98, 0x11, 0xa1, 0x8f, 0x5b, 0xd1, 0x3f, 0x55, 0xf3, 0xbc, 0xac, 0xb7, + 0x5b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xcb, 0xbc, 0x96, 0xcc, 0x0d, 0x00, 0x00, } func (this *QuerySecretContractRequest) Equal(that interface{}) bool { @@ -1987,34 +2028,6 @@ func (m *DecryptedAnswer) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.PlaintextError) > 0 { - i -= len(m.PlaintextError) - copy(dAtA[i:], m.PlaintextError) - i = encodeVarintQuery(dAtA, i, uint64(len(m.PlaintextError))) - i-- - dAtA[i] = 0x3a - } - if len(m.OutputError) > 0 { - i -= len(m.OutputError) - copy(dAtA[i:], m.OutputError) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OutputError))) - i-- - dAtA[i] = 0x32 - } - if len(m.OutputLogs) > 0 { - for iNdEx := len(m.OutputLogs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.OutputLogs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } if len(m.OutputDataAsString) > 0 { i -= len(m.OutputDataAsString) copy(dAtA[i:], m.OutputDataAsString) @@ -2046,6 +2059,71 @@ func (m *DecryptedAnswer) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DecryptedAnswers) 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 *DecryptedAnswers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DecryptedAnswers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PlaintextError) > 0 { + i -= len(m.PlaintextError) + copy(dAtA[i:], m.PlaintextError) + i = encodeVarintQuery(dAtA, i, uint64(len(m.PlaintextError))) + i-- + dAtA[i] = 0x22 + } + if len(m.OutputError) > 0 { + i -= len(m.OutputError) + copy(dAtA[i:], m.OutputError) + i = encodeVarintQuery(dAtA, i, uint64(len(m.OutputError))) + i-- + dAtA[i] = 0x1a + } + if len(m.OutputLogs) > 0 { + for iNdEx := len(m.OutputLogs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OutputLogs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Answers) > 0 { + for iNdEx := len(m.Answers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Answers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2295,6 +2373,21 @@ func (m *DecryptedAnswer) Size() (n int) { if l > 0 { n += 1 + l + sovQuery(uint64(l)) } + return n +} + +func (m *DecryptedAnswers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Answers) > 0 { + for _, e := range m.Answers { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } if len(m.OutputLogs) > 0 { for _, e := range m.OutputLogs { l = e.Size() @@ -3875,7 +3968,91 @@ func (m *DecryptedAnswer) Unmarshal(dAtA []byte) error { } m.OutputDataAsString = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + 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 *DecryptedAnswers) 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: DecryptedAnswers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DecryptedAnswers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Answers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Answers = append(m.Answers, &DecryptedAnswer{}) + if err := m.Answers[len(m.Answers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field OutputLogs", wireType) } @@ -3909,7 +4086,7 @@ func (m *DecryptedAnswer) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field OutputError", wireType) } @@ -3943,7 +4120,7 @@ func (m *DecryptedAnswer) Unmarshal(dAtA []byte) error { m.OutputError = []byte{} } iNdEx = postIndex - case 7: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field PlaintextError", wireType) } From 373991f33fd83ad467ae82411f87cb3cb3cf4d7e Mon Sep 17 00:00:00 2001 From: TomL94 Date: Tue, 23 Aug 2022 00:30:56 +0300 Subject: [PATCH 4/6] multiple messages decryption --- x/compute/client/cli/query.go | 160 ++++++++++++++++++---------------- 1 file changed, 85 insertions(+), 75 deletions(-) diff --git a/x/compute/client/cli/query.go b/x/compute/client/cli/query.go index dbf5af3ae..11b2237d9 100644 --- a/x/compute/client/cli/query.go +++ b/x/compute/client/cli/query.go @@ -359,65 +359,64 @@ func GetQueryDecryptTxCmd() *cobra.Command { return fmt.Errorf("no transaction found with hash %s", args[0]) } - var answer types.DecryptedAnswer - var encryptedInput []byte - var dataOutputHexB64 string - txInputs := result.GetTx().GetMsgs() - if len(txInputs) != 1 { - return fmt.Errorf("can only decrypt txs with 1 input. Got %d", len(txInputs)) - } - - switch txInput := txInputs[0].(type) { - case *types.MsgExecuteContract: - { - encryptedInput = txInput.Msg - dataOutputHexB64 = result.Data - answer.Type = "execute" - } - case *types.MsgInstantiateContract: - { - encryptedInput = txInput.InitMsg - dataOutputHexB64 = result.Data - answer.Type = "instantiate" - } - case *types.MsgStoreCode: - { - txInput.WASMByteCode = nil - return clientCtx.PrintProto(txInput) - } - default: - return fmt.Errorf("TX is not a compute transaction") - } - - nonce, originalTxSenderPubkey, ciphertextInput, err := parseEncryptedBlob(encryptedInput) - if err != nil { - return fmt.Errorf("can't parse encrypted blob: %w", err) - } - wasmCtx := wasmUtils.WASMContext{CLIContext: clientCtx} _, myPubkey, err := wasmCtx.GetTxSenderKeyPair() if err != nil { return fmt.Errorf("error in GetTxSenderKeyPair: %w", err) } - if !bytes.Equal(originalTxSenderPubkey, myPubkey) { - return fmt.Errorf("cannot decrypt, not original tx sender") + answers := types.DecryptedAnswers{ + Answers: make([]*types.DecryptedAnswer, len(txInputs)), + OutputLogs: []sdk.StringEvent{}, + OutputError: []byte{}, + PlaintextError: "", } + nonces := make([][]byte, len(txInputs)) - var plaintextInput []byte - if len(ciphertextInput) > 0 { - plaintextInput, err = wasmCtx.Decrypt(ciphertextInput, nonce) - if err != nil { - return fmt.Errorf("error while trying to decrypt the tx input: %w", err) + for i, tx := range txInputs { + var encryptedInput []byte + answers.Answers[i] = &types.DecryptedAnswer{} + + switch txInput := tx.(type) { + case *types.MsgExecuteContract: + { + encryptedInput = txInput.Msg + answers.Answers[i].Type = "execute" + } + case *types.MsgInstantiateContract: + { + encryptedInput = txInput.InitMsg + answers.Answers[i].Type = "instantiate" + } } - } - answer.Input = string(plaintextInput) + if encryptedInput != nil { + nonce, originalTxSenderPubkey, ciphertextInput, err := parseEncryptedBlob(encryptedInput) + if err != nil { + return fmt.Errorf("can't parse encrypted blob: %w", err) + } + + if !bytes.Equal(originalTxSenderPubkey, myPubkey) { + return fmt.Errorf("cannot decrypt, not original tx sender") + } + + var plaintextInput []byte + if len(ciphertextInput) > 0 { + plaintextInput, err = wasmCtx.Decrypt(ciphertextInput, nonce) + if err != nil { + return fmt.Errorf("error while trying to decrypt the tx input: %w", err) + } + } + + answers.Answers[i].Input = string(plaintextInput) + nonces[i] = nonce + } + } - // decrypt data - if answer.Type == "execute" { + dataOutputHexB64 := result.Data + if dataOutputHexB64 != "" { dataOutputAsProtobuf, err := hex.DecodeString(dataOutputHexB64) if err != nil { return fmt.Errorf("error while trying to decode the encrypted output data from hex string: %w", err) @@ -429,29 +428,27 @@ func GetQueryDecryptTxCmd() *cobra.Command { return fmt.Errorf("error while trying to parse data as protobuf: %w: %s", err, dataOutputHexB64) } - if len(txData.Data) > 1 { - println("WARN: more than one response in tx data. only deciphering the first.") - } + for i, data := range txData.Data { + if len(data.Data) != 0 { + dataPlaintextB64Bz, err := wasmCtx.Decrypt(data.Data, nonces[i]) + if err != nil { + continue + } + dataPlaintextB64 := string(dataPlaintextB64Bz) + answers.Answers[i].OutputData = dataPlaintextB64 - if len(txData.Data) > 0 { - dataPlaintextB64Bz, err := wasmCtx.Decrypt(txData.Data[0].Data, nonce) - if err != nil { - return fmt.Errorf("error while trying to decrypt the output data: %w", err) - } - dataPlaintextB64 := string(dataPlaintextB64Bz) - answer.OutputData = dataPlaintextB64 + dataPlaintext, err := base64.StdEncoding.DecodeString(dataPlaintextB64) + if err != nil { + continue + } - dataPlaintext, err := base64.StdEncoding.DecodeString(dataPlaintextB64) - if err != nil { - return fmt.Errorf("error while trying to decode the decrypted output data from base64 '%s': %w", dataPlaintextB64, err) + answers.Answers[i].OutputDataAsString = string(dataPlaintext) } - - answer.OutputDataAsString = string(dataPlaintext) } } // decrypt logs - answer.OutputLogs = []sdk.StringEvent{} + answers.OutputLogs = []sdk.StringEvent{} for _, l := range result.Logs { for _, e := range l.Events { if e.Type == "wasm" { @@ -461,11 +458,17 @@ func GetQueryDecryptTxCmd() *cobra.Command { if a.Key != "" { // Try to decrypt the log key. If it doesn't look encrypted, leave it as-is keyCiphertext, err := base64.StdEncoding.DecodeString(a.Key) - if err == nil { + if err != nil { + continue + } + + for _, nonce := range nonces { keyPlaintext, err := wasmCtx.Decrypt(keyCiphertext, nonce) - if err == nil { - a.Key = string(keyPlaintext) + if err != nil { + continue } + a.Key = string(keyPlaintext) + break } } @@ -473,34 +476,41 @@ func GetQueryDecryptTxCmd() *cobra.Command { if a.Value != "" { // Try to decrypt the log value. If it doesn't look encrypted, leave it as-is valueCiphertext, err := base64.StdEncoding.DecodeString(a.Value) - if err == nil { + if err != nil { + continue + } + for _, nonce := range nonces { valuePlaintext, err := wasmCtx.Decrypt(valueCiphertext, nonce) if err == nil { - a.Value = string(valuePlaintext) + continue } + a.Value = string(valuePlaintext) + break } } e.Attributes[i] = a } } - answer.OutputLogs = append(answer.OutputLogs, e) + answers.OutputLogs = append(answers.OutputLogs, e) } } } if types.IsEncryptedErrorCode(result.Code) && types.ContainsEncryptedString(result.RawLog) { - stdErr, err := wasmCtx.DecryptError(result.RawLog, answer.Type, nonce) - if err != nil { - return err + for i, nonce := range nonces { + stdErr, err := wasmCtx.DecryptError(result.RawLog, answers.Answers[i].Type, nonce) + if err != nil { + continue + } + answers.OutputError = append(json.RawMessage(fmt.Sprintf("message inedx %d: ", i)), stdErr...) + break } - - answer.OutputError = stdErr } else if types.ContainsEnclaveError(result.RawLog) { - answer.PlaintextError = result.RawLog + answers.PlaintextError = result.RawLog } - return clientCtx.PrintObjectLegacy(&answer) + return clientCtx.PrintObjectLegacy(&answers) }, } From 4d27ddf77ec7686d476a6e302aa8a80910a5f6c6 Mon Sep 17 00:00:00 2001 From: TomL94 Date: Wed, 7 Sep 2022 14:39:19 +0300 Subject: [PATCH 5/6] Change OutputError to be a string --- proto/secret/compute/v1beta1/query.proto | 3 +- x/compute/internal/types/query.pb.go | 170 +++++++++++------------ 2 files changed, 84 insertions(+), 89 deletions(-) diff --git a/proto/secret/compute/v1beta1/query.proto b/proto/secret/compute/v1beta1/query.proto index cfe8f0556..a04527eee 100644 --- a/proto/secret/compute/v1beta1/query.proto +++ b/proto/secret/compute/v1beta1/query.proto @@ -146,7 +146,6 @@ message DecryptedAnswers { repeated DecryptedAnswer answers = 1; repeated cosmos.base.abci.v1beta1.StringEvent output_logs = 2 [ (gogoproto.nullable) = false ]; - bytes output_error = 3 - [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; + string output_error = 3; string plaintext_error = 4; } \ No newline at end of file diff --git a/x/compute/internal/types/query.pb.go b/x/compute/internal/types/query.pb.go index c046ac5ea..c8f461d33 100644 --- a/x/compute/internal/types/query.pb.go +++ b/x/compute/internal/types/query.pb.go @@ -6,7 +6,6 @@ package types import ( bytes "bytes" context "context" - encoding_json "encoding/json" fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" @@ -611,10 +610,10 @@ func (m *DecryptedAnswer) XXX_DiscardUnknown() { var xxx_messageInfo_DecryptedAnswer proto.InternalMessageInfo type DecryptedAnswers struct { - Answers []*DecryptedAnswer `protobuf:"bytes,1,rep,name=answers,proto3" json:"answers,omitempty"` - OutputLogs []types.StringEvent `protobuf:"bytes,2,rep,name=output_logs,json=outputLogs,proto3" json:"output_logs"` - OutputError encoding_json.RawMessage `protobuf:"bytes,3,opt,name=output_error,json=outputError,proto3,casttype=encoding/json.RawMessage" json:"output_error,omitempty"` - PlaintextError string `protobuf:"bytes,4,opt,name=plaintext_error,json=plaintextError,proto3" json:"plaintext_error,omitempty"` + Answers []*DecryptedAnswer `protobuf:"bytes,1,rep,name=answers,proto3" json:"answers,omitempty"` + OutputLogs []types.StringEvent `protobuf:"bytes,2,rep,name=output_logs,json=outputLogs,proto3" json:"output_logs"` + OutputError string `protobuf:"bytes,3,opt,name=output_error,json=outputError,proto3" json:"output_error,omitempty"` + PlaintextError string `protobuf:"bytes,4,opt,name=plaintext_error,json=plaintextError,proto3" json:"plaintext_error,omitempty"` } func (m *DecryptedAnswers) Reset() { *m = DecryptedAnswers{} } @@ -674,80 +673,79 @@ func init() { } var fileDescriptor_7735281c5fa969d4 = []byte{ - // 1167 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0x5e, 0xa7, 0x9b, 0xa6, 0x79, 0x09, 0x49, 0x3a, 0xa4, 0xe9, 0x76, 0x13, 0x76, 0x8b, 0x29, - 0x24, 0x69, 0x5a, 0x9b, 0xdd, 0xb6, 0x1c, 0xe0, 0x80, 0xb2, 0x4d, 0x24, 0x82, 0x52, 0x10, 0xee, - 0x01, 0x09, 0x51, 0x45, 0xb3, 0xf6, 0xc4, 0x31, 0xdd, 0xf5, 0xb8, 0x9e, 0xd9, 0x26, 0x51, 0x15, - 0x0e, 0x9c, 0x38, 0x22, 0x15, 0x24, 0x84, 0x84, 0xc4, 0x09, 0x10, 0x07, 0x24, 0x6e, 0xdc, 0xb8, - 0xe6, 0x18, 0x89, 0x0b, 0xa7, 0x08, 0x12, 0x0e, 0x88, 0x3f, 0x81, 0x13, 0x9a, 0xf1, 0xd8, 0xb1, - 0x13, 0x67, 0xb3, 0x5b, 0x0e, 0xdc, 0xfc, 0x66, 0xde, 0x8f, 0x6f, 0xbe, 0x37, 0xef, 0xbd, 0x31, - 0xe8, 0x8c, 0xd8, 0x21, 0xe1, 0xa6, 0x4d, 0xdb, 0x41, 0x87, 0x13, 0xf3, 0x71, 0xad, 0x49, 0x38, - 0xae, 0x99, 0x8f, 0x3a, 0x24, 0xdc, 0x36, 0x82, 0x90, 0x72, 0x8a, 0xa6, 0x22, 0x1d, 0x43, 0xe9, - 0x18, 0x4a, 0xa7, 0x3c, 0xe9, 0x52, 0x97, 0x4a, 0x15, 0x53, 0x7c, 0x45, 0xda, 0xe5, 0xd3, 0x3c, - 0xf2, 0xed, 0x80, 0x30, 0xa5, 0x33, 0xed, 0x52, 0xea, 0xb6, 0x88, 0x29, 0xa5, 0x66, 0x67, 0xdd, - 0x24, 0xed, 0x80, 0xab, 0x70, 0xe5, 0x19, 0xb5, 0x89, 0x03, 0xcf, 0xc4, 0xbe, 0x4f, 0x39, 0xe6, - 0x1e, 0xf5, 0x63, 0xd3, 0x97, 0x6c, 0xca, 0xda, 0x94, 0x99, 0x4d, 0xcc, 0x88, 0x89, 0x9b, 0xb6, - 0x97, 0x04, 0x10, 0x42, 0xa4, 0xa4, 0x3f, 0x80, 0xf2, 0x7b, 0xe2, 0x00, 0xf7, 0x25, 0x94, 0xbb, - 0xd4, 0xe7, 0x21, 0xb6, 0xb9, 0x45, 0x1e, 0x75, 0x08, 0xe3, 0x68, 0x1e, 0x26, 0x6c, 0xb5, 0xb4, - 0x86, 0x1d, 0x27, 0x24, 0x8c, 0x95, 0xb4, 0xab, 0xda, 0xdc, 0xb0, 0x35, 0x1e, 0xaf, 0x2f, 0x46, - 0xcb, 0x68, 0x12, 0x06, 0x25, 0x13, 0xa5, 0x81, 0xab, 0xda, 0xdc, 0xa8, 0x15, 0x09, 0xfa, 0x02, - 0x3c, 0x2f, 0xdd, 0x37, 0xb6, 0x57, 0x71, 0x93, 0xb4, 0x62, 0xbf, 0x93, 0x30, 0xd8, 0x12, 0xb2, - 0x72, 0x16, 0x09, 0xfa, 0xdb, 0xf0, 0x82, 0x52, 0xbe, 0x9b, 0x75, 0xde, 0x3f, 0x1c, 0xdd, 0x84, - 0xc9, 0xc4, 0x97, 0x43, 0x56, 0x96, 0x62, 0x17, 0x97, 0x61, 0xc8, 0xa6, 0x0e, 0x59, 0xf3, 0x1c, - 0x69, 0x59, 0xb4, 0xce, 0x0b, 0x71, 0xc5, 0xd1, 0x6b, 0x30, 0x9d, 0x4b, 0x04, 0x0b, 0xa8, 0xcf, - 0x08, 0x42, 0x50, 0x74, 0x30, 0xc7, 0xd2, 0x68, 0xd4, 0x92, 0xdf, 0xfa, 0x57, 0x1a, 0x5c, 0x91, - 0x36, 0xb1, 0xf6, 0x8a, 0xbf, 0x4e, 0x13, 0x8b, 0x3e, 0xb8, 0xb3, 0x60, 0x34, 0xed, 0x42, 0x52, - 0x38, 0x52, 0xbf, 0x66, 0xe4, 0xdf, 0x26, 0x23, 0xad, 0xdb, 0xb8, 0xb0, 0xb7, 0x5f, 0xd5, 0xfe, - 0xde, 0xaf, 0x16, 0xac, 0x8c, 0x0f, 0xfd, 0x4b, 0x0d, 0x2e, 0xa7, 0x17, 0xde, 0xf7, 0xf8, 0x46, - 0x1c, 0xef, 0x7f, 0x86, 0xf6, 0x31, 0x54, 0x32, 0xb4, 0xb1, 0xa3, 0x24, 0x29, 0xee, 0x3e, 0x84, - 0xb1, 0x04, 0xa0, 0xe7, 0xaf, 0x53, 0x01, 0xef, 0xdc, 0xdc, 0x48, 0xdd, 0xec, 0x25, 0x6e, 0xea, - 0xa4, 0x8d, 0xe2, 0xae, 0x08, 0xff, 0x9c, 0x9d, 0xda, 0x66, 0xfa, 0xe7, 0x1a, 0x4c, 0xc8, 0x80, - 0xe9, 0x74, 0x9d, 0x76, 0x31, 0x50, 0x09, 0x86, 0xec, 0x90, 0x60, 0x4e, 0x43, 0x79, 0xf8, 0x61, - 0x2b, 0x16, 0xd1, 0x34, 0x0c, 0x4b, 0x93, 0x0d, 0xcc, 0x36, 0x4a, 0xe7, 0xe4, 0xde, 0x05, 0xb1, - 0xf0, 0x16, 0x66, 0x1b, 0x68, 0x0a, 0xce, 0x33, 0xda, 0x09, 0x6d, 0x52, 0x2a, 0xca, 0x1d, 0x25, - 0x09, 0x77, 0xcd, 0x8e, 0xd7, 0x72, 0x48, 0x58, 0x1a, 0x8c, 0xdc, 0x29, 0x51, 0xdf, 0x82, 0x8b, - 0x8a, 0x16, 0x87, 0x24, 0xb0, 0xde, 0x55, 0x31, 0x04, 0x0b, 0x12, 0xd8, 0x48, 0x7d, 0xee, 0x74, - 0x12, 0xb2, 0x67, 0x4a, 0x25, 0x40, 0xe2, 0x12, 0x7b, 0xe2, 0x22, 0x6f, 0x62, 0xd6, 0x56, 0x65, - 0x2a, 0xbf, 0x75, 0x1b, 0x50, 0x12, 0x99, 0x25, 0xa1, 0xef, 0x01, 0x24, 0xa1, 0xe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3, 0x4a, 0x61, 0xef, - 0xb0, 0x52, 0xf8, 0xed, 0xb0, 0x52, 0xf8, 0xe0, 0x0d, 0xd7, 0xe3, 0x1b, 0x9d, 0xa6, 0x40, 0x62, - 0x12, 0xdf, 0x73, 0xdb, 0xb8, 0x1d, 0xd8, 0x66, 0xd4, 0x2e, 0xde, 0x21, 0x7c, 0x93, 0x86, 0x0f, - 0xcd, 0xad, 0x24, 0xa0, 0x98, 0x11, 0xa1, 0x8f, 0x5b, 0xd1, 0x3f, 0x55, 0xf3, 0xbc, 0xac, 0xb7, - 0x5b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xcb, 0xbc, 0x96, 0xcc, 0x0d, 0x00, 0x00, + // 1138 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x3d, 0x6c, 0x1c, 0x45, + 0x14, 0xbe, 0x71, 0xce, 0x76, 0xfc, 0x6c, 0x6c, 0x67, 0x70, 0x9c, 0xcb, 0x39, 0x9c, 0x93, 0x25, + 0x60, 0x3b, 0x4e, 0x76, 0xb9, 0x4b, 0x42, 0x01, 0x95, 0x1d, 0x5b, 0xc2, 0xc8, 0x80, 0xb8, 0x14, + 0x48, 0x88, 0xc8, 0x9a, 0xdb, 0x1d, 0x9f, 0x57, 0xb9, 0xdb, 0xd9, 0xec, 0xcc, 0xc5, 0xb6, 0x22, + 0x53, 0x50, 0x51, 0x22, 0x01, 0x12, 0x42, 0x42, 0xa2, 0x02, 0x44, 0x81, 0x44, 0x47, 0x47, 0xeb, + 0xd2, 0x12, 0x0d, 0x55, 0x04, 0x36, 0x05, 0xa2, 0xa7, 0x47, 0xf3, 0xb3, 0xeb, 0x5d, 0x7b, 0x7d, + 0xf6, 0x85, 0x22, 0xdd, 0xce, 0xcc, 0xfb, 0xf9, 0xde, 0xf7, 0xe6, 0xbd, 0x37, 0x0b, 0x16, 0xa7, + 0x6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 0xf1, + 0x16, 0xe1, 0x1b, 0x78, 0x12, 0x06, 0x38, 0xeb, 0x44, 0x2e, 0x2d, 0x15, 0xd5, 0x89, 0x59, 0x49, + 0x73, 0x8d, 0x8e, 0xdf, 0xf2, 0x68, 0x54, 0xea, 0xd7, 0xe6, 0xcc, 0xd2, 0xda, 0x82, 0x0b, 0x86, + 0x16, 0x8f, 0x26, 0xb0, 0xde, 0x33, 0x3e, 0x24, 0x0b, 0x0a, 0xd8, 0x70, 0x6d, 0xf6, 0x64, 0x12, + 0xb2, 0x31, 0xa5, 0x12, 0xa0, 0x70, 0xc9, 0x33, 0x79, 0x91, 0x37, 0x09, 0x6f, 0x9b, 0x32, 0x55, + 0xdf, 0x96, 0x0b, 0x38, 0xf1, 0xcc, 0x13, 0xd7, 0xef, 0x00, 0x24, 0xae, 0xe3, 0x04, 0x9c, 0xdd, + 0xb7, 0x66, 0x7e, 0x28, 0xf6, 0xcb, 0xad, 0x15, 0xb8, 0x92, 0xc9, 0x7a, 0x52, 0xdb, 0x3d, 0xd7, + 0x8b, 0x55, 0x33, 0x4d, 0x2b, 0x36, 0x65, 0x7a, 0x8b, 0x31, 0x94, 0xdf, 0x5c, 0xee, 0xc0, 0xc5, + 0x24, 0x46, 0x99, 0xa0, 0x44, 0x3c, 0x93, 0x45, 0x94, 0xcd, 0xa2, 0xf5, 0x25, 0x82, 0xb1, 0x25, + 0xea, 0x46, 0xdb, 0xa1, 0xa0, 0xde, 0x42, 0xc0, 0x37, 0x69, 0x24, 0x19, 0x94, 0x1d, 0xda, 0xc8, + 0xaa, 0x6f, 0xe9, 0xd3, 0x0f, 0xc2, 0x8e, 0x30, 0x57, 0x44, 0x2f, 0xf0, 0x34, 0x0c, 0xb3, 0x8e, + 0x08, 0x3b, 0x62, 0x4d, 0xf5, 0x0e, 0x7d, 0x45, 0x40, 0x6f, 0x2d, 0x11, 0x41, 0x70, 0x15, 0x2e, + 0xa6, 0x04, 0xd6, 0x08, 0x5f, 0xe3, 0x22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xc6, 0xf3, 0xa7, 0x00, 0x4e, 0xbf, 0xc8, 0xcb, 0x77, 0xce, 0x04, 0xf3, 0xc8, 0xcc, + 0xee, 0x02, 0xf4, 0x28, 0x42, 0xe7, 0x89, 0x82, 0xbe, 0xb3, 0xf8, 0x60, 0xf7, 0xcf, 0x4a, 0xe1, + 0x87, 0xfd, 0x0a, 0xda, 0xdd, 0xaf, 0xa0, 0xbd, 0xfd, 0x0a, 0xfa, 0x63, 0xbf, 0x82, 0x3e, 0x3b, + 0xa8, 0x14, 0xf6, 0x0e, 0x2a, 0x85, 0xdf, 0x0f, 0x2a, 0x85, 0x0f, 0xdf, 0x6c, 0xfa, 0x62, 0xa3, + 0xd3, 0x90, 0x48, 0x1c, 0x1a, 0xf8, 0xcd, 0x36, 0x69, 0x87, 0xae, 0xa3, 0xdb, 0xc5, 0xbb, 0x54, + 0x6c, 0xb2, 0xe8, 0xa1, 0xb3, 0x95, 0x38, 0x94, 0x33, 0x22, 0x0a, 0x48, 0x4b, 0xff, 0x35, 0x35, + 0x06, 0x54, 0xbd, 0xdd, 0xfe, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x18, 0x7c, 0x8c, 0xae, 0x0d, + 0x00, 0x00, } func (this *QuerySecretContractRequest) Equal(that interface{}) bool { @@ -4090,7 +4088,7 @@ func (m *DecryptedAnswers) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field OutputError", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4100,25 +4098,23 @@ func (m *DecryptedAnswers) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.OutputError = append(m.OutputError[:0], dAtA[iNdEx:postIndex]...) - if m.OutputError == nil { - m.OutputError = []byte{} - } + m.OutputError = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { From 8619e89324b892cc905ec65d66203d413bd31e80 Mon Sep 17 00:00:00 2001 From: TomL94 Date: Tue, 23 Aug 2022 01:09:06 +0300 Subject: [PATCH 6/6] Fix OutputError --- x/compute/client/cli/query.go | 8 ++++---- x/compute/client/utils/utils.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x/compute/client/cli/query.go b/x/compute/client/cli/query.go index 11b2237d9..52de777e6 100644 --- a/x/compute/client/cli/query.go +++ b/x/compute/client/cli/query.go @@ -370,7 +370,7 @@ func GetQueryDecryptTxCmd() *cobra.Command { answers := types.DecryptedAnswers{ Answers: make([]*types.DecryptedAnswer, len(txInputs)), OutputLogs: []sdk.StringEvent{}, - OutputError: []byte{}, + OutputError: "", PlaintextError: "", } nonces := make([][]byte, len(txInputs)) @@ -499,11 +499,11 @@ func GetQueryDecryptTxCmd() *cobra.Command { if types.IsEncryptedErrorCode(result.Code) && types.ContainsEncryptedString(result.RawLog) { for i, nonce := range nonces { - stdErr, err := wasmCtx.DecryptError(result.RawLog, answers.Answers[i].Type, nonce) + stdErr, err := wasmCtx.DecryptError(result.RawLog, nonce) if err != nil { continue } - answers.OutputError = append(json.RawMessage(fmt.Sprintf("message inedx %d: ", i)), stdErr...) + answers.OutputError = string(append(json.RawMessage(fmt.Sprintf("message inedx %d: ", i)), stdErr...)) break } } else if types.ContainsEnclaveError(result.RawLog) { @@ -601,7 +601,7 @@ func QueryWithData(contractAddress sdk.AccAddress, queryData []byte, cliCtx clie res, _, err := cliCtx.QueryWithData(route, queryData) if err != nil { if types.ErrContainsQueryError(err) { - errorPlainBz, err := wasmCtx.DecryptError(err.Error(), "query", nonce) + errorPlainBz, err := wasmCtx.DecryptError(err.Error(), nonce) if err != nil { return err } diff --git a/x/compute/client/utils/utils.go b/x/compute/client/utils/utils.go index d94fb1432..a33f262a8 100644 --- a/x/compute/client/utils/utils.go +++ b/x/compute/client/utils/utils.go @@ -268,7 +268,7 @@ func (ctx WASMContext) Decrypt(ciphertext []byte, nonce []byte) ([]byte, error) var re = regexp.MustCompile("encrypted: (.+?):") -func (ctx WASMContext) DecryptError(errString string, msgType string, nonce []byte) (json.RawMessage, error) { +func (ctx WASMContext) DecryptError(errString string, nonce []byte) (json.RawMessage, error) { regexMatch := re.FindStringSubmatch(errString) if len(regexMatch) != 2 { return nil, fmt.Errorf("got an error finding base64 of the error: regexMatch '%v' should have a length of 2. error: %v", regexMatch, errString)