Skip to content

feat: createBid batching#394

Draft
vertex451 wants to merge 8 commits into
artem/batchingfrom
artem/batching-create-bid
Draft

feat: createBid batching#394
vertex451 wants to merge 8 commits into
artem/batchingfrom
artem/batching-create-bid

Conversation

@vertex451
Copy link
Copy Markdown
Contributor

@vertex451 vertex451 commented Apr 27, 2026

Should be merged after #392

Testing

Batcher

While provider was stopped I created 10 deployments and started a provider. During the order catchup it created expected batch of bids:

  • flush batch=1 remaining=0 ← first bid fires immediately (idle)
  • enqueue inFlight=true pending=9 ← rest coalesce while in-flight
  • flush batch=5 remaining=4 ← first batch of 5 drains
  • batch succeeded count=5
  • flush batch=4 remaining=0 ← remaining 4 sent together
  • batch succeeded count=4

Smart retry

I've changed a code and force first message in a batch to fail.

  • flush batch=1 → injecting test failure idx=0 → ERR message failed, retrying remainder remaining=0 (msg removed, nothing left to retry → done)

  • flush batch=2
    → WRN injecting test failure idx=0 → ERR remaining=2
    → WRN injecting test failure idx=0 → ERR remaining=1
    → WRN injecting test failure idx=0 → ERR remaining=0
    (all 3 stripped one by one, each caller gets individual error)

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 24f0f5b5-1e3f-475d-897f-e1afa8b6ca45

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch artem/batching-create-bid

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@vertex451 vertex451 changed the base branch from main to artem/batching April 27, 2026 14:32
Comment thread bidengine/order.go
// Channel for receiving cluster reservation result.
clusterch <-chan runner.Result
// Channel for receiving bid creation transaction result.
bidch <-chan runner.Result
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's no runner.Result involved anymore - the channel type reflects the new reply mechanism directly.

Comment thread bidengine/order.go
})
replyCh := make(chan error, 1)
select {
case o.bidSubmitCh <- bidRequest{msg: msg, replyCh: replyCh}:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since BidBatcher is owned by the bidengine.service, we communicate with it by the channel, in this case we can have concurrent orders and one bidBatcher.

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.

1 participant