autonomys / subspace

Subspace Network reference implementation
https://subspace.network
380 stars 243 forks source link

Running the message listener for the consensus chain #2966

Closed NingLin-P closed 2 months ago

NingLin-P commented 2 months ago

In main the consensus chain message listener only starts after the run_domain returns the domain_code_executor: https://github.com/autonomys/subspace/blob/38d6b5be8209b9ad5cd08a788dff7675e621540f/crates/subspace-node/src/commands/run.rs#L346-L362

which won't happen until the domain worker shuts down, as a result, the consensus chain message listener is not running at all.

This PR fixes the issue by constructing a new domain executor and using it to start the consensus chain message listener without waiting.

Code contributor checklist: