Skip to content

Commit

Permalink
EVM: precompile actor_type error (#1034)
Browse files Browse the repository at this point in the history
precompile revert instead of succeeding with nothing if input is invalid.
  • Loading branch information
mriise authored Jan 13, 2023
1 parent e8a4798 commit 93aab43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion actors/evm/src/interpreter/precompiles/fvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ pub(super) fn get_actor_type<RT: Runtime>(
let id_bytes: [u8; 32] = right_pad(input, 32)[..32].as_ref().try_into().unwrap();
let id = match Parameter::<u64>::try_from(&id_bytes) {
Ok(id) => id.0,
Err(_) => return Ok(Vec::new()),
Err(_) => {
log::debug!(target: "evm", "ID address parsing failed: {}", hex::encode(id_bytes));
return Err(PrecompileError::InvalidInput);
}
};

// resolve type from code CID
Expand Down

0 comments on commit 93aab43

Please sign in to comment.