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

refactor: change try from casm contract class to be by ref to avoid clones #604

Closed

Conversation

ArniStarkware
Copy link
Contributor

@ArniStarkware ArniStarkware commented Aug 26, 2024

This change is Reviewable

@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 081e3a9 to 290a38c Compare August 26, 2024 14:49
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 4955cde to f533d4e Compare August 26, 2024 14:50
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 290a38c to c1b419f Compare August 26, 2024 17:06
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from f533d4e to 4b3ff61 Compare August 26, 2024 17:07
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 15 lines in your changes missing coverage. Please review.

Project coverage is 74.23%. Comparing base (f68bd90) to head (ced42c2).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
crates/blockifier/src/execution/contract_class.rs 70.58% 4 Missing and 1 partial ⚠️
crates/blockifier/src/transaction/transactions.rs 0.00% 3 Missing ⚠️
crates/papyrus_execution/src/lib.rs 0.00% 1 Missing and 1 partial ⚠️
crates/gateway/src/rpc_state_reader.rs 0.00% 0 Missing and 1 partial ⚠️
...ates/gateway/src/stateful_transaction_validator.rs 0.00% 0 Missing and 1 partial ⚠️
...tive_blockifier/src/state_readers/papyrus_state.rs 0.00% 0 Missing and 1 partial ⚠️
crates/papyrus_execution/src/execution_utils.rs 0.00% 0 Missing and 1 partial ⚠️
crates/papyrus_execution/src/state_reader.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #604      +/-   ##
==========================================
+ Coverage   74.18%   74.23%   +0.05%     
==========================================
  Files         359      359              
  Lines       36240    36234       -6     
  Branches    36240    36234       -6     
==========================================
+ Hits        26884    26900      +16     
+ Misses       7220     7203      -17     
+ Partials     2136     2131       -5     
Flag Coverage Δ
74.23% <50.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from c1b419f to 55f42fd Compare August 26, 2024 17:27
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 4b3ff61 to cb68be0 Compare August 26, 2024 17:28
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 55f42fd to bc3e260 Compare August 27, 2024 07:23
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from cb68be0 to 812f027 Compare August 27, 2024 07:23
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from bc3e260 to 64de94c Compare August 27, 2024 10:36
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 812f027 to be6d00b Compare August 27, 2024 10:36
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 64de94c to ac61120 Compare August 28, 2024 11:19
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from be6d00b to e1bfb64 Compare August 28, 2024 11:19
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from ac61120 to eaf97ab Compare August 28, 2024 11:57
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from e1bfb64 to f107907 Compare August 28, 2024 11:57
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from eaf97ab to d7ba348 Compare August 29, 2024 10:58
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from f107907 to bcefa05 Compare August 29, 2024 10:58
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from d7ba348 to c11dd88 Compare August 29, 2024 12:30
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from bcefa05 to 9306405 Compare August 29, 2024 12:30
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from c11dd88 to 5f0331e Compare August 29, 2024 12:40
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 9306405 to 82db51b Compare August 29, 2024 12:41
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 5f0331e to f39173d Compare August 29, 2024 15:14
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 82db51b to bb54e99 Compare August 29, 2024 15:14
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from f39173d to a3374e7 Compare September 1, 2024 11:08
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from bb54e99 to 74126b2 Compare September 1, 2024 11:08
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from a3374e7 to c819722 Compare September 2, 2024 15:34
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 18d0df2 to bf63d6e Compare September 15, 2024 07:42
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from b4e640f to 1a4a07f Compare September 16, 2024 15:24
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 1a4a07f to 811ebb9 Compare September 17, 2024 06:39
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from bf63d6e to 22f76d8 Compare September 17, 2024 06:39
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 811ebb9 to f159d01 Compare September 18, 2024 06:56
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 22f76d8 to 8b61365 Compare September 18, 2024 06:57
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from f159d01 to 1cd81f0 Compare September 18, 2024 07:00
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 8b61365 to e804a29 Compare September 18, 2024 07:01
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 1cd81f0 to 728fd16 Compare September 18, 2024 07:23
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from e804a29 to 5138e68 Compare September 18, 2024 07:24
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from 728fd16 to c4e9a61 Compare September 18, 2024 07:54
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 5138e68 to 61444df Compare September 18, 2024 08:33
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/stateful_validator_interface branch from c4e9a61 to ae9880e Compare September 18, 2024 12:28
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 61444df to 5abf220 Compare September 18, 2024 12:29
@ArniStarkware ArniStarkware changed the base branch from arni/executable_tx_in_gateway/stateful_validator_interface to graphite-base/604 September 19, 2024 07:02
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 5abf220 to 17952e5 Compare September 19, 2024 07:04
@ArniStarkware ArniStarkware changed the base branch from graphite-base/604 to main September 19, 2024 07:05
@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 17952e5 to 07f610f Compare September 19, 2024 07:05
@ArniStarkware
Copy link
Contributor Author

crates/gateway/src/stateful_transaction_validator.rs line 83 at r2 (raw file):

            // TODO(Arni): create a try_from for &ExecutableTransaction.
            executable_tx.clone(),
        )

This is the goal of this PR.

Code quote:

            // TODO(Arni): create a try_from for &ExecutableTransaction.
            executable_tx.clone(),
        )

@ArniStarkware
Copy link
Contributor Author

crates/gateway/src/stateful_transaction_validator.rs line 83 at r2 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

This is the goal of this PR.

For declare transaction, this clone might be pretty expensive (The clone might hurt for other transaction types - but it is justifiable in those cases).

@ArniStarkware ArniStarkware force-pushed the arni/executable_tx_in_gateway/try_from_casm_by_ref branch from 07f610f to ced42c2 Compare September 22, 2024 10:51
@ArniStarkware
Copy link
Contributor Author

Already merged.

@ArniStarkware ArniStarkware deleted the arni/executable_tx_in_gateway/try_from_casm_by_ref branch September 26, 2024 09:42
@github-actions github-actions bot locked and limited conversation to collaborators Oct 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant