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

Optimize ByteArray serialization #310

Merged
merged 3 commits into from
Dec 6, 2024
Merged

Optimize ByteArray serialization #310

merged 3 commits into from
Dec 6, 2024

Conversation

m-kus
Copy link
Collaborator

@m-kus m-kus commented Dec 5, 2024

Getting rid of ByteArray completely would be a bit complicated, because that would change the way we serialize arguments and also utreexo outpoints (need to change bridge node also). Moreover, it would probably not give that much of upside because we'd need to fill partial words anyways.

Alternative approach is just a more optimal ByteArray serialization:

  • First convert to an array of felts
  • Then append felts one by one

It might probably make sense to move some of the logic to corelib.

For block 839999: 238M steps => 36M steps

Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
raito ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 6, 2024 11:08am

@m-kus
Copy link
Collaborator Author

m-kus commented Dec 5, 2024

Before
graph_full_839999

After
graph_full_839999_new

@maciejka
Copy link
Collaborator

maciejka commented Dec 5, 2024

Does this make it possible to re-enable most of integration tests?

@m-kus
Copy link
Collaborator Author

m-kus commented Dec 5, 2024

Does this make it possible to re-enable most of integration tests?

All of them pass actually 🤯

@maciejka
Copy link
Collaborator

maciejka commented Dec 6, 2024

Does this make it possible to re-enable most of integration tests?

All of them pass actually 🤯

🦸

packages/consensus/src/codec.cairo Outdated Show resolved Hide resolved
@m-kus m-kus marked this pull request as ready for review December 6, 2024 11:08
@m-kus m-kus merged commit b2116db into main Dec 6, 2024
8 checks passed
@m-kus m-kus deleted the m-kus/replace-bytearray branch December 6, 2024 11:14
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

Successfully merging this pull request may close these issues.

2 participants