-
Notifications
You must be signed in to change notification settings - Fork 21
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
Remove block contents from mempool #485
Conversation
da98381
to
dbf71cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
pub trait Attestation { | ||
type Blob: Blob; | ||
type Hash: Hash + Eq + Clone; | ||
fn blob(&self) -> <Self::Blob as Blob>::Hash; | ||
fn hash(&self) -> <Self::Blob as Blob>::Hash; | ||
fn hash(&self) -> Self::Hash; | ||
fn as_bytes(&self) -> Bytes; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why adding the Hash
associated type? Reasoning for using the blob one was to mark that the return hash is not the attestation/certificate/whatever but the related blob one. Which now that I think of it it makes sense at type level but maybe not so much as it cannot be enforced (neither I added documentation, completely wrong on my side).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reasoning for using the blob one was to mark that the return hash is not the attestation/certificate/whatever but the related blob one.
For that we have the blob
method. Attestations and certificates could be for the same blob but still be different (e.g. produced by different nodes) and we need a way to differentiate those.
Why adding the Hash associated type?
In theory we could reuse the blob type to enforce that all the items for DA use the same hash type but I could not find a way to write a generic constraint like Attestation<Blob::Hash = T>
(rust-lang/rust#52662), so I had to add this as a separate trait instead
Let's signal to the mempool which items were included in a block already to avoid reinclusion.