starknet_os_runner: add mock_rpc for integration test with the SDK#12909
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
b820ac8 to
6326b23
Compare
ecd01fe to
d86781f
Compare
d86781f to
b94451a
Compare
avivg-starkware
left a comment
There was a problem hiding this comment.
@avivg-starkware made 1 comment.
Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on avivg-starkware).
crates/starknet_os_runner/resources/mock_proving_rpc/prove_transaction_result.json line 23 at r3 (raw file):
] } ]
I'm not very familiar with l2_to_l1_messages - can you approve the format?
Code quote:
"l2_to_l1_messages": [
{
"from_address": "0x123",
"to_address": "0xdeadbeef",
"payload": [
"0x1",
"0x2",
"0x3"
]
}
]
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware made 1 comment.
Reviewable status: 0 of 6 files reviewed, 1 unresolved discussion (waiting on avivg-starkware).
crates/starknet_os_runner/resources/mock_proving_rpc/prove_transaction_result.json line 23 at r3 (raw file):
Previously, avivg-starkware wrote…
I'm not very familiar with
l2_to_l1_messages- can you approve the format?
Yeah looks good. Actually, try to remove one of the fields - your test should test in this case.
|
Previously, Yoni-Starkware (Yoni) wrote…
Yes, just tried- removing each of the fields ("from_address", "to_address", "payload") causes |
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware reviewed 5 files and all commit messages, and made 1 comment.
Reviewable status: 5 of 6 files reviewed, 1 unresolved discussion (waiting on avivg-starkware).
avivg-starkware
left a comment
There was a problem hiding this comment.
@avivg-starkware resolved 1 discussion.
Reviewable status: 5 of 6 files reviewed, all discussions resolved (waiting on Yoni-Starkware).
avivg-starkware
left a comment
There was a problem hiding this comment.
@avivg-starkware reviewed 1 file.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on avivg-starkware).
AvivYossef-starkware
left a comment
There was a problem hiding this comment.
@AvivYossef-starkware made 4 comments.
Reviewable status: all files reviewed, 4 unresolved discussions.
crates/starknet_os_runner/src/server.rs line 4 at r3 (raw file):
pub mod cors; pub mod error; pub mod mock_rpc;
plz put it under feature
it should be part of the production code
crates/starknet_os_runner/src/server/mock_rpc.rs line 17 at r3 (raw file):
#[cfg(test)] #[path = "mock_rpc_test.rs"] mod mock_rpc_test;
plz define it in serever.rs
Code quote:
#[cfg(test)]
#[path = "mock_rpc_test.rs"]
mod mock_rpc_test;crates/starknet_os_runner/src/server/mock_rpc.rs line 73 at r3 (raw file):
fn reference_json_dir() -> PathBuf { PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("resources").join("mock_proving_rpc") }
Code quote:
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("resources").join("mock_proving_rpc")
}crates/starknet_os_runner/src/server/mock_rpc_test.rs line 9 at r3 (raw file):
//! 2. Update `resources/mock_proving_rpc/prove_transaction_result.json` to match the new serialized //! format. //! 3. Update the SDK to parse the new response format.
its a docsting of the test not the module
Code quote:
//! Serde roundtrip test for the **response** format (`ProveTransactionResult`).
//!
//! Ensures the reference JSON file stays in sync with the Rust type.
//!
//! **If this test fails**:
//! 1. The serde layout of `ProveTransactionResult` has changed.
//! 2. Update `resources/mock_proving_rpc/prove_transaction_result.json` to match the new serialized
//! format.
//! 3. Update the SDK to parse the new response format.
Note
Low Risk
Low risk: adds a test-only mock RPC implementation and a reference JSON fixture without changing the real proving flow; only minor visibility change to reuse
SPEC_VERSION.Overview
Adds a
MockProvingRpcimplementation of thestarknet_proveTransactionRPC that returns a deterministic, preloadedProveTransactionResultfromresources/mock_proving_rpc/prove_transaction_result.jsonfor SDK integration tests.Introduces a serde roundtrip test to ensure the reference JSON fixture stays in sync with the
ProveTransactionResultserialization format, and makesSPEC_VERSIONpub(crate)so the mock can reuse the samespecVersionresponse.Written by Cursor Bugbot for commit b94451a. This will update automatically on new commits. Configure here.