Skip to content

Conversation

@tetektoza
Copy link
Contributor

As the title says, but:

Currently, we have a limit that only 16 variables can be held in async blocks.

So, this patch repairs it by creating "synthetic" structs when an async block captures more than 16 variables, and also creates replacement mappings for bundled variable accesses to refer to the struct directly in the aleo bytecode.

Resolves: #28744

As the title says, but:

Currently, we have a limit that only 16 variables can be held in async
blocks.

So, this patch repairs it by creating "synthetic" structs when an async
block captures more than 16 variables, and also creates replacement
mappings for bundled variable accesses to refer to the struct directly
in the aleo bytecode.
@tetektoza
Copy link
Contributor Author

Maybe a bit of an overkill with testcases and I can remove redundant ones, but those ones test tuples, operations, mix with user structs, nested structs and arrays, multiple functions and overall stress test with a lot of captures so we can see how many bundles it broke into.

@tetektoza tetektoza force-pushed the fix/28744_let_async_have_unlimited_captures branch from 65a2097 to 3a53d85 Compare October 9, 2025 20:32
@mohammadfawaz
Copy link
Collaborator

Maybe a bit of an overkill with testcases and I can remove redundant ones, but those ones test tuples, operations, mix with user structs, nested structs and arrays, multiple functions and overall stress test with a lot of captures so we can see how many bundles it broke into.

No such thing as "overkill with testcases"...

@mohammadfawaz mohammadfawaz self-assigned this Oct 21, 2025
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.

[Feature] Allow arbitrary number of variables to be captured by an async block

2 participants