starpc 0.36.4 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/go.mod CHANGED
@@ -1,8 +1,8 @@
1
1
  module github.com/aperturerobotics/starpc
2
2
 
3
- go 1.23
3
+ go 1.23.0
4
4
 
5
- toolchain go1.23.4
5
+ toolchain go1.24.0
6
6
 
7
7
  replace (
8
8
  // This fork uses go-protobuf-lite and adds post-quantum crypto support.
@@ -14,18 +14,19 @@ replace (
14
14
 
15
15
  require (
16
16
  github.com/aperturerobotics/protobuf-go-lite v0.8.0 // latest
17
- github.com/aperturerobotics/util v1.27.1 // latest
17
+ github.com/aperturerobotics/util v1.28.1 // latest
18
18
  )
19
19
 
20
20
  require (
21
21
  github.com/coder/websocket v1.8.12 // latest
22
- github.com/libp2p/go-libp2p v0.38.1 // latest
23
- github.com/libp2p/go-yamux/v4 v4.0.2-0.20240826150533-e92055b23e0e // master
22
+ github.com/libp2p/go-libp2p v0.41.0 // latest
24
23
  github.com/pkg/errors v0.9.1 // latest
25
24
  github.com/sirupsen/logrus v1.9.3 // latest
26
- google.golang.org/protobuf v1.36.1 // latest
25
+ google.golang.org/protobuf v1.36.5 // latest
27
26
  )
28
27
 
28
+ require github.com/libp2p/go-yamux/v4 v4.0.1
29
+
29
30
  require (
30
31
  github.com/aperturerobotics/json-iterator-lite v1.0.1-0.20240713111131-be6bf89c3008 // indirect
31
32
  github.com/ipfs/go-cid v0.4.1 // indirect
@@ -42,7 +43,7 @@ require (
42
43
  github.com/multiformats/go-varint v0.0.7 // indirect
43
44
  github.com/spaolacci/murmur3 v1.1.0 // indirect
44
45
  golang.org/x/crypto v0.31.0 // indirect
45
- golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
46
+ golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa // indirect
46
47
  golang.org/x/sys v0.28.0 // indirect
47
48
  lukechampine.com/blake3 v1.3.0 // indirect
48
49
  )
package/go.sum CHANGED
@@ -4,8 +4,8 @@ github.com/aperturerobotics/json-iterator-lite v1.0.1-0.20240713111131-be6bf89c3
4
4
  github.com/aperturerobotics/json-iterator-lite v1.0.1-0.20240713111131-be6bf89c3008/go.mod h1:snaApCEDtrHHP6UWSLKiYNOZU9A5NyzccKenx9oZEzg=
5
5
  github.com/aperturerobotics/protobuf-go-lite v0.8.0 h1:SoiTAVArmOrNTX31e6CC5Bem6HuOElg3YYNhp4AAPQc=
6
6
  github.com/aperturerobotics/protobuf-go-lite v0.8.0/go.mod h1:y49wVEezRHg78uQ2OzLLZbtTTWuox+ChmaTuh6FLJW8=
7
- github.com/aperturerobotics/util v1.27.1 h1:htCjY/HvP8DusRxWiCFEbm8lMz7HzJSovdhSzVcrtuI=
8
- github.com/aperturerobotics/util v1.27.1/go.mod h1:hurmxv5jC2CqkfhgySRYrXDcvqPk6BHUhHizu6yyXhE=
7
+ github.com/aperturerobotics/util v1.28.1 h1:FpTOt/tsawTrxDz4lrdglK47ZR2p0UM+GBB3zHhSUsc=
8
+ github.com/aperturerobotics/util v1.28.1/go.mod h1:tFCW8S1eUGvEohv9IebTxq5bgVZNfaKGLV9ELa6iKbI=
9
9
  github.com/coder/websocket v1.8.12 h1:5bUXkEPPIbewrnkU8LTCLVaxi4N4J8ahufH2vlo4NAo=
10
10
  github.com/coder/websocket v1.8.12/go.mod h1:LNVeNrXQZfe5qhS9ALED3uA+l5pPqvwXg3CKoDBB2gs=
11
11
  github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -21,8 +21,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6
21
21
  github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg=
22
22
  github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA=
23
23
  github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg=
24
- github.com/libp2p/go-yamux/v4 v4.0.2-0.20240826150533-e92055b23e0e h1:Luuxp/lnfmJjQgGgAh5kmMZalC+8EVh/bYNQ8vS6d7I=
25
- github.com/libp2p/go-yamux/v4 v4.0.2-0.20240826150533-e92055b23e0e/go.mod h1:C808cCRgOs1iBwY4S71T5oxgMxgLmqUw56qh4AeBW2o=
24
+ github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCypkQ=
25
+ github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4=
26
26
  github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
27
27
  github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
28
28
  github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
@@ -55,14 +55,14 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT
55
55
  github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
56
56
  golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
57
57
  golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
58
- golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo=
59
- golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
58
+ golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa h1:t2QcU6V556bFjYgu4L6C+6VrCPyJZ+eyRsABUPs1mz4=
59
+ golang.org/x/exp v0.0.0-20250218142911-aa4b98e5adaa/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk=
60
60
  golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
61
61
  golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
62
62
  golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
63
63
  golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
64
- google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
65
- google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
64
+ google.golang.org/protobuf v1.36.5 h1:tPhr+woSbjfYvY6/GPufUoYizxw1cF/yFoxJ2fmpwlM=
65
+ google.golang.org/protobuf v1.36.5/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
66
66
  gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
67
67
  gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
68
68
  gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starpc",
3
- "version": "0.36.4",
3
+ "version": "0.37.1",
4
4
  "description": "Streaming protobuf RPC service protocol over any two-way channel.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -80,26 +80,26 @@
80
80
  "./{srpc,echo,e2e,integration,rpcstream,cmd}/**/(*.ts|*.tsx|*.html|*.css)": "prettier --config .prettierrc.yaml --write"
81
81
  },
82
82
  "devDependencies": {
83
- "@typescript-eslint/eslint-plugin": "^8.24.1",
84
- "@typescript-eslint/parser": "^8.24.1",
83
+ "@typescript-eslint/eslint-plugin": "^8.26.0",
84
+ "@typescript-eslint/parser": "^8.26.0",
85
85
  "depcheck": "^1.4.6",
86
86
  "esbuild": "^0.25.0",
87
- "eslint": "^9.20.1",
88
- "eslint-config-prettier": "^10.0.1",
87
+ "eslint": "^9.21.0",
88
+ "eslint-config-prettier": "^10.0.2",
89
89
  "husky": "^9.1.7",
90
90
  "lint-staged": "^15.4.3",
91
- "prettier": "^3.5.1",
91
+ "prettier": "^3.5.3",
92
92
  "rimraf": "^6.0.1",
93
- "tsx": "^4.19.1",
94
- "typescript": "^5.7.3",
95
- "vitest": "^3.0.5"
93
+ "tsx": "^4.19.3",
94
+ "typescript": "^5.8.2",
95
+ "vitest": "^3.0.7"
96
96
  },
97
97
  "dependencies": {
98
98
  "@aptre/it-ws": "^1.0.1",
99
99
  "@aptre/protobuf-es-lite": "^0.4.6",
100
100
  "@chainsafe/libp2p-yamux": "^7.0.1",
101
- "@libp2p/interface": "^2.5.0",
102
- "@libp2p/logger": "^5.1.8",
101
+ "@libp2p/interface": "^2.6.1",
102
+ "@libp2p/logger": "^5.1.11",
103
103
  "event-iterator": "^2.0.0",
104
104
  "isomorphic-ws": "^5.0.0",
105
105
  "it-first": "^3.0.6",
@@ -107,7 +107,7 @@
107
107
  "it-pushable": "^3.2.3",
108
108
  "it-stream-types": "^2.0.2",
109
109
  "uint8arraylist": "^2.4.7",
110
- "ws": "^8.17.0"
110
+ "ws": "^8.18.1"
111
111
  },
112
112
  "resolutions": {
113
113
  "@aptre/protobuf-es-lite": "0.4.8"
@@ -45,21 +45,26 @@ func (c *commonRPC) Context() context.Context {
45
45
  // Wait waits for the RPC to finish (remote end closed the stream).
46
46
  func (c *commonRPC) Wait(ctx context.Context) error {
47
47
  for {
48
- var dataClosed bool
49
48
  var err error
50
49
  var waitCh <-chan struct{}
50
+ var rpcCtx context.Context
51
51
  c.bcast.HoldLock(func(broadcast func(), getWaitCh func() <-chan struct{}) {
52
- dataClosed, err = c.dataClosed, c.remoteErr
52
+ rpcCtx, err = c.ctx, c.remoteErr
53
53
  waitCh = getWaitCh()
54
54
  })
55
55
 
56
- if dataClosed {
56
+ if err != nil {
57
57
  return err
58
58
  }
59
+ if rpcCtx.Err() != nil {
60
+ // rpc must have ended w/o an error being set
61
+ return context.Canceled
62
+ }
59
63
 
60
64
  select {
61
65
  case <-ctx.Done():
62
66
  return context.Canceled
67
+ case <-rpcCtx.Done():
63
68
  case <-waitCh:
64
69
  }
65
70
  }
@@ -94,6 +94,7 @@ func CheckServerStream(t *testing.T, out echo.SRPCEchoer_EchoServerStreamClient,
94
94
  }
95
95
  return err
96
96
  }
97
+
97
98
  body := echoMsg.GetBody()
98
99
  bodyTxt := req.GetBody()
99
100
  if body != bodyTxt {
@@ -101,10 +102,17 @@ func CheckServerStream(t *testing.T, out echo.SRPCEchoer_EchoServerStreamClient,
101
102
  }
102
103
  t.Logf("server->client message %d/%d", totalExpected-expectedRx+1, totalExpected)
103
104
  expectedRx--
105
+
106
+ if out.Context().Err() != nil {
107
+ return errors.New("expected context not canceled yet")
108
+ }
104
109
  }
105
110
  if expectedRx < 0 {
106
111
  return errors.Errorf("got %d more messages than expected", -1*expectedRx)
107
112
  }
113
+ if expectedRx > 0 {
114
+ return errors.Errorf("got %d less messages than expected", expectedRx)
115
+ }
108
116
  return nil
109
117
  }
110
118