ratio1 3.4.86__py3-none-any.whl → 3.4.88__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ratio1/_ver.py CHANGED
@@ -1,4 +1,4 @@
1
- __VER__ = "3.4.86"
1
+ __VER__ = "3.4.88"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
@@ -24,7 +24,7 @@ from ..bc import DefaultBlockEngine, _DotDict, EE_VPN_IMPL
24
24
  from ..const import (
25
25
  COMMANDS, ENVIRONMENT, HB, PAYLOAD_DATA, STATUS_TYPE,
26
26
  PLUGIN_SIGNATURES, DEFAULT_PIPELINES,
27
- BLOCKCHAIN_CONFIG, SESSION_CT, NET_CONFIG
27
+ BLOCKCHAIN_CONFIG, SESSION_CT, NET_CONFIG,
28
28
  )
29
29
  from ..const import comms as comm_ct
30
30
  from ..const import DEEPLOY_CT
@@ -993,7 +993,7 @@ class GenericSession(BaseDecentrAIObject):
993
993
  sender_addr: str,
994
994
  ):
995
995
  """
996
- This method processes the net-mon messages received from the communication
996
+ This method processes the net-mon (NETMON) messages received from the communication
997
997
  channel.
998
998
  """
999
999
  REQUIRED_PIPELINE = DEFAULT_PIPELINES.ADMIN_PIPELINE
@@ -1007,8 +1007,12 @@ class GenericSession(BaseDecentrAIObject):
1007
1007
  ee_id = dict_msg.get(PAYLOAD_DATA.EE_ID, None)
1008
1008
  current_network = dict_msg.get(PAYLOAD_DATA.NETMON_CURRENT_NETWORK, {})
1009
1009
  if current_network:
1010
- # received valid netmon current network
1011
-
1010
+ # received valid netmon current network
1011
+ if self._eth_enabled:
1012
+ dct_msg = PAYLOAD_DATA.maybe_convert_netmon_whitelist(dict_msg)
1013
+ current_network = dct_msg.get(PAYLOAD_DATA.NETMON_CURRENT_NETWORK, {})
1014
+ # end if eth enabled
1015
+
1012
1016
  # first we record the second of the minute
1013
1017
  second_bin = self.log.second_of_minute()
1014
1018
  self._netmon_second_bins[second_bin] += 1
ratio1/const/payload.py CHANGED
@@ -208,13 +208,36 @@ class PAYLOAD_DATA:
208
208
  NETMON_LAST_SEEN = 'last_seen_sec'
209
209
  NETMON_IS_SUPERVISOR = 'is_supervisor'
210
210
  NETMON_WHITELIST = 'whitelist'
211
+ NETMON_WHITELIST_MAP = 'whitelist_map'
211
212
  NETMON_NODE_SECURED = 'secured'
212
213
  NETMON_NODE_VERSION = 'version'
213
214
  NETMON_NODE_R1FS_ID = 'r1fs_id'
214
215
  NETMON_NODE_R1FS_ONLINE = 'r1fs_online'
215
216
  NETMON_NODE_R1FS_RELAY = 'r1fs_relay'
216
217
 
217
-
218
+ @staticmethod
219
+ def maybe_convert_netmon_whitelist(full_payload : dict) -> dict:
220
+ """
221
+ This function will convert each node individual whitelist from the compressed index-based
222
+ version to the full address version if needed (EVM-based implementations only).
223
+ """
224
+ current_network = full_payload.get(PAYLOAD_DATA.NETMON_CURRENT_NETWORK, {})
225
+ dct_whitelist = full_payload.get(PAYLOAD_DATA.NETMON_WHITELIST_MAP, {})
226
+ if len(dct_whitelist) == 0:
227
+ return full_payload
228
+ # now lets decompress the whitelists
229
+ dct_idx_to_addr = {str(v): k for k, v in dct_whitelist.items()}
230
+ for node_info in current_network.values():
231
+ wl_indexes = node_info.get(PAYLOAD_DATA.NETMON_WHITELIST, [])
232
+ if not isinstance(wl_indexes, list):
233
+ wl_indexes = []
234
+ full_wl = []
235
+ for idx in wl_indexes:
236
+ addr = dct_idx_to_addr.get(str(idx), None)
237
+ if addr is not None:
238
+ full_wl.append(addr)
239
+ node_info[PAYLOAD_DATA.NETMON_WHITELIST] = full_wl
240
+ return full_payload
218
241
 
219
242
 
220
243
  class NET_CONFIG:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ratio1
3
- Version: 3.4.86
3
+ Version: 3.4.88
4
4
  Summary: `ratio1` or Ration1 SDK is the Python SDK required for client app development for the Ratio1 ecosystem
