-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
F3 errors may not be round-tripping through RPC #12630
Comments
Separately @virajbhartiya and I are discussing whether we should loosen the test in go-jsonrpc to avoid a footgun, but for now it's kind of locked in as is and it even has a specific test for pointer vs value types registered as different errors. |
Sorry! I meant @akaladarshi and I are discussing this, working over in @virajbhartiya's go-jsonrpc fork. |
masih
added a commit
that referenced
this issue
Oct 24, 2024
Fix the issue by instantiating pointers to sentinel F3 error values and assert that errors indeed pass through via an integration test. Fixes #12630
8 tasks
masih
added a commit
that referenced
this issue
Oct 24, 2024
Fix the issue by instantiating pointers to sentinel F3 error values and assert that errors indeed pass through via an integration test. Fixes #12630
masih
added a commit
that referenced
this issue
Oct 24, 2024
Fix the issue by instantiating pointers to sentinel F3 error values and assert that errors indeed pass through via an integration test. Fixes #12630
rjan90
pushed a commit
that referenced
this issue
Oct 28, 2024
Fix the issue by instantiating pointers to sentinel F3 error values and assert that errors indeed pass through via an integration test. Fixes #12630
rjan90
pushed a commit
that referenced
this issue
Oct 28, 2024
Fix the issue by instantiating pointers to sentinel F3 error values and assert that errors indeed pass through via an integration test. Fixes #12630
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
These errors are only ever used as values:
lotus/api/api_errors.go
Lines 25 to 42 in 02a8b97
But go-jsonrpc needs it to match what it was registered with: https://github.com/filecoin-project/go-jsonrpc/blob/c1852724d242f0833191649eb190e51534a7a181/handler.go#L340
But we register them as pointers:
lotus/api/api_errors.go
Lines 55 to 62 in 02a8b97
They get looked up as the specific type using reflect: https://github.com/filecoin-project/go-jsonrpc/blob/c1852724d242f0833191649eb190e51534a7a181/handler.go#L340
I haven't actually checked this with F3 errors, maybe it's working properly and I'm missing something, but it would be good if we could see a check for an
ErrF3
type in an itest where it has to do a jsonrpc roundtrip. If it's not, then they're all generic error types without being coded so the type passes through the rpc boundary as we apparently want.The equivalents here are
api.ErrActorNotFound
andapi.ErrOutOfGas
, which are not set up as reusable constants but they are instantiated as pointers whenever we need them.Here's a quick diff in go-jsonrpc with a similar setup that demonstrates the issue:
^ change to
errs.Register(EBad3, new(ErrSomethingBadder))
, orvar ErrSomethingBadderInstance = &ErrSomethingBadder{}
and it'll pass.@masih would you mind having a look into this?
The text was updated successfully, but these errors were encountered: