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

chore: cleanup host blockhash fn #1430

Merged
merged 1 commit into from
May 17, 2024
Merged

chore: cleanup host blockhash fn #1430

merged 1 commit into from
May 17, 2024

Conversation

rakita
Copy link
Member

@rakita rakita commented May 17, 2024

No description provided.

Copy link
Contributor

Valgrind Results:

==3819== Cachegrind, a cache and branch-prediction profiler
==3819== Copyright (C) 2002-2017, and GNU GPL'd, by Nicholas Nethercote et al.
==3819== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==3819== Command: target/release/snailtracer
==3819== 
--3819-- warning: L3 cache found, using its data for the LL simulation.
Running snailtracer example!
elapsed: 1.783256839s
==3819== 
==3819== I   refs:      429,371,749
==3819== I1  misses:          3,093
==3819== LLi misses:          2,789
==3819== I1  miss rate:        0.00%
==3819== LLi miss rate:        0.00%
==3819== 
==3819== D   refs:      206,205,179  (133,650,671 rd   + 72,554,508 wr)
==3819== D1  misses:        344,815  (    204,754 rd   +    140,061 wr)
==3819== LLd misses:        137,632  (      4,276 rd   +    133,356 wr)
==3819== D1  miss rate:         0.2% (        0.2%     +        0.2%  )
==3819== LLd miss rate:         0.1% (        0.0%     +        0.2%  )
==3819== 
==3819== LL refs:           347,908  (    207,847 rd   +    140,061 wr)
==3819== LL misses:         140,421  (      7,065 rd   +    133,356 wr)
==3819== LL miss rate:          0.0% (        0.0%     +        0.2%  )

Copy link
Collaborator

@onbjerg onbjerg 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 2239820 into main May 17, 2024
25 checks passed
@github-actions github-actions bot mentioned this pull request May 17, 2024
// through.
}
let block_number = as_usize_saturated!(self.env().block.number);
let requested_number = as_usize_saturated!(number);
Copy link
Collaborator

@DaniPopes DaniPopes May 17, 2024

Choose a reason for hiding this comment

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

technically this breaks blockhash when block number is > usize::MAX because diff will always saturate to 0.

@github-actions github-actions bot mentioned this pull request May 24, 2024
This was referenced Jun 3, 2024
@rakita rakita deleted the rakita/chore_bh branch June 10, 2024 16:55
This was referenced Jun 11, 2024
@github-actions github-actions bot mentioned this pull request Jun 19, 2024
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.

3 participants