From 1c825215d1fcbf4699dab24190005e72a7cc83c3 Mon Sep 17 00:00:00 2001 From: ZhAnGeek Date: Fri, 8 Nov 2024 09:21:14 +0800 Subject: [PATCH] fix: precompile issue for risv32 bytes len array --- crates/precompile/src/cometbft.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/precompile/src/cometbft.rs b/crates/precompile/src/cometbft.rs index a76187e3..98db6a72 100644 --- a/crates/precompile/src/cometbft.rs +++ b/crates/precompile/src/cometbft.rs @@ -408,7 +408,7 @@ fn encode_light_block_validation_result( let mut output = vec![0; (VALIDATE_RESULT_METADATA_LENGTH + consensus_state_bytes.len() as u64) as usize]; output[0] = if validator_set_changed { 1 } else { 0 }; - output[24..32].copy_from_slice(consensus_state_bytes.len().to_be_bytes().as_ref()); + output[24..32].copy_from_slice((consensus_state_bytes.len() as u64).to_be_bytes().as_ref()); output[32..].copy_from_slice(consensus_state_bytes.as_ref()); Bytes::from(output) }