Skip to content

Commit 5b721a6

Browse files
authored
Merge pull request #324 from lidofinance/feature/orc-526-fix-bug-in-depositor-metrics
feat: export gas metrics in basic checks
2 parents 11b67ea + ec0cc79 commit 5b721a6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/bots/depositor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,9 @@ def _get_preferred_to_deposit_modules(self) -> list[int]:
267267
# gather quorum
268268
now = datetime.now()
269269
for module_id in module_ids:
270+
# Just for metrics
271+
self._select_strategy(module_id).is_gas_price_ok(module_id)
272+
270273
if self._get_quorum(module_id):
271274
self._module_last_heart_beat[module_id] = now
272275

@@ -284,6 +287,7 @@ def _get_preferred_to_deposit_modules(self) -> list[int]:
284287
# take all the modules in sorted order until the first healthy one(including)
285288
result = self._take_until_first_healthy_module(modules_healthiness)
286289
logger.info({'msg': f'Module iteration order {result}.'})
290+
287291
return result
288292

289293
def _is_module_healthy(self, module_id: int) -> bool:

tests/bots/test_depositor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_get_preferred_to_deposit_modules(self, mock_datetime):
4848
[0, 0, [3], [10, 16]], # Module 3: 6 active validators
4949
]
5050
self.bot._get_quorum = Mock()
51+
self.bot._select_strategy = Mock()
5152

5253
# Mock module healthiness and quorum
5354
# Module ID: 2 1 3
@@ -171,6 +172,7 @@ def test_depositor_one_module_deposited(depositor_bot, block_data):
171172
(0, 0, (2,), (0, 10, 10)),
172173
]
173174
)
175+
depositor_bot._general_strategy.is_gas_price_ok = Mock(return_value=True)
174176
depositor_bot._general_strategy.deposited_keys_amount = Mock(return_value=10)
175177
depositor_bot._check_balance = Mock()
176178
depositor_bot._deposit_to_module = Mock(return_value=True)

0 commit comments

Comments
 (0)