starkware-libs / blockifier

Blockifier is a Rust implementation for the transaction-executing component in the StarkNet sequencer, in charge of creating state diffs and blocks.
Apache License 2.0
170 stars 107 forks source link

refactor: add BouncerConfig to BlockContext #1956

Closed Yoni-Starkware closed 3 months ago

Yoni-Starkware commented 3 months ago

This change is Reviewable

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 90.90909% with 3 lines in your changes missing coverage. Please review.

Project coverage is 78.02%. Comparing base (faa3e44) to head (35665c7).

Files Patch % Lines
crates/native_blockifier/src/py_validator.rs 0.00% 2 Missing :warning:
crates/blockifier/src/context.rs 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1956 +/- ## ========================================== - Coverage 78.02% 78.02% -0.01% ========================================== Files 61 61 Lines 8770 8756 -14 Branches 8770 8756 -14 ========================================== - Hits 6843 6832 -11 + Misses 1487 1484 -3 Partials 440 440 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

avi-starkware commented 3 months ago

crates/blockifier/src/blockifier/transaction_executor.rs line 58 at r2 (raw file):

Previously, Yoni-Starkware (Yoni) wrote…
We don't move it that much, there are two clones for each block. I don't like the implicit copy (a struct might get big in the future).

Note that BouncerWeights does implement Copy. It is derived, but we can implement it explicitly to control what gets copied in case the struct gets big. If we use clone(), everything gets duplicated in an uncontrolled manner.