dfinity / dfinity/candid

"Recursion limit exceeded at depth 1" in TEE

Open
#596 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
301
Forks
85
Avg merge
1h 4m
Merged PRs (30d)
4

Description

When running the application in the TEE, I encounter this exception due to stack size issues, and I wish to disable check_recursion.

https://github.com/dfinity/candid/blob/master/rust/candid/src/de.rs#L281

{"file":"agents/anda_bot/src/main.rs","level":"ERROR","line":92,"message":"bootstrap error: \"failed to create table andaicp: lance error: LanceError(IO): Generic ICObjectStore error: Custom(input: 4449444c086b02bc8a0101c5fed201036c02c0ecf0b4060298cec7e707026e716b0bdca6afcf020493a4aff30205cfa0def20606eabfe2c10704f7b3b29d0807f4f6d8a209069c98cfb40906bbbdfb8a0c07b8f2ccc30c048f9dbf8b0d7f96f1ede50f046c02a5cbc7d20471c897a79907716c019f93c602716c01a5cbc7d204716c01c897a79907710100_0001013100\\ntable: type table0 = variant { 17_724 : table1; 3_456_837 : table3 }\\ntype table1 = record { 1_721_513_536 : table2; 2_096_228_120 : table2 }\\ntype table2 = opt text\\ntype table3 = variant {\\n  703_320_924 : table4;\\n  778_818_067 : table5;\\n  1_851_232_335 : table6;\\n  2_016_976_874 : table4;\\n  2_209_126_903 : table7;\\n  2_488_679_284 : table6;\\n  2_526_268_444 : table6;\\n  3_244_220_091 : table7;\\n  3_362_994_488 : table4;\\n  3_513_765_519;\\n  4_240_144_534 : table4;\\n}\\ntype table4 = record { 1_246_881_189 : text; 1_932_118_984 : text }\\ntype table5 = record { 5_343_647 : text }\\ntype table6 = record { 1_246_881_189 : text }\\ntype table7 = record { 1_932_118_984 : text }\\nwire_type: table0, expect_type: variant {\\n  Ok : record { e_tag : opt text; version : opt text };\\n  Err : variant {\\n    NotModified : record { path : text; error : text };\\n    UnknownConfigurationKey : record { key : text };\\n    NotFound : record { path : text };\\n    PermissionDenied : record { path : text; error : text };\\n    Generic : record { error : text };\\n    AlreadyExists : record { path : text };\\n    InvalidPath : record { path : text };\\n    NotSupported : record { error : text };\\n    Precondition : record { path : text; error : text };\\n    NotImplemented;\\n    Unauthenticated : record { path : text; error : text };\\n  };\\n}\\n\\nCaused by:\\n    0: Fail to decode argument 0 from table0 to variant {\\n         Ok : record { e_tag : opt text; version : opt text };\\n         Err : variant {\\n           NotModified : record { path : text; error : text };\\n           UnknownConfigurationKey : record { key : text };\\n           NotFound : record { path : text };\\n           PermissionDenied : record { path : text; error : text };\\n           Generic : record { error : text };\\n           AlreadyExists : record { path : text };\\n           InvalidPath : record { path : text };\\n           NotSupported : record { error : text };\\n           Precondition : record { path : text; error : text };\\n           NotImplemented;\\n           Unauthenticated : record { path : text; error : text };\\n         };\\n       }\\n    1: Recursion limit exceeded at depth 1), /github/home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/lance-0.22.0/src/io/commit.rs:118:5\"","module":"anda_bot","target":"anda_bot","timestamp":1737591470695}

The data comes from:
https://github.com/ldclabs/ic-cose/blob/main/src/ic_object_store_canister/src/api.rs#L32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read rust/candid/src/de.rs at line 281 to understand how check_recursion causes the reported failure. Reproduce the TEE decoding case using the supplied log and the ic-cose source link, then determine the supported way to make recursion checking configurable. Done means the reported data can be decoded with that setting without the depth-1 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.