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

Make sure chunk validators to avoid contract compilation as much as possible #11125

Closed
walnut-the-cat opened this issue Apr 19, 2024 · 1 comment
Assignees
Labels
A-stateless-validation Area: stateless validation

Comments

@walnut-the-cat
Copy link
Contributor

With #11124, state witness will always include uncompiled contract code even when compiled version is cached from Chunk Validator side. Since compilation takes a lot of time, we need to make sure chunk validators always use cached compiled contract binary when it's available.

Relevant discussion: ref

@walnut-the-cat walnut-the-cat added the A-stateless-validation Area: stateless validation label Apr 19, 2024
@walnut-the-cat walnut-the-cat changed the title Make sure chunk validators are always using Make sure chunk validators to avoid contract compilation as much as possible Apr 19, 2024
github-merge-queue bot pushed a commit that referenced this issue May 6, 2024
…chunk production vs. chunk validation. (#11178)

As part of #11125, we add metrics to count compiled-contract cache
hits/misses.

We want to track the use of compiled-contract cache for apply-chunk
operations. With stateless validation, apply-chunk will be executed for
two different purposes: (1) while updating the shards by chunk producers
as part of tracking shards and (2) while validating the chunk-witness in
stateless validation (they do not necessarily track the shards they
validate). Since the chunk validators are stateless, they will need to
recompile contracts that they see anew unless they have already cached
the previous compilation results.

We want to closely monitor the trend for chunk validators, thus we need
to distinguish the apply-chunk operations executed for chunk producers
vs chunk validators.

In this PR, we introduce a new enum to make this distinction and
propagate it through apply-chunk call stack up to the point VM is
called. Then we use the Metrics structure exported by the VM.run method
to report the metrics.
@tayfunelmas
Copy link
Contributor

tayfunelmas commented Nov 12, 2024

This is addressed in #11099 by proactively distributing the newly deployed contract code to validators to allow them to pre-compile and persist the contracts in their cache, so closing this issue.

@tayfunelmas tayfunelmas closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-stateless-validation Area: stateless validation
Projects
None yet
Development

No branches or pull requests

3 participants