@@ -97,70 +97,33 @@ pub async fn step_args_from_finality_update<S: Spec, T: EthSpec>(
97
97
} )
98
98
. collect_vec ( ) ;
99
99
100
- let ( execution_payload_root, execution_payload_branch, finalized_beacon_body_root) =
101
- match finality_update {
102
- LightClientFinalityUpdate :: Altair ( _) => unimplemented ! ( ) ,
103
- LightClientFinalityUpdate :: Capella ( ref header) => {
104
- let finalized_header = & header. finalized_header ;
105
-
106
- (
107
- finalized_header. execution . tree_hash_root ( ) . 0 . to_vec ( ) ,
108
- finalized_header
109
- . execution_branch
110
- . iter ( )
111
- . map ( |n| n. 0 . to_vec ( ) )
112
- . collect_vec ( ) ,
113
- finalized_header. beacon . body_root ,
114
- )
115
- }
116
- LightClientFinalityUpdate :: Deneb ( ref header) => {
117
- let finalized_header = & header. finalized_header ;
100
+ let ( execution_payload_root, execution_payload_branch) = match finality_update {
101
+ LightClientFinalityUpdate :: Altair ( _) => unimplemented ! ( ) ,
102
+ LightClientFinalityUpdate :: Capella ( ref header) => {
103
+ let finalized_header = & header. finalized_header ;
118
104
119
- (
120
- finalized_header. execution . tree_hash_root ( ) . 0 . to_vec ( ) ,
121
- finalized_header
122
- . execution_branch
123
- . iter ( )
124
- . map ( |n| n. 0 . to_vec ( ) )
125
- . collect_vec ( ) ,
126
- finalized_header . beacon . body_root ,
127
- )
128
- }
129
- } ;
105
+ (
106
+ finalized_header. execution . tree_hash_root ( ) . 0 . to_vec ( ) ,
107
+ finalized_header
108
+ . execution_branch
109
+ . iter ( )
110
+ . map ( |n| n. 0 . to_vec ( ) )
111
+ . collect_vec ( ) ,
112
+ )
113
+ }
114
+ LightClientFinalityUpdate :: Deneb ( ref header ) => {
115
+ let finalized_header = & header . finalized_header ;
130
116
131
- assert ! (
132
- merkle_proof:: verify_merkle_proof(
133
- Hash256 :: from_slice( & execution_payload_root) ,
134
- & execution_payload_branch
135
- . iter( )
136
- . map( |n| Hash256 :: from_slice( n) )
137
- . collect_vec( ) ,
138
- S :: EXECUTION_STATE_ROOT_DEPTH ,
139
- S :: EXECUTION_STATE_ROOT_INDEX ,
140
- finalized_beacon_body_root,
141
- ) ,
142
- "Execution payload merkle proof verification failed"
143
- ) ;
144
- // assert!(
145
- // merkle_proof::verify_merkle_proof(
146
- // finality_update
147
- // .finalized_header
148
- // .beacon
149
- // .clone()
150
- // .hash_tree_root()
151
- // .unwrap(),
152
- // &finality_update
153
- // .finality_branch
154
- // .iter()
155
- // .map(|n| n.as_ref())
156
- // .collect_vec(),
157
- // S::FINALIZED_HEADER_DEPTH,
158
- // S::FINALIZED_HEADER_INDEX,
159
- // finality_update.attested_header.beacon.state_root,
160
- // )
161
- // .is_ok(),
162
- // "Finality merkle proof verification failed"
163
- // );
117
+ (
118
+ finalized_header. execution . tree_hash_root ( ) . 0 . to_vec ( ) ,
119
+ finalized_header
120
+ . execution_branch
121
+ . iter ( )
122
+ . map ( |n| n. 0 . to_vec ( ) )
123
+ . collect_vec ( ) ,
124
+ )
125
+ }
126
+ } ;
164
127
165
128
let attested_header_beacon = match & finality_update {
166
129
LightClientFinalityUpdate :: Altair ( _) => unimplemented ! ( ) ,
@@ -176,6 +139,30 @@ pub async fn step_args_from_finality_update<S: Spec, T: EthSpec>(
176
139
LightClientFinalityUpdate :: Deneb ( update) => update. finalized_header . beacon . clone ( ) ,
177
140
} ;
178
141
142
+ assert ! (
143
+ merkle_proof:: verify_merkle_proof(
144
+ Hash256 :: from_slice( & execution_payload_root) ,
145
+ & execution_payload_branch
146
+ . iter( )
147
+ . map( |n| Hash256 :: from_slice( n) )
148
+ . collect_vec( ) ,
149
+ S :: EXECUTION_STATE_ROOT_DEPTH ,
150
+ S :: EXECUTION_STATE_ROOT_INDEX ,
151
+ finalized_header_beacon. body_root,
152
+ ) ,
153
+ "Execution payload merkle proof verification failed"
154
+ ) ;
155
+ assert ! (
156
+ merkle_proof:: verify_merkle_proof(
157
+ finalized_header_beacon. tree_hash_root( ) ,
158
+ & finality_update. finality_branch( ) ,
159
+ S :: FINALIZED_HEADER_DEPTH ,
160
+ S :: FINALIZED_HEADER_INDEX ,
161
+ attested_header_beacon. state_root,
162
+ ) ,
163
+ "Finality merkle proof verification failed"
164
+ ) ;
165
+
179
166
Ok ( SyncStepArgs {
180
167
signature_compressed : finality_update
181
168
. sync_aggregate ( )
0 commit comments