Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use drop-in mutex through build tags #2629

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ARG REMOTE_DEBUGGING=0
FROM golang:1.20-bullseye AS build

ARG RUN_TEST=0
ARG BUILD_TAGS=rocksdb
ARG BUILD_TAGS=rocksdb,fakemutex

# Define second time inside the build stage to work in bash conditions.
ARG REMOTE_DEBUGGING=0
Expand Down
4 changes: 2 additions & 2 deletions client/evilwallet/connector.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package evilwallet

import (
"sync"
"time"

"github.com/iotaledger/goshimmer/client"
Expand All @@ -14,6 +13,7 @@ import (
"github.com/iotaledger/goshimmer/packages/protocol/models"
"github.com/iotaledger/hive.go/core/slot"
"github.com/iotaledger/hive.go/crypto/identity"
"github.com/iotaledger/hive.go/runtime/syncutils"
)

type ServersStatus []*wallet.ServerStatus
Expand Down Expand Up @@ -47,7 +47,7 @@ type WebClients struct {
// helper variable indicating which clt was recently used, useful for double, triple,... spends
lastUsed int

mu sync.Mutex
mu syncutils.Mutex
}

// NewWebClients creates Connector from provided GoShimmerAPI urls.
Expand Down
32 changes: 16 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ require (
github.com/go-resty/resty/v2 v2.6.0
github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.4.2
github.com/iotaledger/hive.go/ads v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/app v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/autopeering v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/constraints v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230417125513-e2e89991217f
github.com/iotaledger/hive.go/crypto v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/ds v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/kvstore v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/lo v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/logger v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/objectstorage v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/runtime v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230417125513-e2e89991217f
github.com/iotaledger/hive.go/stringify v0.0.0-20230417125513-e2e89991217f
github.com/iotaledger/hive.go/ads v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/app v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/autopeering v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/constraints v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/crypto v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/ds v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/kvstore v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/lo v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/logger v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/objectstorage v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/runtime v0.0.0-20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230425063402-a1a1712d13a2
github.com/iotaledger/hive.go/stringify v0.0.0-20230425063402-a1a1712d13a2
github.com/jellydator/ttlcache/v2 v2.11.1
github.com/labstack/echo/v4 v4.10.0
github.com/libp2p/go-libp2p v0.27.1
Expand Down Expand Up @@ -68,7 +68,7 @@ require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/elastic/gosigar v0.14.2 // indirect
github.com/ethereum/go-ethereum v1.11.5 // indirect
github.com/ethereum/go-ethereum v1.11.6 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/flynn/noise v1.0.0 // indirect
github.com/francoispqt/gojay v1.2.13 // indirect
Expand All @@ -82,7 +82,7 @@ require (
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20230405160723-4a4c7d95572b // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
Expand Down
66 changes: 33 additions & 33 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
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/ethereum/go-ethereum v1.11.6 h1:2VF8Mf7XiSUfmoNOy3D+ocfl9Qu8baQBrCNbo2CXQ8E=
github.com/ethereum/go-ethereum v1.11.6/go.mod h1:+a8pUj1tOyJ2RinsNQD4326YS+leSoKGiG/uVVb0x6Y=
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
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=
Expand Down Expand Up @@ -331,8 +331,8 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
Expand Down Expand Up @@ -428,7 +428,7 @@ github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4DvxnHolD5P8pOtXigYlRuPLGl6moFx3ulM68=
github.com/hjson/hjson-go/v4 v4.0.0 h1:wlm6IYYqHjOdXH1gHev4VoXCaW20HdQAGCxdOEEg2cs=
github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E=
github.com/holiman/uint256 v1.2.0 h1:gpSYcPLWGv4sG43I2mVLiDZCNDh/EpGjSk8tmtxitHM=
github.com/holiman/uint256 v1.2.2-0.20230321075855-87b91420868c h1:DZfsyhDK1hnSS5lH8l+JggqzEleHteTYfutAiVlSUM8=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc=
github.com/huin/goupnp v1.1.0 h1:gEe0Dp/lZmPZiDFzJJaOfUpOvv2MKUkoBX8lDrn9vKU=
Expand All @@ -445,34 +445,34 @@ github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/C
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7 h1:dTrD7X2PTNgli6EbS4tV9qu3QAm/kBU3XaYZV2xdzys=
github.com/iotaledger/grocksdb v1.7.5-0.20230220105546-5162e18885c7/go.mod h1:ZRdPu684P0fQ1z8sXz4dj9H5LWHhz4a9oCtvjunkSrw=
github.com/iotaledger/hive.go/ads v0.0.0-20230417125513-e2e89991217f h1:plS7qPSBQZvxaUWm53sMOrv5jC83Bki1CJbhAnLXf9Y=
github.com/iotaledger/hive.go/ads v0.0.0-20230417125513-e2e89991217f/go.mod h1:wPxiUI/+jRqeHm/WQO70agvAWeouxzlkha0CkCpCNjs=
github.com/iotaledger/hive.go/app v0.0.0-20230417125513-e2e89991217f h1:7KxnUM6z9qjNPJThLCCneQAAtqMDcnfv/nDh78qgFRM=
github.com/iotaledger/hive.go/app v0.0.0-20230417125513-e2e89991217f/go.mod h1:vMXrLYkkHAqQC8yGLXcB1Adq9s3hPPf8Dv4sfd/koas=
github.com/iotaledger/hive.go/autopeering v0.0.0-20230417125513-e2e89991217f h1:a6SK3bEMe6/eP0++EMljy3Ldgn7XLwsXKU9sLBXh3dM=
github.com/iotaledger/hive.go/autopeering v0.0.0-20230417125513-e2e89991217f/go.mod h1:WDIeFSOpeEL1MNSQBlWr0FgIxke+UlrYJ37ncQP+Fl0=
github.com/iotaledger/hive.go/constraints v0.0.0-20230417125513-e2e89991217f h1:CmfPv23a32gSf3iYx0LAHRKZydt9hPgnRTknR85Cles=
github.com/iotaledger/hive.go/constraints v0.0.0-20230417125513-e2e89991217f/go.mod h1:bvXXc6quBdERMMKnirr2+iQU4WnTz4KDbdHcusW9Ats=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230417125513-e2e89991217f h1:qjwpHDPMAq0BLVol8lWylMPFE/tSKTl6xDR1mBnUoAE=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230417125513-e2e89991217f/go.mod h1:DG3Z4F+nBNapmU3RaWUS/5YUtqzaj/EclUkRrV74rV4=
github.com/iotaledger/hive.go/crypto v0.0.0-20230417125513-e2e89991217f h1:fUUKFqf2SBBqHffRYqML+aoCwzw5s+9QmTV3nB+EydM=
github.com/iotaledger/hive.go/crypto v0.0.0-20230417125513-e2e89991217f/go.mod h1:xp9Wbk2vp4LHb0xTbDRphSJLgLYvRNNe5lWHd8OLI5c=
github.com/iotaledger/hive.go/ds v0.0.0-20230417125513-e2e89991217f h1:LQxEzB+w5aC+wdjz2AYAwzwJz0gars8Ibuau4EYSxL8=
github.com/iotaledger/hive.go/ds v0.0.0-20230417125513-e2e89991217f/go.mod h1:wwPP73b6InomUeirqEfaYNqoTsuzxNZPa/ci4efzuyU=
github.com/iotaledger/hive.go/kvstore v0.0.0-20230417125513-e2e89991217f h1:G074X16SOzjiBJtQkIfAvjm+dX8T4IhvztyK81V8uro=
github.com/iotaledger/hive.go/kvstore v0.0.0-20230417125513-e2e89991217f/go.mod h1:oET9GdiN58SWw+INHuNwmiBlfmfRyoe1cJMx7TYk1Js=
github.com/iotaledger/hive.go/lo v0.0.0-20230417125513-e2e89991217f h1:Q1MM9T6zE9iXk6QtUgqGzxuk9j7pNapbB0iD+39VNNA=
github.com/iotaledger/hive.go/lo v0.0.0-20230417125513-e2e89991217f/go.mod h1:dsAfSt53PGgT3n675q2wFLGcvRlLNS3Affhf+vnFbb4=
github.com/iotaledger/hive.go/logger v0.0.0-20230417125513-e2e89991217f h1:i0Hyuamj1iRRixOusCCMlHkHR/NAs9+cv/lFUV94kts=
github.com/iotaledger/hive.go/logger v0.0.0-20230417125513-e2e89991217f/go.mod h1:7ZE+E8JgqJ9zxg5/FOObEfYyBpC813TMv6Qzcm2YekY=
github.com/iotaledger/hive.go/objectstorage v0.0.0-20230417125513-e2e89991217f h1:10ZUosNi8HCD7KyWWm2kocacqCj52l/yGlOVYNgJRSA=
github.com/iotaledger/hive.go/objectstorage v0.0.0-20230417125513-e2e89991217f/go.mod h1:E7/slsvlTsSP+laCKWbBOmSPg83UTh9mPm8ostFOlv4=
github.com/iotaledger/hive.go/runtime v0.0.0-20230417125513-e2e89991217f h1:c3PjrBnD26nlUOPlBlF1dS4sv1LN5ndJqfUvWwO9jwQ=
github.com/iotaledger/hive.go/runtime v0.0.0-20230417125513-e2e89991217f/go.mod h1:kYmuL6D9aDLqLpskEEC+DGKXC/9mx7wtLF0WItRuexs=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230417125513-e2e89991217f h1:tUw+oQKBsM67QeI3dGKhb7p/ziZ35+pgN9fu8W06UFY=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230417125513-e2e89991217f/go.mod h1:NrZTRu5hrKwSxzPyA5G8BxaQakOLRvoFJM+5vtHDE04=
github.com/iotaledger/hive.go/stringify v0.0.0-20230417125513-e2e89991217f h1:C2AIi1lpQieqa5piGeJN0byheffJNF0aMiiyUujU1b8=
github.com/iotaledger/hive.go/stringify v0.0.0-20230417125513-e2e89991217f/go.mod h1:l/F3cA/+67QdNj+sohv2v4HhmsdOcWScoA+sVYoAE4c=
github.com/iotaledger/hive.go/ads v0.0.0-20230425063402-a1a1712d13a2 h1:XwuBd2W1VcAwMfgLJP5WJCo4d9b7ssXB2aongJAaY9g=
github.com/iotaledger/hive.go/ads v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:wPxiUI/+jRqeHm/WQO70agvAWeouxzlkha0CkCpCNjs=
github.com/iotaledger/hive.go/app v0.0.0-20230425063402-a1a1712d13a2 h1:Z2x8TvwMUUbCrk1SDU99Ij+/WbpiuFB8RTrIKToyaxw=
github.com/iotaledger/hive.go/app v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:vMXrLYkkHAqQC8yGLXcB1Adq9s3hPPf8Dv4sfd/koas=
github.com/iotaledger/hive.go/autopeering v0.0.0-20230425063402-a1a1712d13a2 h1:PREknjsj8V4sMVD3sR6+fEb/sOeYf07En+OSFp6yGjg=
github.com/iotaledger/hive.go/autopeering v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:WDIeFSOpeEL1MNSQBlWr0FgIxke+UlrYJ37ncQP+Fl0=
github.com/iotaledger/hive.go/constraints v0.0.0-20230425063402-a1a1712d13a2 h1:lp4PmIk2lJoPbIXs25n7Hyb0Q8BSGRWfxnWVhX7z6l0=
github.com/iotaledger/hive.go/constraints v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:bvXXc6quBdERMMKnirr2+iQU4WnTz4KDbdHcusW9Ats=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230425063402-a1a1712d13a2 h1:RH1NTY0HfBCRp88px8qZ7Cn28R3mTt/1yDRxNwKCHhc=
github.com/iotaledger/hive.go/core v1.0.0-rc.3.0.20230425063402-a1a1712d13a2/go.mod h1:DG3Z4F+nBNapmU3RaWUS/5YUtqzaj/EclUkRrV74rV4=
github.com/iotaledger/hive.go/crypto v0.0.0-20230425063402-a1a1712d13a2 h1:gukBhOoK7NdjTGSiWc+ixDipNycWIiRLjxTB7oaGm0g=
github.com/iotaledger/hive.go/crypto v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:xp9Wbk2vp4LHb0xTbDRphSJLgLYvRNNe5lWHd8OLI5c=
github.com/iotaledger/hive.go/ds v0.0.0-20230425063402-a1a1712d13a2 h1:UJ2/JF5OpkLjA7rSTFPf0SO1mwCYWvxCqRm0u4ePPWU=
github.com/iotaledger/hive.go/ds v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:wwPP73b6InomUeirqEfaYNqoTsuzxNZPa/ci4efzuyU=
github.com/iotaledger/hive.go/kvstore v0.0.0-20230425063402-a1a1712d13a2 h1:0w+4/SXRRQSKS/w7eqPdw/tueymY/W4mZG5eJRBv7Fo=
github.com/iotaledger/hive.go/kvstore v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:oET9GdiN58SWw+INHuNwmiBlfmfRyoe1cJMx7TYk1Js=
github.com/iotaledger/hive.go/lo v0.0.0-20230425063402-a1a1712d13a2 h1:RzyniGJR0ydfc6ZyfzCLrTlef6N4Y2wpzsc+pYSjog8=
github.com/iotaledger/hive.go/lo v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:dsAfSt53PGgT3n675q2wFLGcvRlLNS3Affhf+vnFbb4=
github.com/iotaledger/hive.go/logger v0.0.0-20230425063402-a1a1712d13a2 h1:wnCXalueu/SfiISMTeAKXlxl9AiZQLUo/4HdP+BuZDc=
github.com/iotaledger/hive.go/logger v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:7ZE+E8JgqJ9zxg5/FOObEfYyBpC813TMv6Qzcm2YekY=
github.com/iotaledger/hive.go/objectstorage v0.0.0-20230425063402-a1a1712d13a2 h1:UhivYtaraLed69zqyfDVfxzdfZsqrYemGQrK2VVmYeM=
github.com/iotaledger/hive.go/objectstorage v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:E7/slsvlTsSP+laCKWbBOmSPg83UTh9mPm8ostFOlv4=
github.com/iotaledger/hive.go/runtime v0.0.0-20230425063402-a1a1712d13a2 h1:8rpKh1ePJsEDEzWdDstS10zisik03DaElmcIS9Rl464=
github.com/iotaledger/hive.go/runtime v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:kYmuL6D9aDLqLpskEEC+DGKXC/9mx7wtLF0WItRuexs=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230425063402-a1a1712d13a2 h1:dIe9DBZ9R1tdjDcdaiOO6+AjvnryLerQZpmqAg/5LYU=
github.com/iotaledger/hive.go/serializer/v2 v2.0.0-rc.1.0.20230425063402-a1a1712d13a2/go.mod h1:NrZTRu5hrKwSxzPyA5G8BxaQakOLRvoFJM+5vtHDE04=
github.com/iotaledger/hive.go/stringify v0.0.0-20230425063402-a1a1712d13a2 h1:6FRZKhOiQEGhnrvS1uYdrCc+f9FIqiuUd7odspJJYVc=
github.com/iotaledger/hive.go/stringify v0.0.0-20230425063402-a1a1712d13a2/go.mod h1:l/F3cA/+67QdNj+sohv2v4HhmsdOcWScoA+sVYoAE4c=
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=
Expand Down
2 changes: 1 addition & 1 deletion packages/app/retainer/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type cachedMetadata struct {
Acceptance *blockWithTime[*blockgadget.Block]
Confirmation *blockWithTime[*blockgadget.Block]

syncutils.RWMutexFake
syncutils.RWMutex
}

func newCachedMetadata() *cachedMetadata {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/commitment/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,5 @@ var (
_IDAliases = make(map[ID]string)

// _IDAliasesMutex is the mutex that is used to synchronize access to the previous map.
_IDAliasesMutex = syncutils.RWMutexFake{}
_IDAliasesMutex = syncutils.RWMutex{}
)
5 changes: 2 additions & 3 deletions packages/core/database/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"path/filepath"
"sort"
"strconv"
"sync"

"github.com/pkg/errors"
"github.com/zyedidia/generic/cache"
Expand All @@ -29,10 +28,10 @@ type Manager struct {
openDBs *cache.Cache[slot.Index, *dbInstance]
bucketedBaseDir string
dbSizes *shrinkingmap.ShrinkingMap[slot.Index, int64]
openDBsMutex sync.Mutex
openDBsMutex syncutils.Mutex

maxPruned slot.Index
maxPrunedMutex syncutils.RWMutexFake
maxPrunedMutex syncutils.RWMutex

// The granularity of the DB instances (i.e. how many buckets/slots are stored in one DB).
optsGranularity int64
Expand Down
2 changes: 1 addition & 1 deletion packages/core/latestblocktracker/latestblocktracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
type LatestBlockTracker struct {
blockID models.BlockID
time time.Time
mutex syncutils.RWMutexFake
mutex syncutils.RWMutex
}

// New return a new LatestBlockTracker.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/traits/batchcommittable.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type batchCommittable struct {
batchSlot slot.Index

// batchSlotMutex is used to synchronize access to batchSlot.
batchSlotMutex syncutils.RWMutexFake
batchSlotMutex syncutils.RWMutex

// Committable is the underlying committable trait.
Committable
Expand Down
2 changes: 1 addition & 1 deletion packages/core/votes/latestvotes/latestvotes.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type LatestVotes[EntityIndex constraints.Integer, VotePowerType constraints.Comp
voter identity.ID
t *thresholdmap.ThresholdMap[EntityIndex, VotePowerType]

m syncutils.RWMutexFake
m syncutils.RWMutex
}

// NewLatestVotes creates a new NewLatestVotes instance associated with the given details.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/votes/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (v *Vote[ConflictIDType, VotePowerType]) WithVotePower(power VotePowerType)
type Votes[ConflictIDType comparable, VotePowerType constraints.Comparable[VotePowerType]] struct {
o orderedmap.OrderedMap[identity.ID, *Vote[ConflictIDType, VotePowerType]]

m syncutils.RWMutexFake
m syncutils.RWMutex
}

func NewVotes[ConflictIDType comparable, VotePowerType constraints.Comparable[VotePowerType]]() *Votes[ConflictIDType, VotePowerType] {
Expand Down
4 changes: 2 additions & 2 deletions packages/network/manualpeering/manualpeering.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ type Manager struct {
startOnce sync.Once
isStarted atomic.Bool
stopOnce sync.Once
stopMutex syncutils.RWMutexFake
stopMutex syncutils.RWMutex
isStopped bool
reconnectInterval time.Duration
knownPeersMutex syncutils.RWMutexFake
knownPeersMutex syncutils.RWMutex
knownPeers map[identity.ID]*knownPeer
workerPool *workerpool.WorkerPool

Expand Down
6 changes: 3 additions & 3 deletions packages/network/p2p/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type Manager struct {
local *peer.Local
libp2pHost host.Host

acceptMutex syncutils.RWMutexFake
acceptMutex syncutils.RWMutex
acceptMap map[libp2ppeer.ID]*AcceptMatcher

log *logger.Logger
Expand All @@ -62,9 +62,9 @@ type Manager struct {
isStopped atomic.Bool

neighbors map[identity.ID]*Neighbor
neighborsMutex syncutils.RWMutexFake
neighborsMutex syncutils.RWMutex

registeredProtocolsMutex syncutils.RWMutexFake
registeredProtocolsMutex syncutils.RWMutex
registeredProtocols map[protocol.ID]*ProtocolHandler
}

Expand Down
6 changes: 3 additions & 3 deletions packages/network/p2p/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func (m *Manager) handleStream(stream network.Stream) {
type AcceptMatcher struct {
Peer *peer.Peer // connecting peer
Libp2pID libp2ppeer.ID
StreamChMutex syncutils.RWMutexFake
StreamChMutex syncutils.RWMutex
StreamCh map[protocol.ID]chan *PacketsStream
Ctx context.Context
CtxCancel context.CancelFunc
Expand Down Expand Up @@ -299,9 +299,9 @@ type PacketsStream struct {
network.Stream
packetFactory func() proto.Message

readerLock sync.Mutex
readerLock syncutils.Mutex
reader *libp2putil.UvarintReader
writerLock sync.Mutex
writerLock syncutils.Mutex
writer *libp2putil.UvarintWriter
packetsRead *atomic.Uint64
packetsWritten *atomic.Uint64
Expand Down
5 changes: 2 additions & 3 deletions packages/network/protocol.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package network

import (
"sync"

"github.com/pkg/errors"
"google.golang.org/protobuf/proto"

Expand All @@ -19,6 +17,7 @@ import (
"github.com/iotaledger/hive.go/ds/types"
"github.com/iotaledger/hive.go/lo"
"github.com/iotaledger/hive.go/runtime/options"
"github.com/iotaledger/hive.go/runtime/syncutils"
"github.com/iotaledger/hive.go/runtime/workerpool"
)

Expand All @@ -36,7 +35,7 @@ type Protocol struct {
duplicateBlockBytesFilter *bytesfilter.BytesFilter

requestedBlockHashes *shrinkingmap.ShrinkingMap[types.Identifier, types.Empty]
requestedBlockHashesMutex sync.Mutex
requestedBlockHashesMutex syncutils.Mutex
}

func NewProtocol(network Endpoint, workerPool *workerpool.WorkerPool, slotTimeProvider *slot.TimeProvider, opts ...options.Option[Protocol]) (protocol *Protocol) {
Expand Down
Loading
Loading