Increase spark mint tx size limit up to 250kb
What changed, and why it matters
This commit increases the maximum allowed transaction size/weight for Spark mint transactions in the Stack Wallet app from 400,000 weight units to 1,000,000 weight units (effectively raising the size cap from roughly 100 KB to 250 KB). It is a configuration change that aligns the wallet with a recent Firo protocol update. There is no direct evidence in the commit that this fixes an exploitable vulnerability; it appears to be a compatibility/functional update to allow larger valid Spark mint transactions.
Treat as a routine protocol-compatibility update. Review whether 1,000,000 weight units matches the current Firo consensus limit and ensure fee calculations and UI messaging remain accurate for larger transactions. No urgent security action is indicated by the diff alone.
Security signals we found
Transaction-size limit constant changed
Reference to upstream Firo protocol change (PR #1457)
No input validation, cryptographic, or authorization changes
No memory-unsafe or secret-handling code modified
Evidence from the diff
The change replaces the constant MAX_STANDARD_TX_WEIGHT (400,000) with MAX_NEW_TX_WEIGHT (1,000,000) and updates the single check that throws if a dummy Spark mint transaction’s weight exceeds the limit. The commit message and added comment reference a Firo pull request (#1457) that raised the network’s transaction-size limit. The patch is minimal and only affects local transaction construction validation in the Dart wallet interface.
Changed components
lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dartInspect captured patch +3 / −2
diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart
index 5e1560f..138b58d 100644
--- a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart
+++ b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart
@@ -39,7 +39,8 @@ import 'electrumx_interface.dart';
const kDefaultSparkIndex = 1;
// TODO dart style constants. Maybe move to spark lib?
-const MAX_STANDARD_TX_WEIGHT = 400000;
+// https://github.com/firoorg/firo/pull/1457/files#diff-1fc0f6b5081e8ed5dfa8bf230744ad08cc6f4c1147e98552f1f424b0492fe9bdR28
+const MAX_NEW_TX_WEIGHT = 1000000;
//https://github.com/firoorg/sparkmobile/blob/ef2e39aae18ecc49e0ddc63a3183e9764b96012e/include/spark.h#L16
const SPARK_OUT_LIMIT_PER_TX = 16;
@@ -1734,7 +1735,7 @@ mixin SparkInterface<T extends ElectrumXCurrencyInterface>
final dummyTx = dummyTxb.build();
final nBytes = dummyTx.virtualSize();
- if (dummyTx.weight() > MAX_STANDARD_TX_WEIGHT) {
+ if (dummyTx.weight() > MAX_NEW_TX_WEIGHT) {
throw Exception("Transaction too large");
}
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.