From adb0f027afe4952b08b50505f1910d22a2b541d9 Mon Sep 17 00:00:00 2001 From: j-rafique Date: Tue, 29 Apr 2025 16:06:35 +0500 Subject: [PATCH] change hashing algorithm form sha256 to blake3 --- go.mod | 3 +- go.sum | 94 +++---------------- p2p/DEVDOCS.md | 2 +- p2p/client.go | 6 +- p2p/kademlia/dht.go | 10 +- p2p/kademlia/fetch_and_store.go | 6 +- p2p/kademlia/network.go | 4 +- p2p/kademlia/node.go | 2 +- p2p/kademlia/store/sqlite/replication.go | 4 +- p2p/kademlia/store/sqlite/sqlite.go | 8 +- p2p/kademlia/store/sqlite/sqlite_test.go | 8 +- p2p/p2p.go | 8 +- pkg/crypto/hash.go | 2 + pkg/net/credentials/alts/common/utils.go | 48 +++++----- pkg/raptorq/helper.go | 2 +- pkg/types/healthcheck_challenge.go | 2 +- pkg/types/self_healing.go | 2 +- pkg/types/storage_challenge.go | 4 +- .../health_check_challenge.go | 2 +- pkg/utils/metrics/metrics.go | 2 +- .../storagechallenge/storage_challenge.go | 2 +- pkg/utils/utils.go | 54 +++++------ tests/integration/p2p/p2p_integration_test.go | 2 +- .../securegrpc/secure_connection_test.go | 6 +- 24 files changed, 106 insertions(+), 177 deletions(-) create mode 100644 pkg/crypto/hash.go diff --git a/go.mod b/go.mod index e03326dc..2540b373 100644 --- a/go.mod +++ b/go.mod @@ -34,6 +34,7 @@ require ( google.golang.org/protobuf v1.36.6 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gopkg.in/yaml.v3 v3.0.1 + lukechampine.com/blake3 v1.4.0 ) require ( @@ -76,7 +77,6 @@ require ( github.com/cosmos/ledger-cosmos-go v0.14.0 // indirect github.com/danieljoos/wincred v1.2.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/deckarep/golang-set/v2 v2.8.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v4 v4.2.0 // indirect @@ -92,7 +92,6 @@ require ( github.com/go-kit/log v0.2.1 // indirect github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect - github.com/gofrs/flock v0.12.1 // indirect github.com/gogo/googleapis v1.4.1 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/glog v1.2.4 // indirect diff --git a/go.sum b/go.sum index 27a304ab..f6d67713 100644 --- a/go.sum +++ b/go.sum @@ -15,8 +15,8 @@ cloud.google.com/go/storage v1.41.0 h1:RusiwatSu6lHeEXe3kglxakAmAbfV+rhtPqA6i8RB cloud.google.com/go/storage v1.41.0/go.mod h1:J1WCa/Z2FcgdEDuPUY8DxT5I+d9mFKsCepp5vR6Sq80= cosmossdk.io/api v0.9.0 h1:QYs9APeSlDNGbsBOBFjp3jXgGd4hnEPnnku3+W3tT4Y= cosmossdk.io/api v0.9.0/go.mod h1:pLkU/NSqYHWxyN7XftVt8iD7oldKJzqMZgzeiOmT2nk= -cosmossdk.io/client/v2 v2.0.0-beta.7 h1:O0PfZL5kC3Sp54wZASLNihQ612Gd6duMp11aM9wawNg= -cosmossdk.io/client/v2 v2.0.0-beta.7/go.mod h1:TzwwrzeK+AfSVSESVEIOYO/9xuCh1fPv0HgeocmfVnM= +cosmossdk.io/client/v2 v2.0.0-beta.5 h1:0LVv3nEByn//hFDIrYLs2WvsEU3HodOelh4SDHnA/1I= +cosmossdk.io/client/v2 v2.0.0-beta.5/go.mod h1:4p0P6o0ro+FizakJUYS9SeM94RNbv0thLmkHRw5o5as= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.11.3 h1:mei+MVDJOwIjIniaKelE3jPDqShCc/F4LkNNHh+4yfo= @@ -31,8 +31,6 @@ cosmossdk.io/math v1.5.1 h1:c6zo52nBRlqOeSIIQrn/zbxwcNwhaLjTMRn6e4vD7uc= cosmossdk.io/math v1.5.1/go.mod h1:ToembcWID/wR94cucsMD+2gq6xrlBBOfWcGwC7ZdwZA= cosmossdk.io/store v1.1.1 h1:NA3PioJtWDVU7cHHeyvdva5J/ggyLDkyH0hGHl2804Y= cosmossdk.io/store v1.1.1/go.mod h1:8DwVTz83/2PSI366FERGbWSH7hL6sB7HbYp8bqksNwM= -cosmossdk.io/tools/confix v0.1.2 h1:2hoM1oFCNisd0ltSAAZw2i4ponARPmlhuNu3yy0VwI4= -cosmossdk.io/tools/confix v0.1.2/go.mod h1:7XfcbK9sC/KNgVGxgLM0BrFbVcR/+6Dg7MFfpx7duYo= cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= @@ -63,16 +61,10 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/LumeraProtocol/lumera v0.4.4 h1:jMMyKs5fT5mShdLwVDM2QA+hJ4zNk4Tn0teaKGQSvak= +github.com/LumeraProtocol/lumera v0.4.4/go.mod h1:MRqVY+f8edEBkDvpr4z2nJpglp3Qj1OUvjeWvrvIUSM= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= -github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= -github.com/VictoriaMetrics/fastcache v1.12.1 h1:i0mICQuojGDL3KblA7wUNlY5lOK6a4bwt3uRKnkZU40= -github.com/VictoriaMetrics/fastcache v1.12.1/go.mod h1:tX04vaqcNoQeGLD+ra5pU5sWkuxnzWhEzLwhP9w653o= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= @@ -82,8 +74,6 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alitto/pond v1.8.3 h1:ydIqygCLVPqIX/USe5EaV/aSRXTRXDEI9JwuDdu+/xs= -github.com/alitto/pond v1.8.3/go.mod h1:CmvIIGd5jKLasGI3D87qDkQxjzChdKMmnXMg3fG6M6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= @@ -108,8 +98,8 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2gVpmOtVTJZNodLdLQLn/KsJqFvXwnd/s= github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= -github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= +github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= @@ -181,8 +171,6 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA= -github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c= github.com/cometbft/cometbft v0.38.15 h1:5veFd8k1uXM27PBg9sMO3hAfRJ3vbh4OmmLf6cVrqXg= github.com/cometbft/cometbft v0.38.15/go.mod h1:+wh6ap6xctVG+JOHwbl8pPKZ0GeqdPYqISu7F4b43cQ= github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= @@ -210,28 +198,16 @@ github.com/cosmos/iavl v1.2.2 h1:qHhKW3I70w+04g5KdsdVSHRbFLgt3yY3qTMd4Xa4rC8= github.com/cosmos/iavl v1.2.2/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= -github.com/cosmos/ibc-go/v8 v8.5.2 h1:27s9oeD2AxLQF3e9BQsYt9doONyZ7FwZi/qkBv6Sdks= -github.com/cosmos/ibc-go/v8 v8.5.2/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= +github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs= +github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/ledger-cosmos-go v0.14.0 h1:WfCHricT3rPbkPSVKRH+L4fQGKYHuGOK9Edpel8TYpE= github.com/cosmos/ledger-cosmos-go v0.14.0/go.mod h1:E07xCWSBl3mTGofZ2QnL4cIUzMbbGVyik84QYKbX3RA= -github.com/cosmos/rosetta v0.50.11 h1:FAM+D1JUvTrxKpbnLRimdPnEoNIcl2MGZ08+o0huYE0= -github.com/cosmos/rosetta v0.50.11/go.mod h1:293MJ7op8JNcBS8s33r8cBqUqld2Hc6Hiw3pso2m8pM= -github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM= -github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/creachadair/atomicfile v0.3.3 h1:yJlDq8qk9QmD/6ol+jq1X4bcoLNVdYq95+owOnauziE= -github.com/creachadair/atomicfile v0.3.3/go.mod h1:X1r9P4wigJlGkYJO1HXZREdkVn+b1yHrsBBMLSj7tak= -github.com/creachadair/tomledit v0.0.26 h1:MoDdgHIHZ5PctBVsAZDjxdxreWUEa9ObPKTRkk5PPwA= -github.com/creachadair/tomledit v0.0.26/go.mod h1:SJi1OxKpMyR141tq1lzsbPtIg3j8TeVPM/ZftfieD7o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/crypto-org-chain/cronos/memiavl v0.0.5-0.20240722062311-8384cad72737 h1:9jyWTnpgelwEvTRFkRxDIn/WBuj8pO4WcWYLbh/fi2k= -github.com/crypto-org-chain/cronos/memiavl v0.0.5-0.20240722062311-8384cad72737/go.mod h1:gHpd4PhJt1BpjfN3PfChzv+9olZ2yVKDoyiIhMk9VFQ= -github.com/crypto-org-chain/cronos/store v0.0.5-0.20240722062311-8384cad72737 h1:KcTmL7lmVr306/7QiBFvgy6mVQuRTdYJc9dP21VuT5s= -github.com/crypto-org-chain/cronos/store v0.0.5-0.20240722062311-8384cad72737/go.mod h1:c4IGVc3Cp6ItRsn3JMDaQ6Xs+YiLTwW25V+F+Lr7G8g= github.com/danieljoos/wincred v1.2.1 h1:dl9cBrupW8+r5250DYkYxocLeZ1Y4vB1kxgtjxw8GQs= github.com/danieljoos/wincred v1.2.1/go.mod h1:uGaFL9fDn3OLTvzCGulzE+SzjEe5NGlh5FdCcyfPwps= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -239,8 +215,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/deckarep/golang-set/v2 v2.8.0 h1:swm0rlPCmdWn9mESxKOjWk8hXSqoxOp+ZlfuyaAdFlQ= -github.com/deckarep/golang-set/v2 v2.8.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg= @@ -279,10 +253,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/ethereum/go-ethereum v1.11.5 h1:3M1uan+LAUvdn+7wCEFrcMM4LJTeuxDrPTg/f31a5QQ= -github.com/ethereum/go-ethereum v1.11.5/go.mod h1:it7x0DWnTDMfVFdXcU6Ti4KEFQynLHVRarcSlPr0HBo= -github.com/evmos/evmos/v20 v20.0.0 h1:/wXGE/wAknT8vbY5MaQoCiGVoUFmYeHkeSUz4opfxzw= -github.com/evmos/evmos/v20 v20.0.0/go.mod h1:QslHUHSn613wH4l2axRfoyUxBu+OjyqwbNUM3XW8QsM= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= @@ -325,8 +295,6 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= -github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= @@ -335,8 +303,6 @@ github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= @@ -344,8 +310,6 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= -github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= @@ -436,8 +400,6 @@ github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/goware/urlx v0.3.2 h1:gdoo4kBHlkqZNaf6XlQ12LGtQOmpKJrR04Rc3RnpJEo= -github.com/goware/urlx v0.3.2/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= @@ -478,8 +440,8 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= -github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= +github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -497,10 +459,6 @@ github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU= github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo= -github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= -github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= -github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA= -github.com/holiman/uint256 v1.3.2/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c= github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U= @@ -564,8 +522,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263 h1:LGEzZvf33Y1NhuP5+jI/ni9l1TFS6oYPDilgy74NusM= -github.com/ledgerwatch/erigon-lib v0.0.0-20230210071639-db0e7ed11263/go.mod h1:OXgMDuUo2lZ3NpH29ZvMYbk+LxFd5ffDl2Z2mGMuY/I= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= @@ -592,8 +548,6 @@ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM= github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= @@ -649,8 +603,6 @@ github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= @@ -737,8 +689,6 @@ github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoG github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= -github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -764,8 +714,6 @@ github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6v github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shamaton/msgpack/v2 v2.2.0 h1:IP1m01pHwCrMa6ZccP9B3bqxEMKMSmMVAVKk54g3L/Y= github.com/shamaton/msgpack/v2 v2.2.0/go.mod h1:6khjYnkx73f7VQU7wjcFS9DFjs+59naVWJv1TB7qdOI= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= -github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -822,22 +770,6 @@ github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2l github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= -github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY= -github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= -github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= -github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= -github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= -github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= -github.com/tidwall/tinylru v1.1.0 h1:XY6IUfzVTU9rpwdhKUF6nQdChgCdGjkMfLzbWyiau6I= -github.com/tidwall/tinylru v1.1.0/go.mod h1:3+bX+TJ2baOLMWTnlyNWHh4QMnFyARg2TLTQ6OFbzw8= -github.com/tidwall/wal v1.1.7 h1:emc1TRjIVsdKKSnpwGBAcsAGg0767SvUk8+ygx7Bb+4= -github.com/tidwall/wal v1.1.7/go.mod h1:r6lR1j27W9EPalgHiB7zLJDYu3mzW5BQP5KrzBpYY/E= -github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= -github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= -github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= -github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= @@ -854,8 +786,6 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/zbiljic/go-filelock v0.0.0-20170914061330-1dbf7103ab7d h1:XQyeLr7N9iY9mi+TGgsBFkj54+j3fdoo8e2u6zrGP5A= -github.com/zbiljic/go-filelock v0.0.0-20170914061330-1dbf7103ab7d/go.mod h1:hoMeDjlNXTNqVwrCk8YDyaBS2g5vFfEX2ezMi4vb6CY= github.com/zondax/hid v0.9.2 h1:WCJFnEDMiqGF64nlZz28E9qLVZ0KSJ7xpc5DLEyma2U= github.com/zondax/hid v0.9.2/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= github.com/zondax/ledger-go v0.14.3 h1:wEpJt2CEcBJ428md/5MgSLsXLBos98sBOyxNmCjfUCw= @@ -1156,8 +1086,6 @@ gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce h1:+JknDZhAj8YMt7GC73Ei8pv4MzjDUNPHgQWJdtMAaDU= -gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= @@ -1182,6 +1110,8 @@ honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +lukechampine.com/blake3 v1.4.0 h1:xDbKOZCVbnZsfzM6mHSYcGRHZ3YrLDzqz8XnV4uaD5w= +lukechampine.com/blake3 v1.4.0/go.mod h1:MQJNQCTnR+kwOP/JEZSxj3MaQjp80FOFSNMMHXcSeX0= lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= diff --git a/p2p/DEVDOCS.md b/p2p/DEVDOCS.md index 1e3bf608..99419c46 100644 --- a/p2p/DEVDOCS.md +++ b/p2p/DEVDOCS.md @@ -132,4 +132,4 @@ Data stored in the network is: - Use `localOnly: true` with `Retrieve()` to only check local storage - DHT operations use a modified Kademlia with `Alpha=6` for parallelism -- Key format is base58-encoded SHA-256 hash of the data \ No newline at end of file +- Key format is base58-encoded Blake3 hash of the data \ No newline at end of file diff --git a/p2p/client.go b/p2p/client.go index 573974c3..50dbd12c 100644 --- a/p2p/client.go +++ b/p2p/client.go @@ -22,7 +22,7 @@ type Client interface { // - the base58 encoded identifier will be returned Store(ctx context.Context, data []byte, typ int) (string, error) - // StoreBatch will store a batch of values with their SHA256 hash as the key + // StoreBatch will store a batch of values with their Blake3 hash as the key StoreBatch(ctx context.Context, values [][]byte, typ int, taskID string) error // Delete a key, value @@ -41,10 +41,10 @@ type Client interface { // - the base58 encoded identifier will be returned LocalStore(ctx context.Context, key string, data []byte) (string, error) - // DisableKey adds key to disabled keys list - It takes in a B58 encoded SHA-256 hash + // DisableKey adds key to disabled keys list - It takes in a B58 encoded blake3 hash DisableKey(ctx context.Context, b58EncodedHash string) error - // EnableKey removes key from disabled list - It takes in a B58 encoded SHA-256 hash + // EnableKey removes key from disabled list - It takes in a B58 encoded blake3 hash EnableKey(ctx context.Context, b58EncodedHash string) error // GetLocalKeys returns a list of all keys stored locally diff --git a/p2p/kademlia/dht.go b/p2p/kademlia/dht.go index 8587f342..478f3fa2 100644 --- a/p2p/kademlia/dht.go +++ b/p2p/kademlia/dht.go @@ -206,7 +206,7 @@ func (s *DHT) retryStore(ctx context.Context, key []byte, data []byte, typ int) // Store the data into the network func (s *DHT) Store(ctx context.Context, data []byte, typ int) (string, error) { - key, _ := utils.Sha3256hash(data) + key, _ := utils.Blake3Hash(data) retKey := base58.Encode(key) // store the key to queries storage @@ -223,7 +223,7 @@ func (s *DHT) Store(ctx context.Context, data []byte, typ int) (string, error) { return retKey, nil } -// StoreBatch will store a batch of values with their SHA256 hash as the key +// StoreBatch will store a batch of values with their Blake3 hash as the key func (s *DHT) StoreBatch(ctx context.Context, values [][]byte, typ int, taskID string) error { log.WithContext(ctx).WithField("taskID", taskID).WithField("records", len(values)).Info("store db batch begin") if err := s.store.StoreBatch(ctx, values, typ, true); err != nil { @@ -822,7 +822,7 @@ func (s *DHT) iterate(ctx context.Context, iterativeType int, target []byte, dat closestNode := nl.Nodes[0] // if it's a find node, reset the refresh timer if iterativeType == IterateFindNode { - hashedTargetID, _ := utils.Sha3256hash(target) + hashedTargetID, _ := utils.Blake3Hash(target) bucket := s.ht.bucketIndex(s.ht.self.HashedID, hashedTargetID) log.P2P().WithContext(ctx).Debugf("bucket for target: %v", sKey) @@ -1172,7 +1172,7 @@ func (s *DHT) storeToAlphaNodes(ctx context.Context, nl *NodeList, data []byte, } }(n) } - skey, _ := utils.Sha3256hash(data) + skey, _ := utils.Blake3Hash(data) // Collect results from parallel requests for i := 0; i < Alpha && i < len(nl.Nodes); i++ { @@ -1258,7 +1258,7 @@ func (s *DHT) IterateBatchStore(ctx context.Context, values [][]byte, typ int, i log.WithContext(ctx).WithField("task-id", id).WithField("keys", len(values)).Info("iterate batch store begin") for i := 0; i < len(values); i++ { - target, _ := utils.Sha3256hash(values[i]) + target, _ := utils.Blake3Hash(values[i]) hashes[i] = target top6 := s.ht.closestContactsWithInlcudingNode(Alpha, target, s.ignorelist.ToNodeList(), nil) diff --git a/p2p/kademlia/fetch_and_store.go b/p2p/kademlia/fetch_and_store.go index fe212216..deb69483 100644 --- a/p2p/kademlia/fetch_and_store.go +++ b/p2p/kademlia/fetch_and_store.go @@ -9,9 +9,9 @@ import ( json "github.com/json-iterator/go" + "github.com/LumeraProtocol/supernode/p2p/kademlia/domain" "github.com/LumeraProtocol/supernode/pkg/log" "github.com/LumeraProtocol/supernode/pkg/utils" - "github.com/LumeraProtocol/supernode/p2p/kademlia/domain" "github.com/cenkalti/backoff/v4" ) @@ -368,8 +368,8 @@ func VerifyAndFilter(decompressedMap map[string][]byte) (map[string][]byte, []st continue } - // Compute the SHA256 hash of the value using the helper function - hash, err := utils.Sha3256hash(value) + // Compute the Blake3 hash of the value using the helper function + hash, err := utils.Blake3Hash(value) if err != nil { failedKeys = append(failedKeys, key) log.WithError(err).Error("failed to compute hash") diff --git a/p2p/kademlia/network.go b/p2p/kademlia/network.go index d06ae1dd..a3c5bdbf 100644 --- a/p2p/kademlia/network.go +++ b/p2p/kademlia/network.go @@ -143,7 +143,7 @@ func (s *Network) handleFindNode(ctx context.Context, message *Message) (res []b s.dht.addNode(ctx, message.Sender) // the closest contacts - hashedTargetID, _ := utils.Sha3256hash(request.Target) + hashedTargetID, _ := utils.Blake3Hash(request.Target) closest, _ := s.dht.ht.closestContacts(K, hashedTargetID, []*Node{message.Sender}) response := &FindNodeResponse{ @@ -232,7 +232,7 @@ func (s *Network) handleStoreData(ctx context.Context, message *Message) (res [] s.dht.addNode(ctx, message.Sender) // format the key - key, _ := utils.Sha3256hash(request.Data) + key, _ := utils.Blake3Hash(request.Data) value, err := s.dht.store.Retrieve(ctx, key) if err != nil || len(value) == 0 { diff --git a/p2p/kademlia/node.go b/p2p/kademlia/node.go index bb541fca..1214773e 100644 --- a/p2p/kademlia/node.go +++ b/p2p/kademlia/node.go @@ -29,7 +29,7 @@ type Node struct { // SetHashedID sets hash of ID func (s *Node) SetHashedID() { if len(s.HashedID) == 0 { - s.HashedID, _ = utils.Sha3256hash(s.ID) + s.HashedID, _ = utils.Blake3Hash(s.ID) } } diff --git a/p2p/kademlia/store/sqlite/replication.go b/p2p/kademlia/store/sqlite/replication.go index 045725df..7065253b 100644 --- a/p2p/kademlia/store/sqlite/replication.go +++ b/p2p/kademlia/store/sqlite/replication.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/LumeraProtocol/supernode/pkg/log" "github.com/LumeraProtocol/supernode/p2p/kademlia/domain" + "github.com/LumeraProtocol/supernode/pkg/log" "github.com/cenkalti/backoff/v4" "github.com/jmoiron/sqlx" ) @@ -185,7 +185,7 @@ func (s *Store) DeleteRepKey(hkey string) error { return nil } -// StoreBatchRepKeys will store a batch of values with their SHA256 hash as the key +// StoreBatchRepKeys will store a batch of values with their Blake3 hash as the key func (s *Store) StoreBatchRepKeys(values []string, id string, ip string, port uint16) error { operation := func() error { tx, err := s.db.Beginx() diff --git a/p2p/kademlia/store/sqlite/sqlite.go b/p2p/kademlia/store/sqlite/sqlite.go index e51dd592..5a5bd1b5 100644 --- a/p2p/kademlia/store/sqlite/sqlite.go +++ b/p2p/kademlia/store/sqlite/sqlite.go @@ -10,9 +10,9 @@ import ( "strings" "time" + "github.com/LumeraProtocol/supernode/p2p/kademlia/store/cloud.go" "github.com/LumeraProtocol/supernode/pkg/log" "github.com/LumeraProtocol/supernode/pkg/utils" - "github.com/LumeraProtocol/supernode/p2p/kademlia/store/cloud.go" "github.com/cenkalti/backoff/v4" "github.com/jmoiron/sqlx" @@ -542,7 +542,7 @@ func (s *Store) storeRecord(key []byte, value []byte, typ int, isOriginal bool) return nil } -// storeBatchRecord will store a batch of values with their SHA256 hash as the key +// storeBatchRecord will store a batch of values with their Blake3 hash as the key func (s *Store) storeBatchRecord(values [][]byte, typ int, isOriginal bool) error { hkeys := make([]UpdateMessage, len(values)) @@ -565,8 +565,8 @@ func (s *Store) storeBatchRecord(values [][]byte, typ int, isOriginal bool) erro // For each value, calculate its hash and insert into DB now := time.Now().UTC() for i := 0; i < len(values); i++ { - // Compute the SHA256 hash - hashed, err := utils.Sha3256hash(values[i]) + // Compute the Blake3 hash + hashed, err := utils.Blake3Hash(values[i]) if err != nil { tx.Rollback() return fmt.Errorf("cannot compute hash: %w", err) diff --git a/p2p/kademlia/store/sqlite/sqlite_test.go b/p2p/kademlia/store/sqlite/sqlite_test.go index 9f0f0598..813c9dc2 100644 --- a/p2p/kademlia/store/sqlite/sqlite_test.go +++ b/p2p/kademlia/store/sqlite/sqlite_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" - "github.com/LumeraProtocol/supernode/pkg/utils" "github.com/LumeraProtocol/supernode/p2p/kademlia/store/cloud.go" + "github.com/LumeraProtocol/supernode/pkg/utils" "github.com/stretchr/testify/assert" ) @@ -88,21 +88,21 @@ func TestStore(t *testing.T) { r2 := []byte("test-record-2") r3 := []byte("test-record-3") - hashed, err := utils.Sha3256hash(r1) + hashed, err := utils.Blake3Hash(r1) if err != nil { t.Fatalf("failed to hash record: %v", err) } r1Key := hex.EncodeToString(hashed) - hashed, err = utils.Sha3256hash(r2) + hashed, err = utils.Blake3Hash(r2) if err != nil { t.Fatalf("failed to hash record: %v", err) } r2Key := hex.EncodeToString(hashed) - hashed, err = utils.Sha3256hash(r3) + hashed, err = utils.Blake3Hash(r3) if err != nil { t.Fatalf("failed to hash record: %v", err) } diff --git a/p2p/p2p.go b/p2p/p2p.go index dcb99d02..cd475cb2 100644 --- a/p2p/p2p.go +++ b/p2p/p2p.go @@ -21,7 +21,7 @@ import ( const ( logPrefix = "p2p" - // B is the number of bits in a SHA256 hash + // B is the number of bits in a Blake3 hash B = 256 ) @@ -122,7 +122,7 @@ func (s *p2p) Store(ctx context.Context, data []byte, typ int) (string, error) { return s.dht.Store(ctx, data, typ) } -// StoreBatch will store a batch of values with their SHA256 hash as the key +// StoreBatch will store a batch of values with their Blake3 hash as the key func (s *p2p) StoreBatch(ctx context.Context, data [][]byte, typ int, taskID string) error { ctx = log.ContextWithPrefix(ctx, logPrefix) @@ -293,7 +293,7 @@ func (s *p2p) LocalStore(ctx context.Context, key string, data []byte) (string, return s.dht.LocalStore(ctx, key, data) } -// DisableKey adds key to disabled keys list - It takes in a B58 encoded SHA-256 hash +// DisableKey adds key to disabled keys list - It takes in a B58 encoded Blake3 hash func (s *p2p) DisableKey(ctx context.Context, b58EncodedHash string) error { decoded := base58.Decode(b58EncodedHash) if len(decoded) != B/8 { @@ -303,7 +303,7 @@ func (s *p2p) DisableKey(ctx context.Context, b58EncodedHash string) error { return s.metaStore.Store(ctx, decoded) } -// EnableKey removes key from disabled list - It takes in a B58 encoded SHA-256 hash +// EnableKey removes key from disabled list - It takes in a B58 encoded Blake3 hash func (s *p2p) EnableKey(ctx context.Context, b58EncodedHash string) error { decoded := base58.Decode(b58EncodedHash) if len(decoded) != B/8 { diff --git a/pkg/crypto/hash.go b/pkg/crypto/hash.go new file mode 100644 index 00000000..e4f8dd12 --- /dev/null +++ b/pkg/crypto/hash.go @@ -0,0 +1,2 @@ +package crypto + diff --git a/pkg/net/credentials/alts/common/utils.go b/pkg/net/credentials/alts/common/utils.go index 37459c6f..e5860e91 100644 --- a/pkg/net/credentials/alts/common/utils.go +++ b/pkg/net/credentials/alts/common/utils.go @@ -1,14 +1,14 @@ package common import ( + "crypto/sha256" "encoding/binary" "fmt" "io" "net" - "crypto/sha256" - "golang.org/x/crypto/hkdf" "github.com/cosmos/gogoproto/proto" + "golang.org/x/crypto/hkdf" lumeraidtypes "github.com/LumeraProtocol/lumera/x/lumeraid/types" ) @@ -24,22 +24,22 @@ func defaultSendHandshakeMessage(conn net.Conn, handshakeBytes, signature []byte // Calculate total message size and allocate a single buffer totalSize := MsgLenFieldSize + len(handshakeBytes) + MsgLenFieldSize + len(signature) buf := make([]byte, totalSize) - + // Write all data into the buffer offset := 0 - + // Write handshake length binary.BigEndian.PutUint32(buf[offset:], uint32(len(handshakeBytes))) offset += MsgLenFieldSize - + // Write handshake bytes copy(buf[offset:], handshakeBytes) offset += len(handshakeBytes) - + // Write signature length binary.BigEndian.PutUint32(buf[offset:], uint32(len(signature))) offset += MsgLenFieldSize - + // Write signature copy(buf[offset:], signature) @@ -124,19 +124,19 @@ func defaultExpandKey(sharedSecret []byte, protocol string, info []byte) ([]byte if err != nil { return nil, fmt.Errorf("failed to get key size: %w", err) } - if (keySize <= len(sharedSecret)) { + if keySize <= len(sharedSecret) { return sharedSecret[:keySize], nil } - // Use HKDF with SHA-256 - hkdf := hkdf.New(sha256.New, sharedSecret, nil, info) - - key := make([]byte, keySize) - if _, err := io.ReadFull(hkdf, key); err != nil { - return nil, fmt.Errorf("failed to expand key: %w", err) - } + // Use HKDF with SHA-256 + hkdf := hkdf.New(sha256.New, sharedSecret, nil, info) + + key := make([]byte, keySize) + if _, err := io.ReadFull(hkdf, key); err != nil { + return nil, fmt.Errorf("failed to expand key: %w", err) + } - return key, nil + return key, nil } // ExpandKey derives protocol-specific keys from the shared secret using HKDF @@ -144,16 +144,16 @@ var ExpandKey ExpandKeyFunc = defaultExpandKey // For XChaCha20Poly1305ReKey, helper to split the expanded key into key and nonce func SplitKeyAndNonce(expandedKey []byte) (key, nonce []byte) { - if len(expandedKey) != KeySizeXChaCha20Poly1305ReKey { - return nil, nil - } - return expandedKey[:32], expandedKey[32:] + if len(expandedKey) != KeySizeXChaCha20Poly1305ReKey { + return nil, nil + } + return expandedKey[:32], expandedKey[32:] } // For AESGCMReKey, helper to split the expanded key into key and counter mask func SplitKeyAndCounterMask(expandedKey []byte) (key, counterMask []byte) { - if len(expandedKey) != KeySizeAESGCMReKey { - return nil, nil - } - return expandedKey[:32], expandedKey[32:] + if len(expandedKey) != KeySizeAESGCMReKey { + return nil, nil + } + return expandedKey[:32], expandedKey[32:] } diff --git a/pkg/raptorq/helper.go b/pkg/raptorq/helper.go index 1924c391..ceecc2d7 100644 --- a/pkg/raptorq/helper.go +++ b/pkg/raptorq/helper.go @@ -171,7 +171,7 @@ func GetIDFiles(ctx context.Context, file []byte, ic uint32, max uint32) (ids [] idFiles = append(idFiles, compressedData) - hash, err := utils.Sha3256hash(compressedData) + hash, err := utils.Blake3Hash(compressedData) if err != nil { return ids, idFiles, errors.Errorf("sha3-256-hash error getting an id file: %w", err) } diff --git a/pkg/types/healthcheck_challenge.go b/pkg/types/healthcheck_challenge.go index a171138b..71b208a7 100644 --- a/pkg/types/healthcheck_challenge.go +++ b/pkg/types/healthcheck_challenge.go @@ -158,7 +158,7 @@ type HealthCheckChallengeMessages []HealthCheckMessage // Hash returns the hash of the health-check-challenge challenge log data func (mdl HealthCheckChallengeMessages) Hash() string { data, _ := json.Marshal(mdl) - hash, _ := utils.Sha3256hash(data) + hash, _ := utils.Blake3Hash(data) return string(hash) } diff --git a/pkg/types/self_healing.go b/pkg/types/self_healing.go index 0ba13081..c30ade41 100644 --- a/pkg/types/self_healing.go +++ b/pkg/types/self_healing.go @@ -246,7 +246,7 @@ type SelfHealingChallengeEvent struct { // Hash returns the hash of the self-healing challenge reports func (s SelfHealingReports) Hash() string { data, _ := json.Marshal(s) - hash, _ := utils.Sha3256hash(data) + hash, _ := utils.Blake3Hash(data) return string(hash) } diff --git a/pkg/types/storage_challenge.go b/pkg/types/storage_challenge.go index 2b0432e1..49008480 100644 --- a/pkg/types/storage_challenge.go +++ b/pkg/types/storage_challenge.go @@ -190,7 +190,7 @@ type StorageChallengeMessages []Message // Hash returns the hash of the storage-challenge challenge log data func (mdl StorageChallengeMessages) Hash() string { data, _ := json.Marshal(mdl) - hash, _ := utils.Sha3256hash(data) + hash, _ := utils.Blake3Hash(data) return string(hash) } @@ -236,7 +236,7 @@ type AggregatedScoreList []AggregatedScore func (asl AggregatedScoreList) Hash() string { data, _ := json.Marshal(asl) - hash, _ := utils.Sha3256hash(data) + hash, _ := utils.Blake3Hash(data) return string(hash) } diff --git a/pkg/utils/healthcheckchallenge/health_check_challenge.go b/pkg/utils/healthcheckchallenge/health_check_challenge.go index 793f877b..733b7a09 100644 --- a/pkg/utils/healthcheckchallenge/health_check_challenge.go +++ b/pkg/utils/healthcheckchallenge/health_check_challenge.go @@ -24,7 +24,7 @@ type HCSummaryStats struct { // Hash returns the hash of the SCSummaryStats func (ss *HCSummaryStatsRes) Hash() string { data, _ := json.Marshal(ss) - hash, _ := utils.Sha3256hash(data) + hash, _ := utils.Blake3Hash(data) return string(hash) } diff --git a/pkg/utils/metrics/metrics.go b/pkg/utils/metrics/metrics.go index 339cde12..f3b5215b 100644 --- a/pkg/utils/metrics/metrics.go +++ b/pkg/utils/metrics/metrics.go @@ -69,7 +69,7 @@ type SHExecutionMetrics struct { // Hash returns the hash of the metrics func (m *Metrics) Hash() string { data, _ := json.Marshal(m) - hash, _ := utils.Sha3256hash(data) + hash, _ := utils.Blake3Hash(data) return string(hash) } diff --git a/pkg/utils/storagechallenge/storage_challenge.go b/pkg/utils/storagechallenge/storage_challenge.go index 0285b291..e44df4ed 100644 --- a/pkg/utils/storagechallenge/storage_challenge.go +++ b/pkg/utils/storagechallenge/storage_challenge.go @@ -24,7 +24,7 @@ type SCSummaryStats struct { // Hash returns the hash of the SCSummaryStats func (ss *SCSummaryStatsRes) Hash() string { data, _ := json.Marshal(ss) - hash, _ := utils.Sha3256hash(data) + hash, _ := utils.Blake3Hash(data) return string(hash) } diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 3024cbc5..98dd9c4b 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -5,13 +5,13 @@ import ( "container/heap" "context" "crypto/rand" - "crypto/sha256" "encoding/base64" "encoding/binary" "encoding/hex" "fmt" "io" "log" + "lukechampine.com/blake3" "math" "math/big" "net" @@ -28,7 +28,6 @@ import ( "golang.org/x/sync/semaphore" "github.com/klauspost/compress/zstd" - "golang.org/x/crypto/sha3" ) const ( @@ -56,25 +55,6 @@ func SafeErrStr(err error) string { return "" } -// Sha3256hash returns SHA-256 hash of input message -func Sha3256hash(msg []byte) ([]byte, error) { - hasher := sha3.New256() - if _, err := io.Copy(hasher, bytes.NewReader(msg)); err != nil { - return nil, err - } - return hasher.Sum(nil), nil -} - -// GetHashStringFromBytes generate sha256 hash string from a given byte array -func GetHashStringFromBytes(msg []byte) string { - h := sha3.New256() - if _, err := io.Copy(h, bytes.NewReader(msg)); err != nil { - return "" - } - - return hex.EncodeToString(h.Sum(nil)) -} - // SafeString returns value of str ptr or empty string if ptr is nil func SafeString(ptr *string) string { if ptr != nil { @@ -174,21 +154,39 @@ func EqualStrList(a, b []string) error { return nil } -// GetHashFromString generate sha256 hash from a given string -func GetHashFromString(inputString string) string { - h := sha3.New256() - h.Write([]byte(inputString)) +// Blake3Hash returns Blake3 hash of input message +func Blake3Hash(msg []byte) ([]byte, error) { + hasher := blake3.New(32, nil) + if _, err := io.Copy(hasher, bytes.NewReader(msg)); err != nil { + return nil, err + } + return hasher.Sum(nil), nil +} + +// GetHashFromBytes generate blake3 hash string from a given byte array +func GetHashFromBytes(msg []byte) string { + h := blake3.New(32, nil) + if _, err := io.Copy(h, bytes.NewReader(msg)); err != nil { + return "" + } + return hex.EncodeToString(h.Sum(nil)) } -func ComputeSHA256HashOfFile(filePath string) ([]byte, error) { +// GetHashFromString returns blake3 hash of a given string +func GetHashFromString(s string) []byte { + sum := blake3.Sum256([]byte(s)) + return sum[:] +} + +func ComputeHashOfFile(filePath string) ([]byte, error) { file, err := os.Open(filePath) if err != nil { return nil, err } defer file.Close() - hasher := sha256.New() + hasher := blake3.New(32, nil) if _, err := io.Copy(hasher, file); err != nil { return nil, err } @@ -219,7 +217,7 @@ func BytesToInt(inputBytes []byte) *big.Int { func ComputeXorDistanceBetweenTwoStrings(string1, string2 string) *big.Int { string1Hash := GetHashFromString(string1) string2Hash := GetHashFromString(string2) - xorDistance, _ := XORBytes([]byte(string1Hash), []byte(string2Hash)) + xorDistance, _ := XORBytes(string1Hash, string2Hash) return big.NewInt(0).SetBytes(xorDistance) } diff --git a/tests/integration/p2p/p2p_integration_test.go b/tests/integration/p2p/p2p_integration_test.go index 0db96a17..b16f890a 100644 --- a/tests/integration/p2p/p2p_integration_test.go +++ b/tests/integration/p2p/p2p_integration_test.go @@ -93,7 +93,7 @@ func TestP2PBasicIntegration(t *testing.T) { data := []byte(fmt.Sprintf("batch data %d", i)) batchData[i] = data // Use the same hashing algorithm as the store - hash, _ := utils.Sha3256hash(data) + hash, _ := utils.Blake3Hash(data) key := base58.Encode(hash) expectedKeys = append(expectedKeys, key) log.Printf("Batch data %d: %s, Expected key: %s", i, data, key) diff --git a/tests/integration/securegrpc/secure_connection_test.go b/tests/integration/securegrpc/secure_connection_test.go index 02285caf..820ee30e 100644 --- a/tests/integration/securegrpc/secure_connection_test.go +++ b/tests/integration/securegrpc/secure_connection_test.go @@ -8,9 +8,9 @@ import ( "fmt" "net" "os" + "regexp" "testing" "time" - "regexp" "github.com/stretchr/testify/require" "google.golang.org/grpc/grpclog" @@ -21,9 +21,9 @@ import ( pb "github.com/LumeraProtocol/supernode/gen/supernode/tests/integration/securegrpc" ltc "github.com/LumeraProtocol/supernode/pkg/net/credentials" "github.com/LumeraProtocol/supernode/pkg/net/credentials/alts/conn" - "github.com/LumeraProtocol/supernode/pkg/testutil" "github.com/LumeraProtocol/supernode/pkg/net/grpc/client" "github.com/LumeraProtocol/supernode/pkg/net/grpc/server" + "github.com/LumeraProtocol/supernode/pkg/testutil" ) func waitForServerReady(address string, timeout time.Duration) error { @@ -48,7 +48,7 @@ func (s *TestServiceImpl) TestMethod(ctx context.Context, req *pb.TestRequest) ( // request is "Hello Lumera Server! I'm [TestClient]!" re := regexp.MustCompile(`\[(.*?)\]`) matches := re.FindStringSubmatch(req.Message) - + clientName := "Unknown Client" if len(matches) > 1 { clientName = matches[1]