Skip to content

Commit

Permalink
fix: override gas params
Browse files Browse the repository at this point in the history
  • Loading branch information
Divya-Solulab committed Nov 22, 2024
1 parent f49134e commit 7cbc1fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion run_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
"mode":"mode"
}
ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"
DEFAULT_MAX_FEE = 20000000
use_default_max_fee = True

def estimate_priority_fee(
web3_object: Web3,
Expand Down Expand Up @@ -394,7 +396,7 @@ def get_service_template(config: OptimusConfig) -> ServiceTemplate:
home_chain_id = "34443"
return ServiceTemplate({
"name": "Optimus",
"hash": "bafybeifokbnipvf4epclritybmfjteqpyqhdhtyrol65j75qq5cv47he2m",
"hash": "bafybeibwo7bduh67esoxw72ok2cn6qneog7sivb66i6rhhew3hqgbnn4fe",

"description": "Optimus",
"image": "https://gateway.autonolas.tech/ipfs/bafybeiaakdeconw7j5z76fgghfdjmsr6tzejotxcwnvmp3nroaw3glgyve",
Expand Down Expand Up @@ -572,10 +574,16 @@ def calculate_fund_requirement(rpc, fee_history_blocks: int, gas_amount: int, fe

def fetch_agent_fund_requirement(chain_id, rpc, fee_history_blocks: int = 500000) -> int:
gas_amount = 50_000_000
if use_default_max_fee:
return DEFAULT_MAX_FEE * gas_amount

return calculate_fund_requirement(rpc, fee_history_blocks, gas_amount)

def fetch_operator_fund_requirement(chain_id, rpc, fee_history_blocks: int = 500000) -> int:
gas_amount = 30_000_000
if use_default_max_fee:
return DEFAULT_MAX_FEE * gas_amount

return calculate_fund_requirement(rpc, fee_history_blocks, gas_amount)

def main() -> None:
Expand Down

0 comments on commit 7cbc1fb

Please sign in to comment.