feat: withdrawal batcher#392
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| return resp | ||
| } | ||
|
|
||
| func (bc *balanceChecker) startWithdraw(ctx context.Context, lid mtypes.LeaseID) error { |
There was a problem hiding this comment.
This was moved to the withdrawal_batcher.go
Must be merged after akash-network/chain-sdk#292
Changes
WithPriorityoption to MsgCreateBid and MsgCloseBidOther callers to batch
MsgCreateBid is not suitable for batching, because failure for one bid will cancel other bids. Same for MsgCloseBid.
No other Msgs in the provider found.
Testing
I run a provider with:
And created a 10 leases.
After that I stopped a provider for one minute and run it again. Observations:
0→1→...→9→4→0as expected. Zero at beginning, then first tx goes in and fires immediately, while in flight, other leases are scheduled to withdrawal, which bumps pending to 9. When tx is finished, next batch is collected, pending tx are reduced bywithdrawal-batch-max-msgs(5).