Skip to content
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

[Feature Request]: match upcoming node version with API #2549

Closed
jcstein opened this issue Aug 9, 2023 · 6 comments · Fixed by #3318
Closed

[Feature Request]: match upcoming node version with API #2549

jcstein opened this issue Aug 9, 2023 · 6 comments · Fixed by #3318
Labels
enhancement New feature or request external Issues created by non node team members

Comments

@jcstein
Copy link
Member

jcstein commented Aug 9, 2023

Implementation ideas

#2521 (comment)

celestia-node v0.12.0-rc0 = api v0.12.0-rc0

@jcstein jcstein added the enhancement New feature or request label Aug 9, 2023
@github-actions github-actions bot added the external Issues created by non node team members label Aug 9, 2023
@jcstein
Copy link
Member Author

jcstein commented Dec 14, 2023

for example, if I check out to v0.12.1 of celestia-node and then run make openrpc-gen, the version reflected is v0.11.0 instead of v0.12.1

@jcstein
Copy link
Member Author

jcstein commented Jan 11, 2024

checking in on this 👀 or are we going to stick with different versioning?

ramin pushed a commit that referenced this issue Feb 9, 2024
<!--
Thank you for submitting a pull request!

Please make sure you have reviewed our contributors guide before
submitting your
first PR.

Please ensure you've addressed or included references to any related
issues.

Tips:
- Use keywords like "closes" or "fixes" followed by an issue number to
automatically close related issues when the PR is merged (e.g., "closes
#123" or "fixes #123").
- Describe the changes made in the PR.
- Ensure the PR has one of the required tags (kind:fix, kind:misc,
kind:break!, kind:refactor, kind:feat, kind:deps, kind:docs, kind:ci,
kind:chore, kind:testing)

-->
# Summary

Open RPC spec generation errors, due to a missing sample value for
blob.GasPrice.

# Problem

Missing sample value in `api/docgen/examples.go`.

Logs from running on v0.13.0:

```json
--> Generating OpenRPC spec
failed to retrieve example value for type: blob.GasPrice on parent 'blob.GasPrice')
{
    "openrpc": "1.2.6",
    "info": {
        "title": "Celestia Node API",
        "description": "The Celestia Node API is the collection of RPC methods that can be used to interact with the services provided by Celestia Data Availability Nodes.",
        "version": "v0.11.0"
    },
```

Output from logs running on v0.11.0, as another check to see that this
worked before:

```json
--> Generating OpenRPC spec
{
    "openrpc": "1.2.6",
    "info": {
        "title": "Celestia Node API",
        "description": "The Celestia Node API is the collection of RPC methods that can be used to interact with the services provided by Celestia Data Availability Nodes.",
        "version": "v0.11.0"
    },
```

# Solution

Add sample value.

[Output after
testing](https://gist.github.com/jcstein/02c459fb781889405d7ebc802484509a)

## Other issues found while testing

API version is still v0.11.0, which is the same as last few releases, i
just ran make openrpc-gen on v0.11.0 and the API version is the same
there. This is already, addressed in
#2549, and I am
highlighting to bring it out from stale state.

### Proposed solutions for other issues found

To avoid this in the future, i would like to see if we can work this
[feature request to add openrpc.json on
main](#2611) into
celestia-node, so that there is validation before publishing specs, and
a history of past versions of the openrpc.json, stored on main with
releases. otherwise we JTMB the person updating node-rpc-docs [on almost
10000 lines of spec
code](https://github.com/celestiaorg/node-rpc-docs/pull/35/files)

> Note, this output must not contain the output which precedes the json:
> `--> Generating OpenRPC spec`
@jcstein
Copy link
Member Author

jcstein commented Apr 16, 2024

api specs generated still show v0.11.0 as of v0.13.3 release

@jcstein
Copy link
Member Author

jcstein commented Apr 16, 2024

const APIVersion = "v0.11.0"

@vgonkivs
Copy link
Member

To resolve this issue, we need to set SemanticVersion instead of the hardcoded value. In this case, docgen cmd should be a part of the node binary to get the correct semantic version:
celestia docgen ...

cc @distractedm1nd @Wondertan

@distractedm1nd
Copy link
Member

Good idea 👍🏼 I'm on board

Wondertan pushed a commit that referenced this issue May 9, 2024
Resolves #2549

`docgen` cmd moved to the root celestia cmd folder, so it will be a part of the c-node binary to get the correct Semantic version.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request external Issues created by non node team members
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants