Skip to content

Commit 91fd461

Browse files
committed
fix gas price 3
1 parent a8c9677 commit 91fd461

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

dkg/providers/blockchain/async_blockchain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ async def fetch_gas_price(oracle_url: str) -> Wei | None:
191191
else:
192192
return None
193193

194-
# Ensure minimum gas price (1 gwei = 1,000,000,000 wei)
195-
min_gas_price = self.w3.to_wei(1, "gwei")
194+
# Ensure minimum gas price (2 gwei = 2,000,000,000 wei)
195+
min_gas_price = self.w3.to_wei(2, "gwei")
196196
if gas_price < min_gas_price:
197197
print(f"⚠️ Gas price from oracle too low ({gas_price} wei), using minimum ({min_gas_price} wei)")
198198
return min_gas_price
@@ -214,14 +214,14 @@ async def fetch_gas_price(oracle_url: str) -> Wei | None:
214214
# Fallback: use network gas price with minimum
215215
try:
216216
network_gas_price = await self.w3.eth.gas_price
217-
min_gas_price = self.w3.to_wei(1, "gwei")
217+
min_gas_price = self.w3.to_wei(2, "gwei")
218218
if network_gas_price < min_gas_price:
219219
print(f"⚠️ Network gas price too low ({network_gas_price} wei), using minimum ({min_gas_price} wei)")
220220
return min_gas_price
221221
return network_gas_price
222222
except Exception:
223223
# Final fallback: return minimum gas price
224-
return self.w3.to_wei(1, "gwei")
224+
return self.w3.to_wei(2, "gwei")
225225

226226
async def _init_contracts(self):
227227
init_tasks = []

dkg/providers/blockchain/blockchain.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ def fetch_gas_price(oracle_url: str) -> Wei | None:
176176
else:
177177
return None
178178

179-
# Ensure minimum gas price (1 gwei = 1,000,000,000 wei)
180-
min_gas_price = self.w3.to_wei(1, "gwei")
179+
# Ensure minimum gas price (2 gwei = 2,000,000,000 wei)
180+
min_gas_price = self.w3.to_wei(2, "gwei")
181181
if gas_price < min_gas_price:
182182
print(f"⚠️ Gas price from oracle too low ({gas_price} wei), using minimum ({min_gas_price} wei)")
183183
return min_gas_price
@@ -199,14 +199,14 @@ def fetch_gas_price(oracle_url: str) -> Wei | None:
199199
# Fallback: use network gas price with minimum
200200
try:
201201
network_gas_price = self.w3.eth.gas_price
202-
min_gas_price = self.w3.to_wei(1, "gwei")
202+
min_gas_price = self.w3.to_wei(2, "gwei")
203203
if network_gas_price < min_gas_price:
204204
print(f"⚠️ Network gas price too low ({network_gas_price} wei), using minimum ({min_gas_price} wei)")
205205
return min_gas_price
206206
return network_gas_price
207207
except Exception:
208208
# Final fallback: return minimum gas price
209-
return self.w3.to_wei(1, "gwei")
209+
return self.w3.to_wei(2, "gwei")
210210

211211
def _init_contracts(self):
212212
for contract in self.abi.keys():

0 commit comments

Comments
 (0)