From 94a3daadaabd18f10997fc20143992fc05e2064e Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Thu, 1 Aug 2024 18:29:43 +0000 Subject: [PATCH 1/2] document the new `ReceiptValidationError::ReceiptSizeExceeded` --- docs/6.integrations/errors/error-implementation.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/6.integrations/errors/error-implementation.md b/docs/6.integrations/errors/error-implementation.md index 7e511c6abe4..9b7ea2bdf00 100644 --- a/docs/6.integrations/errors/error-implementation.md +++ b/docs/6.integrations/errors/error-implementation.md @@ -441,6 +441,8 @@ pub enum ReceiptValidationError { NumberInputDataDependenciesExceeded { number_of_input_data_dependencies: u64, limit: u64 }, /// An error occurred while validating actions of an ActionReceipt. ActionsValidation(ActionsValidationError), + /// Receipt is bigger than the limit. + ReceiptSizeExceeded { size: u64, limit: u64 }, } ``` @@ -466,6 +468,9 @@ ReceiptValidationError::NumberInputDataDependenciesExceeded { number_of_input_da "The number of input data dependencies {} exceeded the limit {} in an ActionReceipt" ReceiptValidationError::ActionsValidation(e) + +ReceiptValidationError::ReceiptSizeExceeded { size, limit } +"The size of the receipt exceeded the limit: {} > {}", ``` From 84b73fedc8f13fb31566347b8f5a4c14fbd65abd Mon Sep 17 00:00:00 2001 From: Jan Ciolek Date: Fri, 9 Aug 2024 19:48:40 +0000 Subject: [PATCH 2/2] Extend the comment about ReceiptSizeExceeded --- docs/6.integrations/errors/error-implementation.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/6.integrations/errors/error-implementation.md b/docs/6.integrations/errors/error-implementation.md index 9b7ea2bdf00..803bd37c68f 100644 --- a/docs/6.integrations/errors/error-implementation.md +++ b/docs/6.integrations/errors/error-implementation.md @@ -442,6 +442,11 @@ pub enum ReceiptValidationError { /// An error occurred while validating actions of an ActionReceipt. ActionsValidation(ActionsValidationError), /// Receipt is bigger than the limit. + /// 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. ReceiptSizeExceeded { size: u64, limit: u64 }, } ```