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

CBOR: Up MaxArrayElements, MaxNestedLevels decoding options #136

Closed
wants to merge 1 commit into from

Conversation

benjaminkvm
Copy link
Contributor

@benjaminkvm benjaminkvm commented May 25, 2020

Description

Increase CBOR DecOptions.MaxArrayElements, DecOptions.MaxNestedLevels decoder options (previously set at defaults 131072 and 32 respectively).

Bug

While running a large test the following error was encountered while attempting to decode a large array from storage:

status: SEALED err: code execution failed: Execution failed:
cbor: exceeded max number of elements 131072 for CBOR array

Testcase forthcoming, just wanted to put this out there in case it was urgent.

// Maximum nested levels permitted.
MaxNestedLevels: 256,
// Maximum array elements permitted.
MaxArrayElements: 134217728,
Copy link
Member

Choose a reason for hiding this comment

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

reasonable to say they'll never hit this limit i think :D

Copy link
Contributor

@psiemens psiemens left a comment

Choose a reason for hiding this comment

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

Eventually it'd be nice be able to instantiate a runtime like this:

rt := runtime.NewInterpreterRuntime(
  runtime.WithEncoder(cborEncoderWithOptions),
)

Copy link
Contributor

@psiemens psiemens left a comment

Choose a reason for hiding this comment

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

💪 Thanks for the quick fix!

@Kay-Zee
Copy link
Member

Kay-Zee commented May 25, 2020

As discussed, would it be okay to only double the previous limits? @benjaminkvm @turbolent

@turbolent
Copy link
Member

@Kay-Zee Yep! I'll bump, but will do it like @psiemens suggested, as options

@turbolent turbolent mentioned this pull request Aug 27, 2020
2 tasks
@turbolent
Copy link
Member

Replaced by #370

@turbolent turbolent closed this Sep 13, 2020
@turbolent turbolent deleted the benjaminkvm/hotfix-up-cbor-dec-options branch February 10, 2023 16:44
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.

4 participants