Skip to content

fix(sandbox): clear sandbox store inside a block#4420

Merged
ByteNacked merged 8 commits intomasterfrom
rmasl-fix-clear-sandbox-store-hack
Jan 12, 2025
Merged

fix(sandbox): clear sandbox store inside a block#4420
ByteNacked merged 8 commits intomasterfrom
rmasl-fix-clear-sandbox-store-hack

Conversation

@ByteNacked
Copy link
Copy Markdown
Contributor

@ByteNacked ByteNacked commented Dec 23, 2024

Resolves # .

Relates #4192

This hack fixes the error:

 tokio-runtime-worker gear::authorship: ⌛️ Pseudo-inherent is taking too long and will not be included in the block.    

HACK: It was discovered that starting with version 4.0, Wasmer experiences a slowdown
when creating a large number of memory/instances beyond a certain threshold.
The usual method to clear the store doesn't work for benchmarks (see Sandboxes::get)
or when too many instances/memories are created within a single block, as the store
is only cleared at the start of a new block.

This is a temporary solution to reset the store after reaching a certain limit
(see SANDBOX_STORE_CLEAR_COUNTER_LIMIT) for memory/instances.
Otherwise, the store grows too large, leading to performance degradation during
normal node execution and benchmarks.

@reviewer-or-team

@ByteNacked ByteNacked self-assigned this Dec 23, 2024
@ByteNacked ByteNacked added the A0-pleasereview PR is ready to be reviewed by the team label Dec 23, 2024
@ByteNacked
Copy link
Copy Markdown
Contributor Author

ByteNacked commented Dec 24, 2024

Synced:

  • testnet
  • mainnet

@breathx breathx added A2-mergeoncegreen PR is ready to merge after CI passes and removed A0-pleasereview PR is ready to be reviewed by the team labels Jan 11, 2025
@ByteNacked ByteNacked merged commit b9e0deb into master Jan 12, 2025
@ByteNacked ByteNacked deleted the rmasl-fix-clear-sandbox-store-hack branch January 12, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A2-mergeoncegreen PR is ready to merge after CI passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants