-
Notifications
You must be signed in to change notification settings - Fork 175
Description
Description
cast mktx (crates/cast/src/cmd/mktx/zksync.rs) calls ZksyncProvider::estimate_fee directly instead of foundry_zksync_core::estimate_fee. This causes two gaps:
-
gas_per_pubdatanot set from estimate — when the user does not pass--zk-gas-per-pubdata,gas_per_pubdatais never populated from the RPC estimate response (fee.gas_per_pubdata_limit). All other commands (cast send,forge create,script broadcast) fall back to the estimate value viafoundry_zksync_core::estimate_fee. -
No gas limit multiplier —
cast mktxuses the rawfee.gas_limitinstead of applying the 130% safety multiplier thatfoundry_zksync_core::estimate_feeapplies.
Note: when the user does pass --zk-gas-per-pubdata, the value is correctly set in build_zk_tx and is not overwritten, so the CLI flag works in that case.
Current code
let fee = ZksyncProvider::estimate_fee(&zk_provider, tx.clone()).await?;
tx.set_max_fee_per_gas(fee.max_fee_per_gas);
tx.set_max_priority_fee_per_gas(fee.max_priority_fee_per_gas);
tx.set_gas_limit(fee.gas_limit);Suggested fix
Replace the manual fee handling with the shared helper:
foundry_zksync_core::estimate_fee(&mut tx, &zk_provider, 130, zk_tx.gas_per_pubdata).await?;Related
- fix: cast send ignores --zk-gas-per-pubdata flag #1274 same class of bug in
cast send(fixed)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status