I have some intuition that some refactors in the beacon bridge, portal-bridge/src/beacon_bridge.rs, can help us strip away some Mutexes, like this one:
let finalized_block_root = Arc::new(Mutex::new(String::new()));
Roughly, the approach would be to move the block root into the spawned async service task, and then return it from that task to re-assign the variable in the outer scope from the returned task value.
I can't do it in my head quite well enough to explain on a PR review, so I'll just code it myself locally to try it out, and show an example.
I have some intuition that some refactors in the beacon bridge,
portal-bridge/src/beacon_bridge.rs
, can help us strip away someMutex
es, like this one:Roughly, the approach would be to move the block root into the spawned async service task, and then return it from that task to re-assign the variable in the outer scope from the returned task value.
I can't do it in my head quite well enough to explain on a PR review, so I'll just code it myself locally to try it out, and show an example.