-
Notifications
You must be signed in to change notification settings - Fork 175
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
API format/protocol redux #24
Comments
I suggest the discussion here wait for #25 to be fleshed out: selecting the format before understanding the requirements is putting the cart before the horse. |
I want to remind everyone of the comments that led to this restful http decision almost a year ago. The arguments made then are just as valid today |
Is the minimum protocol still up for debate? @prysmaticlabs is on board to support restful http and I haven't heard any strong advocates for anything else recently (json-rpc, grpc, soap, etc). |
The arguments for the protocol and the canonical format to define the API in are a bit intertwined in that linked thread. Notably well definedness of the API, spec maintainability, simplicity, and wide support are desired features for the canonical definitions to be used in the spec and are discussed in the above. |
Worth pointing out that this is a javascript limitation, rather than that of any particular application (see e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). It may be that some JSON parsers work around this, but it's not standard. |
Closing! Decided on API call to use OpenAPI with JSON as a first class citizen and document No action item on the repo as that's the current format. Keep SSZ types in mind as we develop the BN APIs |
As brought up by @skmgoldin on that last eth2 call, there is a strong desire from application developers for eth2 clients to provide a standard/conformant API.
We have this repo which is intended to be a collection of RESTful HTTP apis for various domains on the eth2 client. The APIs found in this repo are currently written in OpenAPI 3.0 in YAML. Some
So far, this repo only defines a beacon<->validator API for the purposes of writing generic "validator clients", but the intention is to host many other user-level APIs for the beacon chain (phase 0) and shard chains (phase 1). To date, the definition of this API has been largely collaborative across clients and the promise of standard/interoperable VCs seems in reach.
Prysmatic has a number of user-level APIs defined in prysmaticlabs/ethereumapis with some decent traction with block explorers and other applications, and Lighthouse has a number of APIs that have also begun to be used by various applications (link?).
There are a few things we need to work through:
We'll tackle [1] here and address the other two in separate issues [#25, #26]
This has been addressed in a number of past conversations and the general consensus was to land on the OpenAPI format.
@paulhauner put together a argument for continuing to write the APIs in OpenAPI, and it seems that it is still the general consensus is to do so.
The alternatives are to define the API (1) in protobufs or (2) in SSZ and provide standard conversion between all three. Some arguments are for/against are made here and were discussed briefly on the last eth2 call.
If we choose to go the OpenAPI native route, we should do an investigation of the types currently used in this repo to ensure that they are sound for our purposes and being easily converted in alternative contexts.
Types to discuss:
0x00
hex-strings in APIs which is why this repo originally used the formatuint64
as a string type (instead of native json integer) because some applications like Postman and Swagger round down integer values greater than int53The text was updated successfully, but these errors were encountered: