You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a security-related bug/issue. If it is, please follow please follow the security policy.
This is not a question or a support request. If you have any lotus related questions, please ask in the lotus forum.
This is not a new feature request. If it is, please file a feature request instead.
This is not an enhancement request. If it is, please file a improvement suggestion instead.
I have searched on the issue tracker and the lotus forum, and there is no existing related issue or discussion.
I am running the Latest release, or the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.
@eshon reported a bug to the Glif team. The bug is connected with https://playground.open-rpc.org/, which does not correctly interact with https://api.node.glif.io despite the fact it was when #4711 was merged. Initially we thought that it might be an issue on Glif side, something with the CORS requests. However, when I started an investigation - I figured out the following:
Glif endpoints works as expected responding to OPTIONS with CORS details
However the rpc.discover request is not passing well, failed with 400 status code.
Recently we have enforced the requirement for "Content-Type": "application/json" argument to be passed to the endpoints due to security reasons, so my initial thought was that this might be somehow connected. However, I learned that https://playground.open-rpc.org/ is actually sending the "Content-Type": "application/json" header, so this is not connected in any way.
Also I learned that according to #4711 the Filecoin.Discover and rpc.discover should provide similar functionality, however it seems to be that output is different for these two methods. Please, check my test results below:
Tests
Method: any; Content-Type header: no; endpoint: Glif API
ubuntu@selfportal:~/DevOps-wiki$ curl -v --request POST 'https://api.node.glif.io' --data-raw '{ "jsonrpc": "2.0", "params": [], "id": 999999, "method": "rpc.discover"}'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Rebuilt URL to: https://api.node.glif.io/
* Trying 52.84.194.93...
* TCP_NODELAY set
* Connected to api.node.glif.io (52.84.194.93) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS handshake, Server hello (2):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Unknown (8):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Certificate (11):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, CERT verify (15):
* TLSv1.3 (IN), TLS Unknown, Certificate Status (22):
* TLSv1.3 (IN), TLS handshake, Finished (20):
* TLSv1.3 (OUT), TLS change cipher, Client hello (1):
* TLSv1.3 (OUT), TLS Unknown, Certificate Status (22):
* TLSv1.3 (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
* subject: CN=node.glif.io
* start date: Apr 21 00:00:00 2022 GMT
* expire date: May 20 23:59:59 2023 GMT
* subjectAltName: host "api.node.glif.io" matched cert's "*.node.glif.io"
* issuer: C=US; O=Amazon; OU=Server CA 1B; CN=Amazon
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* Using Stream ID: 1 (easy handle 0x560e9ced8540)
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
> POST / HTTP/2
> Host: api.node.glif.io
> User-Agent: curl/7.58.0
> Accept: */*
> Content-Length: 77
> Content-Type: application/x-www-form-urlencoded
>
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* We are completely uploaded and fine
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
* TLSv1.3 (OUT), TLS Unknown, Unknown (23):
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
< HTTP/2 415
< content-type: application/json
< content-length: 37
< date: Tue, 26 Apr 2022 13:39:39 GMT
< x-amzn-requestid: 97ec59b1-1681-43a9-934a-9c5faccc9e1e
< x-amzn-errortype: BadRequestException
< x-amz-apigw-id: RMNkPGngCYcF1ew=
< x-cache: Error from cloudfront
< via: 1.1 58bdfbab355a53b4cbc6b93312bb8748.cloudfront.net (CloudFront)
< x-amz-cf-pop: WAW50-C1
< x-amz-cf-id: JR4UJHs3kzqmAgtvACVqB8Yv2bMQBnJo3fNO7wywjPx0ONujV9JHaQ==
<
* TLSv1.3 (IN), TLS Unknown, Unknown (23):
* Connection #0 to host api.node.glif.io left intact
{"message": "Unsupported Media Type"}ubuntu@selfportal:~/DevOps-wiki$
lotus_user@space06-lotus-0:/$ curl -v --header "Content-Type":"application/json" -X POST 'localhost:1234/rpc/v0' --data-raw '{ "jsonrpc": "2.0", "params": [], "id": 999999, "method": "Filecoin.Discover"}'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:1234...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 1234 (#0)
> POST /rpc/v0 HTTP/1.1
> Host: localhost:1234
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Type:application/json
> Content-Length: 82
>
* upload completely sent off: 82 out of 82 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Tue, 26 Apr 2022 14:01:54 GMT
< Content-Type: text/plain; charset=utf-8
< Transfer-Encoding: chunked
<
{"jsonrpc":"2.0","result":{"info":{"title":"Lotus RPC API","version":"1.15.1"},"methods":[{"deprecated":false,"description":"```go\nfunc (s *FullNodeStruct) Bea
............................................................................................................................................................
............................................................................................................................................................
ss does not have to be in the wallet.\n"}],"openrpc":"1.2.6"},"id":999999}
* Connection #0 to host localhost left intact
I have shortened the output of Filecoin.Discover method above. To sum things up:
Lotus expects application/json header to be passed just as Glif endpoints
rpc.discover works not as Filecoin.Discover (not sure if this is intended or not)
rpc.discover is a "not found" method right now
Logging Information
I don't think there is a need for the logs. Also, Glif endpoints are public, so there are just tooooooo many flood in the logs.
Repo Steps
Run commands in the testing section to verify that the issue exists
The text was updated successfully, but these errors were encountered:
Checklist
Latest release
, or the most recent RC(release canadiate) for the upcoming release or the dev branch(master), or have an issue updating to any of these.Lotus component
Lotus Version
Describe the Bug
@eshon reported a bug to the Glif team. The bug is connected with
https://playground.open-rpc.org/
, which does not correctly interact with https://api.node.glif.io despite the fact it was when #4711 was merged. Initially we thought that it might be an issue on Glif side, something with the CORS requests. However, when I started an investigation - I figured out the following:Recently we have enforced the requirement for "Content-Type": "application/json" argument to be passed to the endpoints due to security reasons, so my initial thought was that this might be somehow connected. However, I learned that
https://playground.open-rpc.org/
is actually sending the "Content-Type": "application/json" header, so this is not connected in any way.Also I learned that according to #4711 the Filecoin.Discover and rpc.discover should provide similar functionality, however it seems to be that output is different for these two methods. Please, check my test results below:
Tests
Method: any; Content-Type header: no; endpoint: Glif API
Method: any; Content-Type header: no; endpoint: Lotus Node
Method: rpc.discover; Content-Type header: yes; endpoint: Glif API
Method: rpc.discover; Content-Type header: yes; endpoint: Lotus Node
Method: Filecoin.Discover; Content-Type header: yes; endpoint: Glif API
Method: Filecoin.Discover; Content-Type header: yes; endpoint: Lotus Node
I have shortened the output of Filecoin.Discover method above. To sum things up:
application/json
header to be passed just as Glif endpointsLogging Information
Repo Steps
The text was updated successfully, but these errors were encountered: