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

Avoid keeping blocks in memory longer than we need to #173

Closed
Stebalien opened this issue Aug 9, 2019 · 1 comment · Fixed by #177
Closed

Avoid keeping blocks in memory longer than we need to #173

Stebalien opened this issue Aug 9, 2019 · 1 comment · Fixed by #177
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@Stebalien
Copy link
Member

When we get a block, we currently send it to every interested session (SessionManager.ReceiveBlocksFrom). Looking into this, we mostly just need the CID. That would:

  1. Save us some memory (sometimes).
  2. Avoid keeping blocks we didn't ask for around. We currently do this to track duplicates but I'd rather toss them ASAP.

We still need the blocks themselves to send them to the user but we should be able to avoid that by removing the per-session PubSub instance and reverting to a global PubSub instance.

@Stebalien Stebalien added the kind/enhancement A net-new feature or improvement to an existing feature label Aug 9, 2019
@dirkmc
Copy link
Contributor

dirkmc commented Aug 13, 2019

I agree, it doesn't seem like the Session needs to know about PubSub or receive the blocks themselves (just the block CIDs). As you say we should be able to handle this with a global PubSub instance, and it would simplify the code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/enhancement A net-new feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants