diff --git a/consensus/types/src/attestation.rs b/consensus/types/src/attestation.rs index 194c44b8671..534a905780a 100644 --- a/consensus/types/src/attestation.rs +++ b/consensus/types/src/attestation.rs @@ -42,13 +42,13 @@ pub enum Error { #[derivative(PartialEq, Hash(bound = "E: EthSpec"))] #[serde(bound = "E: EthSpec")] #[arbitrary(bound = "E: EthSpec")] -#[tree_hash(struct_behaviour = "profile", max_fields = "typenum::U8")] +//#[tree_hash(struct_behaviour = "profile", max_fields = "typenum::U8")] pub struct Attestation { - #[tree_hash(stable_index = 0)] + //#[tree_hash(stable_index = 0)] pub aggregation_bits: BitList, - #[tree_hash(stable_index = 1)] + //#[tree_hash(stable_index = 1)] pub data: AttestationData, - #[tree_hash(stable_index = 2)] + //#[tree_hash(stable_index = 2)] pub signature: AggregateSignature, } diff --git a/consensus/types/src/attester_slashing.rs b/consensus/types/src/attester_slashing.rs index 6cf3d3cc464..5f090a4baa9 100644 --- a/consensus/types/src/attester_slashing.rs +++ b/consensus/types/src/attester_slashing.rs @@ -28,11 +28,11 @@ use tree_hash_derive::TreeHash; #[derivative(PartialEq, Eq, Hash(bound = "E: EthSpec"))] #[serde(bound = "E: EthSpec")] #[arbitrary(bound = "E: EthSpec")] -#[tree_hash(struct_behaviour = "profile", max_fields = "typenum::U8")] +//#[tree_hash(struct_behaviour = "profile", max_fields = "typenum::U8")] pub struct AttesterSlashing { - #[tree_hash(stable_index = 0)] + //#[tree_hash(stable_index = 0)] pub attestation_1: IndexedAttestation, - #[tree_hash(stable_index = 1)] + //#[tree_hash(stable_index = 1)] pub attestation_2: IndexedAttestation, } diff --git a/consensus/types/src/beacon_block_body.rs b/consensus/types/src/beacon_block_body.rs index 82f9f385d3c..f5423d7ee3e 100644 --- a/consensus/types/src/beacon_block_body.rs +++ b/consensus/types/src/beacon_block_body.rs @@ -49,8 +49,11 @@ pub const BLOB_KZG_COMMITMENTS_INDEX: usize = 11; deny_unknown_fields ), arbitrary(bound = "E: EthSpec, Payload: AbstractExecPayload"), - tree_hash(struct_behaviour = "profile", max_fields = "typenum::U64"), ), + specific_variant_attributes(tree_hash( + struct_behaviour = "profile", + max_fields = "typenum::U64" + )), cast_error(ty = "Error", expr = "Error::IncorrectStateVariant"), partial_getter_error(ty = "Error", expr = "Error::IncorrectStateVariant") )] diff --git a/consensus/types/src/beacon_state.rs b/consensus/types/src/beacon_state.rs index 6bcb8b15461..e24f035d96f 100644 --- a/consensus/types/src/beacon_state.rs +++ b/consensus/types/src/beacon_state.rs @@ -224,7 +224,6 @@ impl From for Hash256 { serde(bound = "E: EthSpec", deny_unknown_fields), arbitrary(bound = "E: EthSpec"), derivative(Clone), - tree_hash(struct_behaviour = "profile", max_fields = "typenum::U128"), ), specific_variant_attributes( Base(metastruct( @@ -297,20 +296,27 @@ impl From for Hash256 { )), num_fields(all()), )), - Electra(metastruct( - mappings( - map_beacon_state_electra_fields(), - map_beacon_state_electra_tree_list_fields(mutable, fallible, groups(tree_lists)), - map_beacon_state_electra_tree_list_fields_immutable(groups(tree_lists)), + Electra( + metastruct( + mappings( + map_beacon_state_electra_fields(), + map_beacon_state_electra_tree_list_fields( + mutable, + fallible, + groups(tree_lists) + ), + map_beacon_state_electra_tree_list_fields_immutable(groups(tree_lists)), + ), + bimappings(bimap_beacon_state_electra_tree_list_fields( + other_type = "BeaconStateElectra", + self_mutable, + fallible, + groups(tree_lists) + )), + num_fields(all()), ), - bimappings(bimap_beacon_state_electra_tree_list_fields( - other_type = "BeaconStateElectra", - self_mutable, - fallible, - groups(tree_lists) - )), - num_fields(all()), - )) + tree_hash(struct_behaviour = "profile", max_fields = "typenum::U128") + ), ), cast_error(ty = "Error", expr = "Error::IncorrectStateVariant"), partial_getter_error(ty = "Error", expr = "Error::IncorrectStateVariant"), diff --git a/consensus/types/src/execution_payload.rs b/consensus/types/src/execution_payload.rs index 87f45311fbf..a4b85d28764 100644 --- a/consensus/types/src/execution_payload.rs +++ b/consensus/types/src/execution_payload.rs @@ -33,8 +33,11 @@ pub type Withdrawals = VariableList::MaxWithdrawal derivative(PartialEq, Hash(bound = "E: EthSpec")), serde(bound = "E: EthSpec", deny_unknown_fields), arbitrary(bound = "E: EthSpec"), - tree_hash(max_fields = "typenum::U64") ), + specific_variant_attributes(Electra(tree_hash( + struct_behaviour = "profile", + max_fields = "typenum::U64" + ))), cast_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant"), partial_getter_error(ty = "Error", expr = "BeaconStateError::IncorrectStateVariant"), map_into(FullPayload, BlindedPayload), diff --git a/consensus/types/src/execution_payload_header.rs b/consensus/types/src/execution_payload_header.rs index a2c7cf38796..e20e03e312e 100644 --- a/consensus/types/src/execution_payload_header.rs +++ b/consensus/types/src/execution_payload_header.rs @@ -26,8 +26,11 @@ use tree_hash_derive::TreeHash; derivative(PartialEq, Hash(bound = "E: EthSpec")), serde(bound = "E: EthSpec", deny_unknown_fields), arbitrary(bound = "E: EthSpec"), - tree_hash(max_fields = "typenum::U64") ), + specific_variant_attributes(Electra(tree_hash( + struct_behaviour = "profile", + max_fields = "typenum::U64" + ))), ref_attributes( derive(PartialEq, TreeHash, Debug), tree_hash(enum_behaviour = "transparent")