apollo_committer: add request_paths_and_commit_block tests#14208
apollo_committer: add request_paths_and_commit_block tests#14208ArielElp wants to merge 1 commit into
Conversation
e720964 to
9c253a8
Compare
PR SummaryLow Risk Overview The happy-path test commits a rich state diff with accessed vs unaccessed keys, checks returned Patricia proofs by re-fetching paths from witness preimages (classes, contracts, per-contract storage), then strips live trie nodes and replays the same request to assert idempotent global root and proofs from persisted witnesses. A second test covers Test-only support: dev-deps on Reviewed by Cursor Bugbot for commit 4a2b243. Bugbot is set up for automated code reviews on this repo. Configure here. |
9c253a8 to
8a3d6fb
Compare
0a150fa to
dcafcad
Compare
8a3d6fb to
b0c6beb
Compare
dcafcad to
10d77f4
Compare
b0c6beb to
b87f87a
Compare
10d77f4 to
bcf65f0
Compare
bcf65f0 to
eb321de
Compare
b87f87a to
14140cc
Compare
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs partially reviewed 3 files and made 5 comments.
Reviewable status: 1 of 5 files reviewed, 5 unresolved discussions (waiting on ArielElp).
a discussion (no related file):
Please split it into settings (block structure) and logic (verify functions) PRs.
crates/apollo_committer/src/request_paths_and_commit_block_tests.rs line 81 at r1 (raw file):
} fn accessed_keys() -> AccessedKeys {
Do the naming clearer - what are the block 0 settings, and what are the general constants.
Code quote:
fn accessed_keys()crates/apollo_committer/src/request_paths_and_commit_block_tests.rs line 111 at r1 (raw file):
accessed_contract_2(), HashMap::from([(accessed_storage_key_2(), StarknetStorageValue(200_u128.into()))]), ),
Share the values with block_0_state_diff.
For testing theaccessed_storage_leaves, they should be connected to the committer input.
Code quote:
(
accessed_contract_1(),
HashMap::from([(accessed_storage_key_1(), StarknetStorageValue(100_u128.into()))]),
),
(
accessed_contract_2(),
HashMap::from([(accessed_storage_key_2(), StarknetStorageValue(200_u128.into()))]),
),crates/apollo_committer/src/request_paths_and_commit_block_tests.rs line 131 at r1 (raw file):
contract_1 => indexmap! { accessed_storage_key_1().0 => 100_u128.into(), UNACCESSED_STORAGE_KEY.into() => 300_u128.into(),
The story of block 0 is broken - unacessed key in the state diff.
Code quote:
accessed_storage_key_1().0 => 100_u128.into(),
UNACCESSED_STORAGE_KEY.into() => 300_u128.into(),crates/apollo_committer/src/request_paths_and_commit_block_tests.rs line 324 at r1 (raw file):
let mut storage = MapStorage(storage_map.clone()); let sorted_leaf_indices = SortedLeafIndices::new(leaf_indices); let fetched = fetch_patricia_paths::<L, FactsNodeLayout>(
This needs some explanation. Just to make sure I understand, are you verifying that fetch_patricia_paths for indexes returns the same result for the facts layout?
If that's the core of the test, consider converting it to a more focused unit test.
Code quote:
fetch_patricia_paths::<L, FactsNodeLayout>14140cc to
7acc60b
Compare
eb321de to
70a879c
Compare
7acc60b to
473b445
Compare
70a879c to
10f2f7d
Compare
473b445 to
20c303b
Compare
10f2f7d to
061ae00
Compare
061ae00 to
f9899db
Compare
20c303b to
4a2b243
Compare

No description provided.