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

Initial DA service sketch #376

Merged
merged 3 commits into from
Sep 6, 2023
Merged

Initial DA service sketch #376

merged 3 commits into from
Sep 6, 2023

Conversation

danielSanchezQ
Copy link
Collaborator

Notice that traits and/or bounds may be changed. This is an initial approach and things would have to change probably a bit when piping everything together. I'll be implementing the backend and adapters after this.

@danielSanchezQ danielSanchezQ self-assigned this Sep 6, 2023
@danielSanchezQ danielSanchezQ linked an issue Sep 6, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

Codecov Report

Patch has no changes to coverable lines.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more.

Files Changed Coverage
...omos-services/data-availability/src/backend/mod.rs 0.00%
nomos-services/data-availability/src/lib.rs 0.00%

📢 Thoughts on this report? Let us know!.


async fn blob_stream(
&self,
) -> Box<dyn Stream<Item = (Self::Blob, oneshot::Sender<Self::Reply>)> + Unpin + Send>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mmm, thinking how the reply would work
Is your idea that the adapter somehow knows this and can create that channel on its own?
In that case, I think it should also be responsible for sending the blob, or better, we should unify the responsibilities of sending and interpreting the same message

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

? Is your idea that the adapter somehow knows this and can create that channel on its own?
yes, this was just the first idea. It is probably gonna change. As for the first version we would be broadcasting the replies anyway.

I think actually for now Im just gonna remove this for what I explained above. And add a call to send the reply.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is your idea that the adapter somehow knows this and can create that channel on its own?

Yes, or at least there's a single component that knows how to read and write those.
What I want to avoid is that we define reading in one component and writing in another one, because we've know created hidden coupling between them

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely right. And the network adapter should not know about it.


fn add_blob(&mut self, blob: Self::Blob) -> Result<(), DaError>;

fn pending_blobs(&self) -> Box<dyn Iterator<Item = Self::Blob> + Send>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the expectation is that pending blobs are removed from the list once returned? or once polled from the iterator? or is that signaled externally?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to remove the blobs in the same fashion we do in the mempool actually. We can use some evicting policy for really old ones as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any method to change the blobs status though here

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Ill add it in the incoming backend PR.

@danielSanchezQ danielSanchezQ merged commit bca27bd into master Sep 6, 2023
11 checks passed
Copy link
Contributor

@youngjoon-lee youngjoon-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Sorry for the late review.

@jakubgs jakubgs deleted the da-service branch February 15, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DA Core
4 participants