-
Notifications
You must be signed in to change notification settings - Fork 19
perf: partitions from actix to tokio #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…d compatibility with existing Actix
…system backward compatible
…nd PackingHandle, remove Addr<PackingActor> from ActorAddresses/chain, and rewire all call sites to use the handle. Improve wait_for_packing to be race-resistant, update tests and multi-node flows accordingly, and fix runtime handle usage in remote-packing tests.
Flagging flaky tests: FLAKY 2/2 block_production::block_production::heavy_test_always_build_on_max_difficulty_block |
Flagging flaky tests: |
This has received some review via slack. Merging and will take any feedback into the next PR in the series to remove actix. |
Describe the changes
Migrate partition mining from Actix actors to Tokio services; extend broadcaster to support Tokio subscribers.
Motivation
Key changes
partition_mining_service.rs
,PartitionMiningService
,PartitionMiningServiceInner
,PartitionMiningController
.MiningBroadcastEvent
,SubscribeTokio
,UnsubscribeTokio
(best-effort).addresses.rs
andActorAddresses
.$crate::storage::ie
in macros; removed strayie
imports.try_send
is Full/Closed to surface backpressure and failures.Behavioral changes
PartitionMiningController
.BroadcastMiningService
fans out to both Actix and Tokio subscribers; closed Tokio channels are pruned on send failure. Unbounded channels are used.Chain initialization changes
ActorAddresses
and the set ofPartitionMiningActor
addresses.partition_controllers: Vec<PartitionMiningController>
onIrysNodeCtx
.init_partition_mining_actor
withinit_partition_mining_services
returning(Vec<PartitionMiningController>, Vec<TokioServiceHandle>)
.MiningControl
toctrl.set_mining(should_mine)
.Operational considerations
BroadcastMiningService
should be registered before miners spawn (tests ensure viafrom_registry()
).Testing
tokio::test
where appropriate and ensure broadcaster init before miners.Follow up PR / out of scope
actix
references frompartition_mining_service.rs
.#[actix::test]
,actix_rt::time::sleep
,actix::Message
usage in unrelated services).ServiceSendersInner::init_with_sender()
and move it to be a "regular" member ofServiceSenders
.Checklist
Additional Context
This is the second of three PRS for actix->tokio
Previous in series of actix removal PRs: #829
Next in series of actix removal PRs: #869