@@ -37,8 +37,6 @@ pub unsafe fn submit_block_signatures_impl(
3737 in_encrypted_random_len : u32 ,
3838 decrypted_random : & mut [ u8 ; 32 ] ,
3939 next_validator_set_evidence : & mut [ u8 ; 32 ] ,
40- in_cron_msgs : * const u8 ,
41- in_cron_msgs_len : u32 ,
4240) -> sgx_status_t {
4341 if let Err ( e) = validate_inputs (
4442 in_header,
@@ -64,12 +62,6 @@ pub unsafe fn submit_block_signatures_impl(
6462 & [ ]
6563 } ;
6664
67- let cron_msgs_slice = if in_cron_msgs_len != 0 && !in_cron_msgs. is_null ( ) {
68- slice:: from_raw_parts ( in_cron_msgs, in_cron_msgs_len as usize )
69- } else {
70- & [ ]
71- } ;
72-
7365 let ( validator_set, height) = {
7466 let extra = KEY_MANAGER . extra_data . lock ( ) . unwrap ( ) ;
7567 let validator_set = match extra. decode_validator_set ( ) {
@@ -94,55 +86,13 @@ pub unsafe fn submit_block_signatures_impl(
9486
9587 let txs = unwrap_or_return ! ( crate :: verify:: txs:: validate_txs( txs_slice, & header) ) ;
9688
97- let cron_msgs = if !cron_msgs_slice. is_empty ( ) {
98- let msgs = crate :: txs:: txs_from_bytes ( cron_msgs_slice) . map_err ( |e| {
99- error ! ( "Error parsing cron msgs from proto: {:?}" , e) ;
100- sgx_status_t:: SGX_ERROR_INVALID_PARAMETER
101- } ) ;
102- if msgs. is_err ( ) {
103- error ! ( "Error parsing cron msgs from proto: {:?}" , msgs) ;
104- return sgx_status_t:: SGX_ERROR_INVALID_PARAMETER ;
105- }
106- Some ( msgs. unwrap ( ) )
107- } else {
108- None
109- } ;
110-
11189 let mut message_verifier = VERIFIED_BLOCK_MESSAGES . lock ( ) . unwrap ( ) ;
11290
11391 if message_verifier. remaining ( ) != 0 {
11492 // new block, clear messages
11593 message_verifier. clear ( ) ;
11694 }
11795
118- if let Some ( implicit_hash_val) = header. header . implicit_hash {
119- let mut hasher = Sha256 :: new ( ) ;
120- hasher. update ( cron_msgs_slice) ;
121- let hash_result = hasher. finalize ( ) ;
122- let hash_result: [ u8 ; 32 ] = hash_result. into ( ) ;
123-
124- let implicit_hash = tendermint:: Hash :: Sha256 ( hash_result) ;
125-
126- if implicit_hash != implicit_hash_val {
127- error ! ( "Implicit hash does not match header implicit hash" ) ;
128- return sgx_status_t:: SGX_ERROR_INVALID_PARAMETER ;
129- }
130- } else if !cron_msgs_slice. is_empty ( ) {
131- error ! ( "Implicit hash not specified, yet implicit msgs provided" ) ;
132- return sgx_status_t:: SGX_ERROR_INVALID_PARAMETER ;
133- }
134-
135- if let Some ( cron_msgs) = cron_msgs {
136- for msg in cron_msgs {
137- let parsed_cron_msg = unwrap_or_return ! ( tx_from_bytes( msg. as_slice( ) ) . map_err( |_| {
138- error!( "Unable to parse tx bytes from proto" ) ;
139- sgx_status_t:: SGX_ERROR_INVALID_PARAMETER
140- } ) ) ;
141-
142- message_verifier. append_msg_from_tx ( parsed_cron_msg) ;
143- }
144- }
145-
14696 for tx in txs. iter ( ) {
14797 // doing this a different way makes the code unreadable or requires creating a copy of
14898
0 commit comments