diff --git a/go.mod b/go.mod index 275436b6fc..bc83a38b3e 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0 github.com/CortexFoundation/inference v1.0.2-0.20230307032835-9197d586a4e8 github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66 - github.com/CortexFoundation/torrentfs v1.0.69-0.20250223164311-777618afaf30 + github.com/CortexFoundation/torrentfs v1.0.69-0.20250312155646-e666064eb3c2 github.com/VictoriaMetrics/fastcache v1.12.2 github.com/arsham/figurine v1.3.0 github.com/aws/aws-sdk-go-v2 v1.36.3 @@ -80,7 +80,7 @@ require ( github.com/CortexFoundation/compress v0.0.0-20240218153512-9074bdc2397c // indirect github.com/CortexFoundation/cvm-runtime v0.0.0-20221117094012-b5a251885572 // indirect github.com/CortexFoundation/merkletree v0.0.0-20240407093305-416581a62b5b // indirect - github.com/CortexFoundation/robot v1.0.7-0.20240728100700-258c7a048a1f // indirect + github.com/CortexFoundation/robot v1.0.7-0.20250226143617-b3819ddaddc6 // indirect github.com/CortexFoundation/wormhole v0.0.2-0.20241128010855-a23c88842cfa // indirect github.com/DataDog/zstd v1.5.6 // indirect github.com/RoaringBitmap/roaring v1.9.4 // indirect @@ -120,7 +120,7 @@ require ( github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/benbjohnson/immutable v0.4.3 // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/bits-and-blooms/bitset v1.21.0 // indirect + github.com/bits-and-blooms/bitset v1.22.0 // indirect github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 // indirect github.com/bwmarrin/snowflake v0.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect @@ -137,7 +137,7 @@ require ( github.com/consensys/bavard v0.1.30 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect github.com/crate-crypto/go-ipa v0.0.0-20240724233137-53bbb0ceb27a // indirect - github.com/dgraph-io/badger/v4 v4.6.0 // indirect + github.com/dgraph-io/badger/v4 v4.6.1-0.20250307192050-12bc62196753 // indirect github.com/dgraph-io/ristretto/v2 v2.1.0 // indirect github.com/dlclark/regexp2 v1.11.5 // indirect github.com/dustin/go-humanize v1.0.1 // indirect @@ -193,9 +193,9 @@ require ( github.com/pion/mdns/v2 v2.0.7 // indirect github.com/pion/randutil v0.1.0 // indirect github.com/pion/rtcp v1.2.15 // indirect - github.com/pion/rtp v1.8.12 // indirect + github.com/pion/rtp v1.8.13 // indirect github.com/pion/sctp v1.8.37 // indirect - github.com/pion/sdp/v3 v3.0.10 // indirect + github.com/pion/sdp/v3 v3.0.11 // indirect github.com/pion/srtp/v3 v3.0.4 // indirect github.com/pion/stun/v3 v3.0.0 // indirect github.com/pion/transport/v2 v2.2.10 // indirect @@ -224,7 +224,7 @@ require ( github.com/tklauser/numcpus v0.10.0 // indirect github.com/ucwong/filecache v1.0.6-0.20230405163841-810d53ced4bd // indirect github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb // indirect - github.com/ucwong/golang-kv v1.0.24-0.20250223163943-e9c513728ab1 // indirect + github.com/ucwong/golang-kv v1.0.24-0.20250311205856-bf6be4c34641 // indirect github.com/ucwong/shard v1.0.1-0.20240327124306-59a521744cae // indirect github.com/wlynxg/anet v0.0.5 // indirect github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect diff --git a/go.sum b/go.sum index e49b583bca..afdd63746d 100644 --- a/go.sum +++ b/go.sum @@ -63,15 +63,15 @@ github.com/CortexFoundation/inference v1.0.2-0.20230307032835-9197d586a4e8 h1:W/ github.com/CortexFoundation/inference v1.0.2-0.20230307032835-9197d586a4e8/go.mod h1:Doj3mBNzdjCDvKVwysKaHEPbS20A7RRaQY0bHtEVz88= github.com/CortexFoundation/merkletree v0.0.0-20240407093305-416581a62b5b h1:PJvLUrORQ3nEiEYK+X06iRRi1Ayq93mqZ8z+YLSb12I= github.com/CortexFoundation/merkletree v0.0.0-20240407093305-416581a62b5b/go.mod h1:H/XQUOyyWqFweHqa39mLPewU3q9GTY4wvf8KQduuuPQ= -github.com/CortexFoundation/robot v1.0.7-0.20240728100700-258c7a048a1f h1:Xmkrf0gGFtmOidWja2cfAkqRTzJoyq8wrhHCDKg/jLA= -github.com/CortexFoundation/robot v1.0.7-0.20240728100700-258c7a048a1f/go.mod h1:o0QGALGkHIwjrz3YlDegPjOtIF5hL3BF7vgvmJnd7ZQ= +github.com/CortexFoundation/robot v1.0.7-0.20250226143617-b3819ddaddc6 h1:Piuiy3tH3FndM0E4j5RKhmb8IOY+utnE4l0nO52dZp8= +github.com/CortexFoundation/robot v1.0.7-0.20250226143617-b3819ddaddc6/go.mod h1:o0QGALGkHIwjrz3YlDegPjOtIF5hL3BF7vgvmJnd7ZQ= github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66 h1:yJbN4DFvpStCShXOVxNV64aawsPqizLuXZhrnhCr2fY= github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66/go.mod h1:AkjV4OECAskB9m6w+2e84F0Zcx7oZWEmHB3EKoaDXYk= github.com/CortexFoundation/torrentfs v1.0.13-0.20200623060705-ce027f43f2f8/go.mod h1:Ma+tGhPPvz4CEZHaqEJQMOEGOfHeQBiAoNd1zyc/w3Q= github.com/CortexFoundation/torrentfs v1.0.14-0.20200703071639-3fcabcabf274/go.mod h1:qnb3YlIJmuetVBtC6Lsejr0Xru+1DNmDCdTqnwy7lhk= github.com/CortexFoundation/torrentfs v1.0.20-0.20200810031954-d36d26f82fcc/go.mod h1:N5BsicP5ynjXIi/Npl/SRzlJ630n1PJV2sRj0Z0t2HA= -github.com/CortexFoundation/torrentfs v1.0.69-0.20250223164311-777618afaf30 h1:DYJCD/9+bU/cPKu9wpaxEJiYi56SZmY3yj38vqwfdIw= -github.com/CortexFoundation/torrentfs v1.0.69-0.20250223164311-777618afaf30/go.mod h1:tfURQ0OpnbNwjwuIFv7Ur36kBHsYvdUd+gDcDq2qQX0= +github.com/CortexFoundation/torrentfs v1.0.69-0.20250312155646-e666064eb3c2 h1:o9CjXY9IooKiupewBv/tNupKuF2TcdAGs6uPwcFZjww= +github.com/CortexFoundation/torrentfs v1.0.69-0.20250312155646-e666064eb3c2/go.mod h1:TkGMGmFcKUZq1hrIOSJOpE9McXDLYDA8itJrdNaMiE0= github.com/CortexFoundation/wormhole v0.0.2-0.20241128010855-a23c88842cfa h1:46VAGWxOwpoLlPNcR9etAhK0NtT215skO9Wl4i14r4o= github.com/CortexFoundation/wormhole v0.0.2-0.20241128010855-a23c88842cfa/go.mod h1:ipzmPabDgzYKUbXkGVe2gTkBEp+MsDx6pXGiuYzmP6s= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= @@ -305,8 +305,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.1-0.20200416141419-39a59b1b2866/go.mod h1:bXegrmTNBg3jTbSwV0BSBcSSfHHctupCgavZr/gX5fo= github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/bits-and-blooms/bitset v1.21.0 h1:9RlxRbMI5dRNNburKqfDSiz5POfImKgtablyV01WUw0= -github.com/bits-and-blooms/bitset v1.21.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.22.0 h1:Tquv9S8+SGaS3EhyA+up3FXzmkhxPGjQQCkcs2uw7w4= +github.com/bits-and-blooms/bitset v1.22.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= @@ -412,8 +412,8 @@ github.com/decred/dcrd/crypto/blake256 v1.1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U github.com/decred/dcrd/crypto/blake256 v1.1.0/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h40= -github.com/dgraph-io/badger/v4 v4.6.0 h1:acOwfOOZ4p1dPRnYzvkVm7rUk2Y21TgPVepCy5dJdFQ= -github.com/dgraph-io/badger/v4 v4.6.0/go.mod h1:KSJ5VTuZNC3Sd+YhvVjk2nYua9UZnnTr/SkXvdtiPgI= +github.com/dgraph-io/badger/v4 v4.6.1-0.20250307192050-12bc62196753 h1:dBNqunZdbGzqPYjc17AIm9RTGwKQMgkwp0ujC7PQtLk= +github.com/dgraph-io/badger/v4 v4.6.1-0.20250307192050-12bc62196753/go.mod h1:xQxKyXAv2sYMJdNDBPigtGej3TqdDOZs4lcpk2ze0wk= github.com/dgraph-io/ristretto/v2 v2.1.0 h1:59LjpOJLNDULHh8MC4UaegN52lC4JnO2dITsie/Pa8I= github.com/dgraph-io/ristretto/v2 v2.1.0/go.mod h1:uejeqfYXpUomfse0+lO+13ATz4TypQYLJZzBSAemuB4= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= @@ -995,14 +995,14 @@ github.com/pion/rtcp v1.2.15 h1:LZQi2JbdipLOj4eBjK4wlVoQWfrZbh3Q6eHtWtJBZBo= github.com/pion/rtcp v1.2.15/go.mod h1:jlGuAjHMEXwMUHK78RgX0UmEJFV4zUKOFHR7OP+D3D0= github.com/pion/rtp v1.3.2/go.mod h1:q9wPnA96pu2urCcW/sK/RiDn597bhGoAQQ+y2fDwHuY= github.com/pion/rtp v1.4.0/go.mod h1:/l4cvcKd0D3u9JLs2xSVI95YkfXW87a3br3nqmVtSlE= -github.com/pion/rtp v1.8.12 h1:nsKs8Wi0jQyBFHU3qmn/OvtZrhktVfJY0vRxwACsL5U= -github.com/pion/rtp v1.8.12/go.mod h1:8uMBJj32Pa1wwx8Fuv/AsFhn8jsgw+3rUC2PfoBZ8p4= +github.com/pion/rtp v1.8.13 h1:8uSUPpjSL4OlwZI8Ygqu7+h2p9NPFB+yAZ461Xn5sNg= +github.com/pion/rtp v1.8.13/go.mod h1:8uMBJj32Pa1wwx8Fuv/AsFhn8jsgw+3rUC2PfoBZ8p4= github.com/pion/sctp v1.7.6/go.mod h1:ichkYQ5tlgCQwEwvgfdcAolqx1nHbYCxo4D7zK/K0X8= github.com/pion/sctp v1.8.37 h1:ZDmGPtRPX9mKCiVXtMbTWybFw3z/hVKAZgU81wcOrqs= github.com/pion/sctp v1.8.37/go.mod h1:cNiLdchXra8fHQwmIoqw0MbLLMs+f7uQ+dGMG2gWebE= github.com/pion/sdp/v2 v2.3.7/go.mod h1:+ZZf35r1+zbaWYiZLfPutWfx58DAWcGb2QsS3D/s9M8= -github.com/pion/sdp/v3 v3.0.10 h1:6MChLE/1xYB+CjumMw+gZ9ufp2DPApuVSnDT8t5MIgA= -github.com/pion/sdp/v3 v3.0.10/go.mod h1:88GMahN5xnScv1hIMTqLdu/cOcUkj6a9ytbncwMCq2E= +github.com/pion/sdp/v3 v3.0.11 h1:VhgVSopdsBKwhCFoyyPmT1fKMeV9nLMrEKxNOdy3IVI= +github.com/pion/sdp/v3 v3.0.11/go.mod h1:88GMahN5xnScv1hIMTqLdu/cOcUkj6a9ytbncwMCq2E= github.com/pion/srtp v1.3.1/go.mod h1:nxEytDDGTN+eNKJ1l5gzOCWQFuksgijorsSlgEjc40Y= github.com/pion/srtp v1.3.2/go.mod h1:snPrfN+gVpRBpmats49oxLWfcFB01eH1N9F+N7+dxKI= github.com/pion/srtp/v3 v3.0.4 h1:2Z6vDVxzrX3UHEgrUyIGM4rRouoC7v+NiF1IHtp9B5M= @@ -1250,8 +1250,8 @@ github.com/ucwong/filecache v1.0.6-0.20230405163841-810d53ced4bd h1:gBtlvLAsgLk+ github.com/ucwong/filecache v1.0.6-0.20230405163841-810d53ced4bd/go.mod h1:ddwX+NCjMZPdpzcGh1fcEbNTUTCtKgt2hC2rqvmLKgA= github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb h1:dVZH3AH9f7zB3VBmsjn25B7lfcAyMP4QxdFYTrfj7tg= github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb/go.mod h1:3yswsBsVuwsOjDvFfC5Na9XSEf4HC7mj3W3g6jvSY/s= -github.com/ucwong/golang-kv v1.0.24-0.20250223163943-e9c513728ab1 h1:QuX7gJwdxeglWdh9t7i+M28X7JlNyEuJw+neRGjhlt4= -github.com/ucwong/golang-kv v1.0.24-0.20250223163943-e9c513728ab1/go.mod h1:YDWETCiFFt1G2ymAcg+RSIFb0N9MJ7RDqK7hxa8Gp5o= +github.com/ucwong/golang-kv v1.0.24-0.20250311205856-bf6be4c34641 h1:7FmEn68tfbvGHWhQBBT0/WaFusCb+v+dYMqU0Zv/1KA= +github.com/ucwong/golang-kv v1.0.24-0.20250311205856-bf6be4c34641/go.mod h1:Hiue4miMAKqEKFi6ofQpu6bmeoPINJkfLMiunNFzfRw= github.com/ucwong/golang-set v1.8.1-0.20200419153428-d7b0b1ac2d43/go.mod h1:xu0FaiQFGbBcFZj2o7udZ5rbA8jRTsv47hkPoG5qQNM= github.com/ucwong/goleveldb v1.0.3-0.20200508074755-578cba616f37/go.mod h1:dgJUTtDxq/ne6/JzZhHzF24OL/uqILz9IWk8HmT4V2g= github.com/ucwong/goleveldb v1.0.3-0.20200618184106-f1c6bc3a428b/go.mod h1:7Sq6w7AfEZuB/a6mrlvHCSXCSkqojCMMrM3Ei12QAT0= diff --git a/vendor/github.com/CortexFoundation/robot/backend/tree.go b/vendor/github.com/CortexFoundation/robot/backend/tree.go index 40441741e3..16057ebbfd 100644 --- a/vendor/github.com/CortexFoundation/robot/backend/tree.go +++ b/vendor/github.com/CortexFoundation/robot/backend/tree.go @@ -19,7 +19,6 @@ package backend import ( "errors" "sort" - "strconv" "time" "github.com/CortexFoundation/CortexTheseus/common" @@ -133,7 +132,7 @@ func (fs *ChainDB) writeRoot(number uint64, root []byte) error { if err != nil { return err } - e := buk.Put([]byte(strconv.FormatUint(number, 16)), root) + e := buk.Put([]byte(hexutil.EncodeUint64(number)), root) if e == nil { log.Debug("Root update", "number", number, "root", common.BytesToHash(root)) @@ -153,7 +152,7 @@ func (fs *ChainDB) GetRoot(number uint64) (root []byte) { return errors.New("root bucket not exist") } - v := buk.Get([]byte(strconv.FormatUint(number, 16))) + v := buk.Get([]byte(hexutil.EncodeUint64(number))) if v == nil { return errors.New("root value not exist") } diff --git a/vendor/github.com/CortexFoundation/robot/rpc.go b/vendor/github.com/CortexFoundation/robot/rpc.go index 6fc9a0b870..b9f702789f 100644 --- a/vendor/github.com/CortexFoundation/robot/rpc.go +++ b/vendor/github.com/CortexFoundation/robot/rpc.go @@ -160,6 +160,17 @@ func (m *Monitor) getReceipt(tx string) (receipt types.Receipt, err error) { return } +func (m *Monitor) getBlockReceipts(hash string) (receipt []types.Receipt, err error) { + rpcReceiptMeter.Mark(1) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + if err = m.cl.CallContext(ctx, &receipt, "ctxc_getBlockReceipts", hash); err != nil { + log.Warn("R array is nil", "R", hash, "err", err) + } + + return +} + func (m *Monitor) currentBlock() (uint64, bool, error) { var ( currentNumber hexutil.Uint64 diff --git a/vendor/github.com/bits-and-blooms/bitset/bitset.go b/vendor/github.com/bits-and-blooms/bitset/bitset.go index ebc7178094..46d05b9ed8 100644 --- a/vendor/github.com/bits-and-blooms/bitset/bitset.go +++ b/vendor/github.com/bits-and-blooms/bitset/bitset.go @@ -1385,16 +1385,36 @@ func (b *BitSet) UnmarshalJSON(data []byte) error { // Rank returns the number of set bits up to and including the index // that are set in the bitset. // See https://en.wikipedia.org/wiki/Ranking#Ranking_in_statistics -func (b *BitSet) Rank(index uint) uint { - if index >= b.length { - return b.Count() +func (b *BitSet) Rank(index uint) (rank uint) { + index++ // Rank is up to and including + + // needed more than once + length := len(b.set) + + // TODO: built-in min requires go1.21 or later + // idx := min(int(index>>6), len(b.set)) + idx := int(index >> 6) + if idx > length { + idx = length + } + + // sum up the popcounts until idx ... + // TODO: cannot range over idx (...): requires go1.22 or later + // for j := range idx { + for j := 0; j < idx; j++ { + if w := b.set[j]; w != 0 { + rank += uint(bits.OnesCount64(w)) + } } - leftover := (index + 1) & 63 - answer := uint(popcntSlice(b.set[:(index+1)>>6])) - if leftover != 0 { - answer += uint(bits.OnesCount64(b.set[(index+1)>>6] << (64 - leftover))) + + // ... plus partial word at idx, + // make Rank inlineable and faster in the end + // don't test index&63 != 0, just add, less branching + if idx < length { + rank += uint(bits.OnesCount64(b.set[idx] << (64 - index&63))) } - return answer + + return } // Select returns the index of the jth set bit, where j is the argument. diff --git a/vendor/github.com/dgraph-io/badger/v4/README.md b/vendor/github.com/dgraph-io/badger/v4/README.md index fe581a7524..ec349a3d9c 100644 --- a/vendor/github.com/dgraph-io/badger/v4/README.md +++ b/vendor/github.com/dgraph-io/badger/v4/README.md @@ -277,6 +277,7 @@ Below is a list of known projects that use Badger: and badger db - [MightyMap](https://github.com/thisisdevelopment/mightymap) - Mightymap: Conveys both robustness and high capability, fitting for a powerful concurrent map. +- [FlowG](https://github.com/link-society/flowg) - A low-code log processing facility If you are using Badger in a project please send a pull request to add it to the list. diff --git a/vendor/github.com/pion/rtp/codecs/h264_packet.go b/vendor/github.com/pion/rtp/codecs/h264_packet.go index b5e50a8fa4..fdc00edc65 100644 --- a/vendor/github.com/pion/rtp/codecs/h264_packet.go +++ b/vendor/github.com/pion/rtp/codecs/h264_packet.go @@ -43,26 +43,47 @@ var ( ) func emitNalus(nals []byte, emit func([]byte)) { - start := 0 + // look for 3-byte NALU start code + start := bytes.Index(nals, naluStartCode) + offset := 3 + + if start == -1 { + // no start code, emit the whole buffer + emit(nals) + + return + } + length := len(nals) for start < length { - end := bytes.Index(nals[start:], annexbNALUStartCode) - offset := 4 - if end == -1 { - end = bytes.Index(nals[start:], naluStartCode) - offset = 3 - } + // look for the next NALU start (end of this NALU) + end := bytes.Index(nals[start+offset:], naluStartCode) if end == -1 { - emit(nals[start:]) + // no more NALUs, emit the rest of the buffer + emit(nals[start+offset:]) break } - emit(nals[start : start+end]) + // next NALU start + nextStart := start + offset + end - // next NAL start position - start += end + offset + // check if the next NALU is actually a 4-byte start code + endIs4Byte := nals[nextStart-1] == 0 + if endIs4Byte { + nextStart-- + } + + emit(nals[start+offset : nextStart]) + + start = nextStart + + if endIs4Byte { + offset = 4 + } else { + offset = 3 + } } } diff --git a/vendor/github.com/pion/sdp/v3/util.go b/vendor/github.com/pion/sdp/v3/util.go index 7cf17a9611..4550feece5 100644 --- a/vendor/github.com/pion/sdp/v3/util.go +++ b/vendor/github.com/pion/sdp/v3/util.go @@ -19,12 +19,16 @@ const ( ) var ( - errExtractCodecRtpmap = errors.New("could not extract codec from rtpmap") - errExtractCodecFmtp = errors.New("could not extract codec from fmtp") - errExtractCodecRtcpFb = errors.New("could not extract codec from rtcp-fb") - errPayloadTypeNotFound = errors.New("payload type not found") - errCodecNotFound = errors.New("codec not found") - errSyntaxError = errors.New("SyntaxError") + errExtractCodecRtpmap = errors.New("could not extract codec from rtpmap") + errExtractCodecFmtp = errors.New("could not extract codec from fmtp") + errExtractCodecRtcpFb = errors.New("could not extract codec from rtcp-fb") + errMultipleName = errors.New("codec has multiple names defined") + errMultipleClockRate = errors.New("codec has multiple clock rates") + errMultipleEncodingParameters = errors.New("codec has multiple encoding parameters") + errMultipleFmtp = errors.New("codec has multiple fmtp values") + errPayloadTypeNotFound = errors.New("payload type not found") + errCodecNotFound = errors.New("codec not found") + errSyntaxError = errors.New("SyntaxError") ) // ConnectionRole indicates which of the end points should initiate the connection establishment. @@ -203,30 +207,49 @@ func parseRtcpFb(rtcpFb string) (codec Codec, isWildcard bool, err error) { return codec, isWildcard, nil } -func mergeCodecs(codec Codec, codecs map[uint8]Codec) { +func mergeCodecs(codec Codec, codecs map[uint8]Codec) error { // nolint: cyclop savedCodec := codecs[codec.PayloadType] + savedCodec.PayloadType = codec.PayloadType + + if codec.Name != "" { + if savedCodec.Name != "" && savedCodec.Name != codec.Name { + return errMultipleName + } - if savedCodec.PayloadType == 0 { - savedCodec.PayloadType = codec.PayloadType - } - if savedCodec.Name == "" { savedCodec.Name = codec.Name } - if savedCodec.ClockRate == 0 { + + if codec.ClockRate != 0 { + if savedCodec.ClockRate != 0 && savedCodec.ClockRate != codec.ClockRate { + return errMultipleClockRate + } + savedCodec.ClockRate = codec.ClockRate } - if savedCodec.EncodingParameters == "" { + + if codec.EncodingParameters != "" { + if savedCodec.EncodingParameters != "" && savedCodec.EncodingParameters != codec.EncodingParameters { + return errMultipleEncodingParameters + } + savedCodec.EncodingParameters = codec.EncodingParameters } - if savedCodec.Fmtp == "" { + + if codec.Fmtp != "" { + if savedCodec.Fmtp != "" && savedCodec.Fmtp != codec.Fmtp { + return errMultipleFmtp + } + savedCodec.Fmtp = codec.Fmtp } - savedCodec.RTCPFeedback = append(savedCodec.RTCPFeedback, codec.RTCPFeedback...) + savedCodec.RTCPFeedback = append(savedCodec.RTCPFeedback, codec.RTCPFeedback...) codecs[savedCodec.PayloadType] = savedCodec + + return nil } -func (s *SessionDescription) buildCodecMap() map[uint8]Codec { //nolint:cyclop +func (s *SessionDescription) buildCodecMap() (map[uint8]Codec, error) { //nolint:cyclop, gocognit codecs := map[uint8]Codec{ // static codecs that do not require a rtpmap 0: { @@ -249,12 +272,16 @@ func (s *SessionDescription) buildCodecMap() map[uint8]Codec { //nolint:cyclop case strings.HasPrefix(attr, "rtpmap:"): codec, err := parseRtpmap(attr) if err == nil { - mergeCodecs(codec, codecs) + if err = mergeCodecs(codec, codecs); err != nil { + return nil, err + } } case strings.HasPrefix(attr, "fmtp:"): codec, err := parseFmtp(attr) if err == nil { - mergeCodecs(codec, codecs) + if err = mergeCodecs(codec, codecs); err != nil { + return nil, err + } } case strings.HasPrefix(attr, "rtcp-fb:"): codec, isWildcard, err := parseRtcpFb(attr) @@ -263,7 +290,9 @@ func (s *SessionDescription) buildCodecMap() map[uint8]Codec { //nolint:cyclop case isWildcard: wildcardRTCPFeedback = append(wildcardRTCPFeedback, codec.RTCPFeedback...) default: - mergeCodecs(codec, codecs) + if err = mergeCodecs(codec, codecs); err != nil { + return nil, err + } } } } @@ -277,7 +306,7 @@ func (s *SessionDescription) buildCodecMap() map[uint8]Codec { //nolint:cyclop codecs[i] = codec } - return codecs + return codecs, nil } func equivalentFmtp(want, got string) bool { @@ -321,7 +350,10 @@ func codecsMatch(wanted, got Codec) bool { // GetCodecForPayloadType scans the SessionDescription for the given payload type and returns the codec. func (s *SessionDescription) GetCodecForPayloadType(payloadType uint8) (Codec, error) { - codecs := s.buildCodecMap() + codecs, err := s.buildCodecMap() + if err != nil { + return Codec{}, err + } codec, ok := codecs[payloadType] if ok { @@ -334,7 +366,10 @@ func (s *SessionDescription) GetCodecForPayloadType(payloadType uint8) (Codec, e // GetPayloadTypeForCodec scans the SessionDescription for a codec that matches the provided codec // as closely as possible and returns its payload type. func (s *SessionDescription) GetPayloadTypeForCodec(wanted Codec) (uint8, error) { - codecs := s.buildCodecMap() + codecs, err := s.buildCodecMap() + if err != nil { + return 0, err + } for payloadType, codec := range codecs { if codecsMatch(wanted, codec) { diff --git a/vendor/modules.txt b/vendor/modules.txt index a588d84f25..c9a6c0d911 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -54,14 +54,14 @@ github.com/CortexFoundation/inference/synapse # github.com/CortexFoundation/merkletree v0.0.0-20240407093305-416581a62b5b ## explicit; go 1.22 github.com/CortexFoundation/merkletree -# github.com/CortexFoundation/robot v1.0.7-0.20240728100700-258c7a048a1f +# github.com/CortexFoundation/robot v1.0.7-0.20250226143617-b3819ddaddc6 ## explicit; go 1.22 github.com/CortexFoundation/robot github.com/CortexFoundation/robot/backend # github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66 ## explicit; go 1.16 github.com/CortexFoundation/statik -# github.com/CortexFoundation/torrentfs v1.0.69-0.20250223164311-777618afaf30 +# github.com/CortexFoundation/torrentfs v1.0.69-0.20250312155646-e666064eb3c2 ## explicit; go 1.23.4 github.com/CortexFoundation/torrentfs github.com/CortexFoundation/torrentfs/backend @@ -326,7 +326,7 @@ github.com/benbjohnson/immutable # github.com/beorn7/perks v1.0.1 ## explicit; go 1.11 github.com/beorn7/perks/quantile -# github.com/bits-and-blooms/bitset v1.21.0 +# github.com/bits-and-blooms/bitset v1.22.0 ## explicit; go 1.16 github.com/bits-and-blooms/bitset # github.com/bradfitz/iter v0.0.0-20191230175014-e8f45d346db8 @@ -493,8 +493,8 @@ github.com/deckarep/golang-set/v2 ## explicit; go 1.17 github.com/decred/dcrd/dcrec/secp256k1/v4 github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa -# github.com/dgraph-io/badger/v4 v4.6.0 -## explicit; go 1.22.12 +# github.com/dgraph-io/badger/v4 v4.6.1-0.20250307192050-12bc62196753 +## explicit; go 1.23.0 github.com/dgraph-io/badger/v4 github.com/dgraph-io/badger/v4/fb github.com/dgraph-io/badger/v4/options @@ -905,7 +905,7 @@ github.com/pion/randutil # github.com/pion/rtcp v1.2.15 ## explicit; go 1.20 github.com/pion/rtcp -# github.com/pion/rtp v1.8.12 +# github.com/pion/rtp v1.8.13 ## explicit; go 1.20 github.com/pion/rtp github.com/pion/rtp/codecs @@ -914,7 +914,7 @@ github.com/pion/rtp/codecs/vp9 # github.com/pion/sctp v1.8.37 ## explicit; go 1.20 github.com/pion/sctp -# github.com/pion/sdp/v3 v3.0.10 +# github.com/pion/sdp/v3 v3.0.11 ## explicit; go 1.20 github.com/pion/sdp/v3 # github.com/pion/srtp/v3 v3.0.4 @@ -1068,8 +1068,8 @@ github.com/ucwong/filecache # github.com/ucwong/go-ttlmap v1.0.2-0.20221020173635-331e7ddde2bb ## explicit; go 1.19 github.com/ucwong/go-ttlmap -# github.com/ucwong/golang-kv v1.0.24-0.20250223163943-e9c513728ab1 -## explicit; go 1.23 +# github.com/ucwong/golang-kv v1.0.24-0.20250311205856-bf6be4c34641 +## explicit; go 1.23.0 github.com/ucwong/golang-kv github.com/ucwong/golang-kv/badger github.com/ucwong/golang-kv/bolt