Repository: oceanprotocol/ocean.py (language: python)

Issue:
Use or drop config GAS_LIMIT
Pending discussion:
I have noticed that the GAS_LIMIT option inside the config was not actually used in gas calculations. I suggest we either work it into the calculation some way, or drop it from the config dict.

_Originally posted by @calina-c in https://github.com/oceanprotocol/ocean.py/issues/953#issuecomment-1254710160_


Discussion / hints:
Let's drop it.

(There are good args for this from a pure sw eng perspective, and from an EVM perspective)

Fix patch:
diff --git a/ocean_lib/example_config.py b/ocean_lib/example_config.py
index 7bce9282e..3efbc9be9 100644
--- a/ocean_lib/example_config.py
+++ b/ocean_lib/example_config.py
@@ -9,7 +9,6 @@
 from enforce_typing import enforce_types
 
 from ocean_lib.ocean.util import get_web3
-from ocean_lib.web3_internal.constants import GAS_LIMIT_DEFAULT
 
 logging.basicConfig(level=logging.INFO)
 
@@ -20,7 +19,6 @@
 config_defaults = {
     "RPC_URL": "http://127.0.0.1:8545",
     "CHAIN_ID": 8996,
-    "GAS_LIMIT": GAS_LIMIT_DEFAULT,
     "BLOCK_CONFIRMATIONS": 0,
     "TRANSACTION_TIMEOUT": 10 * 60,  # 10 minutes
     "METADATA_CACHE_URI": "http://172.15.0.5:5000",


Test patch:
diff --git a/ocean_lib/test/test_config.py b/ocean_lib/test/test_config.py
index ec26c7816..bc97f092e 100644
--- a/ocean_lib/test/test_config.py
+++ b/ocean_lib/test/test_config.py
@@ -8,7 +8,6 @@
 
 from ocean_lib.ocean.ocean import Ocean
 from ocean_lib.ocean.util import GANACHE_URL
-from ocean_lib.web3_internal.constants import GAS_LIMIT_DEFAULT
 
 
 @pytest.mark.unit
@@ -19,7 +18,6 @@ def test_metadataCacheUri_config_key():
         "METADATA_CACHE_URI": "http://ItWorked.com",
         "RPC_URL": GANACHE_URL,
         "CHAIN_ID": 8996,
-        "GAS_LIMIT": GAS_LIMIT_DEFAULT,
         "BLOCK_CONFIRMATIONS": 0,
         "TRANSACTION_TIMEOUT": 10 * 60,  # 10 minutes
         "PROVIDER_URL": "http://172.15.0.4:8030",
diff --git a/tests/integration/remote/test_mumbai.py b/tests/integration/remote/test_mumbai.py
index e8a87dcfd..398ce86b9 100644
--- a/tests/integration/remote/test_mumbai.py
+++ b/tests/integration/remote/test_mumbai.py
@@ -11,7 +11,6 @@
 import requests
 
 from ocean_lib.ocean.ocean import Ocean
-from ocean_lib.web3_internal.constants import GAS_LIMIT_DEFAULT
 from ocean_lib.web3_internal.wallet import Wallet
 
 
@@ -114,7 +113,6 @@ def _remote_config(tmp_path):
         "TRANSACTION_TIMEOUT": 60,
         "METADATA_CACHE_URI": "https://v4.aquarius.oceanprotocol.com",
         "PROVIDER_URL": "https://v4.provider.mumbai.oceanprotocol.com",
-        "GAS_LIMIT": GAS_LIMIT_DEFAULT,
         "CHAIN_ID": 80001,
         "DOWNLOADS_PATH": "consume-downloads",
     }