feat(mev): add eth_sendBundle rate limit option - #224
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ef5HwDcHb2r5EhaYbjhFEc
thanhpp
force-pushed
the
feat/mev-send-bundle-rate-limit
branch
from
September 2, 2026 04:31
585be8d to
6f103b0
Compare
vaigay
approved these changes
Sep 2, 2026
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.
What
Add an optional per-client rate limit for
eth_sendBundlerequests inpkg/mev, and size it for the Ultrasound builder.Why
Ultrasound caps the
eth_sendBundlerate per endpoint at 50 requests per second. A client over the limit should fail the call at once instead of queuing, because a late bundle has no value.Changes
WithSendBundleRateLimit(requestsPerSecond, burst)inpkg/mev/bundle_sender_options.go, backed bygolang.org/x/time/rate.Limiter.postBundleinpkg/mev/bundle_sender.gochecks the limiter only forETHSendBundleMethodand returns the newErrSendBundleRateLimited(pkg/mev/errors.go) when no token is free.UltrasoundSendBundleRPSandUltrasoundSendBundleBurstconstants inpkg/mev/constants.go, both 50, one limit per Ultrasound endpoint.go.mod:golang.org/x/timemoves from indirect to direct.pkg/mev/bundle_sender_rate_limit_test.go: 5 tests for the burst limit, that onlyeth_sendBundleis limited, the unlimited default, a non-positive limit, and the Ultrasound constant values.Test plan
go build ./...go test ./pkg/mev/...(new tests pass)golangci-lint run --config=.golangci.yml ./pkg/mev/...(only pre-existing issues, unrelated to this change)go mod tidy(no further change)🤖 Generated with Claude Code
https://claude.ai/code/session_01Ef5HwDcHb2r5EhaYbjhFEc