Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses advancer “app starvation” by changing the advancer’s processing strategy to be fair across applications and by introducing an internal self-reschedule mechanism so services can immediately re-tick when they detect more work.
Changes:
- Advancer now processes at most one input batch per application per Step (and only the first unprocessed epoch per app), preventing a “flood” app from monopolizing processing.
- Base
service.Servicegains an optional self-reschedule channel (EnableReschedule+SignalReschedule) and a shutdown-in-progress flag (IsStopping()), and advancer/claimer opt into rescheduling. - Adds supporting infra: Postgres partial index for unprocessed inputs, CLI
send --async, and a bash load-test script/Makefile targets to reproduce starvation conditions.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
internal/advancer/advancer.go |
Implements per-app single-batch processing and returns a “more work” signal from Step(). |
internal/advancer/service.go |
Enables rescheduling for advancer; signals reschedule when work remains; adjusts shutdown cleanup semantics. |
internal/advancer/advancer_test.go |
Updates Step signature usage and adds extensive starvation/scheduling tests. |
pkg/service/service.go |
Adds EnableReschedule, reschedule channel plumbing, and IsStopping() tracking in the base service loop. |
pkg/service/service_test.go |
Adds unit tests for reschedule behavior and shutdown responsiveness. |
internal/claimer/service.go |
Enables rescheduling and signals it when claim pipeline progresses. |
internal/claimer/claimer.go |
Returns transition counts from claim state transitions to drive rescheduling decisions. |
internal/claimer/claimer_test.go |
Updates tests for new transition-count return values. |
internal/prt/service.go |
Uses IsStopping() to avoid doing work and suppress shutdown-related context errors. |
internal/manager/manager.go |
Returns applications in deterministic order (sorted by ID). |
pkg/ethutil/ethutil.go |
Adds AddInputAsync helper for high-throughput load testing. |
cmd/cartesi-rollups-cli/root/send/send.go |
Adds --async option to send inputs without waiting for receipts. |
internal/repository/postgres/schema/migrations/000001_create_initial_schema.up.sql |
Adds partial index for unprocessed inputs and lowers autovacuum scale factor on input. |
internal/repository/postgres/schema/migrations/000001_create_initial_schema.down.sql |
Drops the new partial index on rollback. |
scripts/load-test.sh |
Adds an automated starvation load test that interleaves inputs across apps and monitors processing fairness. |
Makefile |
Adds deploy-load-test-apps and load-test targets to run the starvation load test easily. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d02f816 to
87e2334
Compare
87e2334 to
bfc7330
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bfc7330 to
dc85f92
Compare
dc85f92 to
90478b4
Compare
90478b4 to
ba571a5
Compare
mpolitzer
approved these changes
Mar 27, 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.
No description provided.