Update block-sdk version with DefaultMempool that keep no duplicated tx#9488
Update block-sdk version with DefaultMempool that keep no duplicated tx#9488
Conversation
WalkthroughDefault lane initialization now creates a mempool via base.NewMempoolWithDefaultOrdering(...) and passes it into defaultlane.NewDefaultLaneWithMempool(...). MEV lane is unchanged. A new mempool factory was added to package base and the default lane constructor signature changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant App as App (lanes.go)
participant Base as base
participant DL as defaultlane
App->>Base: NewMempoolWithDefaultOrdering(priority, signerExtractor, maxTxs)
Base-->>App: Mempool (default ordering)
App->>DL: NewDefaultLaneWithMempool(config, matchHandler, mempool)
DL-->>App: DefaultLane instance
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
app/lanes.go (3)
74-83: Nit: clarify intent and align variable name with lane.A short rationale comment helps future readers, and the variable name can be a touch more specific.
Apply:
- defaultMempool := base.NewMempoolWithDefaultOrdering( + // Use DefaultMempool to deduplicate identical txs and avoid saturating capacity due to duplicates. + defaultLaneMempool := base.NewMempoolWithDefaultOrdering( base.DefaultTxPriority(), defaultConfig.SignerExtractor, defaultConfig.MaxTxs, ) - defaultLane := defaultlane.NewDefaultLaneWithMempool( + defaultLane := defaultlane.NewDefaultLaneWithMempool( defaultConfig, defaultMatchHandler, - defaultMempool, + defaultLaneMempool, )
74-83: Double-check MEV lane dedup semantics.Only the default lane now uses the new deduping mempool. Please confirm the MEV lane’s internal mempool already rejects duplicates in v2.1.8; otherwise consider adopting a similar explicit mempool or enabling dedup there to avoid capacity issues for bids.
74-83: Add regression tests around duplicates and capacity behavior.Recommend adding tests that:
- Insert the same tx twice into the default lane; assert second insert is ignored (or returns a specific duplicate error) and mempool size stays 1.
- Flood with N unique + M duplicates; assert no “pool reached max tx capacity” errors are emitted prematurely and ordering remains consistent with DefaultTxPriority.
- Ensure MEV lane behavior (if applicable) matches expectations for duplicates.
I can draft table-driven tests against CreateLanes to construct lanes and exercise the mempool interface with mock or signed txs if helpful.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (2)
go.modis excluded by!**/*.modgo.sumis excluded by!**/*.sum,!**/*.sum
📒 Files selected for processing (1)
app/lanes.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
- GitHub Check: e2e
- GitHub Check: go-split-test-files
- GitHub Check: osmosisd-darwin-arm64
- GitHub Check: osmosisd-darwin-amd64
- GitHub Check: osmosisd-linux-arm64
- GitHub Check: osmosisd-linux-amd64
- GitHub Check: Run golangci-lint
- GitHub Check: check-proto
- GitHub Check: test
- GitHub Check: Summary
🔇 Additional comments (2)
app/lanes.go (2)
74-83: Good migration to explicit DefaultMempool with default ordering.Wiring the default lane through an explicit mempool with default ordering aligns with the PR goal (drop dup txs) and should reduce spurious “max tx capacity” failures. Constructor usage and params look consistent with the new API.
74-83: Action Required: Confirm SDK Bump and Constructor Removal
- I did not locate a
go.modin the repository root (or within five directory levels); please ensure your project’sgo.modexists and referencesgithub.com/skip-mev/block-sdk/v2at v2.1.8 or later.- Ran a ripgrep scan for any remaining
defaultlane.NewDefaultLane(...)calls—none were found, so the deprecated constructor has been removed across the codebase.
What is the purpose of the change
Fix previous version of block-sdk that resulted in frequent
failed to insert tx into mempool: pool reached max tx capacityerror due to missing duplicated tx detection.