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

Remove the std::mem::transmute when getting NsTable in Rust espresso crypto #339

Open
ImJeremyHe opened this issue Nov 22, 2024 · 0 comments

Comments

@ImJeremyHe
Copy link
Member

ImJeremyHe commented Nov 22, 2024

let ns_table: NsTable = unsafe { std::mem::transmute(ns_table_bytes.to_vec()) };

I think we can marshal the NsTable to JSON first and deserialize it again in Rust. This will lead to a worse performance though, getting rid of unsafe should worth it as we can get more debug information.
Or adding a method NsTable::from_bytes in sequencer repo is even a better alternative, if there is no side effect in sequencer

@ImJeremyHe ImJeremyHe changed the title Remove the std::mem::transmute when getting NsTable Remove the std::mem::transmute when getting NsTable in Rust espresso crypto Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant