Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

network/src/legacy/gossip: Wrap GossipEngine in Arc Mutex & lock it on use #890

Closed
wants to merge 2 commits into from

Conversation

mxinden
Copy link
Contributor

@mxinden mxinden commented Mar 9, 2020

GossipEngine in itself has no need to be Send and Sync, given that it
does not rely on separately spawned background tasks anymore.
RegisteredMessageValidator needs to be Send and Sync due to the
inherited trait bounds from implementing GossipService. In addition
RegisteredMessageValidator derives Clone. Thereby GossipEngine
needs to be wrapped in an Arc and Mutex to keep the status quo.


The first commit contains the actual logic, the second points to a patched version of Substrate's polkadot-master branch.

mxinden added 2 commits March 9, 2020 12:06
…n use

`GossipEngine` in itself has no need to be Send and Sync, given that it
does not rely on separately spawned background tasks anymore.
`RegisteredMessageValidator` needs to be `Send` and `Sync` due to the
inherited trait bounds from implementing `GossipService`. In addition
`RegisteredMessageValidator` derives `Clone`. Thereby `GossipEngine`
needs to be wrapped in an `Arc` and `Mutex` to keep the status quo.
@mxinden mxinden requested a review from rphmeier March 9, 2020 11:22
@parity-cla-bot
Copy link

It looks like @mxinden signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@mxinden mxinden added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes labels Mar 9, 2020
@rphmeier rphmeier added A7-looksgoodtestsfail and removed A0-please_review Pull request needs code review. labels Mar 9, 2020
@rphmeier
Copy link
Contributor

rphmeier commented Mar 9, 2020

Thanks!

@gavofyork gavofyork closed this Mar 13, 2020
HCastano added a commit to HCastano/polkadot that referenced this pull request Apr 15, 2021
5330d84e CLI: naming clean-up. (paritytech#897)
f99f2225 Westend<>Rococo Headers Relay (paritytech#875)
72c9117b Use complex headers+messages relay in test deployments (paritytech#905)
48423d5b Stop recursing when creating test headers (paritytech#906)
f8586fd4 Fix outstanding bridge names. (paritytech#901)
54b683b3 Complex headers+messages Millau<->Rialto relay (paritytech#878)
c0e77ca1 fix message generator scripts (paritytech#900)
debf3a82 Use Substrate state_getReadProof RPC method to get storage proofs (paritytech#893)
c3fa7216 Support more than `u8::max_value` GRANDPA validators (paritytech#896)
e5cb87f9 Grandpa Pallet Pruning (paritytech#890)
0b6a8920 RestartNeeded is a connection error (paritytech#894)
2cf5fa26 CLI: Estimate Fee (paritytech#888)
7dace624 CLI: Send Message (paritytech#886)
f8eaecfa CLI: Encode Message (paritytech#889)
1610f868 Bump `jsonrpsee` to Alpha.3 (paritytech#892)
d665b531 Use new Cargo feature resolver (paritytech#891)
ce2ee6ed Rialto Millau Maintenance Dashboard (paritytech#881)
7c585ce8 Revert to older nightly. (paritytech#887)
73a0470e Adding GrandpaJustification custom type (paritytech#882)
b9ccea9c Install CA certificates in relay images (paritytech#880)
ec7841a2 fix widget names (paritytech#879)
REVERT: 746a4027 Accidentally committed `cargo-expand`ed code 🤦
REVERT: 1a5d09c5 Add note to more closely match `initialize` Call variant
REVERT: fdd6e6b3 Add `submit_finality_proof` mock Call variant
REVERT: 768b053e Simplify the Rococo and Westend signing params
REVERT: 62aca80e Add Westend<>Rococo variants to `relay_headers`
REVERT: 0bcb0f51 Add Westend<>Rococo variants to `init_bridge`
REVERT: 01d1305f Use mock Westend and Rococo finaltiy tx calls
REVERT: fb34b9dd Add modules for Rococo<>Westend header sync

git-subtree-dir: bridges
git-subtree-split: 5330d84e9511e38cf9d9ec765bee865fedd4b260
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
B0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants