perf: eliminate redundant read_dispair calls in try_into_call#2793
perf: eliminate redundant read_dispair calls in try_into_call#2793thedavidmeister wants to merge 2 commits into
Conversation
try_into_call previously called read_dispair 3 times (once directly and once inside each try_parse_rainlang call), totalling 12 sequential RPC round-trips just to read 4 immutable deployer addresses. Add parse_bytecode_with_dispair, which takes a pre-fetched DISPaiR and skips the read_dispair step. try_parse_rainlang becomes a wrapper around read_dispair + parse_bytecode_with_dispair. try_into_call now calls read_dispair once and passes the result to both parse calls via clone/move. RPC calls for a single deposit+addOrder submission: 14 → 6 (saves 8 sequential round-trips, ~2.4s at 300ms RTT). Adds assertions to test_into_add_order_call verifying both config.evaluable and tasks[0].evaluable carry the correct interpreter and store addresses from the single shared dispair read. Closes #2776 Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 18 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Mark try_parse_rainlang as #[cfg(test)] — after the try_into_call refactor it is only called from tests, so the production build flags it as dead code under -D warnings. Co-Authored-By: Claude <noreply@anthropic.com>
Summary
try_into_callpreviously calledread_dispairthree times — once inline and once inside eachtry_parse_rainlangcall — totalling 12 sequential RPC round-trips just to read 4 immutable deployer addresses. At 300ms RTT (remote RPC) that is ~3.6s of avoidable latency.Changes
parse_bytecode_with_dispair: the parsing body extracted fromtry_parse_rainlang, takes a pre-fetchedDISPaiR(no additional dispair reads).try_parse_rainlangis now a thin wrapper:read_dispair+parse_bytecode_with_dispair. All existing tests remain unchanged.try_into_callcallsread_dispaironce, clones for the first parse, moves for the second parse, and extractsinterpreter/storeupfront.Result
RPC calls per
generate_deposit_and_add_order_calldatas(dispair portion):read_dispair)read_dispair)Total for a single deposit+addOrder: 14 → 6 sequential
eth_callround-trips, saving ~2.4s at 300ms RTT.Test
Adds assertions to
test_into_add_order_callverifying bothconfig.evaluable.interpreter/storeandtasks[0].evaluable.interpreter/storematch the expected interpreter/store addresses (and match each other). This mutation-validates that both evaluables receive the correct dispair from the single shared read.Closes #2776
Co-Authored-By: Claude noreply@anthropic.com