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

feat: update RPC error schema for protocol version 69 #1363

Merged
merged 3 commits into from
Jul 30, 2024

Conversation

jakmeier
Copy link
Contributor

With protocol version 68, cross-shard congestion control is introduced that adds two new errors on the RPC endpoints for submitting transactions. (ShardCongested, ShardStuck)

Protocol version 69 introduces stateless validation and also adds a new error for submitted transactions. (ReceiptSizeExceeded)

Technically, there are additional errors in nearcore's version of the rpc schema. But those are from nightly features that have not been masked properly. (NonRefundableTransferToExistingAccount and InvalidTransactionVersion are waiting for NEP-491 and NEP-541 respectively.)

Aside from updating the schema, I also added human readable error messages and tests for the new errors.

Closes #1358

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this changes code in a published package: I have run pnpm changeset to create a changeset JSON document appropriate for this change.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

See #1358

Test Plan

Unit tests in packages/utils/test/rpc-errors.test.js check that the new error kinds are recognized as expected.

Related issues/PRs

See #1358

jakmeier added 2 commits July 22, 2024 12:22
With protocol version 68, cross-shard congestion control is
introduced that adds two new errors on the RPC endpoints
for submitting transactions. (ShardCongested, ShardStuck)

Protocol version 69 introduces stateless validation and also
adds a new error for submitted transactions. (ReceiptSizeExceeded)

Technically, there are additional errors in nearcore's version
of the rpc schema. But those are from nightly features that
have not been masked properly.
(NonRefundableTransferToExistingAccount  and
InvalidTransactionVersion are waiting for NEP-491
and NEP-541 respectively.)

Aside from updating the schema, I also added human readable
error messages and tests for the new errors.
Copy link

changeset-bot bot commented Jul 22, 2024

🦋 Changeset detected

Latest commit: 8584206

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@near-js/utils Minor
@near-js/accounts Patch
@near-js/biometric-ed25519 Patch
@near-js/crypto Patch
near-api-js Patch
@near-js/providers Patch
@near-js/transactions Patch
@near-js/wallet-account Patch
@near-js/cookbook Patch
@near-js/keystores-browser Patch
@near-js/keystores-node Patch
@near-js/keystores Patch
@near-js/signers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jakmeier
Copy link
Contributor Author

I've only added a minor bump changeset for the utils package, since I only changed code in there. If this isn't right, please let me know which packages should be included.

@jakmeier jakmeier requested a review from gtsonevv July 22, 2024 11:08
@jakmeier
Copy link
Contributor Author

@race-of-sloths please, include my PR in the race

@race-of-sloths
Copy link

race-of-sloths commented Jul 25, 2024

@jakmeier Thank you for your contribution! Your pull request is now a part of the Race of Sloths!
New Sloth joined the Race! Welcome!

Shows profile picture for the author of the PR

Current status: executed
Reviewer Score
@andy-haynes 3

The average score is 3

@jakmeier check out your results on the Race of Sloths Leaderboard! and in the profile

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

@jakmeier jakmeier requested review from mpeterdev and andy-haynes and removed request for gtsonevv July 30, 2024 09:14
@jakmeier
Copy link
Contributor Author

@mpeterdev @andy-haynes can one of you please review this PR? Vlad pinged you in the Telegram Tools Communiy Group last weak but you might have missed that.

@andy-haynes
Copy link
Collaborator

Thanks @jakmeier for the clear description! Changeset looks good, much appreciated.

@andy-haynes
Copy link
Collaborator

@race-of-sloths score 3

@race-of-sloths
Copy link

🌟 Score recorded!

@andy-haynes, thank you for scoring this pull request in the Race of Sloths!

@andy-haynes andy-haynes merged commit f6b7794 into near:master Jul 30, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Jul 30, 2024
@race-of-sloths
Copy link

✅ PR is finalized!

Your contribution is much appreciated with a final score of 3!
You have received 40 (30 base + 10 weekly bonus) Sloth points for this contribution

Another weekly streak completed, well done @jakmeier! To keep your weekly streak and get another bonus make pull request next week! Looking forward to see you in race-of-sloths

@jakmeier jakmeier deleted the update-error-v69 branch August 1, 2024 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updating RPC error schema
3 participants