bevy/crates/bevy_reflect/src
Johan Klokkhammer Helsing 18cfb226db Use a fixed state hasher in bevy_reflect for deterministic Reflect::reflect_hash() across processes (#7583)
# Objective

- bevy_ggrs uses `reflect_hash` in order to produce checksums for its world snapshots. These checksums are sent between clients in order to detect desyncronization.
- However, since we currently use `async::AHasher` with the `std` feature, this means that hashes will always be different for different peers, even if the state is identical.
- This means bevy_ggrs needs a way to get a deterministic (fixed) hash.

## Solution

- ~~Add a feature to use `bevy_utils::FixedState` for the hasher used by bevy_reflect.~~
- Always use `bevy_utils::FixedState` for initializing the bevy_reflect hasher. 

---

## Changelog

- bevy_reflect now uses a fixed state for its hasher, which means the output of `Reflect::reflect_hash` is now deterministic across processes.
2023-02-17 15:37:35 +00:00
..
enums Use a fixed state hasher in bevy_reflect for deterministic Reflect::reflect_hash() across processes (#7583) 2023-02-17 15:37:35 +00:00
impls Use a fixed state hasher in bevy_reflect for deterministic Reflect::reflect_hash() across processes (#7583) 2023-02-17 15:37:35 +00:00
serde Fix beta clippy lints (#7154) 2023-01-11 09:51:22 +00:00
array.rs Use a fixed state hasher in bevy_reflect for deterministic Reflect::reflect_hash() across processes (#7583) 2023-02-17 15:37:35 +00:00
fields.rs bevy_reflect: Reflect doc comments (#6234) 2022-10-18 13:49:57 +00:00
from_reflect.rs bevy_reflect: Simplify take-or-else-from_reflect operation (#6566) 2023-01-11 16:25:37 +00:00
lib.rs implement TypeUuid for primitives and fix multiple-parameter generics having the same TypeUuid (#6633) 2023-02-16 17:09:44 +00:00
list.rs Use a fixed state hasher in bevy_reflect for deterministic Reflect::reflect_hash() across processes (#7583) 2023-02-17 15:37:35 +00:00
map.rs Add remove method to Map reflection trait. (#6564) 2022-11-14 21:03:39 +00:00
path.rs bevy_reflect: Support tuple reflection paths (#7324) 2023-02-06 21:22:45 +00:00
reflect.rs Use a fixed state hasher in bevy_reflect for deterministic Reflect::reflect_hash() across processes (#7583) 2023-02-17 15:37:35 +00:00
std_traits.rs fix nightly clippy warnings (#6395) 2022-10-28 21:03:01 +00:00
struct_trait.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
tuple.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
tuple_struct.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
type_info.rs bevy_reflect: Add Reflect::into_reflect (#6502) 2022-11-07 02:11:16 +00:00
type_registry.rs Add safe constructors for untyped pointers Ptr and PtrMut (#6539) 2022-11-14 22:53:50 +00:00
type_uuid.rs implement TypeUuid for primitives and fix multiple-parameter generics having the same TypeUuid (#6633) 2023-02-16 17:09:44 +00:00
type_uuid_impl.rs implement TypeUuid for primitives and fix multiple-parameter generics having the same TypeUuid (#6633) 2023-02-16 17:09:44 +00:00
utility.rs Use a fixed state hasher in bevy_reflect for deterministic Reflect::reflect_hash() across processes (#7583) 2023-02-17 15:37:35 +00:00