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

In house transaction and block types (wrappers) #191

Open
Boog900 opened this issue Jun 22, 2024 · 2 comments
Open

In house transaction and block types (wrappers) #191

Boog900 opened this issue Jun 22, 2024 · 2 comments
Labels
A-types Related to types. C-proposal A proposal of some kind, and a request for comments.

Comments

@Boog900
Copy link
Member

Boog900 commented Jun 22, 2024

What

Currently we are using monero-serai directly across multiple crates, this proposal is to create wrapper types in types that we use across crates instead.

Why

This will allow us to do things like caching the tx hash, we currently do this in the consensus crates, however we also calculate tx hashes in the block downloader, which isn't cached.

Where

types and anywhere currently using monero-serai

How

Right now monero-serai is planning a big change to their transaction type seen as we are going to have to make (a lot of) changes for this it makes sense to do this at the same time

@Boog900 Boog900 added A-types Related to types. C-proposal A proposal of some kind, and a request for comments. labels Jun 22, 2024
@Boog900 Boog900 changed the title In house transaction and block types In house transaction and block types (wrappers) Jun 22, 2024
@kayabaNerve
Copy link
Contributor

Not to say you shouldn't add a wrapper struct, yet I'm curious the argument against localized hashes.

Hash a TX as it comes in, store said hash with the TX.

Is the argument that the wrapper, despite being a wrapper, would offer better overall UX and prevent cache misses across distinct areas? If you use the Deref types as Box does, it should be quite seamless I think...

@Boog900
Copy link
Member Author

Boog900 commented Jun 23, 2024

yes, mainly for UX. I am also considering only exposing the necessary API for Cuprate on the the types although I don't really think the benefits are there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-types Related to types. C-proposal A proposal of some kind, and a request for comments.
Projects
None yet
Development

No branches or pull requests

2 participants