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

Add bytecode hash in interpreter #1888 #1952

Merged
merged 11 commits into from
Dec 31, 2024

Conversation

FredCoen
Copy link
Contributor

Resolves #1888

Copy link

codspeed-hq bot commented Dec 25, 2024

CodSpeed Performance Report

Merging #1952 will not alter performance

Comparing FredCoen:Add-bytecode-hash-in-Interpreter-#1888 (afc98d0) with main (d2a3b5b)

Summary

✅ 8 untouched benchmarks

@FredCoen
Copy link
Contributor Author

@rakita i am not sure if option is the best way to do this? Also let me know if we should set the value in the getter directly !

@rakita
Copy link
Member

rakita commented Dec 25, 2024

Hey, check out the ExtBytecode, it is better place for the hash. And allow ExtBytecode to be initialized with the hash, if this is regenerated every time it is a performance hit.

@FredCoen
Copy link
Contributor Author

thanks!

"allow ExtBytecode to be initialized with the hash" -> i introduced new_with_hash to allow this, otherwise calling the hash() method returns the hash and cashes it on the ExtByteCode. Is this what you had in mind?

For some reason it caused a regression on the ecrecover precompile perf. I am not sure why though. Do you have any idea @rakita ?

@rakita
Copy link
Member

rakita commented Dec 31, 2024

thanks!

"allow ExtBytecode to be initialized with the hash" -> i introduced new_with_hash to allow this, otherwise calling the hash() method returns the hash and cashes it on the ExtByteCode. Is this what you had in mind?

Yes! It would be good for fn hash() to return Option as there is already a function to generate hash in Bytecode.

For some reason it caused a regression on the ecrecover precompile perf. I am not sure why though. Do you have any idea @rakita ?

It is not related, it can be ignored. The test is kinda flaky.

@FredCoen
Copy link
Contributor Author

hey i removed the cached hash test. Should i add anything else? CI passes where do you see it being flaky on your side locally?

@rakita
Copy link
Member

rakita commented Dec 31, 2024

hey i removed the cached hash test. Should i add anything else? CI passes where do you see it being flaky on your side locally?

Perfect!

The recovery test is flaky as nothing is changed with precompiles but it shows a diff, we can ignore it.

Have added the ExtBytecode::new_with_hash usege and will PR merge after CI

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@rakita rakita merged commit e3c7abf into bluealloy:main Dec 31, 2024
28 checks passed
@github-actions github-actions bot mentioned this pull request Dec 31, 2024
@github-actions github-actions bot mentioned this pull request Jan 8, 2025
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.

Add bytecode hash in Interpreter
2 participants