-
Notifications
You must be signed in to change notification settings - Fork 15
Description
For some cases, I think it might be useful for client software to be able to specify using a non-inlined payload (aka register) to simplify concurrency.
Suggested Solution
Look into adding an option in Atree's API that allows client software to specify using a non-inlined payload. For example, new Atree API can allow Cadence to pass a flag (or callback function) to indicate if the given data structure can be inlined or not.
This shouldn't require migration and it should be backward compatible with existing data.
Scope
Look into the feasibility of adding support for client software to specify to Atree if a given data structure can or cannot be inlinded (e.g., by using new Atree API to pass a flag or callback function from Cadence to Atree).
NOTE: It is outside the scope of this issue to evaluate if some use case(s) that would utilize this new feature is better/worse than alternative solutions.
Results and Caveats
As mentioned on Dec 8, 2025, it appears to be feasible to add support for this new feature to Atree.
However, it would be safer (and easier for future optimizations) to not expose the option of using not-inlinable payloads for the general public to use directly on Flow mainnet, because not inlining payloads can increase bloat and reduce efficiency of:
- payload databases
- payload indexers
- payload caches (e.g., LRU caches)
- MTrie (execution state)
My preference (even for internal use) is to limit the use of this new feature as much as possible (e.g., only allow it for system account vaults if appropriate to do so and carefully approve other uses in the future after evaluation). Adding a feature or making it more widely available is easier than taking that feature away.
As noted in "Scope" section, it is outside the scope of this issue to evaluate if some use case(s) that would utilize this new feature is better/worse than alternative solutions.