Skip to content

feat(interpreter): add hash to bytecode#628

Merged
rakita merged 6 commits intobluealloy:mainfrom
Evalir:evalir/add-hash-contract
Aug 23, 2023
Merged

feat(interpreter): add hash to bytecode#628
rakita merged 6 commits intobluealloy:mainfrom
Evalir:evalir/add-hash-contract

Conversation

@Evalir
Copy link
Contributor

@Evalir Evalir commented Aug 22, 2023

Caches the bytecode on Contract to only call hash_slow once during Contract's creation.

Should speed up the coverage interpreter in foundry. cc @rakita


impl Contract {
pub fn new(input: Bytes, bytecode: Bytecode, address: B160, caller: B160, value: U256) -> Self {
let hash = bytecode.hash_slow();
Copy link
Member

@rakita rakita Aug 22, 2023

Choose a reason for hiding this comment

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

Didnt mean like this. You can pass the hash through the constructor

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, you mean like this? ab9d4b4

@Evalir Evalir force-pushed the evalir/add-hash-contract branch from 499aef1 to afb0be9 Compare August 22, 2023 17:28
@Evalir Evalir force-pushed the evalir/add-hash-contract branch from afb0be9 to f895c57 Compare August 22, 2023 17:30
@Evalir Evalir requested a review from rakita August 22, 2023 17:56
@Evalir Evalir requested a review from rakita August 23, 2023 13:52
@rakita rakita merged commit 6b55b9c into bluealloy:main Aug 23, 2023
@Evalir Evalir deleted the evalir/add-hash-contract branch August 23, 2023 14:06
mikelodder7 pushed a commit to LIT-Protocol/revm that referenced this pull request Sep 12, 2023
* feat: add hash to bytecode

* chore: introduce args through constructor

* chore: lint

* chore: do not hash again

* chore: load account

* chore: use unwrap_or_default and set error
Evalir added a commit to Evalir/revm that referenced this pull request Sep 14, 2023
* feat: add hash to bytecode

* chore: introduce args through constructor

* chore: lint

* chore: do not hash again

* chore: load account

* chore: use unwrap_or_default and set error
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