Browse Source

fix(fortuna): Manual eip1559 as the automatic version buggy (#1604)

Amin Moghaddam 1 year ago
parent
commit
81e51931ad

+ 1 - 1
apps/fortuna/Cargo.lock

@@ -1488,7 +1488,7 @@ dependencies = [
 
 [[package]]
 name = "fortuna"
-version = "5.4.4"
+version = "5.4.5"
 dependencies = [
  "anyhow",
  "axum",

+ 1 - 1
apps/fortuna/Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name    = "fortuna"
-version = "5.4.4"
+version = "5.4.5"
 edition = "2021"
 
 [dependencies]

+ 1 - 6
apps/fortuna/src/chain/ethereum.rs

@@ -102,15 +102,10 @@ impl SignablePythContract {
     ) -> Result<SignablePythContract> {
         let provider = Provider::<Http>::try_from(&chain_config.geth_rpc_addr)?;
         let chain_id = provider.get_chainid().await?;
-        let eip1559_supported = match provider.estimate_eip1559_fees(None).await {
-            Ok((max_fee, max_priority_fee)) => !max_fee.is_zero() && !max_priority_fee.is_zero(),
-            Err(_) => false,
-        };
         let gas_oracle = EthProviderOracle::new(provider.clone());
         let transformer = LegacyTxTransformer {
-            use_legacy_tx: !eip1559_supported,
+            use_legacy_tx: chain_config.legacy_tx,
         };
-
         let wallet__ = private_key
             .parse::<LocalWallet>()?
             .with_chain_id(chain_id.as_u64());

+ 4 - 0
apps/fortuna/src/config.rs

@@ -153,6 +153,10 @@ pub struct EthereumConfig {
     #[serde(default)]
     pub confirmed_block_status: BlockStatus,
 
+    /// Use the legacy transaction format (for networks without EIP 1559)
+    #[serde(default)]
+    pub legacy_tx: bool,
+
     /// The gas limit to use for entropy callback transactions.
     pub gas_limit: u64,
 }