fix(lido): fix panic in eth_call — reqwest::blocking inside async runtime (v0.2.1)#92
Closed
fix(lido): fix panic in eth_call — reqwest::blocking inside async runtime (v0.2.1)#92
Conversation
…time (v0.2.1) `eth_call` used `reqwest::blocking::Client` which internally creates its own tokio runtime. Calling it inside a `#[tokio::main]` async context causes a panic: "Cannot drop a runtime in a context where blocking is not allowed." This crashed the following commands at startup: - balance (2 eth_call sites) - stake (1 eth_call site — isStakingPaused check) - get-withdrawals (2 eth_call sites) - claim-withdrawal (2 eth_call sites) Fix: convert eth_call to async fn, replace reqwest::blocking::Client with async reqwest::Client, and add .await to all 7 call sites. Bump version to 0.2.1 in Cargo.toml, SKILL.md, plugin.yaml, and .claude-plugin/plugin.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
Superseded by #93 — rebased on fork main to avoid .github/ diff false positive. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
eth_callusedreqwest::blocking::Client, which internally creates its own tokio runtime. Calling it from within a#[tokio::main]async context causes an immediate panic:Affected commands (all call
eth_callfrom async context):balancebalanceOf,sharesOf)stakeisStakingPausedpre-flight check)get-withdrawalsgetWithdrawalRequests,getWithdrawalStatus)claim-withdrawalgetLastCheckpointIndex,findCheckpointHints)Fix
eth_calltoasync fninonchainos.rsreqwest::blocking::Clientwith asyncreqwest::Client.awaitto all 7 call sites acrossbalance.rs,stake.rs,get_withdrawals.rs,claim_withdrawal.rs0.2.1inCargo.toml,SKILL.md,plugin.yaml,.claude-plugin/plugin.jsonTest plan
lido get-apy— APR query (unaffected, returns 2.39%)lido balance— on-chain stETH balance query, no paniclido get-withdrawals— lists withdrawal requests from chain, no paniclido request-withdrawal --amount-eth 0.00001 --confirm— 2-step tx (approve + requestWithdrawals), both confirmed on-chainlido claim-withdrawal --ids <ID>— reaches chain correctly (returns expectedRequestNotFoundOrNotFinalizedfor PENDING requests, confirming RPC call succeeds)🤖 Generated with Claude Code