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

Switch to big endian? #265

Open
nazar-pc opened this issue Sep 4, 2024 · 3 comments
Open

Switch to big endian? #265

nazar-pc opened this issue Sep 4, 2024 · 3 comments

Comments

@nazar-pc
Copy link
Contributor

nazar-pc commented Sep 4, 2024

@ArtiomTr you pushed 3d0b849#diff-0d5371bff0db1d54cd1fda4827c9bab8b1dd4ba41ca77699c0d47a9420b280f3R62 where you have changed little-endian encoding to big-endian encoding, which broke a bunch of assumptions in our downstream project.

There was no PR and no explanation given, why would you possibly do that all of a sudden?

@nazar-pc
Copy link
Contributor Author

nazar-pc commented Sep 4, 2024

I suspect it is related to ethereum/c-kzg-4844#305 and discussions linked from there? If so please create PR and include proper description next time to avoid such surprises.

@ArtiomTr
Copy link
Contributor

ArtiomTr commented Sep 4, 2024

Hello, yeah, we try to follow c-kzg-4844 implementation. I agree, there should be a better way to document changes - perhaps, having a CHANGELOG.md, or documenting changes in GitHub releases (we should discuss this with @sauliusgrigaitis).

Regarding encoding migration - what issues this caused in your project? Is it caused by from_bytes/to_bytes functions? Maybe they should have more descriptive names, like in rust std - from_be_bytes/from_le_bytes

@nazar-pc
Copy link
Contributor Author

nazar-pc commented Sep 4, 2024

Even proper commit message would be helpful in understanding the changes.

It is caused by from_bytes and to_bytes implementations indeed. We have assumption of the data layout in a few places in our codebase, so after upgrade we started to hit "Invalid scalar" right away. For now I copy-pasted little-endian implementations of those methods into our codebase and we'll try to switch to big-endian before hitting mainnet.

In case it wasn't obvious, we're not implementing Ethereum, just sharing some of the cryptography primitives.

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

2 participants