-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
mirror jms timeless history2 a9acf2741f6ddb1ed431d8143e0f1ed41672173d #123
Closed
shahar4
wants to merge
4
commits into
main
from
mirror-jms-timeless-history2-a9acf2741f6ddb1ed431d8143e0f1ed41672173d
Closed
mirror jms timeless history2 a9acf2741f6ddb1ed431d8143e0f1ed41672173d #123
shahar4
wants to merge
4
commits into
main
from
mirror-jms-timeless-history2-a9acf2741f6ddb1ed431d8143e0f1ed41672173d
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #123 +/- ##
==========================================
+ Coverage 31.49% 31.91% +0.42%
==========================================
Files 477 480 +3
Lines 25429 25135 -294
==========================================
+ Hits 8010 8023 +13
+ Misses 17419 17112 -307
☔ View full report in Codecov by Sentry. |
…d431d8143e0f1ed41672173d
Deniallugo
force-pushed
the
mirror-jms-timeless-history2-a9acf2741f6ddb1ed431d8143e0f1ed41672173d
branch
from
October 2, 2023 06:41
e806bf5
to
5b951c2
Compare
Detected VM performance changes
|
mr-teikst
pushed a commit
to mr-teikst/zksync-era
that referenced
this pull request
Mar 6, 2024
This commit addresses the issue of an unbounded loop in the `writes` function of the `WritesAndMessages` contract. The unbounded loop could potentially lead to out-of-gas errors and transaction failures if the `iterations` parameter is set too high. The fix introduces a `LOOP_LIMIT` constant that sets the maximum number of iterations allowed in a single transaction. If the desired `iterations` exceed the loop limit, the function now splits the iterations into multiple batches, executing the loop for the `LOOP_LIMIT` iterations in each batch. The `writes` function has been modified as follows: - Introduce a `LOOP_LIMIT` constant set to 1000 (adjustable based on gas limits and requirements) - Use a `while` loop to handle remaining iterations - Calculate the `batchSize` as the minimum of `LOOP_LIMIT` and the remaining iterations - Execute the loop for the calculated `batchSize` - Update the remaining iterations and start index for the next batch By splitting the operation into multiple transactions, the function ensures that the loop never exceeds the `LOOP_LIMIT`, preventing potential out-of-gas issues. However, this approach may introduce additional complexity and potential for inconsistencies if transactions fail or are reordered. Resolves: matter-labs#123 (replace with the actual issue number, if applicable)
6 tasks
Deniallugo
deleted the
mirror-jms-timeless-history2-a9acf2741f6ddb1ed431d8143e0f1ed41672173d
branch
March 12, 2024 16:55
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes VM internal rollbacks to work differently: you now call snapshot to push a snapshot onto a stack. Later you can rollback or forget_snapshot.
This enables many optimizations. For example, in the old model an integer had to remember all its old values. In the new model, remembering the value it had at the time of the snapshot suffices. The snapshots can be used in place of the forwards and rollbacks lists in storage and event_sink and doing so will fix a pubdata refund bug.
Bytes paid for storage writes are computed in a new much simpler way because the old way relied on reading history, which is bad as it is tightly coupled to how history is implemented. Same thing with the number of contracts decommitted.
VM memory statistics are no longer published because nobody seems to care about them and I don't want to have to change them all the time during the history optimizations that I'm going to do. A more maintainable version could be developed but I'd suggest using massif for memory statistics instead.
This is a mirror of this private PR.