Skip to content
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

Upgrade flow refactoring #807

Merged
merged 30 commits into from
Mar 8, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
2033712
[skip ci] Start of upgrade refacto
Menduist Nov 22, 2022
df97314
kinda working
Menduist Nov 23, 2022
1ab9cc9
remove upgraded system
Menduist Nov 23, 2022
8b76889
re-add custom matcher
Menduist Nov 23, 2022
b954dad
Simplify connManager
Menduist Nov 23, 2022
c0316e3
fix
Menduist Nov 23, 2022
12ac83f
fix tests
Menduist Nov 24, 2022
7ad1ea8
try fix test
Menduist Nov 25, 2022
263b9e8
Fix GossipSub race condition
Menduist Nov 25, 2022
7b98af6
fix more race conditions
Menduist Nov 25, 2022
99bc8ee
Fix GossipSub race condition
Menduist Nov 25, 2022
6992d81
Merge remote-tracking branch 'origin/unstable' into upgraderefacto
Menduist Jan 2, 2023
a6cec9f
Better fix
Menduist Jan 2, 2023
696a5b4
Merge branch 'fixgossiprace' into upgraderefacto
Menduist Jan 2, 2023
92a425c
Fix typo
Menduist Jan 3, 2023
95fb447
Merge branch 'fixgossiprace' into upgraderefacto
Menduist Jan 3, 2023
7a74dd3
fix ci
Menduist Jan 3, 2023
5510ef7
Merge remote-tracking branch 'origin/unstable' into upgraderefacto
Menduist Jan 10, 2023
281a15a
Merge remote-tracking branch 'origin/unstable' into upgraderefacto
Menduist Jan 24, 2023
6acf4b4
Merge remote-tracking branch 'origin/unstable' into upgraderefacto
Menduist Jan 25, 2023
c279e5a
Fix pubsub
Menduist Jan 25, 2023
5c6fe92
fix short agent
Menduist Jan 30, 2023
5dc290b
Update libp2p/multistream.nim
Menduist Jan 30, 2023
c5f2dbd
Merge remote-tracking branch 'origin/unstable' into upgraderefacto
Menduist Feb 21, 2023
de06b46
Add getWrapped to YamuxChannel
Menduist Feb 21, 2023
2ab82c0
Merge remote-tracking branch 'origin/upgraderefacto' into upgraderefacto
Menduist Feb 21, 2023
685966c
fix autonat
Menduist Feb 21, 2023
8618c85
Merge branch 'unstable' into upgraderefacto
diegomrsantos Feb 22, 2023
b07e66b
Merge remote-tracking branch 'origin/unstable' into upgraderefacto
Menduist Mar 2, 2023
c9cc2bc
Trigger events before identify
Menduist Mar 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ switch("warning", "LockLevel:off")
if (NimMajor, NimMinor) < (1, 6):
--styleCheck:hint
else:
switch("warningAsError", "UseBase:on")
--styleCheck:error

# Avoid some rare stack corruption while using exceptions with a SEH-enabled
Expand Down
9 changes: 5 additions & 4 deletions libp2p/builders.nim
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ proc build*(b: SwitchBuilder): Switch
identify = Identify.new(peerInfo, b.sendSignedPeerRecord)
connManager = ConnManager.new(b.maxConnsPerPeer, b.maxConnections, b.maxIn, b.maxOut)
ms = MultistreamSelect.new()
muxedUpgrade = MuxedUpgrade.new(identify, b.muxers, secureManagerInstances, connManager, ms)
muxedUpgrade = MuxedUpgrade.new(b.muxers, secureManagerInstances, connManager, ms)

let
transports = block:
Expand All @@ -242,20 +242,21 @@ proc build*(b: SwitchBuilder): Switch

let peerStore =
if isSome(b.peerStoreCapacity):
PeerStore.new(b.peerStoreCapacity.get())
PeerStore.new(identify, b.peerStoreCapacity.get())
else:
PeerStore.new()
PeerStore.new(identify)

let switch = newSwitch(
peerInfo = peerInfo,
transports = transports,
identity = identify,
secureManagers = secureManagerInstances,
connManager = connManager,
ms = ms,
nameResolver = b.nameResolver,
peerStore = peerStore)

switch.mount(identify)

if b.autonat:
let autonat = Autonat.new(switch)
switch.mount(autonat)
Expand Down
Loading