diff --git a/go.mod b/go.mod index 39a0e0de60..07d6f551d2 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/CortexFoundation/statik v0.0.0-20210315012922-8bb8a7b5dc66 github.com/CortexFoundation/torrentfs v1.0.73-0.20260223192041-9493f0ab021a github.com/Microsoft/go-winio v0.6.2 - github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260403213135-1d43121312d4 + github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260416073033-7c2071eaa8d4 github.com/VictoriaMetrics/fastcache v1.13.3 github.com/arsham/figurine v1.3.0 github.com/aws/aws-sdk-go-v2 v1.41.5 @@ -64,13 +64,13 @@ require ( github.com/ucwong/color v1.10.1-0.20200624105241-fba1e010fe1e github.com/urfave/cli/v2 v2.27.7 go.uber.org/automaxprocs v1.6.0 - golang.org/x/crypto v0.49.0 + golang.org/x/crypto v0.50.0 golang.org/x/mobile v0.0.0-20201217150744-e6ae53a27f4f golang.org/x/sync v0.20.0 golang.org/x/sys v0.43.0 - golang.org/x/text v0.35.0 + golang.org/x/text v0.36.0 golang.org/x/time v0.15.0 - golang.org/x/tools v0.43.0 + golang.org/x/tools v0.44.0 google.golang.org/protobuf v1.36.11 gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c gopkg.in/urfave/cli.v1 v1.20.0 @@ -118,7 +118,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.30.15 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 // indirect - github.com/aws/smithy-go v1.24.3 // indirect + github.com/aws/smithy-go v1.25.0 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/benbjohnson/immutable v0.4.3 // indirect @@ -130,7 +130,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charmbracelet/colorprofile v0.4.3 // indirect github.com/charmbracelet/lipgloss v1.1.0 // indirect - github.com/charmbracelet/x/ansi v0.11.6 // indirect + github.com/charmbracelet/x/ansi v0.11.7 // indirect github.com/charmbracelet/x/cellbuf v0.0.15 // indirect github.com/charmbracelet/x/term v0.2.2 // indirect github.com/clipperhouse/displaywidth v0.11.0 // indirect @@ -153,7 +153,7 @@ require ( github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect github.com/felixge/fgprof v0.9.5 // indirect github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61 // indirect - github.com/getsentry/sentry-go v0.45.0 // indirect + github.com/getsentry/sentry-go v0.45.1 // indirect github.com/go-llsqlite/adapter v0.2.0 // indirect github.com/go-llsqlite/crawshaw v0.6.0 // indirect github.com/go-logr/logr v1.4.3 // indirect @@ -196,7 +196,7 @@ require ( github.com/pion/datachannel v1.6.0 // indirect github.com/pion/dtls/v2 v2.2.12 // indirect github.com/pion/dtls/v3 v3.1.2 // indirect - github.com/pion/ice/v4 v4.2.2 // indirect + github.com/pion/ice/v4 v4.2.4 // indirect github.com/pion/interceptor v0.1.44 // indirect github.com/pion/logging v0.2.4 // indirect github.com/pion/mdns/v2 v2.1.0 // indirect @@ -248,16 +248,16 @@ require ( go.opentelemetry.io/otel/metric v1.43.0 // indirect go.opentelemetry.io/otel/trace v1.43.0 // indirect go.yaml.in/yaml/v2 v2.4.4 // indirect - golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 // indirect - golang.org/x/mod v0.34.0 // indirect - golang.org/x/net v0.52.0 // indirect - golang.org/x/term v0.41.0 // indirect + golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f // indirect + golang.org/x/mod v0.35.0 // indirect + golang.org/x/net v0.53.0 // indirect + golang.org/x/term v0.42.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.4.1 // indirect - modernc.org/libc v1.70.0 // indirect + modernc.org/libc v1.72.0 // indirect modernc.org/mathutil v1.7.1 // indirect modernc.org/memory v1.11.0 // indirect - modernc.org/sqlite v1.48.1 // indirect + modernc.org/sqlite v1.48.2 // indirect zombiezen.com/go/sqlite v1.4.2 // indirect ) diff --git a/go.sum b/go.sum index 484928f215..0f709e7fea 100644 --- a/go.sum +++ b/go.sum @@ -85,8 +85,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260403213135-1d43121312d4 h1:V27aI3JlNRwiX+6GajEoKA/6OTwBjLFyJcWjTHhMGL8= -github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260403213135-1d43121312d4/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI= +github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260416073033-7c2071eaa8d4 h1:/97whAzwYxMNHXeTfhAtCRzNCpyblmxCtSYpsfzCszM= +github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260416073033-7c2071eaa8d4/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI= github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w= github.com/RoaringBitmap/roaring v0.4.17/go.mod h1:D3qVegWTmfCaX4Bl5CrBE9hfrSrrXIr8KVNvRsDi1NI= @@ -292,8 +292,8 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19 h1:dzztQ1YmfPrxdrOiuZRMF6f github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19/go.mod h1:YO8TrYtFdl5w/4vmjL8zaBSsiNp3w0L1FfKVKenZT7w= github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 h1:p8ogvvLugcR/zLBXTXrTkj0RYBUdErbMnAFFp12Lm/U= github.com/aws/aws-sdk-go-v2/service/sts v1.41.10/go.mod h1:60dv0eZJfeVXfbT1tFJinbHrDfSJ2GZl4Q//OSSNAVw= -github.com/aws/smithy-go v1.24.3 h1:XgOAaUgx+HhVBoP4v8n6HCQoTRDhoMghKqw4LNHsDNg= -github.com/aws/smithy-go v1.24.3/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/aws/smithy-go v1.25.0 h1:Sz/XJ64rwuiKtB6j98nDIPyYrV1nVNJ4YU74gttcl5U= +github.com/aws/smithy-go v1.25.0/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= @@ -346,8 +346,8 @@ github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q= github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY= github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30= -github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8= -github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ= +github.com/charmbracelet/x/ansi v0.11.7 h1:kzv1kJvjg2S3r9KHo8hDdHFQLEqn4RBCb39dAYC84jI= +github.com/charmbracelet/x/ansi v0.11.7/go.mod h1:9qGpnAVYz+8ACONkZBUWPtL7lulP9No6p1epAihUZwQ= github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI= github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q= github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk= @@ -509,8 +509,8 @@ github.com/garyburd/redigo v1.6.0/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05 github.com/gballet/go-libpcsclite v0.0.0-20191108122812-4678299bea08/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/gballet/go-libpcsclite v0.0.0-20250918194357-1ec6f2e601c6 h1:ko+DlyhLqUHpgrvwqs5ybydoGAqjpJQTXpAS7vUqVlM= github.com/gballet/go-libpcsclite v0.0.0-20250918194357-1ec6f2e601c6/go.mod h1:3IVE7v4II2gS2V5amIH7F7NeYQtbbORtQtjdflgS1vk= -github.com/getsentry/sentry-go v0.45.0 h1:/ZlbfGcaOzG4QkCACCfxrbuABemjem7UnY5o+V5HmeM= -github.com/getsentry/sentry-go v0.45.0/go.mod h1:XDotiNZbgf5U8bPDUAfvcFmOnMQQceESxyKaObSssW0= +github.com/getsentry/sentry-go v0.45.1 h1:9rfzJtGiJG+MGIaWZXidDGHcH5GU1Z5y0WVJGf9nysw= +github.com/getsentry/sentry-go v0.45.1/go.mod h1:XDotiNZbgf5U8bPDUAfvcFmOnMQQceESxyKaObSssW0= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= @@ -985,8 +985,8 @@ github.com/pion/dtls/v3 v3.1.2 h1:gqEdOUXLtCGW+afsBLO0LtDD8GnuBBjEy6HRtyofZTc= github.com/pion/dtls/v3 v3.1.2/go.mod h1:Hw/igcX4pdY69z1Hgv5x7wJFrUkdgHwAn/Q/uo7YHRo= github.com/pion/ice v0.7.13/go.mod h1:U3ERMkJgkPMlBjzMe2XxIQPl6ZrfRHyENwGCBoFrWWk= github.com/pion/ice v0.7.14/go.mod h1:/Lz6jAUhsvXed7kNJImXtvVSgjtcdGKoZAZIYb9WEm0= -github.com/pion/ice/v4 v4.2.2 h1:dQJzzcgTFHDYyV3BoCfjPeX+JEtr58BWPi4PGyo6Vjg= -github.com/pion/ice/v4 v4.2.2/go.mod h1:2quLV1S5v1tAx3VvAJaH//KGitRXvo4RKlX6D3tnN+c= +github.com/pion/ice/v4 v4.2.4 h1:6IU9X19HNcgjieVlp0qntG9jca/RTgo1770c/t5JrV4= +github.com/pion/ice/v4 v4.2.4/go.mod h1:ELQIH5Xmcs/nsJnKyzLJWij8v9Z/xHOzdPTfpFZMh2o= github.com/pion/interceptor v0.1.44 h1:sNlZwM8dWXU9JQAkJh8xrarC0Etn8Oolcniukmuy0/I= github.com/pion/interceptor v0.1.44/go.mod h1:4atVlBkcgXuUP+ykQF0qOCGU2j7pQzX2ofvPRFsY5RY= github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= @@ -1371,8 +1371,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4= -golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA= +golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1385,8 +1385,8 @@ golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20220428152302-39d4317da171/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= -golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90 h1:jiDhWWeC7jfWqR9c/uplMOqJ0sbNlNWv0UkzE0vX1MA= -golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90/go.mod h1:xE1HEv6b+1SCZ5/uscMRjUBKtIxworgEcEi+/n9NQDQ= +golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f h1:W3F4c+6OLc6H2lb//N1q4WpJkhzJCK5J6kUi1NTVXfM= +golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f/go.mod h1:J1xhfL/vlindoeF/aINzNzt2Bket5bjo9sdOYzOsU80= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1413,8 +1413,8 @@ golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= -golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= +golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= golang.org/x/net v0.0.0-20180524181706-dfa909b99c79/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1472,8 +1472,8 @@ golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= -golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0= -golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1580,8 +1580,8 @@ golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= -golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU= -golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A= +golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= +golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1593,8 +1593,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= -golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8= -golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1643,8 +1643,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= -golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= +golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= +golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= @@ -1778,10 +1778,10 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= lukechampine.com/blake3 v1.4.1 h1:I3Smz7gso8w4/TunLKec6K2fn+kyKtDxr/xcQEN84Wg= lukechampine.com/blake3 v1.4.1/go.mod h1:QFosUxmjB8mnrWFSNwKmvxHpfY72bmD2tQ0kBMM3kwo= -modernc.org/cc/v4 v4.27.1 h1:9W30zRlYrefrDV2JE2O8VDtJ1yPGownxciz5rrbQZis= -modernc.org/cc/v4 v4.27.1/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0= -modernc.org/ccgo/v4 v4.32.0 h1:hjG66bI/kqIPX1b2yT6fr/jt+QedtP2fqojG2VrFuVw= -modernc.org/ccgo/v4 v4.32.0/go.mod h1:6F08EBCx5uQc38kMGl+0Nm0oWczoo1c7cgpzEry7Uc0= +modernc.org/cc/v4 v4.27.3 h1:uNCgn37E5U09mTv1XgskEVUJ8ADKpmFMPxzGJ0TSo+U= +modernc.org/cc/v4 v4.27.3/go.mod h1:3YjcbCqhoTTHPycJDRl2WZKKFj0nwcOIPBfEZK0Hdk8= +modernc.org/ccgo/v4 v4.32.4 h1:L5OB8rpEX4ZsXEQwGozRfJyJSFHbbNVOoQ59DU9/KuU= +modernc.org/ccgo/v4 v4.32.4/go.mod h1:lY7f+fiTDHfcv6YlRgSkxYfhs+UvOEEzj49jAn2TOx0= modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM= modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU= modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI= @@ -1790,8 +1790,8 @@ modernc.org/gc/v3 v3.1.2 h1:ZtDCnhonXSZexk/AYsegNRV1lJGgaNZJuKjJSWKyEqo= modernc.org/gc/v3 v3.1.2/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY= modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks= modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI= -modernc.org/libc v1.70.0 h1:U58NawXqXbgpZ/dcdS9kMshu08aiA6b7gusEusqzNkw= -modernc.org/libc v1.70.0/go.mod h1:OVmxFGP1CI/Z4L3E0Q3Mf1PDE0BucwMkcXjjLntvHJo= +modernc.org/libc v1.72.0 h1:IEu559v9a0XWjw0DPoVKtXpO2qt5NVLAnFaBbjq+n8c= +modernc.org/libc v1.72.0/go.mod h1:tTU8DL8A+XLVkEY3x5E/tO7s2Q/q42EtnNWda/L5QhQ= modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI= @@ -1800,8 +1800,8 @@ modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8= modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns= modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w= modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE= -modernc.org/sqlite v1.48.1 h1:S85iToyU6cgeojybE2XJlSbcsvcWkQ6qqNXJHtW5hWA= -modernc.org/sqlite v1.48.1/go.mod h1:hWjRO6Tj/5Ik8ieqxQybiEOUXy0NJFNp2tpvVpKlvig= +modernc.org/sqlite v1.48.2 h1:5CnW4uP8joZtA0LedVqLbZV5GD7F/0x91AXeSyjoh5c= +modernc.org/sqlite v1.48.2/go.mod h1:hWjRO6Tj/5Ik8ieqxQybiEOUXy0NJFNp2tpvVpKlvig= modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= diff --git a/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/crypto.go b/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/crypto.go new file mode 100644 index 0000000000..117807108a --- /dev/null +++ b/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/crypto.go @@ -0,0 +1,188 @@ +//go:build mipsle +// +build mipsle + +package zkvm_runtime + +import ( + "encoding/binary" + "unsafe" +) + +// Sha256 computes the SHA-256 hash of data using zkVM precompiles. +func Sha256(data []byte) [32]byte { + // SHA-256 initial hash values + state := [8]uint32{ + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19, + } + + // Pad message per SHA-256 spec + msgLen := len(data) + bitLen := uint64(msgLen) * 8 + + // Append 0x80 byte + data = append(data, 0x80) + // Pad to 56 mod 64 + for len(data)%64 != 56 { + data = append(data, 0x00) + } + // Append original length in bits as big-endian uint64 + var lenBuf [8]byte + binary.BigEndian.PutUint64(lenBuf[:], bitLen) + data = append(data, lenBuf[:]...) + + // Process each 64-byte block + for offset := 0; offset < len(data); offset += 64 { + var w [64]uint32 + + // Load 16 words from block (big-endian as per SHA-256 spec) + for i := 0; i < 16; i++ { + w[i] = binary.BigEndian.Uint32(data[offset+i*4 : offset+i*4+4]) + } + + // Extend to 64 words using precompile + SyscallSha256Extend(unsafe.Pointer(&w[0])) + + // Compress using precompile + SyscallSha256Compress(unsafe.Pointer(&w[0]), unsafe.Pointer(&state[0])) + } + + // Convert state to big-endian bytes + var result [32]byte + for i := 0; i < 8; i++ { + binary.BigEndian.PutUint32(result[i*4:i*4+4], state[i]) + } + return result +} + +// Bn254G1Point represents a BN254 G1 affine point as [16]uint32 in little-endian. +type Bn254G1Point [16]uint32 + +// Bn254G1Add computes p = p + q on BN254 G1. +func Bn254G1Add(p, q *Bn254G1Point) { + SyscallBn254Add(unsafe.Pointer(p), unsafe.Pointer(q)) +} + +// Bn254G1Double computes p = 2*p on BN254 G1. +func Bn254G1Double(p *Bn254G1Point) { + SyscallBn254Double(unsafe.Pointer(p), unsafe.Pointer(nil)) +} + +// Bn254G1ScalarMul computes result = scalar * base using double-and-add. +// scalar is a big-endian 32-byte value. +func Bn254G1ScalarMul(base *Bn254G1Point, scalar []byte) Bn254G1Point { + var result Bn254G1Point // identity (all zeros) + temp := *base + + for i := len(scalar) - 1; i >= 0; i-- { + b := scalar[i] + for bit := 0; bit < 8; bit++ { + if (b>>uint(bit))&1 == 1 { + bn254AddSafe(&result, &temp) + } + Bn254G1Double(&temp) + } + } + return result +} + +func bn254AddSafe(p, q *Bn254G1Point) { + if isZeroPoint(p[:]) { + *p = *q + return + } + if isZeroPoint(q[:]) { + return + } + if *p == *q { + Bn254G1Double(p) + return + } + Bn254G1Add(p, q) +} + +// Bls12381G1Point represents a BLS12-381 G1 affine point as [24]uint32 in little-endian. +type Bls12381G1Point [24]uint32 + +// Bls12381G1Add computes p = p + q on BLS12-381 G1. +func Bls12381G1Add(p, q *Bls12381G1Point) { + SyscallBls12381Add(unsafe.Pointer(p), unsafe.Pointer(q)) +} + +// Bls12381G1Double computes p = 2*p on BLS12-381 G1. +func Bls12381G1Double(p *Bls12381G1Point) { + SyscallBls12381Double(unsafe.Pointer(p), unsafe.Pointer(nil)) +} + +// Bls12381G1ScalarMul computes result = scalar * base using double-and-add. +// scalar is a big-endian 32-byte value. +func Bls12381G1ScalarMul(base *Bls12381G1Point, scalar []byte) Bls12381G1Point { + var result Bls12381G1Point + temp := *base + + for i := len(scalar) - 1; i >= 0; i-- { + b := scalar[i] + for bit := 0; bit < 8; bit++ { + if (b>>uint(bit))&1 == 1 { + bls12381AddSafe(&result, &temp) + } + Bls12381G1Double(&temp) + } + } + return result +} + +func bls12381AddSafe(p, q *Bls12381G1Point) { + if isZeroPoint(p[:]) { + *p = *q + return + } + if isZeroPoint(q[:]) { + return + } + if *p == *q { + Bls12381G1Double(p) + return + } + Bls12381G1Add(p, q) +} + +func isZeroPoint(limbs []uint32) bool { + for _, v := range limbs { + if v != 0 { + return false + } + } + return true +} + +// BeToLeU32 converts a big-endian byte slice to little-endian [N]uint32. +// Each 4 bytes of big-endian input becomes one uint32, stored in reverse order. +func BeToLeU32(be []byte, limbs []uint32) { + n := len(limbs) + for i := 0; i < n; i++ { + // Read from the end of BE bytes + off := len(be) - (i+1)*4 + if off >= 0 { + limbs[i] = binary.LittleEndian.Uint32([]byte{be[off+3], be[off+2], be[off+1], be[off]}) + } + } +} + +// LeU32ToBe converts little-endian [N]uint32 back to big-endian bytes. +func LeU32ToBe(limbs []uint32, be []byte) { + n := len(limbs) + for i := range be { + be[i] = 0 + } + for i := 0; i < n; i++ { + off := len(be) - (i+1)*4 + if off >= 0 { + v := limbs[i] + be[off] = byte(v >> 24) + be[off+1] = byte(v >> 16) + be[off+2] = byte(v >> 8) + be[off+3] = byte(v) + } + } +} diff --git a/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/runtime.go b/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/runtime.go index 875f9f06cf..8bedd8e3d0 100644 --- a/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/runtime.go +++ b/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/runtime.go @@ -16,8 +16,83 @@ func SyscallHintLen() int func SyscallHintRead(ptr []byte, len int) func SyscallCommit(index int, word uint32) func SyscallExit(code int) +func SyscallEnterUnconstrained() int +func SyscallExitUnconstrained() func SyscallKeccakSponge(input unsafe.Pointer, result unsafe.Pointer) +// secp256k1 precompiles +func SyscallSecp256k1Add(p unsafe.Pointer, q unsafe.Pointer) +func SyscallSecp256k1Double(p unsafe.Pointer, dummy unsafe.Pointer) +func SyscallSecp256k1Decompress(point unsafe.Pointer, isOdd uint32) + +// SHA-256 precompiles +func SyscallSha256Extend(w unsafe.Pointer) +func SyscallSha256Compress(w unsafe.Pointer, state unsafe.Pointer) + +// BN254 curve precompiles +func SyscallBn254Add(p unsafe.Pointer, q unsafe.Pointer) +func SyscallBn254Double(p unsafe.Pointer, dummy unsafe.Pointer) + +// BN254 field arithmetic precompiles (Fp: [8]u32 LE, Fp2: [16]u32 LE) +func SyscallBn254FpAdd(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBn254FpSub(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBn254FpMul(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBn254Fp2Add(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBn254Fp2Sub(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBn254Fp2Mul(a unsafe.Pointer, b unsafe.Pointer) + +// BLS12-381 precompiles +func SyscallBls12381Add(p unsafe.Pointer, q unsafe.Pointer) +func SyscallBls12381Double(p unsafe.Pointer, dummy unsafe.Pointer) + +// BLS12-381 field arithmetic precompiles (Fp: [12]u32 LE, Fp2: [24]u32 LE) +func SyscallBls12381FpAdd(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBls12381FpSub(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBls12381FpMul(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBls12381Fp2Add(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBls12381Fp2Sub(a unsafe.Pointer, b unsafe.Pointer) +func SyscallBls12381Fp2Mul(a unsafe.Pointer, b unsafe.Pointer) + +// secp256r1 (P-256) precompiles +func SyscallSecp256r1Add(p unsafe.Pointer, q unsafe.Pointer) +func SyscallSecp256r1Double(p unsafe.Pointer, dummy unsafe.Pointer) +func SyscallSecp256r1Decompress(point unsafe.Pointer, isOdd uint32) + +// uint256 multiplication +func SyscallUint256Mul(x unsafe.Pointer, y unsafe.Pointer) + +// SyscallHintWrite writes to the hint stream (fd=4) using Ziren WRITE syscall. +func SyscallHintWrite(write_buf []byte, nbytes int) + +// HintSlice writes bytes to the hint stream (fd=4) for unconstrained block pattern. +func HintSlice(data []byte) { + // Write length as 4-byte LE, then data + lenBuf := make([]byte, 4) + lenBuf[0] = byte(len(data)) + lenBuf[1] = byte(len(data) >> 8) + lenBuf[2] = byte(len(data) >> 16) + lenBuf[3] = byte(len(data) >> 24) + SyscallHintWrite(lenBuf, 4) + SyscallHintWrite(data, len(data)) +} + +// ReadHintVec reads a hint vector from the hint stream. +// Reads two items: first a 4-byte LE length, then the actual data. +func ReadHintVec() []byte { + // Read length prefix (4 bytes LE) + lenLen := SyscallHintLen() + lenBuf := make([]byte, ((lenLen + 3) / 4) * 4) + SyscallHintRead(lenBuf, lenLen) + dataLen := int(lenBuf[0]) | int(lenBuf[1])<<8 | int(lenBuf[2])<<16 | int(lenBuf[3])<<24 + + // Read actual data + _ = SyscallHintLen() // advance to next item + capacity := (dataLen + 3) / 4 * 4 + buf := make([]byte, capacity) + SyscallHintRead(buf, dataLen) + return buf[:dataLen] +} + var PublicValuesHasher hash.Hash = sha256.New() const EMBEDDED_RESERVED_INPUT_REGION_SIZE int = 1024 * 1024 * 1024 diff --git a/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/syscall_mipsle.s b/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/syscall_mipsle.s index f106c148bd..8721cbf2c9 100644 --- a/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/syscall_mipsle.s +++ b/vendor/github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime/syscall_mipsle.s @@ -10,6 +10,14 @@ TEXT ·SyscallWrite(SB), $0-24 MOVW R2, ret+0(FP) RET +TEXT ·SyscallHintWrite(SB), $0-16 + MOVW $0x02, R2 // v0 = WRITE (Ziren syscall code 0x02) + MOVW $4, R4 // a0 = fd = FD_HINT = 4 + MOVW write_buf+0(FP), R5 // a1 = buf pointer (first field of slice) + MOVW nbytes+12(FP), R6 // a2 = nbytes (after slice: ptr=0, len=4, cap=8, nbytes=12) + SYSCALL + RET + TEXT ·SyscallHintLen(SB), $0-4 MOVW $0xF0, R2 // #define SYS_hint_len 0xF0 SYSCALL @@ -36,9 +44,211 @@ TEXT ·SyscallExit(SB), $0-4 SYSCALL RET +TEXT ·SyscallEnterUnconstrained(SB), $0-4 + MOVW $0x03, R2 // v0 = ENTER_UNCONSTRAINED + SYSCALL + MOVW R2, ret+0(FP) // return value + RET + +TEXT ·SyscallExitUnconstrained(SB), $0-0 + MOVW $0x04, R2 // v0 = EXIT_UNCONSTRAINED + SYSCALL + RET + TEXT ·SyscallKeccakSponge(SB), $0-8 MOVW $0x01010009, R2 // v0 = KECCAK_SPONGE syscall MOVW input+0(FP), R4 // a0 = input pointer MOVW result+4(FP), R5 // a1 = result pointer SYSCALL RET + +// secp256k1 elliptic curve precompiles + +TEXT ·SyscallSecp256k1Add(SB), $0-8 + MOVW $0x0101000A, R2 // v0 = SECP256K1_ADD + MOVW p+0(FP), R4 // a0 = p pointer ([16]u32, x||y LE) + MOVW q+4(FP), R5 // a1 = q pointer ([16]u32, x||y LE) + SYSCALL + RET + +TEXT ·SyscallSecp256k1Double(SB), $0-8 + MOVW $0x0001000B, R2 // v0 = SECP256K1_DOUBLE + MOVW p+0(FP), R4 // a0 = p pointer ([16]u32, x||y LE) + MOVW $0, R5 // a1 = 0 (unused) + SYSCALL + RET + +TEXT ·SyscallSecp256k1Decompress(SB), $0-8 + MOVW $0x0001000C, R2 // v0 = SECP256K1_DECOMPRESS + MOVW point+0(FP), R4 // a0 = point pointer (64 bytes, BE) + MOVW isOdd+4(FP), R5 // a1 = is_odd (0 or 1) + SYSCALL + RET + +// SHA-256 precompiles + +TEXT ·SyscallSha256Extend(SB), $0-4 + MOVW $0x30010005, R2 // v0 = SHA_EXTEND + MOVW w+0(FP), R4 // a0 = w pointer ([64]u32) + MOVW $0, R5 + SYSCALL + RET + +TEXT ·SyscallSha256Compress(SB), $0-8 + MOVW $0x01010006, R2 // v0 = SHA_COMPRESS + MOVW w+0(FP), R4 // a0 = w pointer ([64]u32) + MOVW state+4(FP), R5 // a1 = state pointer ([8]u32) + SYSCALL + RET + +// BN254 elliptic curve precompiles + +TEXT ·SyscallBn254Add(SB), $0-8 + MOVW $0x0101000E, R2 // v0 = BN254_ADD + MOVW p+0(FP), R4 // a0 = p pointer ([16]u32, x||y LE) + MOVW q+4(FP), R5 // a1 = q pointer ([16]u32, x||y LE) + SYSCALL + RET + +TEXT ·SyscallBn254Double(SB), $0-8 + MOVW $0x0001000F, R2 // v0 = BN254_DOUBLE + MOVW p+0(FP), R4 // a0 = p pointer ([16]u32, x||y LE) + MOVW $0, R5 + SYSCALL + RET + +// BN254 field arithmetic precompiles + +TEXT ·SyscallBn254FpAdd(SB), $0-8 + MOVW $0x01010026, R2 // v0 = BN254_FP_ADD + MOVW a+0(FP), R4 // a0 = a pointer ([8]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([8]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBn254FpSub(SB), $0-8 + MOVW $0x01010027, R2 // v0 = BN254_FP_SUB + MOVW a+0(FP), R4 // a0 = a pointer ([8]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([8]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBn254FpMul(SB), $0-8 + MOVW $0x01010028, R2 // v0 = BN254_FP_MUL + MOVW a+0(FP), R4 // a0 = a pointer ([8]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([8]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBn254Fp2Add(SB), $0-8 + MOVW $0x01010029, R2 // v0 = BN254_FP2_ADD + MOVW a+0(FP), R4 // a0 = a pointer ([16]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([16]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBn254Fp2Sub(SB), $0-8 + MOVW $0x0101002A, R2 // v0 = BN254_FP2_SUB + MOVW a+0(FP), R4 // a0 = a pointer ([16]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([16]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBn254Fp2Mul(SB), $0-8 + MOVW $0x0101002B, R2 // v0 = BN254_FP2_MUL + MOVW a+0(FP), R4 // a0 = a pointer ([16]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([16]u32 LE) + SYSCALL + RET + +// BLS12-381 elliptic curve precompiles + +TEXT ·SyscallBls12381Add(SB), $0-8 + MOVW $0x0101001E, R2 // v0 = BLS12381_ADD + MOVW p+0(FP), R4 // a0 = p pointer ([24]u32, x||y LE) + MOVW q+4(FP), R5 // a1 = q pointer ([24]u32, x||y LE) + SYSCALL + RET + +TEXT ·SyscallBls12381Double(SB), $0-8 + MOVW $0x0001001F, R2 // v0 = BLS12381_DOUBLE + MOVW p+0(FP), R4 // a0 = p pointer ([24]u32, x||y LE) + MOVW $0, R5 + SYSCALL + RET + +// BLS12-381 field arithmetic precompiles (Fp: [12]u32 LE, Fp2: [24]u32 LE) + +TEXT ·SyscallBls12381FpAdd(SB), $0-8 + MOVW $0x01010020, R2 // v0 = BLS12381_FP_ADD + MOVW a+0(FP), R4 // a0 = a pointer ([12]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([12]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBls12381FpSub(SB), $0-8 + MOVW $0x01010021, R2 // v0 = BLS12381_FP_SUB + MOVW a+0(FP), R4 // a0 = a pointer ([12]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([12]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBls12381FpMul(SB), $0-8 + MOVW $0x01010022, R2 // v0 = BLS12381_FP_MUL + MOVW a+0(FP), R4 // a0 = a pointer ([12]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([12]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBls12381Fp2Add(SB), $0-8 + MOVW $0x01010023, R2 // v0 = BLS12381_FP2_ADD + MOVW a+0(FP), R4 // a0 = a pointer ([24]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([24]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBls12381Fp2Sub(SB), $0-8 + MOVW $0x01010024, R2 // v0 = BLS12381_FP2_SUB + MOVW a+0(FP), R4 // a0 = a pointer ([24]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([24]u32 LE) + SYSCALL + RET + +TEXT ·SyscallBls12381Fp2Mul(SB), $0-8 + MOVW $0x01010025, R2 // v0 = BLS12381_FP2_MUL + MOVW a+0(FP), R4 // a0 = a pointer ([24]u32 LE), result stored here + MOVW b+4(FP), R5 // a1 = b pointer ([24]u32 LE) + SYSCALL + RET + +// secp256r1 (P-256) elliptic curve precompiles + +TEXT ·SyscallSecp256r1Add(SB), $0-8 + MOVW $0x0101002C, R2 // v0 = SECP256R1_ADD + MOVW p+0(FP), R4 // a0 = p pointer ([16]u32, x||y LE) + MOVW q+4(FP), R5 // a1 = q pointer ([16]u32, x||y LE) + SYSCALL + RET + +TEXT ·SyscallSecp256r1Double(SB), $0-8 + MOVW $0x0001002D, R2 // v0 = SECP256R1_DOUBLE + MOVW p+0(FP), R4 // a0 = p pointer ([16]u32, x||y LE) + MOVW $0, R5 + SYSCALL + RET + +TEXT ·SyscallSecp256r1Decompress(SB), $0-8 + MOVW $0x0001002E, R2 // v0 = SECP256R1_DECOMPRESS + MOVW point+0(FP), R4 // a0 = point pointer (64 bytes) + MOVW isOdd+4(FP), R5 // a1 = is_odd (0 or 1) + SYSCALL + RET + +// uint256 multiplication + +TEXT ·SyscallUint256Mul(SB), $0-8 + MOVW $0x0101001D, R2 // v0 = UINT256_MUL + MOVW x+0(FP), R4 // a0 = x pointer ([8]u32 LE) + MOVW y+4(FP), R5 // a1 = y pointer ([8]u32 LE) + SYSCALL + RET diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index 85f4e2b605..2db174e021 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,12 @@ +# Release (2026-04-15) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.25.0 + * **Feature**: Add support for endpointBdd trait + # Release (2026-04-02) ## General Highlights diff --git a/vendor/github.com/aws/smithy-go/endpoints/private/rulesfn/split.go b/vendor/github.com/aws/smithy-go/endpoints/private/rulesfn/split.go new file mode 100644 index 0000000000..f8b30789a0 --- /dev/null +++ b/vendor/github.com/aws/smithy-go/endpoints/private/rulesfn/split.go @@ -0,0 +1,16 @@ +package rulesfn + +import "strings" + +// Split splits the input string by the delimiter and returns the resulting +// parts. If limit is > 0, at most limit substrings are returned. +// Returns a slice with a single empty string if the input is empty. +func Split(input, delimiter string, limit int) []string { + if len(input) == 0 { + return []string{""} + } + if limit > 0 { + return strings.SplitN(input, delimiter, limit) + } + return strings.Split(input, delimiter) +} diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go index 5aeb377cd2..35938d4072 100644 --- a/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ b/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -3,4 +3,4 @@ package smithy // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.24.3" +const goModuleVersion = "1.25.0" diff --git a/vendor/github.com/charmbracelet/x/ansi/width.go b/vendor/github.com/charmbracelet/x/ansi/width.go index fd680cfdc0..a4735b8ac0 100644 --- a/vendor/github.com/charmbracelet/x/ansi/width.go +++ b/vendor/github.com/charmbracelet/x/ansi/width.go @@ -87,7 +87,7 @@ func stringWidth(m Method, s string) int { for i := 0; i < len(s); i++ { state, action := parser.Table.Transition(pstate, s[i]) - if state == parser.Utf8State { + if action == parser.PrintAction || state == parser.Utf8State { cluster, w := FirstGraphemeCluster(s[i:], m) width += w diff --git a/vendor/github.com/getsentry/sentry-go/CHANGELOG.md b/vendor/github.com/getsentry/sentry-go/CHANGELOG.md index 426e603eec..ca05ce6cab 100644 --- a/vendor/github.com/getsentry/sentry-go/CHANGELOG.md +++ b/vendor/github.com/getsentry/sentry-go/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.45.1 + +### Bug Fixes 🐛 + +- Add missing TracesSampler fields for SamplingContext by @giortzisg in [#1259](https://github.com/getsentry/sentry-go/pull/1259) + ## 0.45.0 ### Breaking Changes 🛠 diff --git a/vendor/github.com/getsentry/sentry-go/sentry.go b/vendor/github.com/getsentry/sentry-go/sentry.go index d15724c02f..cb87609589 100644 --- a/vendor/github.com/getsentry/sentry-go/sentry.go +++ b/vendor/github.com/getsentry/sentry-go/sentry.go @@ -6,7 +6,7 @@ import ( ) // The version of the SDK. -const SDKVersion = "0.45.0" +const SDKVersion = "0.45.1" // apiVersion is the minimum version of the Sentry API compatible with the // sentry-go SDK. diff --git a/vendor/github.com/getsentry/sentry-go/traces_sampler.go b/vendor/github.com/getsentry/sentry-go/traces_sampler.go index 69e7cb7fa5..5775db4293 100644 --- a/vendor/github.com/getsentry/sentry-go/traces_sampler.go +++ b/vendor/github.com/getsentry/sentry-go/traces_sampler.go @@ -7,7 +7,14 @@ package sentry // user-provided data. type SamplingContext struct { Span *Span // The current span, always non-nil. - Parent *Span // The parent span, may be nil. + Parent *Span // The local parent span, non-nil only when the parent exists in the same process. + // ParentSampled is the sampling decision of the parent span. + // + // For a remote span, Parent is nil but ParentSampled reflects the upstream decision. + // For a local span, ParentSampled mirrors Parent.Sampled. + ParentSampled Sampled + // ParentSampleRate is the sample rate used by the parent transaction. + ParentSampleRate *float64 } // The TracesSample type is an adapter to allow the use of ordinary diff --git a/vendor/github.com/getsentry/sentry-go/tracing.go b/vendor/github.com/getsentry/sentry-go/tracing.go index 7704364a7b..0ac680a417 100644 --- a/vendor/github.com/getsentry/sentry-go/tracing.go +++ b/vendor/github.com/getsentry/sentry-go/tracing.go @@ -540,9 +540,23 @@ func (s *Span) sample() Sampled { // #3 use TracesSampler from ClientOptions. sampler := clientOptions.TracesSampler + parentSampled := SampledUndefined + if s.parent != nil { + parentSampled = s.parent.Sampled + } else if s.ParentSpanID != zeroSpanID { + parentSampled = s.Sampled + } + var parentSampleRate *float64 + if rateStr, ok := s.dynamicSamplingContext.Entries["sample_rate"]; ok { + if rate, err := strconv.ParseFloat(rateStr, 64); err == nil { + parentSampleRate = &rate + } + } samplingContext := SamplingContext{ - Span: s, - Parent: s.parent, + Span: s, + Parent: s.parent, + ParentSampled: parentSampled, + ParentSampleRate: parentSampleRate, } if sampler != nil { diff --git a/vendor/github.com/pion/ice/v4/.golangci.yml b/vendor/github.com/pion/ice/v4/.golangci.yml index 1fbb8dbbfe..6c7ceed691 100644 --- a/vendor/github.com/pion/ice/v4/.golangci.yml +++ b/vendor/github.com/pion/ice/v4/.golangci.yml @@ -146,3 +146,6 @@ formatters: - goimports # Goimports does everything that gofmt does. Additionally it checks unused imports exclusions: generated: lax +issues: + max-issues-per-linter: 0 + max-same-issues: 0 \ No newline at end of file diff --git a/vendor/github.com/pion/ice/v4/agent.go b/vendor/github.com/pion/ice/v4/agent.go index ff312c4080..90b143c4ab 100644 --- a/vendor/github.com/pion/ice/v4/agent.go +++ b/vendor/github.com/pion/ice/v4/agent.go @@ -119,9 +119,10 @@ type Agent struct { selectedPair atomic.Value // *CandidatePair - urls []*stun.URI - networkTypes []NetworkType - addressRewriteRules []AddressRewriteRule + urls []*stun.URI + networkTypes []NetworkType + turnTransportProtocols []NetworkType + addressRewriteRules []AddressRewriteRule buf *packetio.Buffer @@ -324,6 +325,16 @@ func createAgentBase(config *AgentConfig) (*Agent, error) { return nil, ErrPort } + normalizedNetworkTypes, err := sanitizeTransportNetworkTypes(config.NetworkTypes) + if err != nil { + return nil, err + } + + normalizedTURNTransportProtocols, err := sanitizeTransportNetworkTypes(config.turnTransportProtocols) + if err != nil { + return nil, err + } + mDNSName, mDNSMode, err := setupMDNSConfig(config) if err != nil { return nil, err @@ -346,7 +357,8 @@ func createAgentBase(config *AgentConfig) (*Agent, error) { remoteCandidates: make(map[NetworkType][]Candidate), pairsByID: make(map[uint64]*CandidatePair), urls: config.Urls, - networkTypes: config.NetworkTypes, + networkTypes: normalizedNetworkTypes, + turnTransportProtocols: normalizedTURNTransportProtocols, onConnected: make(chan struct{}), buf: packetio.NewBuffer(), startedCh: startedCtx.Done(), @@ -374,8 +386,8 @@ func createAgentBase(config *AgentConfig) (*Agent, error) { enableUseCandidateCheckPriority: config.EnableUseCandidateCheckPriority, enableRenomination: false, nominationValueGenerator: nil, - nominationAttribute: stun.AttrType(0x0030), // Default value - continualGatheringPolicy: GatherOnce, // Default to GatherOnce + nominationAttribute: DefaultNominationAttribute, + continualGatheringPolicy: GatherOnce, // Default to GatherOnce networkMonitorInterval: 2 * time.Second, lastKnownInterfaces: make(map[string]netip.Addr), automaticRenomination: false, @@ -1106,6 +1118,45 @@ func remoteDialIPForLocalInterface(remoteIP, localIP netip.Addr) netip.Addr { return remoteIP } +// replaceRedundantPeerReflexiveCandidates removes any peer-reflexive candidates +// from the given set that have the same transport address as cand. +// It also updates any candidate pairs and local candidate caches that +// referenced the removed peer-reflexive candidates to reference cand instead. +// It is implemented according to RFC 8838 §11.4. +// It returns the updated set of candidates. +func (a *Agent) replaceRedundantPeerReflexiveCandidates(set []Candidate, cand Candidate) []Candidate { + if cand.Type() != CandidateTypePeerReflexive { + var replacedPrflx []Candidate + + for i := 0; i < len(set); i++ { + existing := set[i] + if existing.Type() == CandidateTypePeerReflexive && existing.transportAddressEqual(cand) { + replacedPrflx = append(replacedPrflx, existing) + set = append(set[:i], set[i+1:]...) + i-- + } + } + + for _, oldRemote := range replacedPrflx { + for _, pair := range a.checklist { + if pair.Remote == oldRemote { + oldPriority := pair.priority() + pair.Remote = cand + pair.setPriorityOverride(oldPriority) + } + } + + for _, locals := range a.localCandidates { + for _, local := range locals { + local.replaceRemoteCandidateCacheValues(oldRemote, cand) + } + } + } + } + + return set +} + // addRemoteCandidate assumes you are holding the lock (must be execute using a.run). // Returns true when the candidate is accepted (including duplicates). func (a *Agent) addRemoteCandidate(cand Candidate) bool { //nolint:cyclop @@ -1113,12 +1164,6 @@ func (a *Agent) addRemoteCandidate(cand Candidate) bool { //nolint:cyclop return false } - if len(a.networkTypes) > 0 && !slices.Contains(a.networkTypes, cand.NetworkType()) { - a.log.Infof("Ignoring remote candidate with disabled network type %s: %s", cand.NetworkType(), cand) - - return false - } - set := a.remoteCandidates[cand.NetworkType()] for _, candidate := range set { @@ -1127,13 +1172,16 @@ func (a *Agent) addRemoteCandidate(cand Candidate) bool { //nolint:cyclop } } + // RFC 8838 §11.4: If a trickled candidate is redundant with an existing + // peer-reflexive candidate (same transport address), prefer the signaled + // candidate and replace the peer-reflexive one. + set = a.replaceRedundantPeerReflexiveCandidates(set, cand) + acceptRemotePassiveTCPCandidate := false // Assert that TCP4 or TCP6 is a enabled NetworkType locally if !a.disableActiveTCP && cand.TCPType() == TCPTypePassive { - for _, networkType := range a.networkTypes { - if cand.NetworkType() == networkType { - acceptRemotePassiveTCPCandidate = true - } + if slices.Contains(configuredNetworkTypes(a.networkTypes), cand.NetworkType()) { + acceptRemotePassiveTCPCandidate = true } } @@ -1147,7 +1195,9 @@ func (a *Agent) addRemoteCandidate(cand Candidate) bool { //nolint:cyclop if cand.TCPType() != TCPTypePassive { if localCandidates, ok := a.localCandidates[cand.NetworkType()]; ok { for _, localCandidate := range localCandidates { - a.addPair(localCandidate, cand) + if a.findPair(localCandidate, cand) == nil { + a.addPair(localCandidate, cand) + } } } } @@ -1613,6 +1663,14 @@ func (a *Agent) handleInboundRequest( RelPort: 0, } + // A peer-reflexive candidate SHOULD take its priority from the PRIORITY + // attribute in the Binding Request that discovered it. + var prio PriorityAttr + err = prio.GetFrom(msg) + if err == nil { + prflxCandidateConfig.Priority = uint32(prio) + } + prflxCandidate, err := NewCandidatePeerReflexive(&prflxCandidateConfig) if err != nil { a.log.Errorf("Failed to create new remote prflx candidate (%s)", err) diff --git a/vendor/github.com/pion/ice/v4/agent_config.go b/vendor/github.com/pion/ice/v4/agent_config.go index 71584d9d87..ea9a1f37d5 100644 --- a/vendor/github.com/pion/ice/v4/agent_config.go +++ b/vendor/github.com/pion/ice/v4/agent_config.go @@ -112,10 +112,24 @@ type AgentConfig struct { // connecting state. CheckInterval *time.Duration - // NetworkTypes is an optional configuration for disabling or enabling - // support for specific network types. + // NetworkTypes controls the candidate network types exposed in ICE candidates + // and used for pairing. + // + // This is independent from the TURN client-to-server transport configured via + // WithTURNTransportProtocols. Supported values are the NetworkType variants + // (NetworkTypeUDP4, NetworkTypeUDP6, NetworkTypeTCP4, NetworkTypeTCP6). + // When empty, all candidate network types are enabled by default. NetworkTypes []NetworkType + // turnTransportProtocols restricts protocols used internally by this agent when connecting + // to TURN servers (the TURN client <-> TURN server transport). + // + // This is independent from NetworkTypes, which controls candidate network types + // exposed in ICE and used for pairing. Configure this via + // WithTURNTransportProtocols. Supported values are the NetworkType variants + // (NetworkTypeUDP4, NetworkTypeUDP6, NetworkTypeTCP4, NetworkTypeTCP6). + turnTransportProtocols []NetworkType + // CandidateTypes is an optional configuration for disabling or enabling // support for specific candidate types. CandidateTypes []CandidateType diff --git a/vendor/github.com/pion/ice/v4/agent_handlers.go b/vendor/github.com/pion/ice/v4/agent_handlers.go index 95ee9256b8..0f96cd771e 100644 --- a/vendor/github.com/pion/ice/v4/agent_handlers.go +++ b/vendor/github.com/pion/ice/v4/agent_handlers.go @@ -48,8 +48,10 @@ func (a *Agent) onConnectionStateChange(s ConnectionState) { type handlerNotifier struct { sync.Mutex - running bool - notifiers sync.WaitGroup + runningConnectionStates bool + runningCandidates bool + runningCandidatePairs bool + notifiers sync.WaitGroup connectionStates []ConnectionState connectionStateFunc func(ConnectionState) @@ -99,7 +101,7 @@ func (h *handlerNotifier) EnqueueConnectionState(state ConnectionState) { for { h.Lock() if len(h.connectionStates) == 0 { - h.running = false + h.runningConnectionStates = false h.Unlock() return @@ -112,8 +114,8 @@ func (h *handlerNotifier) EnqueueConnectionState(state ConnectionState) { } h.connectionStates = append(h.connectionStates, state) - if !h.running { - h.running = true + if !h.runningConnectionStates { + h.runningConnectionStates = true h.notifiers.Add(1) go notify() } @@ -134,7 +136,7 @@ func (h *handlerNotifier) EnqueueCandidate(cand Candidate) { for { h.Lock() if len(h.candidates) == 0 { - h.running = false + h.runningCandidates = false h.Unlock() return @@ -147,8 +149,8 @@ func (h *handlerNotifier) EnqueueCandidate(cand Candidate) { } h.candidates = append(h.candidates, cand) - if !h.running { - h.running = true + if !h.runningCandidates { + h.runningCandidates = true h.notifiers.Add(1) go notify() } @@ -169,7 +171,7 @@ func (h *handlerNotifier) EnqueueSelectedCandidatePair(pair *CandidatePair) { for { h.Lock() if len(h.selectedCandidatePairs) == 0 { - h.running = false + h.runningCandidatePairs = false h.Unlock() return @@ -182,8 +184,8 @@ func (h *handlerNotifier) EnqueueSelectedCandidatePair(pair *CandidatePair) { } h.selectedCandidatePairs = append(h.selectedCandidatePairs, pair) - if !h.running { - h.running = true + if !h.runningCandidatePairs { + h.runningCandidatePairs = true h.notifiers.Add(1) go notify() } diff --git a/vendor/github.com/pion/ice/v4/agent_options.go b/vendor/github.com/pion/ice/v4/agent_options.go index fc97d0b668..dd124655c3 100644 --- a/vendor/github.com/pion/ice/v4/agent_options.go +++ b/vendor/github.com/pion/ice/v4/agent_options.go @@ -682,7 +682,7 @@ func WithRenomination(generator NominationValueGenerator) AgentOption { } // WithNominationAttribute sets the STUN attribute type to use for ICE renomination. -// The default value is 0x0030. This can be configured until the attribute is officially +// The default value is 0xC001. This can be configured until the attribute is officially // assigned by IANA for draft-thatcher-ice-renomination. // // This option returns an error if the provided attribute type is invalid. @@ -856,7 +856,9 @@ func WithNetworkMonitorInterval(interval time.Duration) AgentOption { } } -// WithNetworkTypes sets the enabled network types for candidate gathering. +// WithNetworkTypes sets the enabled candidate network types for candidate gathering. +// This controls the network types exposed in ICE candidates and used for pairing. +// Use WithTURNTransportProtocols to control the local TURN client-to-server transport. // By default, all network types are enabled. // // Example: @@ -870,12 +872,63 @@ func WithNetworkTypes(networkTypes []NetworkType) AgentOption { return ErrAgentOptionNotUpdatable } - a.networkTypes = networkTypes + normalized, err := sanitizeTransportNetworkTypes(networkTypes) + if err != nil { + return err + } + + a.networkTypes = normalized + + return nil + } +} + +// WithTURNTransportProtocols restricts protocols used by this agent when +// connecting to TURN servers (TURN client <-> TURN server transport). +// +// This is independent from WithNetworkTypes, which controls ICE candidate +// network types announced to the peer. Supported values are +// NetworkTypeUDP4/UDP6 and NetworkTypeTCP4/TCP6. +func WithTURNTransportProtocols(protocols []NetworkType) AgentOption { + return func(a *Agent) error { + if a.constructed { + return ErrAgentOptionNotUpdatable + } + + normalized, err := sanitizeTransportNetworkTypes(protocols) + if err != nil { + return err + } + + a.turnTransportProtocols = normalized return nil } } +func sanitizeTransportNetworkTypes(types []NetworkType) ([]NetworkType, error) { + if len(types) == 0 { + return nil, nil + } + + seen := map[NetworkType]struct{}{} + out := make([]NetworkType, 0, len(types)) + for _, networkType := range types { + if !networkType.IsUDP() && !networkType.IsTCP() { + return nil, ErrProtoType + } + + if _, ok := seen[networkType]; ok { + continue + } + + seen[networkType] = struct{}{} + out = append(out, networkType) + } + + return out, nil +} + // WithCandidateTypes sets the enabled candidate types for gathering. // By default, host, server reflexive, and relay candidates are enabled. // diff --git a/vendor/github.com/pion/ice/v4/candidate.go b/vendor/github.com/pion/ice/v4/candidate.go index dafe07ca7a..362d925fd4 100644 --- a/vendor/github.com/pion/ice/v4/candidate.go +++ b/vendor/github.com/pion/ice/v4/candidate.go @@ -82,6 +82,10 @@ type Candidate interface { Marshal() string + // transportAddressEqual checks if the transport address (IP, Port, NetworkType, TCPType) is equal to another + // candidate. + transportAddressEqual(other Candidate) bool + addr() net.Addr filterForLocationTracking() bool agent() *Agent @@ -92,4 +96,6 @@ type Candidate interface { seen(outbound bool) start(a *Agent, conn net.PacketConn, initializedCh <-chan struct{}) writeTo(raw []byte, dst Candidate) (int, error) + + replaceRemoteCandidateCacheValues(oldRemote, newRemote Candidate) } diff --git a/vendor/github.com/pion/ice/v4/candidate_base.go b/vendor/github.com/pion/ice/v4/candidate_base.go index 47e20ec086..b713e238a3 100644 --- a/vendor/github.com/pion/ice/v4/candidate_base.go +++ b/vendor/github.com/pion/ice/v4/candidate_base.go @@ -248,7 +248,9 @@ func (c *candidateBase) start(a *Agent, conn net.PacketConn, initializedCh <-cha var bufferPool = sync.Pool{ // nolint:gochecknoglobals New: func() any { - return make([]byte, receiveMTU) + buf := make([]byte, receiveMTU) + + return &buf }, } @@ -263,12 +265,12 @@ func (c *candidateBase) recvLoop(initializedCh <-chan struct{}) { return } - bufferPoolBuffer := bufferPool.Get() - defer bufferPool.Put(bufferPoolBuffer) - buf, ok := bufferPoolBuffer.([]byte) + bufPtr, ok := bufferPool.Get().(*[]byte) if !ok { return } + defer bufferPool.Put(bufPtr) + buf := *bufPtr for { n, srcAddr, err := c.conn.ReadFrom(buf) @@ -301,6 +303,14 @@ func (c *candidateBase) addRemoteCandidateCache(candidate Candidate, srcAddr net c.remoteCandidateCaches[toAddrPort(srcAddr)] = candidate } +func (c *candidateBase) replaceRemoteCandidateCacheValues(oldRemote, newRemote Candidate) { + for k, v := range c.remoteCandidateCaches { + if v == oldRemote { + c.remoteCandidateCaches[k] = newRemote + } + } +} + func (c *candidateBase) handleInboundPacket(buf []byte, srcAddr net.Addr) { agent := c.agent() @@ -445,8 +455,9 @@ func (c *candidateBase) Priority() uint32 { (1<<0)*uint32(256-c.Component()) } -// Equal is used to compare two candidateBases. -func (c *candidateBase) Equal(other Candidate) bool { +// transportAddressEqual checks if the transport address (IP, Port, NetworkType, TCPType) is equal to another +// candidate. +func (c *candidateBase) transportAddressEqual(other Candidate) bool { if c.addr() != other.addr() { if c.addr() == nil || other.addr() == nil { return false @@ -457,10 +468,15 @@ func (c *candidateBase) Equal(other Candidate) bool { } return c.NetworkType() == other.NetworkType() && - c.Type() == other.Type() && c.Address() == other.Address() && c.Port() == other.Port() && - c.TCPType() == other.TCPType() && + c.TCPType() == other.TCPType() +} + +// Equal is used to compare two candidateBases. +func (c *candidateBase) Equal(other Candidate) bool { + return c.transportAddressEqual(other) && + c.Type() == other.Type() && c.RelatedAddress().Equal(other.RelatedAddress()) } diff --git a/vendor/github.com/pion/ice/v4/candidatepair.go b/vendor/github.com/pion/ice/v4/candidatepair.go index c0a7dafae3..65378b0f04 100644 --- a/vendor/github.com/pion/ice/v4/candidatepair.go +++ b/vendor/github.com/pion/ice/v4/candidatepair.go @@ -26,6 +26,8 @@ type CandidatePair struct { iceRoleControlling bool Remote Candidate Local Candidate + priorityOverride uint64 + hasPriorityOverride bool bindingRequestCount uint16 state CandidatePairState nominated bool @@ -84,12 +86,21 @@ func (p *CandidatePair) equal(other *CandidatePair) bool { return p.Local.Equal(other.Local) && p.Remote.Equal(other.Remote) } +func (p *CandidatePair) setPriorityOverride(prio uint64) { + p.priorityOverride = prio + p.hasPriorityOverride = true +} + // RFC 5245 - 5.7.2. Computing Pair Priority and Ordering Pairs // Let G be the priority for the candidate provided by the controlling // agent. Let D be the priority for the candidate provided by the // controlled agent. // pair priority = 2^32*MIN(G,D) + 2*MAX(G,D) + (G>D?1:0). func (p *CandidatePair) priority() uint64 { + if p.hasPriorityOverride { + return p.priorityOverride + } + var g, d uint32 //nolint:varnamelen // clearer to use g and d here if p.iceRoleControlling { g = p.Local.Priority() diff --git a/vendor/github.com/pion/ice/v4/gather.go b/vendor/github.com/pion/ice/v4/gather.go index 3210866f80..b45eb496a7 100644 --- a/vendor/github.com/pion/ice/v4/gather.go +++ b/vendor/github.com/pion/ice/v4/gather.go @@ -64,30 +64,38 @@ func urlSupportsSrflxGathering(url stun.URI) bool { return url.Scheme == stun.SchemeTypeSTUN || url.Scheme == stun.SchemeTypeTURN } -func relayNetworkTypesForURL(url stun.URI, networkTypes []NetworkType) []NetworkType { +func relayNetworkTypesForConfiguredCandidates(networkTypes []NetworkType) []NetworkType { + // Relay allocations currently produce UDP relay endpoints, so relay candidate + // publication must be gated by configured UDP candidate network types. + res := []NetworkType{} + for _, networkType := range configuredNetworkTypes(networkTypes) { + if networkType.IsUDP() { + res = append(res, networkType) + } + } + + return res +} + +func turnNetworkTypesForURL(url stun.URI, networkTypes []NetworkType) []NetworkType { proto := effectiveURLProtoType(url) - switch proto { - case stun.ProtoTypeUDP: - res := []NetworkType{} - for _, networkType := range configuredNetworkTypes(networkTypes) { + res := []NetworkType{} + + for _, networkType := range configuredNetworkTypes(networkTypes) { + switch proto { + case stun.ProtoTypeUDP: if networkType.IsUDP() { res = append(res, networkType) } - } - - return res - case stun.ProtoTypeTCP: - res := []NetworkType{} - for _, networkType := range configuredNetworkTypes(networkTypes) { + case stun.ProtoTypeTCP: if networkType.IsTCP() { res = append(res, networkType) } + default: } - - return res - default: - return nil } + + return res } // Close a net.Conn and log if we have a failure. @@ -932,6 +940,13 @@ func (a *Agent) gatherCandidatesRelay(ctx context.Context, urls []*stun.URI) { localAddrs := []ifaceAddr{} if useFilteredLocalAddrs { localAddrs = append(localAddrs, ifaces...) + if len(localAddrs) == 0 { + return + } + } + + if len(relayNetworkTypesForConfiguredCandidates(a.networkTypes)) == 0 { + return } for _, url := range urls { @@ -948,7 +963,9 @@ func (a *Agent) gatherCandidatesRelay(ctx context.Context, urls []*stun.URI) { return } - networkTypes := relayNetworkTypesForURL(*url, a.networkTypes) + urlProto := effectiveURLProtoType(*url) + + networkTypes := turnNetworkTypesForURL(*url, a.turnTransportProtocols) if len(networkTypes) == 0 { continue } @@ -960,8 +977,6 @@ func (a *Agent) gatherCandidatesRelay(ctx context.Context, urls []*stun.URI) { } network := networkType.String() - urlProto := effectiveURLProtoType(*url) - bindAddrs := []string{} if !useFilteredLocalAddrs { // nolint:nestif if networkType.IsIPv6() { @@ -1175,8 +1190,10 @@ func (a *Agent) gatherCandidatesRelay(ctx context.Context, urls []*stun.URI) { return } + // Relay allocations currently produce UDP relay endpoints regardless of + // whether the TURN control connection uses UDP/TCP/TLS/DTLS. a.addRelayCandidates(ctx, relayEndpoint{ - network: network, + network: udp, address: rAddr.IP, port: rAddr.Port, relAddr: relAddr, diff --git a/vendor/github.com/pion/ice/v4/renomination.go b/vendor/github.com/pion/ice/v4/renomination.go index a0674f03b9..ebaa2f97f3 100644 --- a/vendor/github.com/pion/ice/v4/renomination.go +++ b/vendor/github.com/pion/ice/v4/renomination.go @@ -15,7 +15,7 @@ const ( // DefaultNominationAttribute represents the default STUN Nomination attribute. // This is a custom attribute for ICE renomination support. // This value can be overridden via AgentConfig.NominationAttribute. - DefaultNominationAttribute stun.AttrType = 0x0030 // Using a value in the reserved range + DefaultNominationAttribute stun.AttrType = 0xC001 // matching libwebrtc. ) // NominationAttribute represents a STUN Nomination attribute. diff --git a/vendor/github.com/pion/ice/v4/selection.go b/vendor/github.com/pion/ice/v4/selection.go index efed335358..aef6c8462f 100644 --- a/vendor/github.com/pion/ice/v4/selection.go +++ b/vendor/github.com/pion/ice/v4/selection.go @@ -34,13 +34,13 @@ func (s *controllingSelector) Start() { func (s *controllingSelector) isNominatable(c Candidate) bool { switch { case c.Type() == CandidateTypeHost: - return time.Since(s.startTime).Nanoseconds() > s.agent.hostAcceptanceMinWait.Nanoseconds() + return time.Since(s.startTime).Nanoseconds() >= s.agent.hostAcceptanceMinWait.Nanoseconds() case c.Type() == CandidateTypeServerReflexive: - return time.Since(s.startTime).Nanoseconds() > s.agent.srflxAcceptanceMinWait.Nanoseconds() + return time.Since(s.startTime).Nanoseconds() >= s.agent.srflxAcceptanceMinWait.Nanoseconds() case c.Type() == CandidateTypePeerReflexive: - return time.Since(s.startTime).Nanoseconds() > s.agent.prflxAcceptanceMinWait.Nanoseconds() + return time.Since(s.startTime).Nanoseconds() >= s.agent.prflxAcceptanceMinWait.Nanoseconds() case c.Type() == CandidateTypeRelay: - return time.Since(s.startTime).Nanoseconds() > s.agent.relayAcceptanceMinWait.Nanoseconds() + return time.Since(s.startTime).Nanoseconds() >= s.agent.relayAcceptanceMinWait.Nanoseconds() } s.log.Errorf("Invalid candidate type: %s", c.Type()) @@ -461,7 +461,15 @@ func (s *controlledSelector) HandleBindingRequest(message *stun.Message, local, } s.agent.sendBindingSuccess(message, local, remote) - s.PingCandidate(local, remote) + + // Only send a triggered check during ICE checking phase (RFC 8445 §7.3.1.4). + // Once the pair is established (succeeded + selected), sending a triggered check + // on every inbound request creates a ping-pong busy loop: the remote side responds + // and sends its own request, which triggers another check here, repeating at 1/RTT. + // After connection, consent freshness is maintained by checkKeepalive() on a timer. + if pair.state != CandidatePairStateSucceeded || s.agent.getSelectedPair() == nil { + s.PingCandidate(local, remote) + } if s.agent.userBindingRequestHandler != nil { if shouldSwitch := s.agent.userBindingRequestHandler(message, local, remote, pair); shouldSwitch { diff --git a/vendor/github.com/pion/ice/v4/transport.go b/vendor/github.com/pion/ice/v4/transport.go index 40ac049bc0..19b30efffa 100644 --- a/vendor/github.com/pion/ice/v4/transport.go +++ b/vendor/github.com/pion/ice/v4/transport.go @@ -12,16 +12,67 @@ import ( "github.com/pion/stun/v3" ) -// Dial connects to the remote agent, acting as the controlling ice agent. +// AwaitConnect waits until a pair is selected. +func (a *Agent) AwaitConnect(ctx context.Context) error { + select { + case <-a.loop.Done(): + return a.loop.Err() + case <-ctx.Done(): + return ErrCanceledByCaller + case <-a.onConnected: + } + + return nil +} + +// StartDial sets the agent up for connecting to the remote agent, acting as the +// controlling agent and returns immediately. +func (a *Agent) StartDial(remoteUfrag, remotePwd string) (*Conn, error) { + conn, err := a.startConnect(true, remoteUfrag, remotePwd) + if err != nil { + return nil, err + } + + return conn, nil +} + // Dial blocks until at least one ice candidate pair has successfully connected. func (a *Agent) Dial(ctx context.Context, remoteUfrag, remotePwd string) (*Conn, error) { - return a.connect(ctx, true, remoteUfrag, remotePwd) + conn, err := a.StartDial(remoteUfrag, remotePwd) //nolint:contextcheck + if err != nil { + return nil, err + } + err = a.AwaitConnect(ctx) + if err != nil { + return nil, err + } + + return conn, nil +} + +// StartAccept sets the agent up for connecting to the remote agent, acting as the +// controlled agent and returns immediately. +func (a *Agent) StartAccept(remoteUfrag, remotePwd string) (*Conn, error) { + conn, err := a.startConnect(false, remoteUfrag, remotePwd) + if err != nil { + return nil, err + } + + return conn, nil } -// Accept connects to the remote agent, acting as the controlled ice agent. // Accept blocks until at least one ice candidate pair has successfully connected. func (a *Agent) Accept(ctx context.Context, remoteUfrag, remotePwd string) (*Conn, error) { - return a.connect(ctx, false, remoteUfrag, remotePwd) + conn, err := a.StartAccept(remoteUfrag, remotePwd) //nolint:contextcheck + if err != nil { + return nil, err + } + err = a.AwaitConnect(ctx) + if err != nil { + return nil, err + } + + return conn, nil } // Conn represents the ICE connection. @@ -42,7 +93,7 @@ func (c *Conn) BytesReceived() uint64 { return c.bytesReceived.Load() } -func (a *Agent) connect(ctx context.Context, isControlling bool, remoteUfrag, remotePwd string) (*Conn, error) { +func (a *Agent) startConnect(isControlling bool, remoteUfrag, remotePwd string) (*Conn, error) { err := a.loop.Err() if err != nil { return nil, err @@ -52,15 +103,6 @@ func (a *Agent) connect(ctx context.Context, isControlling bool, remoteUfrag, re return nil, err } - // Block until pair selected - select { - case <-a.loop.Done(): - return nil, a.loop.Err() - case <-ctx.Done(): - return nil, ErrCanceledByCaller - case <-a.onConnected: - } - return &Conn{ agent: a, }, nil diff --git a/vendor/golang.org/x/net/http2/hpack/tables.go b/vendor/golang.org/x/net/http2/hpack/tables.go index 8cbdf3f019..803fe5178c 100644 --- a/vendor/golang.org/x/net/http2/hpack/tables.go +++ b/vendor/golang.org/x/net/http2/hpack/tables.go @@ -6,6 +6,7 @@ package hpack import ( "fmt" + "strings" ) // headerFieldTable implements a list of HeaderFields. @@ -54,10 +55,16 @@ func (t *headerFieldTable) len() int { // addEntry adds a new entry. func (t *headerFieldTable) addEntry(f HeaderField) { + // Prevent f from escaping to the heap. + f2 := HeaderField{ + Name: strings.Clone(f.Name), + Value: strings.Clone(f.Value), + Sensitive: f.Sensitive, + } id := uint64(t.len()) + t.evictCount + 1 - t.byName[f.Name] = id - t.byNameValue[pairNameValue{f.Name, f.Value}] = id - t.ents = append(t.ents, f) + t.byName[f2.Name] = id + t.byNameValue[pairNameValue{f2.Name, f2.Value}] = id + t.ents = append(t.ents, f2) } // evictOldest evicts the n oldest entries in the table. diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 2e9c2f6a52..19553f10c8 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -718,9 +718,6 @@ func canRetryError(err error) bool { } func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) { - if t.transportTestHooks != nil { - return t.newClientConn(nil, singleUse, nil) - } host, _, err := net.SplitHostPort(addr) if err != nil { return nil, err @@ -2861,6 +2858,9 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { var seenMaxConcurrentStreams bool err := f.ForeachSetting(func(s Setting) error { + if err := s.Valid(); err != nil { + return err + } switch s.ID { case SettingMaxFrameSize: cc.maxFrameSize = s.Val @@ -2892,9 +2892,6 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { cc.henc.SetMaxDynamicTableSize(s.Val) cc.peerMaxHeaderTableSize = s.Val case SettingEnableConnectProtocol: - if err := s.Valid(); err != nil { - return err - } // If the peer wants to send us SETTINGS_ENABLE_CONNECT_PROTOCOL, // we require that it do so in the first SETTINGS frame. // diff --git a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go index 56723d1f82..77aad553d5 100644 --- a/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go +++ b/vendor/golang.org/x/tools/go/types/objectpath/objectpath.go @@ -524,7 +524,7 @@ func (f *finder) find(T types.Type, path []byte) []byte { for i := 0; i < T.NumMethods(); i++ { m := T.Method(i) if f.seenMethods[m] { - return nil + continue // break cycles (see TestIssue70418) } path2 := appendOpArg(path, opMethod, i) if m == f.obj { diff --git a/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go b/vendor/golang.org/x/tools/internal/gcimporter/ureader.go similarity index 88% rename from vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go rename to vendor/golang.org/x/tools/internal/gcimporter/ureader.go index 2e0d80585f..3db62b8908 100644 --- a/vendor/golang.org/x/tools/internal/gcimporter/ureader_yes.go +++ b/vendor/golang.org/x/tools/internal/gcimporter/ureader.go @@ -35,6 +35,10 @@ type pkgReader struct { // laterFns holds functions that need to be invoked at the end of // import reading. + // + // TODO(mdempsky): Is it safe to have a single "later" slice or do + // we need to have multiple passes? See comments on CL 386002 and + // go.dev/issue/52104. laterFns []func() // laterFors is used in case of 'type A B' to ensure that B is processed before A. laterFors map[types.Type]int @@ -158,12 +162,11 @@ type reader struct { // A readerDict holds the state for type parameters that parameterize // the current unified IR element. type readerDict struct { - // bounds is a slice of typeInfos corresponding to the underlying - // bounds of the element's type parameters. - bounds []typeInfo + rtbounds []typeInfo // contains constraint types for each parameter in rtparams + rtparams []*types.TypeParam // contains receiver type parameters for an element - // tparams is a slice of the constructed TypeParams for the element. - tparams []*types.TypeParam + tbounds []typeInfo // contains constraint types for each parameter in tparams + tparams []*types.TypeParam // contains type parameters for an element // derived is a slice of types derived from tparams, which may be // instantiated while reading the current element. @@ -353,7 +356,11 @@ func (r *reader) doTyp() (res types.Type) { return name.Type() case pkgbits.TypeTypeParam: - return r.dict.tparams[r.Len()] + n := r.Len() + if n < len(r.dict.rtbounds) { + return r.dict.rtparams[n] + } + return r.dict.tparams[n-len(r.dict.rtbounds)] case pkgbits.TypeArray: len := int64(r.Uint64()) @@ -534,7 +541,7 @@ func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { pos := r.pos() var tparams []*types.TypeParam if r.Version().Has(pkgbits.AliasTypeParamNames) { - tparams = r.typeParamNames() + tparams = r.typeParamNames(false) } typ := r.typ() declare(aliases.New(pos, objPkg, objName, typ, tparams)) @@ -547,8 +554,15 @@ func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { case pkgbits.ObjFunc: pos := r.pos() - tparams := r.typeParamNames() - sig := r.signature(nil, nil, tparams) + var rtparams []*types.TypeParam + var recv *types.Var + if r.Version().Has(pkgbits.GenericMethods) && r.Bool() { + r.selector() + rtparams = r.typeParamNames(true) + recv = r.param() + } + tparams := r.typeParamNames(false) + sig := r.signature(recv, rtparams, tparams) declare(types.NewFunc(pos, objPkg, objName, sig)) case pkgbits.ObjType: @@ -558,7 +572,7 @@ func (pr *pkgReader) objIdx(idx pkgbits.Index) (*types.Package, string) { named := types.NewNamed(obj, nil, nil) declare(obj) - named.SetTypeParams(r.typeParamNames()) + named.SetTypeParams(r.typeParamNames(false)) setUnderlying := func(underlying types.Type) { // If the underlying type is an interface, we need to @@ -638,9 +652,20 @@ func (pr *pkgReader) objDictIdx(idx pkgbits.Index) *readerDict { errorf("unexpected object with %v implicit type parameter(s)", implicits) } - dict.bounds = make([]typeInfo, r.Len()) - for i := range dict.bounds { - dict.bounds[i] = r.typInfo() + nreceivers := 0 + if r.Version().Has(pkgbits.GenericMethods) && r.Bool() { + nreceivers = r.Len() + } + nexplicits := r.Len() + + dict.rtbounds = make([]typeInfo, nreceivers) + for i := range dict.rtbounds { + dict.rtbounds[i] = r.typInfo() + } + + dict.tbounds = make([]typeInfo, nexplicits) + for i := range dict.tbounds { + dict.tbounds[i] = r.typInfo() } dict.derived = make([]derivedInfo, r.Len()) @@ -659,15 +684,24 @@ func (pr *pkgReader) objDictIdx(idx pkgbits.Index) *readerDict { return &dict } -func (r *reader) typeParamNames() []*types.TypeParam { +func (r *reader) typeParamNames(isGenMeth bool) []*types.TypeParam { r.Sync(pkgbits.SyncTypeParamNames) - // Note: This code assumes it only processes objects without - // implement type parameters. This is currently fine, because - // reader is only used to read in exported declarations, which are - // always package scoped. + // Note: This code assumes there are no implicit type parameters. + // This is fine since it only reads exported declarations, which + // never have implicits. - if len(r.dict.bounds) == 0 { + var in []typeInfo + var out *[]*types.TypeParam + if isGenMeth { + in = r.dict.rtbounds + out = &r.dict.rtparams + } else { + in = r.dict.tbounds + out = &r.dict.tparams + } + + if len(in) == 0 { return nil } @@ -676,40 +710,34 @@ func (r *reader) typeParamNames() []*types.TypeParam { // create all the TypeNames and TypeParams, then we construct and // set the bound type. - r.dict.tparams = make([]*types.TypeParam, len(r.dict.bounds)) - for i := range r.dict.bounds { + // We have to save tparams outside of the closure, because typeParamNames + // can be called multiple times with the same dictionary instance. + tparams := make([]*types.TypeParam, len(in)) + *out = tparams + + for i := range in { pos := r.pos() pkg, name := r.localIdent() tname := types.NewTypeName(pos, pkg, name, nil) - r.dict.tparams[i] = types.NewTypeParam(tname, nil) + tparams[i] = types.NewTypeParam(tname, nil) } - typs := make([]types.Type, len(r.dict.bounds)) - for i, bound := range r.dict.bounds { - typs[i] = r.p.typIdx(bound, r.dict) + // The reader dictionary will continue mutating before we have time + // to call delayed functions; make a local copy of the constraints. + types := make([]types.Type, len(in)) + for i, info := range in { + types[i] = r.p.typIdx(info, r.dict) } - // TODO(mdempsky): This is subtle, elaborate further. - // - // We have to save tparams outside of the closure, because - // typeParamNames() can be called multiple times with the same - // dictionary instance. - // - // Also, this needs to happen later to make sure SetUnderlying has - // been called. - // - // TODO(mdempsky): Is it safe to have a single "later" slice or do - // we need to have multiple passes? See comments on CL 386002 and - // go.dev/issue/52104. - tparams := r.dict.tparams + // This needs to happen later to make sure SetUnderlying has been called. r.p.later(func() { - for i, typ := range typs { + for i, typ := range types { tparams[i].SetConstraint(typ) } }) - return r.dict.tparams + return tparams } func (r *reader) method() *types.Func { @@ -717,7 +745,7 @@ func (r *reader) method() *types.Func { pos := r.pos() pkg, name := r.selector() - rparams := r.typeParamNames() + rparams := r.typeParamNames(false) sig := r.signature(r.param(), rparams, nil) _ = r.pos() // TODO(mdempsky): Remove; this is a hacker for linker.go. diff --git a/vendor/golang.org/x/tools/internal/gocommand/version.go b/vendor/golang.org/x/tools/internal/gocommand/version.go index 446c5846a6..cce290c419 100644 --- a/vendor/golang.org/x/tools/internal/gocommand/version.go +++ b/vendor/golang.org/x/tools/internal/gocommand/version.go @@ -26,6 +26,9 @@ func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) { inv.BuildFlags = nil // This is not a build command. inv.ModFlag = "" inv.ModFile = "" + // Set GO111MODULE=off so that we are immune to errors in go.{work,mod}. + // Unfortunately, this breaks the Go 1.21+ toolchain directive and + // may affect the set of ReleaseTags; see #68495. inv.Env = append(inv.Env[:len(inv.Env):len(inv.Env)], "GO111MODULE=off") stdoutBytes, err := r.Run(ctx, inv) diff --git a/vendor/golang.org/x/tools/internal/imports/source_modindex.go b/vendor/golang.org/x/tools/internal/imports/source_modindex.go deleted file mode 100644 index ca745d4a1b..0000000000 --- a/vendor/golang.org/x/tools/internal/imports/source_modindex.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package imports - -import ( - "context" - "sync" - "time" - - "golang.org/x/tools/internal/modindex" -) - -// This code is here rather than in the modindex package -// to avoid import loops - -// TODO(adonovan): this code is only used by a test in this package. -// Can we delete it? Or is there a plan to call NewIndexSource from -// cmd/goimports? - -// implements Source using modindex, so only for module cache. -// -// this is perhaps over-engineered. A new Index is read at first use. -// And then Update is called after every 15 minutes, and a new Index -// is read if the index changed. It is not clear the Mutex is needed. -type IndexSource struct { - modcachedir string - mu sync.Mutex - index *modindex.Index // (access via getIndex) - expires time.Time -} - -// create a new Source. Called from NewView in cache/session.go. -func NewIndexSource(cachedir string) *IndexSource { - return &IndexSource{modcachedir: cachedir} -} - -func (s *IndexSource) LoadPackageNames(ctx context.Context, srcDir string, paths []ImportPath) (map[ImportPath]PackageName, error) { - /// This is used by goimports to resolve the package names of imports of the - // current package, which is irrelevant for the module cache. - return nil, nil -} - -func (s *IndexSource) ResolveReferences(ctx context.Context, filename string, missing References) ([]*Result, error) { - index, err := s.getIndex() - if err != nil { - return nil, err - } - var cs []modindex.Candidate - for pkg, nms := range missing { - for nm := range nms { - x := index.Lookup(pkg, nm, false) - cs = append(cs, x...) - } - } - found := make(map[string]*Result) - for _, c := range cs { - var x *Result - if x = found[c.ImportPath]; x == nil { - x = &Result{ - Import: &ImportInfo{ - ImportPath: c.ImportPath, - Name: "", - }, - Package: &PackageInfo{ - Name: c.PkgName, - Exports: make(map[string]bool), - }, - } - found[c.ImportPath] = x - } - x.Package.Exports[c.Name] = true - } - var ans []*Result - for _, x := range found { - ans = append(ans, x) - } - return ans, nil -} - -func (s *IndexSource) getIndex() (*modindex.Index, error) { - s.mu.Lock() - defer s.mu.Unlock() - - // (s.index = nil => s.expires is zero, - // so the first condition is strictly redundant. - // But it makes the postcondition very clear.) - if s.index == nil || time.Now().After(s.expires) { - index, err := modindex.Update(s.modcachedir) - if err != nil { - return nil, err - } - s.index = index - s.expires = index.ValidAt.Add(15 * time.Minute) // (refresh period) - } - // Inv: s.index != nil - - return s.index, nil -} diff --git a/vendor/golang.org/x/tools/internal/modindex/directories.go b/vendor/golang.org/x/tools/internal/modindex/directories.go deleted file mode 100644 index 9a963744b5..0000000000 --- a/vendor/golang.org/x/tools/internal/modindex/directories.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2024 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package modindex - -import ( - "fmt" - "log" - "os" - "path/filepath" - "regexp" - "strings" - "sync" - "time" - - "golang.org/x/mod/semver" - "golang.org/x/tools/internal/gopathwalk" -) - -type directory struct { - path string // relative to GOMODCACHE - importPath string - version string // semantic version -} - -// bestDirByImportPath returns the best directory for each import -// path, where "best" means most recent semantic version. These import -// paths are inferred from the GOMODCACHE-relative dir names in dirs. -func bestDirByImportPath(dirs []string) (map[string]directory, error) { - dirsByPath := make(map[string]directory) - for _, dir := range dirs { - importPath, version, err := dirToImportPathVersion(dir) - if err != nil { - return nil, err - } - new := directory{ - path: dir, - importPath: importPath, - version: version, - } - if old, ok := dirsByPath[importPath]; !ok || compareDirectory(new, old) < 0 { - dirsByPath[importPath] = new - } - } - return dirsByPath, nil -} - -// compareDirectory defines an ordering of path@version directories, -// by descending version, then by ascending path. -func compareDirectory(x, y directory) int { - if sign := -semver.Compare(x.version, y.version); sign != 0 { - return sign // latest first - } - return strings.Compare(string(x.path), string(y.path)) -} - -// modCacheRegexp splits a relpathpath into module, module version, and package. -var modCacheRegexp = regexp.MustCompile(`(.*)@([^/\\]*)(.*)`) - -// dirToImportPathVersion computes import path and semantic version -// from a GOMODCACHE-relative directory name. -func dirToImportPathVersion(dir string) (string, string, error) { - m := modCacheRegexp.FindStringSubmatch(string(dir)) - // m[1] is the module path - // m[2] is the version major.minor.patch(-
 1 && flds[1][1] == 'D',
-			}
-			if px.Type == Func {
-				n, err := strconv.Atoi(flds[2])
-				if err != nil {
-					continue // should never happen
-				}
-				px.Results = int16(n)
-				if len(flds) >= 4 {
-					sig := strings.Split(flds[3], " ")
-					for i := range sig {
-						// $ cannot otherwise occur. removing the spaces
-						// almost works, but for chan struct{}, e.g.
-						sig[i] = strings.Replace(sig[i], "$", " ", -1)
-					}
-					px.Sig = toFields(sig)
-				}
-			}
-			ans = append(ans, px)
-		}
-	}
-	return ans
-}
-
-func toFields(sig []string) []Field {
-	ans := make([]Field, len(sig)/2)
-	for i := range ans {
-		ans[i] = Field{Arg: sig[2*i], Type: sig[2*i+1]}
-	}
-	return ans
-}
-
-// benchmarks show this is measurably better than strings.Split
-// split into first 4 fields separated by single space
-func fastSplit(x string) []string {
-	ans := make([]string, 0, 4)
-	nxt := 0
-	start := 0
-	for i := 0; i < len(x); i++ {
-		if x[i] != ' ' {
-			continue
-		}
-		ans = append(ans, x[start:i])
-		nxt++
-		start = i + 1
-		if nxt >= 3 {
-			break
-		}
-	}
-	ans = append(ans, x[start:])
-	return ans
-}
-
-func asLexType(c byte) LexType {
-	switch c {
-	case 'C':
-		return Const
-	case 'V':
-		return Var
-	case 'T':
-		return Type
-	case 'F':
-		return Func
-	}
-	return -1
-}
diff --git a/vendor/golang.org/x/tools/internal/modindex/modindex.go b/vendor/golang.org/x/tools/internal/modindex/modindex.go
deleted file mode 100644
index 5fa285d98e..0000000000
--- a/vendor/golang.org/x/tools/internal/modindex/modindex.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright 2024 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package modindex contains code for building and searching an
-// [Index] of the Go module cache.
-package modindex
-
-// The directory containing the index, returned by
-// [IndexDir], contains a file index-name- that contains the name
-// of the current index. We believe writing that short file is atomic.
-// [Read] reads that file to get the file name of the index.
-// WriteIndex writes an index with a unique name and then
-// writes that name into a new version of index-name-.
-// ( stands for the CurrentVersion of the index format.)
-
-import (
-	"maps"
-	"os"
-	"path/filepath"
-	"slices"
-	"strings"
-	"time"
-
-	"golang.org/x/mod/semver"
-)
-
-// Update updates the index for the specified Go
-// module cache directory, creating it as needed.
-// On success it returns the current index.
-func Update(gomodcache string) (*Index, error) {
-	prev, err := Read(gomodcache)
-	if err != nil {
-		if !os.IsNotExist(err) {
-			return nil, err
-		}
-		prev = nil
-	}
-	return update(gomodcache, prev)
-}
-
-// update builds, writes, and returns the current index.
-//
-// If old is nil, the new index is built from all of GOMODCACHE;
-// otherwise it is built from the old index plus cache updates
-// since the previous index's time.
-func update(gomodcache string, old *Index) (*Index, error) {
-	gomodcache, err := filepath.Abs(gomodcache)
-	if err != nil {
-		return nil, err
-	}
-	new, changed, err := build(gomodcache, old)
-	if err != nil {
-		return nil, err
-	}
-	if old == nil || changed {
-		if err := write(gomodcache, new); err != nil {
-			return nil, err
-		}
-	}
-	return new, nil
-}
-
-// build returns a new index for the specified Go module cache (an
-// absolute path).
-//
-// If an old index is provided, only directories more recent than it
-// that it are scanned; older directories are provided by the old
-// Index.
-//
-// The boolean result indicates whether new entries were found.
-func build(gomodcache string, old *Index) (*Index, bool, error) {
-	// Set the time window.
-	var start time.Time // = dawn of time
-	if old != nil {
-		start = old.ValidAt
-	}
-	now := time.Now()
-	end := now.Add(24 * time.Hour) // safely in the future
-
-	// Enumerate GOMODCACHE package directories.
-	// Choose the best (latest) package for each import path.
-	pkgDirs := findDirs(gomodcache, start, end)
-	dirByPath, err := bestDirByImportPath(pkgDirs)
-	if err != nil {
-		return nil, false, err
-	}
-
-	// For each import path it might occur only in
-	// dirByPath, only in old, or in both.
-	// If both, use the semantically later one.
-	var entries []Entry
-	if old != nil {
-		for _, entry := range old.Entries {
-			dir, ok := dirByPath[entry.ImportPath]
-			if !ok || semver.Compare(dir.version, entry.Version) <= 0 {
-				// New dir is missing or not more recent; use old entry.
-				entries = append(entries, entry)
-				delete(dirByPath, entry.ImportPath)
-			}
-		}
-	}
-
-	// Extract symbol information for all the new directories.
-	newEntries := extractSymbols(gomodcache, maps.Values(dirByPath))
-	entries = append(entries, newEntries...)
-	slices.SortFunc(entries, func(x, y Entry) int {
-		if n := strings.Compare(x.PkgName, y.PkgName); n != 0 {
-			return n
-		}
-		return strings.Compare(x.ImportPath, y.ImportPath)
-	})
-
-	return &Index{
-		GOMODCACHE: gomodcache,
-		ValidAt:    now, // time before the directories were scanned
-		Entries:    entries,
-	}, len(newEntries) > 0, nil
-}
diff --git a/vendor/golang.org/x/tools/internal/modindex/symbols.go b/vendor/golang.org/x/tools/internal/modindex/symbols.go
deleted file mode 100644
index 8e9702d84b..0000000000
--- a/vendor/golang.org/x/tools/internal/modindex/symbols.go
+++ /dev/null
@@ -1,244 +0,0 @@
-// Copyright 2024 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package modindex
-
-import (
-	"fmt"
-	"go/ast"
-	"go/parser"
-	"go/token"
-	"go/types"
-	"iter"
-	"os"
-	"path/filepath"
-	"runtime"
-	"slices"
-	"strings"
-	"sync"
-
-	"golang.org/x/sync/errgroup"
-)
-
-// The name of a symbol contains information about the symbol:
-//  T for types, TD if the type is deprecated
-//  C for consts, CD if the const is deprecated
-//  V for vars, VD if the var is deprecated
-// and for funcs:  F  ( )*
-// any spaces in  are replaced by $s so that the fields
-// of the name are space separated. F is replaced by FD if the func
-// is deprecated.
-type symbol struct {
-	pkg  string // name of the symbols's package
-	name string // declared name
-	kind string // T, C, V, or F, followed by D if deprecated
-	sig  string // signature information, for F
-}
-
-// extractSymbols returns a (new, unordered) array of Entries, one for
-// each provided package directory, describing its exported symbols.
-func extractSymbols(cwd string, dirs iter.Seq[directory]) []Entry {
-	var (
-		mu      sync.Mutex
-		entries []Entry
-	)
-
-	var g errgroup.Group
-	g.SetLimit(max(2, runtime.GOMAXPROCS(0)/2))
-	for dir := range dirs {
-		g.Go(func() error {
-			thedir := filepath.Join(cwd, string(dir.path))
-			mode := parser.SkipObjectResolution | parser.ParseComments
-
-			// Parse all Go files in dir and extract symbols.
-			dirents, err := os.ReadDir(thedir)
-			if err != nil {
-				return nil // log this someday?
-			}
-			var syms []symbol
-			for _, dirent := range dirents {
-				if !strings.HasSuffix(dirent.Name(), ".go") ||
-					strings.HasSuffix(dirent.Name(), "_test.go") {
-					continue
-				}
-				fname := filepath.Join(thedir, dirent.Name())
-				tr, err := parser.ParseFile(token.NewFileSet(), fname, nil, mode)
-				if err != nil {
-					continue // ignore errors, someday log them?
-				}
-				syms = append(syms, getFileExports(tr)...)
-			}
-
-			// Create an entry for the package.
-			pkg, names := processSyms(syms)
-			if pkg != "" {
-				mu.Lock()
-				defer mu.Unlock()
-				entries = append(entries, Entry{
-					PkgName:    pkg,
-					Dir:        dir.path,
-					ImportPath: dir.importPath,
-					Version:    dir.version,
-					Names:      names,
-				})
-			}
-
-			return nil
-		})
-	}
-	g.Wait() // ignore error
-
-	return entries
-}
-
-func getFileExports(f *ast.File) []symbol {
-	pkg := f.Name.Name
-	if pkg == "main" || pkg == "" {
-		return nil
-	}
-	var ans []symbol
-	// should we look for //go:build ignore?
-	for _, decl := range f.Decls {
-		switch decl := decl.(type) {
-		case *ast.FuncDecl:
-			if decl.Recv != nil {
-				// ignore methods, as we are completing package selections
-				continue
-			}
-			name := decl.Name.Name
-			dtype := decl.Type
-			// not looking at dtype.TypeParams. That is, treating
-			// generic functions just like non-generic ones.
-			sig := dtype.Params
-			kind := "F"
-			if isDeprecated(decl.Doc) {
-				kind += "D"
-			}
-			result := []string{fmt.Sprintf("%d", dtype.Results.NumFields())}
-			for _, x := range sig.List {
-				// This code creates a string representing the type.
-				// TODO(pjw): it may be fragile:
-				// 1. x.Type could be nil, perhaps in ill-formed code
-				// 2. ExprString might someday change incompatibly to
-				//    include struct tags, which can be arbitrary strings
-				if x.Type == nil {
-					// Can this happen without a parse error? (Files with parse
-					// errors are ignored in getSymbols)
-					continue // maybe report this someday
-				}
-				tp := types.ExprString(x.Type)
-				if len(tp) == 0 {
-					// Can this happen?
-					continue // maybe report this someday
-				}
-				// This is only safe if ExprString never returns anything with a $
-				// The only place a $ can occur seems to be in a struct tag, which
-				// can be an arbitrary string literal, and ExprString does not presently
-				// print struct tags. So for this to happen the type of a formal parameter
-				// has to be a explicit struct, e.g. foo(x struct{a int "$"}) and ExprString
-				// would have to show the struct tag. Even testing for this case seems
-				// a waste of effort, but let's remember the possibility
-				if strings.Contains(tp, "$") {
-					continue
-				}
-				tp = strings.Replace(tp, " ", "$", -1)
-				if len(x.Names) == 0 {
-					result = append(result, "_")
-					result = append(result, tp)
-				} else {
-					for _, y := range x.Names {
-						result = append(result, y.Name)
-						result = append(result, tp)
-					}
-				}
-			}
-			sigs := strings.Join(result, " ")
-			if s := newsym(pkg, name, kind, sigs); s != nil {
-				ans = append(ans, *s)
-			}
-		case *ast.GenDecl:
-			depr := isDeprecated(decl.Doc)
-			switch decl.Tok {
-			case token.CONST, token.VAR:
-				tp := "V"
-				if decl.Tok == token.CONST {
-					tp = "C"
-				}
-				if depr {
-					tp += "D"
-				}
-				for _, sp := range decl.Specs {
-					for _, x := range sp.(*ast.ValueSpec).Names {
-						if s := newsym(pkg, x.Name, tp, ""); s != nil {
-							ans = append(ans, *s)
-						}
-					}
-				}
-			case token.TYPE:
-				tp := "T"
-				if depr {
-					tp += "D"
-				}
-				for _, sp := range decl.Specs {
-					if s := newsym(pkg, sp.(*ast.TypeSpec).Name.Name, tp, ""); s != nil {
-						ans = append(ans, *s)
-					}
-				}
-			}
-		}
-	}
-	return ans
-}
-
-func newsym(pkg, name, kind, sig string) *symbol {
-	if len(name) == 0 || !ast.IsExported(name) {
-		return nil
-	}
-	sym := symbol{pkg: pkg, name: name, kind: kind, sig: sig}
-	return &sym
-}
-
-func isDeprecated(doc *ast.CommentGroup) bool {
-	if doc == nil {
-		return false
-	}
-	// go.dev/wiki/Deprecated Paragraph starting 'Deprecated:'
-	// This code fails for /* Deprecated: */, but it's the code from
-	// gopls/internal/analysis/deprecated
-	for line := range strings.SplitSeq(doc.Text(), "\n\n") {
-		if strings.HasPrefix(line, "Deprecated:") {
-			return true
-		}
-	}
-	return false
-}
-
-// return the package name and the value for the symbols.
-// if there are multiple packages, choose one arbitrarily
-// the returned slice is sorted lexicographically
-func processSyms(syms []symbol) (string, []string) {
-	if len(syms) == 0 {
-		return "", nil
-	}
-	slices.SortFunc(syms, func(l, r symbol) int {
-		return strings.Compare(l.name, r.name)
-	})
-	pkg := syms[0].pkg
-	var names []string
-	for _, s := range syms {
-		if s.pkg != pkg {
-			// Symbols came from two files in same dir
-			// with different package declarations.
-			continue
-		}
-		var nx string
-		if s.sig != "" {
-			nx = fmt.Sprintf("%s %s %s", s.name, s.kind, s.sig)
-		} else {
-			nx = fmt.Sprintf("%s %s", s.name, s.kind)
-		}
-		names = append(names, nx)
-	}
-	return pkg, names
-}
diff --git a/vendor/golang.org/x/tools/internal/pkgbits/version.go b/vendor/golang.org/x/tools/internal/pkgbits/version.go
index 53af9df22b..0db9652748 100644
--- a/vendor/golang.org/x/tools/internal/pkgbits/version.go
+++ b/vendor/golang.org/x/tools/internal/pkgbits/version.go
@@ -28,6 +28,15 @@ const (
 	// - remove derived info "needed" bool
 	V2
 
+	// V3: introduces a more compact format for composite literal element lists
+	// - negative lengths indicate that (some) elements may have keys
+	// - positive lengths indicate that no element has a key
+	// - a negative struct field index indicates an embedded field
+	V3
+
+	// V4: encodes generic methods as standalone function objects
+	V4
+
 	numVersions = iota
 )
 
@@ -61,6 +70,12 @@ const (
 	// whether a type was a derived type.
 	DerivedInfoNeeded
 
+	// Composite literals use a more compact format for element lists.
+	CompactCompLiterals
+
+	// Generic methods may appear as standalone function objects.
+	GenericMethods
+
 	numFields = iota
 )
 
@@ -68,6 +83,8 @@ const (
 var introduced = [numFields]Version{
 	Flags:               V1,
 	AliasTypeParamNames: V2,
+	CompactCompLiterals: V3,
+	GenericMethods:      V4,
 }
 
 // removed is the version a field was removed in or 0 for fields
diff --git a/vendor/golang.org/x/tools/internal/typeparams/coretype.go b/vendor/golang.org/x/tools/internal/typeparams/coretype.go
index 27a2b17929..2e05de4649 100644
--- a/vendor/golang.org/x/tools/internal/typeparams/coretype.go
+++ b/vendor/golang.org/x/tools/internal/typeparams/coretype.go
@@ -11,7 +11,9 @@ import (
 
 // CoreType returns the core type of T or nil if T does not have a core type.
 //
-// See https://go.dev/ref/spec#Core_types for the definition of a core type.
+// As of Go1.25, the notion of a core type has been removed from the language spec.
+// See https://go.dev/blog/coretypes for more details.
+// TODO(mkalil): We should eventually consider removing all uses of CoreType.
 func CoreType(T types.Type) types.Type {
 	U := T.Underlying()
 	if _, ok := U.(*types.Interface); !ok {
@@ -34,7 +36,7 @@ func CoreType(T types.Type) types.Type {
 	}
 
 	if identical == len(terms) {
-		// https://go.dev/ref/spec#Core_types
+		// From the deprecated core types spec:
 		// "There is a single type U which is the underlying type of all types in the type set of T"
 		return U
 	}
@@ -42,7 +44,7 @@ func CoreType(T types.Type) types.Type {
 	if !ok {
 		return nil // no core type as identical < len(terms) and U is not a channel.
 	}
-	// https://go.dev/ref/spec#Core_types
+	// From the deprecated core types spec:
 	// "the type chan E if T contains only bidirectional channels, or the type chan<- E or
 	// <-chan E depending on the direction of the directional channels present."
 	for chans := identical; chans < len(terms); chans++ {
diff --git a/vendor/golang.org/x/tools/internal/typesinternal/types.go b/vendor/golang.org/x/tools/internal/typesinternal/types.go
index 7112318fc2..6582cc81f5 100644
--- a/vendor/golang.org/x/tools/internal/typesinternal/types.go
+++ b/vendor/golang.org/x/tools/internal/typesinternal/types.go
@@ -194,3 +194,51 @@ func Imports(pkg *types.Package, path string) bool {
 	}
 	return false
 }
+
+// ObjectKind returns a description of the object's kind.
+//
+// from objectKind in go/types
+func ObjectKind(obj types.Object) string {
+	switch obj := obj.(type) {
+	case *types.PkgName:
+		return "package name"
+	case *types.Const:
+		return "constant"
+	case *types.TypeName:
+		if obj.IsAlias() {
+			return "type alias"
+		} else if _, ok := obj.Type().(*types.TypeParam); ok {
+			return "type parameter"
+		} else {
+			return "defined type"
+		}
+	case *types.Var:
+		switch obj.Kind() {
+		case PackageVar:
+			return "package-level variable"
+		case LocalVar:
+			return "local variable"
+		case RecvVar:
+			return "receiver"
+		case ParamVar:
+			return "parameter"
+		case ResultVar:
+			return "result variable"
+		case FieldVar:
+			return "struct field"
+		}
+	case *types.Func:
+		if obj.Signature().Recv() != nil {
+			return "method"
+		} else {
+			return "function"
+		}
+	case *types.Label:
+		return "label"
+	case *types.Builtin:
+		return "built-in function"
+	case *types.Nil:
+		return "untyped nil"
+	}
+	return "unknown symbol"
+}
diff --git a/vendor/golang.org/x/tools/internal/versions/features.go b/vendor/golang.org/x/tools/internal/versions/features.go
index cdd36c388a..360a5b5529 100644
--- a/vendor/golang.org/x/tools/internal/versions/features.go
+++ b/vendor/golang.org/x/tools/internal/versions/features.go
@@ -19,6 +19,7 @@ const (
 	Go1_24 = "go1.24"
 	Go1_25 = "go1.25"
 	Go1_26 = "go1.26"
+	Go1_27 = "go1.27"
 )
 
 // Future is an invalid unknown Go version sometime in the future.
diff --git a/vendor/modernc.org/libc/libc_linux_statfs.go b/vendor/modernc.org/libc/libc_linux_statfs.go
new file mode 100644
index 0000000000..b070a1cad0
--- /dev/null
+++ b/vendor/modernc.org/libc/libc_linux_statfs.go
@@ -0,0 +1,13 @@
+// Copyright 2024 The Libc Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build linux && (amd64 || arm64 || loong64 || ppc64le || s390x || riscv64 || 386 || arm || mips64le)
+
+package libc // import "modernc.org/libc"
+
+// int statfs(const char *path, struct statfs *buf);
+// Wrapper for ___statfs from ccgo-transpiled musl.
+func Xstatfs(tls *TLS, path uintptr, buf uintptr) int32 {
+	return ___statfs(tls, path, buf)
+}
diff --git a/vendor/modernc.org/libc/libc_windows.go b/vendor/modernc.org/libc/libc_windows.go
index 72f9729b3c..b235fd275c 100644
--- a/vendor/modernc.org/libc/libc_windows.go
+++ b/vendor/modernc.org/libc/libc_windows.go
@@ -128,6 +128,7 @@ var (
 	procGetModuleFileNameW         = modkernel32.NewProc("GetModuleFileNameW")
 	procGetModuleHandleA           = modkernel32.NewProc("GetModuleHandleA")
 	procGetModuleHandleW           = modkernel32.NewProc("GetModuleHandleW")
+	procGetNativeSystemInfo        = modkernel32.NewProc("GetNativeSystemInfo")
 	procGetPrivateProfileStringA   = modkernel32.NewProc("GetPrivateProfileStringA")
 	procGetProcAddress             = modkernel32.NewProc("GetProcAddress")
 	procGetProcessHeap             = modkernel32.NewProc("GetProcessHeap")
@@ -253,6 +254,7 @@ var (
 	procWfindfirst64i32 = moducrt.NewProc("_wfindfirst64i32")
 	procWfindnext32     = moducrt.NewProc("_wfindnext32")
 	procWfindnext64i32  = moducrt.NewProc("_wfindnext64i32")
+	procWfullpath       = moducrt.NewProc("_wfullpath")
 	procWmkdir          = moducrt.NewProc("_wmkdir")
 	procWstat32         = moducrt.NewProc("_wstat32")
 	procWstat64i32      = moducrt.NewProc("_wstat64i32")
@@ -3832,6 +3834,18 @@ func XRtlGetVersion(t *TLS, lpVersionInformation uintptr) uintptr {
 	panic(todo(""))
 }
 
+// void GetNativeSystemInfo(
+//
+//	LPSYSTEM_INFO lpSystemInfo
+//
+// );
+func XGetNativeSystemInfo(t *TLS, lpSystemInfo uintptr) {
+	if __ccgo_strace {
+		trc("t=%v lpSystemInfo=%v, (%v:)", t, lpSystemInfo, origin(2))
+	}
+	procGetNativeSystemInfo.Call(lpSystemInfo, 0, 0)
+}
+
 // void GetSystemInfo(
 //
 //	LPSYSTEM_INFO lpSystemInfo
@@ -7798,6 +7812,19 @@ func X_wfindnext64i32(tls *TLS, handle types.Intptr_t, fileinfo uintptr) (r int3
 	return int32(r0)
 }
 
+// wchar_t *_wfullpath(
+//    wchar_t *absPath,
+//    const wchar_t *relPath,
+//    size_t maxLength
+// );
+func X_wfullpath(tls *TLS, absPath, relPath uintptr, maxLength Tsize_t) (r uintptr) {
+	r0, _, err := procWfullpath.Call(absPath, relPath, uintptr(maxLength))
+	if err != windows.NOERROR {
+		tls.setErrno(int32(err.(windows.Errno)))
+	}
+	return r0
+}
+
 // int _wchmod( const wchar_t *filename, int pmode );
 func X_wchmod(tls *TLS, filename uintptr, pmode int32) (r int32) {
 	r0, _, err := procWchmod.Call(filename, uintptr(pmode))
diff --git a/vendor/modernc.org/libc/pthread_musl.go b/vendor/modernc.org/libc/pthread_musl.go
index c051945afc..8b7ecbc664 100644
--- a/vendor/modernc.org/libc/pthread_musl.go
+++ b/vendor/modernc.org/libc/pthread_musl.go
@@ -483,6 +483,65 @@ func _pthread_sigmask(tls *TLS, now int32, set, old uintptr) int32 {
 	return 0
 }
 
+type barrierState struct {
+	mu         sync.Mutex
+	cond       *sync.Cond
+	count      uint32
+	tripCount  uint32
+	generation uint32
+}
+
+var (
+	barriers   = map[uintptr]*barrierState{}
+	barriersMu sync.Mutex
+)
+
+// int pthread_barrier_init(pthread_barrier_t *restrict barrier, const pthread_barrierattr_t *restrict attr, unsigned count);
+func Xpthread_barrier_init(tls *TLS, barrier, attr uintptr, count uint32) int32 {
+	if count == 0 {
+		return EINVAL
+	}
+	barriersMu.Lock()
+	defer barriersMu.Unlock()
+	state := &barrierState{tripCount: count}
+	state.cond = sync.NewCond(&state.mu)
+	barriers[barrier] = state
+	return 0
+}
+
+// int pthread_barrier_destroy(pthread_barrier_t *barrier);
+func Xpthread_barrier_destroy(tls *TLS, barrier uintptr) int32 {
+	barriersMu.Lock()
+	defer barriersMu.Unlock()
+	delete(barriers, barrier)
+	return 0
+}
+
+// int pthread_barrier_wait(pthread_barrier_t *barrier);
+func Xpthread_barrier_wait(tls *TLS, barrier uintptr) int32 {
+	barriersMu.Lock()
+	state := barriers[barrier]
+	barriersMu.Unlock()
+	if state == nil {
+		return EINVAL
+	}
+	state.mu.Lock()
+	gen := state.generation
+	state.count++
+	if state.count >= state.tripCount {
+		state.count = 0
+		state.generation++
+		state.cond.Broadcast()
+		state.mu.Unlock()
+		return -1 // PTHREAD_BARRIER_SERIAL_THREAD
+	}
+	for gen == state.generation {
+		state.cond.Wait()
+	}
+	state.mu.Unlock()
+	return 0
+}
+
 // 202402251838      all_test.go:589: files=36 buildFails=30 execFails=2 pass=4
 // 202402262246      all_test.go:589: files=36 buildFails=26 execFails=2 pass=8
 // 202403041858 all_musl_test.go:640: files=36 buildFails=22 execFails=4 pass=10
diff --git a/vendor/modernc.org/libc/surface.new b/vendor/modernc.org/libc/surface.new
index e86baf2567..8d722b74ee 100644
--- a/vendor/modernc.org/libc/surface.new
+++ b/vendor/modernc.org/libc/surface.new
@@ -8860,6 +8860,9 @@ Xpthread_self
 Xpthread_setcancelstate
 Xpthread_setspecific
 Xpthread_sigmask
+Xpthread_barrier_destroy
+Xpthread_barrier_init
+Xpthread_barrier_wait
 Xptrace
 Xptsname
 Xptsname_r
@@ -9047,6 +9050,7 @@ Xsrandom
 Xsscanf
 Xstat
 Xstat64
+Xstatfs
 Xstatvfs
 Xstatx
 Xstderr
diff --git a/vendor/modernc.org/libc/surface.old b/vendor/modernc.org/libc/surface.old
index 37c63fec02..c692488577 100644
--- a/vendor/modernc.org/libc/surface.old
+++ b/vendor/modernc.org/libc/surface.old
@@ -8757,6 +8757,9 @@ Xpthread_self
 Xpthread_setcancelstate
 Xpthread_setspecific
 Xpthread_sigmask
+Xpthread_barrier_destroy
+Xpthread_barrier_init
+Xpthread_barrier_wait
 Xptrace
 Xptsname
 Xptsname_r
@@ -8935,6 +8938,7 @@ Xsrandom
 Xsscanf
 Xstat
 Xstat64
+Xstatfs
 Xstatvfs
 Xstatx
 Xstderr
diff --git a/vendor/modernc.org/sqlite/lib/mutex.go b/vendor/modernc.org/sqlite/lib/mutex.go
index f076e2e1a7..4c68a0d9e3 100644
--- a/vendor/modernc.org/sqlite/lib/mutex.go
+++ b/vendor/modernc.org/sqlite/lib/mutex.go
@@ -253,7 +253,7 @@ func mutexTry(tls *libc.TLS, m uintptr) int32 {
 	// Non-recursive mutex
 	if !(*mutex)(unsafe.Pointer(m)).recursive {
 		if (*mutex)(unsafe.Pointer(m)).TryLock() {
-			(*mutex)(unsafe.Pointer(m)).id = tls.ID
+			atomic.StoreInt32(&(*mutex)(unsafe.Pointer(m)).id, tls.ID)
 			return SQLITE_OK
 		}
 
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 9afecc44b4..cdc8d1471d 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -81,7 +81,7 @@ github.com/Microsoft/go-winio/internal/fs
 github.com/Microsoft/go-winio/internal/socket
 github.com/Microsoft/go-winio/internal/stringbuffer
 github.com/Microsoft/go-winio/pkg/guid
-# github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260403213135-1d43121312d4
+# github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260416073033-7c2071eaa8d4
 ## explicit; go 1.24.0
 github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime
 # github.com/RoaringBitmap/roaring v1.9.4
@@ -305,7 +305,7 @@ github.com/aws/aws-sdk-go-v2/service/ssooidc/types
 github.com/aws/aws-sdk-go-v2/service/sts
 github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints
 github.com/aws/aws-sdk-go-v2/service/sts/types
-# github.com/aws/smithy-go v1.24.3
+# github.com/aws/smithy-go v1.25.0
 ## explicit; go 1.24
 github.com/aws/smithy-go
 github.com/aws/smithy-go/auth
@@ -370,7 +370,7 @@ github.com/charmbracelet/colorprofile
 # github.com/charmbracelet/lipgloss v1.1.0
 ## explicit; go 1.18
 github.com/charmbracelet/lipgloss
-# github.com/charmbracelet/x/ansi v0.11.6
+# github.com/charmbracelet/x/ansi v0.11.7
 ## explicit; go 1.24.2
 github.com/charmbracelet/x/ansi
 github.com/charmbracelet/x/ansi/parser
@@ -602,7 +602,7 @@ github.com/garslo/gogen
 # github.com/gballet/go-libpcsclite v0.0.0-20250918194357-1ec6f2e601c6
 ## explicit; go 1.19
 github.com/gballet/go-libpcsclite
-# github.com/getsentry/sentry-go v0.45.0
+# github.com/getsentry/sentry-go v0.45.1
 ## explicit; go 1.24.0
 github.com/getsentry/sentry-go
 github.com/getsentry/sentry-go/attribute
@@ -914,7 +914,7 @@ github.com/pion/dtls/v3/pkg/protocol/alert
 github.com/pion/dtls/v3/pkg/protocol/extension
 github.com/pion/dtls/v3/pkg/protocol/handshake
 github.com/pion/dtls/v3/pkg/protocol/recordlayer
-# github.com/pion/ice/v4 v4.2.2
+# github.com/pion/ice/v4 v4.2.4
 ## explicit; go 1.24.0
 github.com/pion/ice/v4
 github.com/pion/ice/v4/internal/atomic
@@ -1192,7 +1192,7 @@ go.uber.org/automaxprocs/maxprocs
 # go.yaml.in/yaml/v2 v2.4.4
 ## explicit; go 1.15
 go.yaml.in/yaml/v2
-# golang.org/x/crypto v0.49.0
+# golang.org/x/crypto v0.50.0
 ## explicit; go 1.25.0
 golang.org/x/crypto/blake2b
 golang.org/x/crypto/blake2s
@@ -1213,7 +1213,7 @@ golang.org/x/crypto/ripemd160
 golang.org/x/crypto/scrypt
 golang.org/x/crypto/sha3
 golang.org/x/crypto/ssh/terminal
-# golang.org/x/exp v0.0.0-20260312153236-7ab1446f8b90
+# golang.org/x/exp v0.0.0-20260410095643-746e56fc9e2f
 ## explicit; go 1.25.0
 golang.org/x/exp/constraints
 golang.org/x/exp/rand
@@ -1226,13 +1226,13 @@ golang.org/x/mobile/internal/binres
 golang.org/x/mobile/internal/importers
 golang.org/x/mobile/internal/importers/java
 golang.org/x/mobile/internal/importers/objc
-# golang.org/x/mod v0.34.0
+# golang.org/x/mod v0.35.0
 ## explicit; go 1.25.0
 golang.org/x/mod/internal/lazyregexp
 golang.org/x/mod/modfile
 golang.org/x/mod/module
 golang.org/x/mod/semver
-# golang.org/x/net v0.52.0
+# golang.org/x/net v0.53.0
 ## explicit; go 1.25.0
 golang.org/x/net/bpf
 golang.org/x/net/dns/dnsmessage
@@ -1264,10 +1264,10 @@ golang.org/x/sys/execabs
 golang.org/x/sys/plan9
 golang.org/x/sys/unix
 golang.org/x/sys/windows
-# golang.org/x/term v0.41.0
+# golang.org/x/term v0.42.0
 ## explicit; go 1.25.0
 golang.org/x/term
-# golang.org/x/text v0.35.0
+# golang.org/x/text v0.36.0
 ## explicit; go 1.25.0
 golang.org/x/text/cases
 golang.org/x/text/collate
@@ -1286,7 +1286,7 @@ golang.org/x/text/width
 # golang.org/x/time v0.15.0
 ## explicit; go 1.25.0
 golang.org/x/time/rate
-# golang.org/x/tools v0.43.0
+# golang.org/x/tools v0.44.0
 ## explicit; go 1.25.0
 golang.org/x/tools/cmd/stringer
 golang.org/x/tools/go/ast/astutil
@@ -1306,7 +1306,6 @@ golang.org/x/tools/internal/gcimporter
 golang.org/x/tools/internal/gocommand
 golang.org/x/tools/internal/gopathwalk
 golang.org/x/tools/internal/imports
-golang.org/x/tools/internal/modindex
 golang.org/x/tools/internal/packagesinternal
 golang.org/x/tools/internal/pkgbits
 golang.org/x/tools/internal/stdlib
@@ -1373,8 +1372,8 @@ gopkg.in/yaml.v3
 lukechampine.com/blake3
 lukechampine.com/blake3/bao
 lukechampine.com/blake3/guts
-# modernc.org/libc v1.70.0
-## explicit; go 1.24.0
+# modernc.org/libc v1.72.0
+## explicit; go 1.25.0
 modernc.org/libc
 modernc.org/libc/errno
 modernc.org/libc/fcntl
@@ -1407,7 +1406,7 @@ modernc.org/mathutil
 # modernc.org/memory v1.11.0
 ## explicit; go 1.23.0
 modernc.org/memory
-# modernc.org/sqlite v1.48.1
+# modernc.org/sqlite v1.48.2
 ## explicit; go 1.25.0
 modernc.org/sqlite/lib
 # zombiezen.com/go/sqlite v1.4.2