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

Da service backend #381

Merged
merged 9 commits into from
Sep 8, 2023
Merged

Da service backend #381

merged 9 commits into from
Sep 8, 2023

Conversation

danielSanchezQ
Copy link
Collaborator

No description provided.

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

Codecov Report

Patch has no changes to coverable lines.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Files Changed Coverage
nomos-core/src/blob/mod.rs 0.00%
...ices/data-availability/src/backend/memory_cache.rs 0.00%
...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!.

Comment on lines +4 to +13
pub type BlobHasher<T> = fn(&T) -> <T as Blob>::Hash;

pub trait Blob {
const HASHER: BlobHasher<Self>;
type Hash: Hash + Eq + Clone;
fn hash(&self) -> Self::Hash {
Self::HASHER(self)
}
fn as_bytes(&self) -> Bytes;
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This may be expanded later if needed when we know more about how would it looks.


pub fn pending_blobs(&self) -> Box<dyn Iterator<Item = B> + Send> {
// bypass lifetime
let blobs: Vec<_> = self.0.iter().map(|t| t.1).collect();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moka clones by default.

Comment on lines +26 to +27
// can we leverage this to evict really old blobs?
.time_to_idle(evicting_period)
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed in https://github.com/logos-co/nomos-node/pull/376/files#r1317083701, the expectation is that the outer service retrieves pending blobs from this service, does something with those blobs, and after that, requests removing those blobs? If so, it seems it's okay to use time_to_idle. This will reset eviction timers whenever pending_blobs() is called, but I guess it's okay if it wouldn't take too long for the outer service to process and remove blobs.

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. So the idea here is that. Either a blob is pending for the whole life until is added into a block. Or is removed. (that is why is using the same evicting period as the time to live). But it would make sense that if it is not included it dies as well after some time.

@danielSanchezQ danielSanchezQ mentioned this pull request Sep 8, 2023
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.

Clear structure to understand! even though I can't now imagine the full scenario about how we'll use this service. I'd like to participate in this topic soon, even for small stuff, to understand our expectation clearly.

@danielSanchezQ danielSanchezQ merged commit 96e3c2d into master Sep 8, 2023
11 checks passed
@jakubgs jakubgs deleted the da-service-backend 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 backend
3 participants