5
5
  Project-URL: Homepage, https://github.com/Ratio1/ratio1_sdk
6
6
  Project-URL: Bug Tracker, https://github.com/Ratio1/ratio1_sdk/issues
@@ -1,10 +1,10 @@
1
1
  ratio1/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
2
- ratio1/_ver.py,sha256=t9VS_l6tDXEhA-DtdV11uCrCKusCG-cUF7zWnM9CF-E,331
2
+ ratio1/_ver.py,sha256=KBX4wRnlHrRWGTg3781atMEGfpsDqSshmos9h1nmjvU,331
3
3
  ratio1/base_decentra_object.py,sha256=iXvAAf6wPnGWzeeiRfwLojVoan-m1e_VsyPzjUQuENo,4492
4
4
  ratio1/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
5
5
  ratio1/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
6
6
  ratio1/base/distributed_custom_code_presets.py,sha256=cvz5R88P6Z5V61Ce1vHVVh8bOkgXd6gve_vdESDNAsg,2544
7
- ratio1/base/generic_session.py,sha256=KhSNXUP_jxN1y1e7D_V6okG3uyQ0r2n2FZJwbDq-a5g,187926
7
+ ratio1/base/generic_session.py,sha256=kTO5VIGQ4ZgGlN6JtZ82TGT9u-l-wX3s6JM__VtCwbU,188158
8
8
  ratio1/base/instance.py,sha256=oQvwzzRvir7851wyhDx_BwN6y_VgsNWwYo53vN33QI4,21914
9
9
  ratio1/base/pipeline.py,sha256=szoHrk1qBdY6NKPUk3tUTsJx3XzYp5C2GTOlzRiQi48,62489
10
10
  ratio1/base/plugin_template.py,sha256=Gs438cSkhvxPujE4CRH_32pcuZaVwI9kia8E4VDRpSU,138794
@@ -48,7 +48,7 @@ ratio1/const/evm_net.py,sha256=9is8Gx2_xtKlWRNAZTNAmmaA33c30xvpBT-zL4AtIuM,16774
48
48
  ratio1/const/formatter.py,sha256=AW3bWlqf39uaqV4BBUuW95qKYfF2OkkU4f9hy3kSVhM,200
49
49
  ratio1/const/heartbeat.py,sha256=Z_n87yI-L4vlBmlHZhkruysEJV5JVbXLQlGI26R42C4,3197
50
50
  ratio1/const/misc.py,sha256=VDCwwpf5bl9ltx9rzT2WPVP8B3mZFRufU1tSS5MO240,413
51
- ratio1/const/payload.py,sha256=0rzfC__amwAIeTA8WIVteohMDN5zbBg4txis57Qh0PM,6844
51
+ ratio1/const/payload.py,sha256=HvKcN6a0r1ma1IMuBYZpYne9zTuLO8_8_18XflndAXY,7910
52
52
  ratio1/const/plugins/deeploy_const.py,sha256=8QcIf7zo_gSC6SdHqQVecn4yOUKCPMXzHC9zgGW5-3E,13314
53
53
  ratio1/default/__init__.py,sha256=ozU6CMMuWl0LhG8Ae3LrZ65a6tLrptfscVYGf83zjxM,46
54
54
  ratio1/default/instance/__init__.py,sha256=JQiqTFm_U5__z4bTlvT033hUOSIDCtrQ-evMrhT6JdA,741
@@ -105,8 +105,8 @@ ratio1/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,10
105
105
  ratio1/utils/config.py,sha256=Elfkl7W4aDMvB5WZLiYlPXrecBncgTxb4hcKhQedMzI,10111
106
106
  ratio1/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
107
107
  ratio1/utils/oracle_sync/oracle_tester.py,sha256=aJOPcZhtbw1XPqsFG4qYpfv2Taj5-qRXbwJzrPyeXDE,27465
108
- ratio1-3.4.86.dist-info/METADATA,sha256=_Zr3blZF3PUgKWP19qEu_tLMOKRc4cySgEDtAVD-x2M,12255
109
- ratio1-3.4.86.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
110
- ratio1-3.4.86.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
111
- ratio1-3.4.86.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
112
- ratio1-3.4.86.dist-info/RECORD,,
108
+ ratio1-3.4.88.dist-info/METADATA,sha256=leT_mX54IZnC---M00RkaKIzkw5ixmVa3sIUdi_q-Hk,12255
109
+ ratio1-3.4.88.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
110
+ ratio1-3.4.88.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
111
+ ratio1-3.4.88.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
112
+ ratio1-3.4.88.dist-info/RECORD,,