Skip to content

Conversation

@Leon1777
Copy link
Contributor

@Leon1777 Leon1777 commented Jul 9, 2025

  • d8c6df8 used a fallback before but we want to strictly enforce only header version 2, now it will panic rather than being silently accepted with fallback
  • rust lints 1.88
  • some more fishhash/khashv2 refactoring in dede848 and f85eab6

119905e
thread Arc<FishHashContext> through consensus stack

  • remove FISHHASH_FULL_DATASET AtomicBool global from pow_hashers (avoids global state)
  • add Arc<FishHashContext>
  • single dataset shared via Arc::clone() across all consensus components

Leon1777 added 8 commits July 9, 2025 02:40
- used a fallback before but we want to strictly enforce only header version 2, now it will panic rather than being silently accepted with fallback

- this should still never happen because we enforce only v1 and v2
after forkactivation in pre_ghostdag_validation
- replace separate lazy_static LIGHT_CACHE and OnceLock FULL_DATASET with single OnceLock<FishHashContext>
- renamed get_dataset_item to lookup
- added back comments which were removed in the previous commit
- fn lookup now does the build full dataset check once
- moved keccak, keccak_in_place, fnv1 and fnv1_512 out of PowFishHash (utility functions outside impl blocks, we previously had it like this)
- add some comments to lookup
- improved the readability of prebuild_dataset and export the core work logic to build_dataset_segment
- lints
- remove FISHHASH_FULL_DATASET AtomicBool global from pow_hashers (avoids global state)
- add Arc<FishHashContext>
- single dataset shared via Arc::clone() across all consensus components

- split fn lookup into lookup and init_context for better readability
- moved build_light_cache and calculate_dataset_item_1024 out of impl PowFishHash because they are standalone functions
- renamed prebuild_dataset to prebuild_full_dataset
- made seed raw [u8; 32] and passed seed parameter to build_light_cache (in scenario that it needs to be changed in the future)

- moved struct def to it's impl blocks
- create FishHashContext struct
- reorganize hash types

- slight refactor on fishhash arg describtion
- log total pp level validation time
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.

1 participant