-
Notifications
You must be signed in to change notification settings - Fork 232
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
Ensure that hashing across account data and resize area works #3889
base: master
Are you sure you want to change the base?
Conversation
The Firedancer team maintains a line-for-line reimplementation of the |
d5f28a1
to
0434fc2
Compare
for item in chunk_iter { | ||
let (region, src_addr, chunk_len) = item?; | ||
|
||
let addr = Result::from(region.vm_to_host(src_addr, chunk_len as u64))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, why do we do the translation at the callsite and not have it in the iterator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fn iter_memory_pair_chunks()
we may want to iterate in reverse, in which case we want to use the last address in the chunk rather than the first.
We could have an fn iter_memory_chunks()
which does this.
n_bytes: u64, | ||
accounts: &[SerializedAccountMetadata], | ||
memory_mapping: &MemoryMapping, | ||
mut fun: F, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a &mut dyn FnMut
, instead of a generic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want &mut dyn FnMut
?
- It's such a short function, code bloat shouldn't be an issue (I think)
fn iter_memory_pair_chunks()
is also generic (so then both should be changed)
generic is "better inlining and optimization, but larger code" and dyn
is "shorter slower code, indirect calling is expensive and fewer optimizations possible".
wdty?
Problem
The account data and resize area are separate regions with direct mapping. So, ensure that hashing data across it works.