Skip to content

Commit 1cad729

Browse files
author
avilagaston9
committed
Fail early if deploy_tdx_contracts returns a zero address instead of
silently proceeding with initialization, which would cause a confusing revert downstream.
1 parent 9dfc2ea commit 1cad729

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

cmd/ethrex/l2/deployer.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,11 @@ async fn deploy_contracts(
914914
None if opts.tdx => {
915915
info!("Deploying TDXVerifier (if tdx_deploy_verifier is true)");
916916
let tdx_verifier_address = deploy_tdx_contracts(opts, tdx_controller_address)?;
917+
if tdx_verifier_address == Address::zero() {
918+
return Err(DeployerError::InternalError(
919+
"TDX verifier deployment returned zero address".to_string(),
920+
));
921+
}
917922

918923
info!(address = %format!("{tdx_verifier_address:#x}"), "TDXVerifier deployed");
919924
tdx_verifier_address

0 commit comments

Comments
 (0)