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

ABI generate native integer(s) if fits #20

Open
maoueh opened this issue May 2, 2023 · 0 comments
Open

ABI generate native integer(s) if fits #20

maoueh opened this issue May 2, 2023 · 0 comments

Comments

@maoueh
Copy link
Collaborator

maoueh commented May 2, 2023

Right now, all Ethereum Solidity types either Signer or Unsigned of any size are serialized to substreams::scalar::BigInt. This hinder a performance hit because arithmetic on pure native types would be much faster.

The goal of this task is to change the type generated in Rust for solidity Signed/Unsigned integers so they are aligned to the closest native type that support it.

For example:

  • int8 -> i8
  • int16 -> i16
  • int24 -> i32
  • ...
  • (same with unsigned).

If bit size > 64, then we would render BigInt as before.

This will be a major breaking change as anyone with such ABI will generate new code using primitive types so it will drastically change their usage.

Maybe we should think about providing a backward compatibility option to the macro and codegen tool always_bigint=true (something like that) so that an easier update path is available.

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