Skip to content

fix(providers-evm-rpc): await semaphore acquire in latest_block#2008

Merged
Theodus merged 1 commit intomainfrom
theodus/evm-rpc
Mar 23, 2026
Merged

fix(providers-evm-rpc): await semaphore acquire in latest_block#2008
Theodus merged 1 commit intomainfrom
theodus/evm-rpc

Conversation

@Theodus
Copy link
Member

@Theodus Theodus commented Mar 23, 2026

The latest_block method was missing .await on self.limiter.acquire(), causing the future to be dropped immediately without ever acquiring a permit. Rate limiting was silently bypassed for every latest_block call.

The `latest_block` method was missing `.await` on `self.limiter.acquire()`,
causing the future to be dropped immediately without ever acquiring a permit.
Rate limiting was silently bypassed for every `latest_block` call.
@Theodus Theodus requested review from LNSD, shiyasmohd and sistemd March 23, 2026 16:30
};
let _permit = self.limiter.acquire();
let _permit = self.limiter.acquire().await.map_err(|_| {
LatestBlockError::from(anyhow::anyhow!("rate limiter semaphore closed"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the anyhow dependency from the client crates?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in #2011

Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

The comment above is not a blocker. But we should address it asap.

@Theodus Theodus merged commit f97dcde into main Mar 23, 2026
8 checks passed
@Theodus Theodus deleted the theodus/evm-rpc branch March 23, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants