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

Updating RPC error schema #1358

Closed
jakmeier opened this issue Jul 8, 2024 · 2 comments · Fixed by #1363
Closed

Updating RPC error schema #1358

jakmeier opened this issue Jul 8, 2024 · 2 comments · Fixed by #1363

Comments

@jakmeier
Copy link
Contributor

jakmeier commented Jul 8, 2024

Description

With the upcoming release of stateless validation in Near Protocol, there are new errors a RPC node may return when a transaction is submitted. Notably, ShardCongested, ShardStuck, and ReceiptSizeExceeded. These are about to land on testnet this week and will make it into mainnet, hopefully within 5-6 weeks.

I wanted to updated the error schema to include them. But I don't get how exactly this should work. Especially how to update packages/near-api-js/src/generated/rpc_error_schema.json.

In the main Readme, there is this description:

### Update error schema

Follow next steps:

1. [Change hash for the commit with errors in the nearcore](https://github.com/near/near-api-js/blob/master/packages/utils/fetch_error_schema.js#L8-L9)
2. Fetch new schema: `node fetch_error_schema.js`
3. `pnpm build` to update `lib/**.js` files

Step 1 seems outdated, since the linked line already points to master instead of a specific commit. Also, the path has changed. (I can send a fix PR but first need to understand what the correct process is)
Step 2 works and updates the file in packages/utils/src/errors/rpc_error_schema.json as expected with the new error variants.
Step 3 succeeds but doesn't update anything for me.

After these steps, I have an updated packages/utils/src/errors/rpc_error_schema.json but my packages/near-api-js/src/generated/rpc_error_schema.json file still contains the old schema without new errors. Since this is in the generated folder, I assume there must be a script that updates it. But it looks to me like this is a different format, perhaps just an old format.

Can someone help me figure out how to update the error schema fully, including packages/near-api-js/src/generated/rpc_error_schema.json?

@jakmeier
Copy link
Contributor Author

I'm gonna take another stab at figuring this out. Any inputs regarding the generated files would still be appreciated.

@jakmeier
Copy link
Contributor Author

My best effort attempt at this:

@github-project-automation github-project-automation bot moved this from NEW❗ to Shipped 🚀 in DevRel Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant