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

Ensure that hashing across account data and resize area works #3889

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

seanyoung
Copy link

@seanyoung seanyoung commented Dec 3, 2024

Problem

The account data consists of two areas: the orignal account data and the resize area, for when the account size is increased. Hashing across these two regions does not work, since they are distinct regions.

This change is required for direct mapping.

See stricter VM verfication SIMD

Copy link

mergify bot commented Dec 3, 2024

The Firedancer team maintains a line-for-line reimplementation of the
native programs, and until native programs are moved to BPF, those
implementations must exactly match their Agave counterparts.
If this PR represents a change to a native program implementation (not
tests), please include a reviewer from the Firedancer team. And please
keep refactors to a minimum.

@seanyoung seanyoung force-pushed the hashers branch 2 times, most recently from d5f28a1 to 0434fc2 Compare December 3, 2024 21:12
@seanyoung seanyoung marked this pull request as ready for review December 4, 2024 09:23
@seanyoung seanyoung requested a review from a team as a code owner December 4, 2024 09:23
n_bytes: u64,
accounts: &[SerializedAccountMetadata],
memory_mapping: &MemoryMapping,
mut fun: F,
Copy link

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.

Copy link
Author

@seanyoung seanyoung Dec 4, 2024

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".

wdyt?

@seanyoung seanyoung requested a review from Lichtso December 6, 2024 19:13
@seanyoung seanyoung force-pushed the hashers branch 2 times, most recently from c0c65ac to 391319f Compare December 9, 2024 19:31
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