-
Notifications
You must be signed in to change notification settings - Fork 107
refactor: share benchmark code with simple flow test #1917
Conversation
I wanted to keep it here, but rust doesn't let me. Are test utils not considered "dev" for the purpose of dependencies? Code quote: rand.workspace = true |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1917 +/- ##
==========================================
+ Coverage 78.02% 78.18% +0.15%
==========================================
Files 61 62 +1
Lines 8756 8828 +72
Branches 8756 8828 +72
==========================================
+ Hits 6832 6902 +70
- Misses 1484 1486 +2
Partials 440 440 ☔ View full report in Codecov by Sentry. |
+reviewer:@OriStarkware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: 0 of 6 files reviewed, 2 unresolved discussions (waiting on @avi-starkware, @noaov1, and @Yoni-Starkware)
a discussion (no related file):
Can you split this into a code-moving PR and a code-changing PR?
7d30fc1
to
d5cf583
Compare
Previously, OriStarkware wrote…
Done. The code change happens in a preliminary PR: #1919 . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 6 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 5 of 6 files reviewed, 2 unresolved discussions (waiting on @avi-starkware, @noaov1, and @Yoni-Starkware)
crates/blockifier/Cargo.toml
line 57 at r1 (raw file):
Previously, avi-starkware wrote…
I wanted to keep it here, but rust doesn't let me. Are test utils not considered "dev" for the purpose of dependencies?
Please check that
crates/blockifier/src/blockifier/transfers_flow_test.rs
line 5 at r2 (raw file):
#[test] pub fn transfers_flow_test() { let n_chunks = 100;
Why do we need so many chunks?
d5cf583
to
fab9ce4
Compare
f1e9882
to
f0c8abe
Compare
Previously, OriStarkware wrote…
This is just an arbitrary number. i'll reduce it to 10. |
f0c8abe
to
41feedd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @noaov1, and @Yoni-Starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 5 of 6 files reviewed, all discussions resolved (waiting on @noaov1 and @Yoni-Starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 6 files at r1.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @noaov1 and @Yoni-Starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 6 files at r1, 1 of 1 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @avi-starkware and @Yoni-Starkware)
crates/blockifier/Cargo.toml
line 57 at r1 (raw file):
Previously, OriStarkware wrote…
Please check that
Can you please explain?
crates/blockifier/src/blockifier/transfers_flow_test.rs
line 5 at r3 (raw file):
#[test] pub fn transfers_flow_test() { let n_chunks = 10;
Given the new implantation of execute_txs
(execute a stream of transactions and divides it to chunks) consider running it one time.
Code quote:
let n_chunks = 10;
crates/blockifier/src/test_utils/transfers_simulator.rs
line 25 at r3 (raw file):
const CHUNK_SIZE: usize = 10; const RANDOMIZATION_SEED: u64 = 0; const CHARGE_FEE: bool = false;
Can you please remind me why it's off? In the flow test we might want to charge fee.
Code quote:
const CHARGE_FEE: bool = false;
crates/blockifier/src/test_utils/transfers_simulator.rs
line 26 at r3 (raw file):
const RANDOMIZATION_SEED: u64 = 0; const CHARGE_FEE: bool = false; const TRANSACTION_VERSION: TransactionVersion = TransactionVersion(StarkFelt::ONE);
Suggestion:
const TRANSACTION_VERSION: TransactionVersion = TransactionVersion(StarkFelt::THREE);
fab9ce4
to
76e4c2e
Compare
41feedd
to
9e34750
Compare
Previously, noaov1 (Noa Oved) wrote…
Test code is compiled when the create is built, so it is not considered a dev-dependency when we use it in |
5420735
to
3edb7a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 6 files reviewed, 3 unresolved discussions (waiting on @noaov1, @OriStarkware, and @Yoni-Starkware)
crates/blockifier/src/blockifier/transfers_flow_test.rs
line 5 at r3 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Given the new implantation of
execute_txs
(execute a stream of transactions and divides it to chunks) consider running it one time.
Done.
crates/blockifier/src/test_utils/transfers_simulator.rs
line 25 at r3 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Can you please remind me why it's off? In the flow test we might want to charge fee.
This is a block of code I moved from elsewhere. I suggest not changing anything in this file in this PR, and doing it in the next PR: #1921.
If I make changes here, anything changed in the previous PR will mess everything up in this PR.
crates/blockifier/src/test_utils/transfers_simulator.rs
line 26 at r3 (raw file):
const RANDOMIZATION_SEED: u64 = 0; const CHARGE_FEE: bool = false; const TRANSACTION_VERSION: TransactionVersion = TransactionVersion(StarkFelt::ONE);
See previous comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @noaov1, @OriStarkware, and @Yoni-Starkware)
crates/blockifier/src/test_utils/transfers_simulator.rs
line 25 at r3 (raw file):
Previously, avi-starkware wrote…
This is a block of code I moved from elsewhere. I suggest not changing anything in this file in this PR, and doing it in the next PR: #1921.
If I make changes here, anything changed in the previous PR will mess everything up in this PR.
I changed it to true
in #1921.
crates/blockifier/src/test_utils/transfers_simulator.rs
line 26 at r3 (raw file):
Previously, avi-starkware wrote…
See previous comment.
Done in #1921.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @noaov1 and @Yoni-Starkware)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r4, 1 of 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
crates/blockifier/Cargo.toml
line 57 at r1 (raw file):
Previously, avi-starkware wrote…
Test code is compiled when the create is built, so it is not considered a dev-dependency when we use it in
test-utils
as opposed to when we use it in the benchmark.
Does it have some negative affect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
The base branch was changed.
68ed4d1
to
7b61429
Compare
Previously, noaov1 (Noa Oved) wrote…
I changed it to be the same as
This ensures that rand is available for cargo test and cargo bench, but is not included in the production build. |
7b61429
to
9cd4260
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
crates/blockifier/Cargo.toml
line 57 at r1 (raw file):
Previously, avi-starkware wrote…
I changed it to be the same as
rstest
:
- set
optional = true
.- add
rand
to the featuretesting
.- add
rand
to dev-dependencies.This ensures that rand is available for cargo test and cargo bench, but is not included in the production build.
Nice!
9cd4260
to
a6fff18
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
* proof scheduler * cleared leftovers * feature fix * Deserialization and tests fix * uncommented apply diffs logic * genesis block fix * fetching last block * moved fetching to separate function * process_block no async * Adding traces and infos for async functions * made dojo core work with merger program * minor logs adjustments in saya * final world contract * preparation for http prover * proving example data by * serializing arguments * debug print * only one program in verifier * preparing args for prover * batch size arg * moved extraction of data from proof to separate module * minor cleanup * updated bin/scheduler * laziness fix and update prover sdk * half done * cairo 1 behind flag * added cairo 0 differ and merger * support for 2 programs in `upgrade_state` * end 2 end saya readme * data extraction from proof * saya working with cairo 0 * updated prover and readme * added a clause about keygen * updated port in readme * clippy and formatting * ignored heavy tests * moved readme to bin * updated stone prover image * made tests pass * removed unneeded files and fixed compilation * formatting after rebase * better fetch parallelization * fixed valid ignoring of not l1_handler * fixed most tests and made compiled programs one line * cairo import formatting * using recursive layout * changed docker images to latest * Update examples/spawn-and-move/Scarb.toml Co-authored-by: glihm <[email protected]> * most of pr comments * keeping track of nonce to avoid sleep * rest of PR comments * made changes to fix the tests * formatting * fixed all the tests * final formatting * rebuilt artifacts * fix: typo in README * fixed duplicated proving state update * fix: remove cargo warning for dual license source * fix: reword some commands + fix options for saya * fix: update README * fix: ensure model get fails if no key is provided * fix: use --bin instead of -p --------- Co-authored-by: Mateusz Zając <[email protected]> Co-authored-by: Mateusz <[email protected]> Co-authored-by: Mateusz Zając <[email protected]> Co-authored-by: glihm <[email protected]>
This change is