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

document the new ReceiptValidationError::ReceiptSizeExceeded #2194

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

jancionear
Copy link
Contributor

@jancionear jancionear commented Aug 1, 2024

Add information about the new ReceiptValidationError::ReceiptSizeExceeded error added in near/nearcore#11492.

I'm new to this repo, I looked at ReceiptValidationError::InvalidDataReceiverId and put information about my error in the same places.

I also have a longer description of the error that users could find more useful, but I'm not sure where to put it. Can I replace the comment saying "/// Receipt is bigger than the limit."? Or should these docs stay in sync with the source files?

Longer description:

ReceiptSizeExceeded means that there was a receipt above the size limit (currently 4MiB). NEAR will refuse to execute receipts that are above the size limit. The most likely source of such receipts would be cross-contract calls with a lot of large actions (contract deployment, function call with large args, etc).
This error means that the user has to adjust their contract to generate smaller receipts.

Refs: zulip conversation

Copy link
Contributor

@telezhnaya telezhnaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add some comments to this page? https://docs.near.org/api/rpc/transactions

Also, we need to give some guidelines what should the user do in this case
(Contact the contract owner?)

@jancionear
Copy link
Contributor Author

Let's also add some comments to this page? https://docs.near.org/api/rpc/transactions

Also, we need to give some guidelines what should the user do in this case (Contact the contract owner?)

I'm not sure if it deserves to be on the transactions page. It's a low level error, I don't see anything about other ReceiptValidationErrors in there. Even basic errors like GasLimitExceeded aren't there.

@frol
Copy link
Collaborator

frol commented Aug 6, 2024

@jancionear Sorry for jumping in, but I'd like to invite you to participate in the Race of Sloths - a fun and gamified open-source contributions program. Consider mentioning @race-of-sloths user in your github comment or PR description to join!

See how the flow works here: near/nearcore#11778

@telezhnaya
Copy link
Contributor

My comment is inspired by fef1566
I think we need to add at least any comment how should it be handled correctly

@jancionear
Copy link
Contributor Author

My comment is inspired by fef1566

I think there's a big difference between ReceiptSizeExceeded and ShardCongested. ReceiptSizeExceeded belongs to a common category of errors that occur when receipt execution fails because of something. Rpc users already know how to handle errors like this.
ShardCongested is a whole new category on its own, it doesn't belong to any of the existing categories, so it makes sense that it has a special place in the transactions doc. It's a special case that rpc users now need to take into account.

I agree that it'd be nice to have a detailed description of the error somewhere, but I'm hesitant to put it on the main transactions page.

Copy link
Contributor

@telezhnaya telezhnaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine without touching transactions page, and feel free to merge it as it is, but I still think it's better to leave additional comment here, right where you already added some lines, with the comment how should the user handle this

@jancionear
Copy link
Contributor Author

but I still think it's better to leave additional comment here, right where you already added some lines, with the comment how should the user handle this

I added the longer comment under the existing short one.

@jancionear jancionear merged commit 2a91c1b into near:master Aug 9, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Shipped 🚀
Development

Successfully merging this pull request may close these issues.

3 participants