Skip to content

Update block-sdk version with DefaultMempool that keep no duplicated tx#9488

Merged
iboss-ptk merged 2 commits intomainfrom
boss/block-sdk-2.1.8-mempool
Aug 21, 2025
Merged

Update block-sdk version with DefaultMempool that keep no duplicated tx#9488
iboss-ptk merged 2 commits intomainfrom
boss/block-sdk-2.1.8-mempool

Conversation

@iboss-ptk
Copy link
Copy Markdown
Contributor

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 capacity error due to missing duplicated tx detection.

@iboss-ptk iboss-ptk requested a review from crnbarr93 August 21, 2025 04:56
@github-actions github-actions bot added the C:app-wiring Changes to the app folder label Aug 21, 2025
@iboss-ptk iboss-ptk requested review from PaddyMc and crnbarr93 and removed request for crnbarr93 August 21, 2025 04:56
@iboss-ptk iboss-ptk added V:state/compatible/backport State machine compatible PR, should be backported A:backport/v30.x backport patches to v30.x branch labels Aug 21, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 21, 2025

Walkthrough

Default 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

Cohort / File(s) Summary
Default lane wiring
app/lanes.go
Replaces defaultlane.NewDefaultLane(...) with defaultlane.NewDefaultLaneWithMempool(..., defaultMempool) after creating defaultMempool via base.NewMempoolWithDefaultOrdering(...).
Mempool API
base/...
Adds exported base.NewMempoolWithDefaultOrdering(p, signerExtractor, maxTxs) -> base.Mempool.
Default lane constructor API
.../defaultlane/...
Introduces exported defaultlane.NewDefaultLaneWithMempool(config, matchHandler, mempool) (replaces previous NewDefaultLane usage).

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
Loading

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 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 92e787b and da502b2.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
⏰ 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)
  • GitHub Check: go (02)
  • GitHub Check: go (01)
  • GitHub Check: go (03)
  • GitHub Check: go (00)
  • GitHub Check: e2e
  • GitHub Check: Run golangci-lint
  • GitHub Check: Summary
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch boss/block-sdk-2.1.8-mempool

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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.

📥 Commits

Reviewing files that changed from the base of the PR and between 2805147 and 92e787b.

⛔ Files ignored due to path filters (2)
  • go.mod is excluded by !**/*.mod
  • go.sum is 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.mod in the repository root (or within five directory levels); please ensure your project’s go.mod exists and references github.com/skip-mev/block-sdk/v2 at 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.

Copy link
Copy Markdown
Collaborator

@PaddyMc PaddyMc left a comment

Choose a reason for hiding this comment

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

🙇

@iboss-ptk iboss-ptk merged commit 3dd2184 into main Aug 21, 2025
1 check passed
@iboss-ptk iboss-ptk deleted the boss/block-sdk-2.1.8-mempool branch August 21, 2025 14:28
mergify bot pushed a commit that referenced this pull request Aug 21, 2025
…tx (#9488)

(cherry picked from commit 3dd2184)

# Conflicts:
#	CHANGELOG.md
iboss-ptk added a commit that referenced this pull request Aug 21, 2025
…tx (backport #9488) (#9489)

* Update block-sdk version with DefaultMempool that keep no duplicated tx (#9488)

(cherry picked from commit 3dd2184)

# Conflicts:
#	CHANGELOG.md

* fix merge conflict

---------

Co-authored-by: Supanat <supanat.ptk@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A:backport/v30.x backport patches to v30.x branch C:app-wiring Changes to the app folder V:state/compatible/backport State machine compatible PR, should be backported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants