diff --git a/go.mod b/go.mod index f576b6b6f5..ba5e345ff6 100644 --- a/go.mod +++ b/go.mod @@ -32,6 +32,7 @@ require ( github.com/iotaledger/inx-app v1.0.0-rc.3.0.20230417131029-0bfe891d7c4a github.com/iotaledger/inx/go v1.0.0-rc.2 github.com/iotaledger/iota.go/v3 v3.0.0-rc.3 + github.com/iotaledger/wasp/tools/wasp-cli v0.0.0-20230921125516-90a9fd02b441 github.com/labstack/echo-contrib v0.15.0 github.com/labstack/echo-jwt/v4 v4.2.0 github.com/labstack/echo/v4 v4.11.1 @@ -44,6 +45,7 @@ require ( github.com/prometheus/client_golang v1.16.0 github.com/samber/lo v1.38.1 github.com/second-state/WasmEdge-go v0.13.4 + github.com/spf13/cobra v1.7.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 github.com/wasmerio/wasmer-go v1.0.4 @@ -110,6 +112,7 @@ require ( github.com/holiman/uint256 v1.2.3 // indirect github.com/huin/goupnp v1.2.0 // indirect github.com/iancoleman/orderedmap v0.3.0 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 // indirect github.com/iotaledger/hive.go/stringify v0.0.0-20230629181801-64c530ff9d15 // indirect github.com/iotaledger/iota.go v1.0.0 // indirect @@ -132,7 +135,7 @@ require ( github.com/libp2p/go-netroute v0.2.1 // indirect github.com/libp2p/go-reuseport v0.4.0 // indirect github.com/libp2p/go-yamux/v4 v4.0.1 // indirect - github.com/magiconair/properties v1.8.0 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.19 // indirect diff --git a/go.sum b/go.sum index 6f4ba77cb6..d787f8b906 100644 --- a/go.sum +++ b/go.sum @@ -11,6 +11,7 @@ filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5E git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= @@ -71,6 +72,7 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v1.0.2 h1:H9MtNqVoVhvd9nCBwOyDjUEdZCREqbIdCJD93PBm/jA= +github.com/cockroachdb/datadriven v1.0.2/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.0 h1:egs/a04mIiCuydSNS4SVe77uDTr0sLx1cq7hb8CxB7g= github.com/cockroachdb/errors v1.11.0/go.mod h1:ycP9D0f30ZLfWZPQgaFXEYbUaa5NUIQxU/2kOxGh6KY= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= @@ -79,6 +81,8 @@ github.com/cockroachdb/pebble v0.0.0-20230412222916-60cfeb46143b h1:92ve6F1Pls/e github.com/cockroachdb/pebble v0.0.0-20230412222916-60cfeb46143b/go.mod h1:9lRMC4XN3/BLPtIp6kAKwIaHu369NOf2rMucPzipz50= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= +github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM= github.com/containerd/cgroups v0.0.0-20201119153540-4cbc285b3327/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= @@ -91,6 +95,7 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= +github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -119,6 +124,7 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/eclipse/paho.mqtt.golang v1.4.3 h1:2kwcUGn8seMUfWndX0hGbvH8r7crgcJguQNCyp70xik= github.com/eclipse/paho.mqtt.golang v1.4.3/go.mod h1:CSYvoAlsMkhYOXh/oKyxa8EcBci6dVkLCbo5tTC1RIE= +github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= @@ -163,7 +169,9 @@ github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= @@ -193,10 +201,12 @@ github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= @@ -323,6 +333,9 @@ github.com/huin/goupnp v1.2.0 h1:uOKW26NG1hsSSbXIZ1IR7XP9Gjd1U8pnLaCMgntmkmY= github.com/huin/goupnp v1.2.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc= github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/iotaledger/go-ethereum v1.12.0-wasp h1:rBMzSLRi+0WReEO5eYmm47fR+/2/GCmm0YUjoTalFro= github.com/iotaledger/go-ethereum v1.12.0-wasp/go.mod h1:/oo2X/dZLJjf2mJ6YT9wcWxa4nNJDBKDBU6sFIpx1Gs= github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PTNgli6EbS4tV9qu3QAm/kBU3XaYZV2xdzys= @@ -359,6 +372,8 @@ github.com/iotaledger/iota.go v1.0.0 h1:tqm1FxJ/zOdzbrAaQ5BQpVF8dUy2eeGlSeWlNG8G github.com/iotaledger/iota.go v1.0.0/go.mod h1:RiKYwDyY7aCD1L0YRzHSjOsJ5mUR9yvQpvhZncNcGQI= github.com/iotaledger/iota.go/v3 v3.0.0-rc.3 h1:/2gH+AlsWX2T7f4uHvD7oAHmPRsW+SkjR29txzqpi5M= github.com/iotaledger/iota.go/v3 v3.0.0-rc.3/go.mod h1:R3m6d5AFI0I++HOaYQR7QU8hY//vUSwbOyqQ7Bco2O4= +github.com/iotaledger/wasp/tools/wasp-cli v0.0.0-20230921125516-90a9fd02b441 h1:z/UNZPuqNwYwv19b8E6+CxVIdgTYCb3R0jV7Cipr4vU= +github.com/iotaledger/wasp/tools/wasp-cli v0.0.0-20230921125516-90a9fd02b441/go.mod h1:AwWT534Yq1kea11WBQFkaU7YndbJfOs81MRt+QrEoE0= github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s= github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= @@ -380,6 +395,7 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -448,6 +464,8 @@ github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5 github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= @@ -512,6 +530,7 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o= github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= @@ -649,6 +668,7 @@ github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNue github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= @@ -656,6 +676,7 @@ github.com/samber/lo v1.38.1 h1:j2XEAqXKb09Am4ebOg31SpvzUTTs6EN3VfgeLUhPdXM= github.com/samber/lo v1.38.1/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA= github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0= github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= +github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/second-state/WasmEdge-go v0.13.4 h1:NHfJC+aayUW93ydAzlcX7Jx1WDRpI24KvY5SAbeTyvY= github.com/second-state/WasmEdge-go v0.13.4/go.mod h1:HyBf9hVj1sRAjklsjc1Yvs9b5RcmthPG9z99dY78TKg= @@ -696,6 +717,8 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= +github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/status-im/keycard-go v0.2.0 h1:QDLFswOQu1r5jsycloeQh3bVU8n/NatHHaZobtDnDzA= @@ -734,6 +757,7 @@ github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0 github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa h1:5SqCsI/2Qya2bCzK15ozrqo2sZxkh0FHynJZOTVoV6Q= +github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= 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/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= diff --git a/packages/chain/cons/cons.go b/packages/chain/cons/cons.go index 2ce980a900..405171ba61 100644 --- a/packages/chain/cons/cons.go +++ b/packages/chain/cons/cons.go @@ -349,8 +349,10 @@ func (c *consImpl) Message(msg gpa.Message) gpa.OutMessages { return msgs.AddAll(c.subACS.ACSOutputReceived(sub.Output())) case subsystemTypeDSS: return msgs.AddAll(c.subDSS.DSSOutputReceived(sub.Output())) + default: + c.log.Warnf("unexpected subsystem after check: %+v", msg) + return nil } - panic(fmt.Errorf("unexpected subsystem after check: %+v", msg)) } panic(fmt.Errorf("unexpected message: %v", msg)) } diff --git a/packages/chain/cons/cons_gr/gr_test.go b/packages/chain/cons/cons_gr/gr_test.go index bc3f0335e8..825f6a85ec 100644 --- a/packages/chain/cons/cons_gr/gr_test.go +++ b/packages/chain/cons/cons_gr/gr_test.go @@ -309,7 +309,7 @@ func (tsm *testStateMgr) ConsensusDecidedState(ctx context.Context, aliasOutput resp := make(chan state.State, 1) stateCommitment, err := transaction.L1CommitmentFromAliasOutput(aliasOutput.GetAliasOutput()) if err != nil { - panic(err) + tsm.t.Fatal(err) } hash := commitmentHash(stateCommitment) tsm.qDecided[hash] = resp diff --git a/packages/chain/dss/dss.go b/packages/chain/dss/dss.go index 4c31becca4..e00d203482 100644 --- a/packages/chain/dss/dss.go +++ b/packages/chain/dss/dss.go @@ -134,7 +134,8 @@ func (d *dssImpl) Message(msg gpa.Message) gpa.OutMessages { msgs := d.msgWrapper.WrapMessages(subsystemDKG, 0, d.dkg.Message(msgT.Wrapped())) return d.tryHandleDkgOutput(msgs) } - panic(fmt.Errorf("unknown wrapped message %+v, wrapped %T: %v", msgT, msgT.Wrapped(), msgT.Wrapped())) + d.log.Warnf("unknown wrapped message %+v, wrapped %T: %v", msgT, msgT.Wrapped(), msgT.Wrapped()) + return nil default: panic(fmt.Errorf("unknown message %T: %v", msg, msg)) } diff --git a/packages/gpa/aba/mostefaoui/mostefaoui.go b/packages/gpa/aba/mostefaoui/mostefaoui.go index f7ddf8da28..8b3e515b21 100644 --- a/packages/gpa/aba/mostefaoui/mostefaoui.go +++ b/packages/gpa/aba/mostefaoui/mostefaoui.go @@ -209,7 +209,7 @@ func (a *abaImpl) startRound(round int, est bool) gpa.OutMessages { // Start the CC. subGPA, subMsgs, err := a.msgWrapper.DelegateInput(subsystemCC, round, nil) if err != nil { - panic(err) + panic(fmt.Errorf("failed to provide input to CC: %v", err)) } msgs.AddAll(subMsgs) if out := subGPA.Output(); out != nil { diff --git a/packages/gpa/aba/mostefaoui/mostefaoui_test.go b/packages/gpa/aba/mostefaoui/mostefaoui_test.go index 1bb47bf833..333e246699 100644 --- a/packages/gpa/aba/mostefaoui/mostefaoui_test.go +++ b/packages/gpa/aba/mostefaoui/mostefaoui_test.go @@ -84,7 +84,7 @@ func testBasic(t *testing.T, n, f int, inpType string, silent int) { case "false": inputs[nid] = false default: - panic("unexpected input type") + t.Fatal("unexpected input type") } } t.Logf("Inputs: %v", inputs) @@ -107,7 +107,7 @@ func testBasic(t *testing.T, n, f int, inpType string, silent int) { case "false": require.Equal(t, false, out.Value) default: - panic("unexpected input type") + t.Fatal("unexpected input type") } } } diff --git a/packages/gpa/acs/acs.go b/packages/gpa/acs/acs.go index 347afa1a91..494e65cedb 100644 --- a/packages/gpa/acs/acs.go +++ b/packages/gpa/acs/acs.go @@ -88,7 +88,7 @@ func New(nodeIDs []gpa.NodeID, me gpa.NodeID, f int, ccCreateFun func(node gpa.N return ccCreateFun(nidCopy, round) } nodeIdx[nid] = i - rbcInsts[nid] = bracha.New(nodeIDs, f, me, nid, math.MaxInt, func(b []byte) bool { return true }) // TODO: MaxInt. + rbcInsts[nid] = bracha.New(nodeIDs, f, me, nid, math.MaxInt, func(b []byte) bool { return true }, log) // TODO: MaxInt. abaInsts[nid] = mostefaoui.New(nodeIDs, me, f, ccCreateFunForNode, log).AsGPA() } @@ -172,8 +172,10 @@ func (a *acsImpl) Message(msg gpa.Message) gpa.OutMessages { case subsystemABA: msgs.AddAll(a.tryHandleABAOutput(a.nodeIDs[msgT.Index()], sub)) return msgs + default: + a.log.Warnf("unexpected subsystem: %v", msgT.Subsystem()) + return nil } - panic(fmt.Errorf("unexpected subsystem: %v", msgT.Subsystem())) } // > • upon delivery of v_j from RBC_j, if input has not yet been diff --git a/packages/gpa/acss/acss.go b/packages/gpa/acss/acss.go index ed97e6dd58..83bcb46a6f 100644 --- a/packages/gpa/acss/acss.go +++ b/packages/gpa/acss/acss.go @@ -162,8 +162,8 @@ func New( dealCB: dealCB, peerPKs: peerPKs, peerIdx: peers, - rbc: rbc.New(peers, f, me, dealer, math.MaxInt, func(b []byte) bool { return true }), // TODO: Provide meaningful maxMsgSize - rbcOut: nil, // Will be set on output from the RBC. + rbc: rbc.New(peers, f, me, dealer, math.MaxInt, func(b []byte) bool { return true }, log), // TODO: Provide meaningful maxMsgSize + rbcOut: nil, // Will be set on output from the RBC. voteOKRecv: map[gpa.NodeID]bool{}, voteREADYRecv: map[gpa.NodeID]bool{}, voteREADYSent: false, @@ -209,7 +209,8 @@ func (a *acssImpl) Message(msg gpa.Message) gpa.OutMessages { case subsystemRBC: return a.handleRBCMessage(m) default: - panic(fmt.Errorf("unexpected wrapped message: %+v", m)) + a.log.Warnf("unexpected wrapped message subsystem: %+v", m) + return nil } case *msgVote: switch m.kind { @@ -218,7 +219,8 @@ func (a *acssImpl) Message(msg gpa.Message) gpa.OutMessages { case msgVoteREADY: return a.handleVoteREADY(m) default: - panic(fmt.Errorf("unexpected vote message: %+v", m)) + a.log.Warnf("unexpected vote message: %+v", m) + return nil } case *msgImplicateRecover: return a.handleImplicateRecoverReceived(m) @@ -266,7 +268,7 @@ func (a *acssImpl) tryHandleRBCTermination(wasOut bool, msgs gpa.OutMessages) gp // Send the result for self as a message (maybe the code will look nicer this way). outParsed, err := rwutil.ReadFromBytes(out.([]byte), &msgRBCCEPayload{suite: a.suite}) if err != nil { - panic(fmt.Errorf("cannot unmarshal msgRBCCEPayload: %w", err)) + outParsed = &msgRBCCEPayload{err: err} } msgs.AddAll(a.handleRBCOutput(outParsed)) } @@ -285,14 +287,18 @@ func (a *acssImpl) handleRBCOutput(rbcOutput *msgRBCCEPayload) gpa.OutMessages { // Take the first RBC output only. return nil } + msgs := gpa.NoMessages() // // Store the broadcast result and process pending IMPLICATE/RECOVER messages, if any. + if rbcOutput.err != nil { + return a.broadcastImplicate(rbcOutput.err, msgs) + } deal, err := crypto.DealUnmarshalBinary(a.suite, a.n, rbcOutput.data) if err != nil { - panic(errors.New("cannot unmarshal msgRBCCEPayload.data")) + return a.broadcastImplicate(errors.New("cannot unmarshal msgRBCCEPayload.data"), msgs) } a.rbcOut = deal - msgs := a.handleImplicateRecoverPending(gpa.NoMessages()) + msgs = a.handleImplicateRecoverPending(msgs) // // Process the RBC output, as described above. secret := crypto.Secret(a.suite, a.rbcOut.PubKey, a.mySK) @@ -349,7 +355,8 @@ func (a *acssImpl) handleImplicateRecoverReceived(msg *msgImplicateRecover) gpa. case msgImplicateRecoverKindRECOVER: return a.handleRecover(msg) default: - panic(fmt.Errorf("handleImplicateRecoverReceived: unexpected msgImplicateRecover.kind=%v, message: %+v", msg.kind, msg)) + a.log.Warnf("handleImplicateRecoverReceived: unexpected msgImplicateRecover.kind=%v, message: %+v", msg.kind, msg) + return nil } } @@ -377,7 +384,8 @@ func (a *acssImpl) handleImplicateRecoverPending(msgs gpa.OutMessages) gpa.OutMe case msgImplicateRecoverKindRECOVER: msgs.AddAll(a.handleRecover(m)) default: - panic(fmt.Errorf("handleImplicateRecoverReceived: unexpected msgImplicateRecover.kind=%v, message: %+v", m.kind, m)) + a.log.Warnf("handleImplicateRecoverReceived: unexpected msgImplicateRecover.kind=%v, message: %+v", m.kind, m) + // Don't return here, we are just dropping incorrect message. } } a.pendingIRMsgs = postponedIRMsgs diff --git a/packages/gpa/acss/crypto/crypto.go b/packages/gpa/acss/crypto/crypto.go index e3ddb61e20..73e8218ae6 100644 --- a/packages/gpa/acss/crypto/crypto.go +++ b/packages/gpa/acss/crypto/crypto.go @@ -59,7 +59,7 @@ func Secret(g kyber.Group, remotePublic kyber.Point, ownPrivate kyber.Scalar) [] dh := g.Point().Mul(ownPrivate, remotePublic) data, err := dh.MarshalBinary() if err != nil { - panic(err) + panic(fmt.Errorf("cannot marshal a shared secret: %v", err)) } return data } diff --git a/packages/gpa/acss/crypto/deal.go b/packages/gpa/acss/crypto/deal.go index de1a358dc7..7105685737 100644 --- a/packages/gpa/acss/crypto/deal.go +++ b/packages/gpa/acss/crypto/deal.go @@ -54,7 +54,7 @@ func NewDeal(suite suites.Suite, pubKeys []kyber.Point, scalar kyber.Scalar) *De salt, err := deal.Commits.MarshalBinary() if err != nil { - panic(err) + panic(fmt.Errorf("cannot marshal commits: %v", err)) } // encrypt the shares for each public key diff --git a/packages/gpa/acss/msg_rbc_ce.go b/packages/gpa/acss/msg_rbc_ce.go index ad000b049b..93a6b8b95a 100644 --- a/packages/gpa/acss/msg_rbc_ce.go +++ b/packages/gpa/acss/msg_rbc_ce.go @@ -19,6 +19,7 @@ type msgRBCCEPayload struct { gpa.BasicMessage suite suites.Suite data []byte + err error // Transient field, should not be serialized. } var _ gpa.Message = new(msgRBCCEPayload) diff --git a/packages/gpa/acss/msg_rbc_ce_test.go b/packages/gpa/acss/msg_rbc_ce_test.go index daf36f2230..2295bb8c67 100644 --- a/packages/gpa/acss/msg_rbc_ce_test.go +++ b/packages/gpa/acss/msg_rbc_ce_test.go @@ -21,6 +21,7 @@ func TestMsgRBCCEPayloadSerialization(t *testing.T) { gpa.BasicMessage{}, nil, b, + nil, } rwutil.ReadWriteTest(t, msg, new(msgRBCCEPayload)) diff --git a/packages/gpa/adkg/nonce/nonce.go b/packages/gpa/adkg/nonce/nonce.go index ef10af7f67..11c1fd2434 100644 --- a/packages/gpa/adkg/nonce/nonce.go +++ b/packages/gpa/adkg/nonce/nonce.go @@ -139,7 +139,8 @@ func (n *nonceDKGImpl) Message(msg gpa.Message) gpa.OutMessages { case msgWrapperACSS: return n.handleACSSMessage(msgT) default: - panic(fmt.Errorf("unexpected message: %+v", msg)) + n.log.Warnf("unexpected message subsystem: %+v", msg) + return nil } default: panic(fmt.Errorf("unexpected message: %+v", msg)) diff --git a/packages/gpa/interface.go b/packages/gpa/interface.go index b1da983415..3737e94ff3 100644 --- a/packages/gpa/interface.go +++ b/packages/gpa/interface.go @@ -161,3 +161,7 @@ func UnmarshalMessage(data []byte, mapper Mapper, fallback ...Fallback) (Message rr.Read(msg) return msg, rr.Err } + +type Logger interface { + Warnf(msg string, args ...any) +} diff --git a/packages/gpa/msg_wrapper.go b/packages/gpa/msg_wrapper.go index 331aba2ea6..70a77b6f19 100644 --- a/packages/gpa/msg_wrapper.go +++ b/packages/gpa/msg_wrapper.go @@ -108,13 +108,6 @@ func (msg *WrappingMsg) SetSender(sender NodeID) { // note: never called, unfinished concept version func (msg *WrappingMsg) Read(r io.Reader) error { panic("this message is un-marshaled by the gpa.MsgWrapper") - //rr := rwutil.NewReader(r) - //msg.msgType.ReadAndVerify(rr) - //msg.subsystem = rr.ReadByte() - //msg.index = int(rr.ReadUint16()) - //// TODO: allocate proper message instead of msg.wrapped parameter - //msg.wrapped, rr.Err = rwutil.ReadFromBytes(rr.ReadBytes(), msg.wrapped) - //return rr.Err } func (msg *WrappingMsg) Write(w io.Writer) error { diff --git a/packages/gpa/rbc/bracha/bracha.go b/packages/gpa/rbc/bracha/bracha.go index f79849e83c..1a7ebb00ea 100644 --- a/packages/gpa/rbc/bracha/bracha.go +++ b/packages/gpa/rbc/bracha/bracha.go @@ -66,12 +66,13 @@ type rbc struct { readySent bool // Have we sent the READY messages? readyRecv map[hashing.HashValue]map[gpa.NodeID]bool // Quorum counter for the READY messages. output []byte + log gpa.Logger } var _ gpa.GPA = &rbc{} // Create new instance of the RBC. -func New(peers []gpa.NodeID, f int, me, broadcaster gpa.NodeID, maxMsgSize int, predicate func([]byte) bool) gpa.GPA { +func New(peers []gpa.NodeID, f int, me, broadcaster gpa.NodeID, maxMsgSize int, predicate func([]byte) bool, log gpa.Logger) gpa.GPA { r := &rbc{ n: len(peers), f: f, @@ -86,6 +87,7 @@ func New(peers []gpa.NodeID, f int, me, broadcaster gpa.NodeID, maxMsgSize int, readySent: false, readyRecv: make(map[hashing.HashValue]map[gpa.NodeID]bool), output: nil, + log: log, } for i := range peers { r.msgRecv[peers[i]] = map[msgBrachaType]bool{} @@ -126,7 +128,8 @@ func (r *rbc) Message(msg gpa.Message) gpa.OutMessages { case msgBrachaTypeReady: return r.handleReady(msgT) default: - panic(fmt.Errorf("unexpected message: %+v", msgT)) + r.log.Warnf("unexpected brachaType=%v in message: %+v", msgT.brachaType, msgT) + return nil } default: panic(fmt.Errorf("unexpected message: %+v", msg)) diff --git a/packages/gpa/rbc/bracha/bracha_test.go b/packages/gpa/rbc/bracha/bracha_test.go index d2f2c45c28..152c4bb6ec 100644 --- a/packages/gpa/rbc/bracha/bracha_test.go +++ b/packages/gpa/rbc/bracha/bracha_test.go @@ -23,7 +23,7 @@ func TestBasic(t *testing.T) { input := []byte("something important to broadcast") nodes := map[gpa.NodeID]gpa.GPA{} for _, nid := range nodeIDs { - nodes[nid] = bracha.New(nodeIDs, f, nid, leader, math.MaxInt, func(b []byte) bool { return true }) + nodes[nid] = bracha.New(nodeIDs, f, nid, leader, math.MaxInt, func(b []byte) bool { return true }, gpa.NewPanicLogger()) } gpa.NewTestContext(nodes).WithInputs(map[gpa.NodeID]gpa.Input{leader: gpa.Input(input)}).RunAll() for _, n := range nodes { @@ -53,7 +53,7 @@ func TestWithSilent(t *testing.T) { input := []byte("something important to broadcast") nodes := map[gpa.NodeID]gpa.GPA{} for _, nid := range fair { - nodes[nid] = bracha.New(nodeIDs, f, nid, leader, math.MaxInt, func(b []byte) bool { return true }) + nodes[nid] = bracha.New(nodeIDs, f, nid, leader, math.MaxInt, func(b []byte) bool { return true }, gpa.NewPanicLogger()) } for _, nid := range faulty { nodes[nid] = gpa.MakeTestSilentNode() @@ -83,7 +83,7 @@ func TestPredicate(t *testing.T) { input := []byte("something important to broadcast") nodes := map[gpa.NodeID]gpa.GPA{} for _, nid := range nodeIDs { - nodes[nid] = bracha.New(nodeIDs, f, nid, leader, math.MaxInt, pFalse) // NOTE: Initially false. + nodes[nid] = bracha.New(nodeIDs, f, nid, leader, math.MaxInt, pFalse, gpa.NewPanicLogger()) // NOTE: Initially false. } // // No outputs are returned while predicates are false. diff --git a/packages/gpa/test_logger.go b/packages/gpa/test_logger.go new file mode 100644 index 0000000000..8f62ddb101 --- /dev/null +++ b/packages/gpa/test_logger.go @@ -0,0 +1,14 @@ +package gpa + +import "fmt" + +// Useful in tests, to make some warnings apparent. +type panicLogger struct{} + +func NewPanicLogger() Logger { + return &panicLogger{} +} + +func (*panicLogger) Warnf(msg string, args ...any) { + panic(fmt.Errorf(msg, args...)) +}