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

refactor: Simplify bitswap WantSession #234

Merged
merged 11 commits into from
Jun 3, 2024
Merged

Conversation

dariusc93
Copy link
Owner

@dariusc93 dariusc93 commented Jun 3, 2024

This PR simplifies some parts of bitswap WantSession by:

  • Using a single field to manage of the peers local state
    • We use IndexMap so we can track the order of the peer and act accordingly.
  • Change discovery to an enum to track when to use a timer to emit a NeedBlock based on specific conditions
  • Pass on and track previous peer id when a request fails.

Additionally, we will only track the connection id as the behaviour would have no need to track the addresses themselves.

@dariusc93 dariusc93 self-assigned this Jun 3, 2024
@dariusc93 dariusc93 marked this pull request as ready for review June 3, 2024 16:53
@dariusc93 dariusc93 merged commit 6849519 into libp2p-next Jun 3, 2024
@dariusc93 dariusc93 deleted the chore/bitswap-timer branch June 3, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant