You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
…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.
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.
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
The text was updated successfully, but these errors were encountered: