feat(ethexe/compute): use proptests instead of custom mock()#5350
feat(ethexe/compute): use proptests instead of custom mock()#5350
Conversation
Changed Files
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the testing suite for the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request migrates the ethexe/compute test suite to property-based testing using the proptest library, introducing strategies for blockchain generation and promise handling. These changes significantly enhance the verification of block preparation, announce computation, and code processing logic. The review feedback focuses on optimizing the async test runner by utilizing a thread-local Tokio runtime to reduce overhead, improving test robustness by increasing the complexity and volume of generated test cases, and ensuring safety by replacing unnecessary unsafe code with safe, idiomatic Rust conversions.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a56eda7ef0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@claude review |
|
Claude finished @playX18's task in 6m 34s —— View job Code Review: feat(ethexe/compute): use proptests instead of custom mock()Tasks
SummaryThis PR replaces the ad-hoc The unsafe-in-tests concern Gemini raised ( medium: File: let tx = announce.injected_transactions[0].clone().into_data();This panics if let tx = announce.injected_transactions.first()
.expect("requestable indexes start at 2, guaranteeing one injected tx per announce")
.clone()
.into_data();medium: No overall timeout for Wasmtime-heavy proptest cases File: The original The Codex reviewer flagged a related concern about the per-event timeout. The real risk here is total runtime — e.g. 64 cases × 15 blocks × 5 messages × Wasmtime overhead. Consider reducing case count for the Wasmtime-heavy tests (16–32 instead of 64), or re-adding proptest! {
#![proptest_config(ProptestConfig::with_cases(32))]
#[test]
fn test_compute_with_promises(...) { ... }low: File: let observed_events =
collect_compute_events(&mut compute_service, expected_events.len()).await;
assert_eq!(observed_events, expected_events);
// Predecessors are computed silently (no AnnounceComputed emitted for them);
// only the explicitly requested announces emit events.low: File:
// blockchain.blocks includes genesis, so blocks.len() - 1 == the strategy's blockchain_len param
let chain_depth = blockchain.blocks.len() - 1;nit: File: const NO_EVENT_TIMEOUT: Duration = Duration::from_millis(500);The original test used 100ms for the "no follow-up event" assertion. 500ms is less flaky on slow machines — that's fine — but it adds 500ms to every What's good
|
|
@claude opus review |
|
Claude finished @grishasobol's task in 3m 7s —— View job Code Review (Opus)Tasks
SummaryThe PR replaces The findings below are mostly hardening notes — there's no correctness regression. The largest practical concern is total Wasmtime runtime under proptest's case multiplier on CI. medium: total Wasmtime runtime under proptest will be high on slow CI File: Two heavy property tests now run with
Each individual event has a 3 s timeout ( Suggestions, in increasing order of disruption:
medium: implicit invariant on File: let tx = announce.injected_transactions[0].clone().into_data();This panics if
But the invariant is implicit and load-bearing. If anyone ever lowers let tx = announce.injected_transactions
.first()
.expect("requestable indexes start at 2; each requested announce carries one injected tx")
.clone()
.into_data();low: File:
All three hold today, but each is non-obvious from the call site. A short comment near line 694 documenting "predecessors are computed silently; only request_indexes emit events" would prevent surprise during a future refactor. low: File: collection::btree_set(any::<[u8; 32]>().prop_map(CodeId::from), count)
.prop_map(|ids| ids.into_iter().collect())
.boxed()
low: File: fn predecessor_test_inputs_strategy() -> BoxedStrategy<(BlockChain, usize)> {
(2usize..=16)
.prop_flat_map(|blockchain_len| {
block_chain_strategy(blockchain_len as u32)
.prop_map(move |chain| (chain, blockchain_len))
})
.boxed()
}
nit: File: This is correct for the current consumers but couples "not prepared" to "no announces". If a future test wants to reset prepared state while keeping announces, this helper would silently corrupt the chain. Worth either renaming to What's good
— branch |
|
/review-delta |
|
@copilot resolve the merge conflicts in this pull request |
Agent-Logs-Url: https://github.com/gear-tech/gear/sessions/4b49c20d-0d17-4ae6-a87a-2c56ac2353fe Co-authored-by: playX18 <[email protected]>
Resolved in 0bff454. I merged the latest Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This reverts commit 0bff454.
No description provided.