From f217ad9c688981a170401181efb06f02c5ae6dfb Mon Sep 17 00:00:00 2001 From: Divya-Solulab Date: Mon, 7 Oct 2024 14:16:42 +0530 Subject: [PATCH 1/2] fix: remove retries for status check --- packages/packages.json | 8 ++++---- .../valory/agents/optimus/aea-config.yaml | 4 ++-- packages/valory/services/optimus/service.yaml | 2 +- .../liquidity_trader_abci/behaviours.py | 19 ++++++++----------- .../skills/liquidity_trader_abci/skill.yaml | 2 +- .../valory/skills/optimus_abci/skill.yaml | 2 +- 6 files changed, 17 insertions(+), 20 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 2a9119c7..8594bd20 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -8,10 +8,10 @@ "contract/valory/merkl_distributor/0.1.0": "bafybeihaqsvmncuzmwv2r6iuzc5t7ur6ugdhephz7ydftypksjidpsylbq", "contract/valory/staking_token/0.1.0": "bafybeifrvtkofw5c26b3irm6izqfdpik6vpjhm6hqwcdzx333h6vhdanai", "contract/valory/staking_activity_checker/0.1.0": "bafybeibjzsi2r5b6xd4iwl4wbwldptnynryzsdpifym4mkv32ynswx22ou", - "skill/valory/liquidity_trader_abci/0.1.0": "bafybeiehcunbb5b5nbazahgham47ankof4ad52b4nmjlgornwdwagyotna", - "skill/valory/optimus_abci/0.1.0": "bafybeiex2jwrqzebrhrleczty3bzfurdkmhbbwg3wd4zfwmyravjntumk4", - "agent/valory/optimus/0.1.0": "bafybeig4dhq3ub6hnvromcfgezatybxujvaliape64jqtk24qldlk2vutq", - "service/valory/optimus/0.1.0": "bafybeige2z6ek4qictsutpyc4njfokrabvm3w7fffq343iltf5xssxzol4" + "skill/valory/liquidity_trader_abci/0.1.0": "bafybeif4g4dpoupdi634wvnll4w2adt6ifu2d4orplhmoevplhukv3yyhy", + "skill/valory/optimus_abci/0.1.0": "bafybeie3jxtlawtkpdcwj45pvz2x4vzm3xm7fjuf24gzz4c2qfecyarqlu", + "agent/valory/optimus/0.1.0": "bafybeiekjqvuxfux6cc7kw7elws6ezsmlokgd4w7xz6pjqb6zjni7itcma", + "service/valory/optimus/0.1.0": "bafybeid5mxngjnwv5sdsttcwnvrmg546rii7xpihhsh2bwncnzy5ygk62q" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/optimus/aea-config.yaml b/packages/valory/agents/optimus/aea-config.yaml index b6b4b3f7..37ec771f 100644 --- a/packages/valory/agents/optimus/aea-config.yaml +++ b/packages/valory/agents/optimus/aea-config.yaml @@ -35,8 +35,8 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeidz54kvxhbdmpruzguuzzq7bjg4pekjb5amqobkxoy4oqknnobopu - valory/abstract_round_abci:0.1.0:bafybeiajjzuh6vf23crp55humonknirvv2f4s3dmdlfzch6tc5ow52pcgm -- valory/liquidity_trader_abci:0.1.0:bafybeiehcunbb5b5nbazahgham47ankof4ad52b4nmjlgornwdwagyotna -- valory/optimus_abci:0.1.0:bafybeiex2jwrqzebrhrleczty3bzfurdkmhbbwg3wd4zfwmyravjntumk4 +- valory/liquidity_trader_abci:0.1.0:bafybeif4g4dpoupdi634wvnll4w2adt6ifu2d4orplhmoevplhukv3yyhy +- valory/optimus_abci:0.1.0:bafybeie3jxtlawtkpdcwj45pvz2x4vzm3xm7fjuf24gzz4c2qfecyarqlu - valory/registration_abci:0.1.0:bafybeiffipsowrqrkhjoexem7ern5ob4fabgif7wa6gtlszcoaop2e3oey - valory/reset_pause_abci:0.1.0:bafybeif4lgvbzsmzljesxbphycdv52ka7qnihyjrjpfaseclxadcmm6yiq - valory/termination_abci:0.1.0:bafybeiekkpo5qef5zaeagm3si6v45qxcojvtjqe4a5ceccvk4q7k3xi3bi diff --git a/packages/valory/services/optimus/service.yaml b/packages/valory/services/optimus/service.yaml index cabe02bc..a7f23385 100644 --- a/packages/valory/services/optimus/service.yaml +++ b/packages/valory/services/optimus/service.yaml @@ -6,7 +6,7 @@ aea_version: '>=1.0.0, <2.0.0' license: Apache-2.0 fingerprint: {} fingerprint_ignore_patterns: [] -agent: valory/optimus:0.1.0:bafybeig4dhq3ub6hnvromcfgezatybxujvaliape64jqtk24qldlk2vutq +agent: valory/optimus:0.1.0:bafybeiekjqvuxfux6cc7kw7elws6ezsmlokgd4w7xz6pjqb6zjni7itcma number_of_agents: 1 deployment: {} --- diff --git a/packages/valory/skills/liquidity_trader_abci/behaviours.py b/packages/valory/skills/liquidity_trader_abci/behaviours.py index ef779bb3..23e824e9 100644 --- a/packages/valory/skills/liquidity_trader_abci/behaviours.py +++ b/packages/valory/skills/liquidity_trader_abci/behaviours.py @@ -1806,7 +1806,7 @@ def get_next_event(self) -> Generator[None, None, Tuple[str, Dict]]: actions = self.synchronized_data.actions if not actions: self.context.logger.info("No actions to prepare") - return Event.DONE.value, {}, {} + return Event.DONE.value, {} positions = self.synchronized_data.positions last_round_id = self.context.state.round_sequence._abci_app._previous_rounds[ @@ -1831,9 +1831,11 @@ def get_next_event(self) -> Generator[None, None, Tuple[str, Dict]]: if last_executed_action_index is not None: if self.synchronized_data.last_action == Action.ENTER_POOL.value: - self._post_execute_enter_pool(actions, last_executed_action_index) + yield from self._post_execute_enter_pool( + actions, last_executed_action_index + ) if self.synchronized_data.last_action == Action.EXIT_POOL.value: - self._post_execute_exit_pool() + yield from self._post_execute_exit_pool() if ( self.synchronized_data.last_action == Action.CLAIM_REWARDS.value and last_round_id != DecisionMakingRound.auto_round_id() @@ -1856,7 +1858,7 @@ def get_next_event(self) -> Generator[None, None, Tuple[str, Dict]]: if current_action_index >= len(self.synchronized_data.actions): self.context.logger.info("All actions have been executed") - return Event.DONE.value, {}, {} + return Event.DONE.value, {} res = yield from self._prepare_next_action( positions, actions, current_action_index, last_round_id @@ -2236,8 +2238,8 @@ def get_swap_status( url = f"{self.params.lifi_check_status_url}?txHash={tx_hash}" self.context.logger.info(f"checking status from endpoint {url}") - MAX_RETRIES = 10 - for _attempt in range(MAX_RETRIES): + + while True: response = yield from self.get_http_response( method="GET", url=url, @@ -2274,11 +2276,6 @@ def get_swap_status( return status, sub_status - self.context.logger.error( - f"Failed to fetch status after {MAX_RETRIES} retries." - ) - return None, None - def get_enter_pool_tx_hash( self, positions, action ) -> Generator[None, None, Tuple[Optional[str], Optional[str], Optional[str]]]: diff --git a/packages/valory/skills/liquidity_trader_abci/skill.yaml b/packages/valory/skills/liquidity_trader_abci/skill.yaml index 0e7d70ae..df4ba460 100644 --- a/packages/valory/skills/liquidity_trader_abci/skill.yaml +++ b/packages/valory/skills/liquidity_trader_abci/skill.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeia7bn2ahqqwkf63ptje6rfnftuwrsp33sswgpcbh5osbesxxr6g4m - behaviours.py: bafybeig5qm7kznx5paaxsel3ju2xotwk47vgswhbclzdttsbna4hfxj43u + behaviours.py: bafybeig6atyyfcgm4ixs2yovyyzpcexdwunosqgr45n6vhwojavu6nfbmm dialogues.py: bafybeiay23otskx2go5xhtgdwfw2kd6rxd62sxxdu3njv7hageorl5zxzm fsm_specification.yaml: bafybeiabbiulb7k6xkjysulmy6o4ugnhxlpp5jiaeextvwj65q4ttadoeq handlers.py: bafybeidxw2lvgiifmo4siobpwuwbxscuifrdo3gnkjyn6bgexotj5f7zf4 diff --git a/packages/valory/skills/optimus_abci/skill.yaml b/packages/valory/skills/optimus_abci/skill.yaml index 2a3b44a7..536da53d 100644 --- a/packages/valory/skills/optimus_abci/skill.yaml +++ b/packages/valory/skills/optimus_abci/skill.yaml @@ -22,7 +22,7 @@ skills: - valory/registration_abci:0.1.0:bafybeiffipsowrqrkhjoexem7ern5ob4fabgif7wa6gtlszcoaop2e3oey - valory/reset_pause_abci:0.1.0:bafybeif4lgvbzsmzljesxbphycdv52ka7qnihyjrjpfaseclxadcmm6yiq - valory/termination_abci:0.1.0:bafybeiekkpo5qef5zaeagm3si6v45qxcojvtjqe4a5ceccvk4q7k3xi3bi -- valory/liquidity_trader_abci:0.1.0:bafybeiehcunbb5b5nbazahgham47ankof4ad52b4nmjlgornwdwagyotna +- valory/liquidity_trader_abci:0.1.0:bafybeif4g4dpoupdi634wvnll4w2adt6ifu2d4orplhmoevplhukv3yyhy - valory/transaction_settlement_abci:0.1.0:bafybeielv6eivt2z6nforq43xewl2vmpfwpdu2s2vfogobziljnwsclmlm behaviours: main: From 552f2bf423067d5c0500e62a67f859d0c1055ab2 Mon Sep 17 00:00:00 2001 From: Divya-Solulab Date: Mon, 7 Oct 2024 14:22:03 +0530 Subject: [PATCH 2/2] fix: update packages --- packages/packages.json | 8 ++++---- packages/valory/agents/optimus/aea-config.yaml | 4 ++-- packages/valory/services/optimus/service.yaml | 2 +- packages/valory/skills/liquidity_trader_abci/skill.yaml | 2 +- packages/valory/skills/optimus_abci/skill.yaml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 8594bd20..3138d4df 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -8,10 +8,10 @@ "contract/valory/merkl_distributor/0.1.0": "bafybeihaqsvmncuzmwv2r6iuzc5t7ur6ugdhephz7ydftypksjidpsylbq", "contract/valory/staking_token/0.1.0": "bafybeifrvtkofw5c26b3irm6izqfdpik6vpjhm6hqwcdzx333h6vhdanai", "contract/valory/staking_activity_checker/0.1.0": "bafybeibjzsi2r5b6xd4iwl4wbwldptnynryzsdpifym4mkv32ynswx22ou", - "skill/valory/liquidity_trader_abci/0.1.0": "bafybeif4g4dpoupdi634wvnll4w2adt6ifu2d4orplhmoevplhukv3yyhy", - "skill/valory/optimus_abci/0.1.0": "bafybeie3jxtlawtkpdcwj45pvz2x4vzm3xm7fjuf24gzz4c2qfecyarqlu", - "agent/valory/optimus/0.1.0": "bafybeiekjqvuxfux6cc7kw7elws6ezsmlokgd4w7xz6pjqb6zjni7itcma", - "service/valory/optimus/0.1.0": "bafybeid5mxngjnwv5sdsttcwnvrmg546rii7xpihhsh2bwncnzy5ygk62q" + "skill/valory/liquidity_trader_abci/0.1.0": "bafybeicll2viv2bs7jmkzr7lskc7qgscvdv3gurlqgzr36npdzvckpja4u", + "skill/valory/optimus_abci/0.1.0": "bafybeid2luqlruokidipj5s4xp7ygetfyirck5j7wmkgzjqfuydx27p42a", + "agent/valory/optimus/0.1.0": "bafybeieanzpdxesfkufg573qakjyqkxnv4wxr3sd4vmlozzic7gxlx6aqq", + "service/valory/optimus/0.1.0": "bafybeifdjaennczbswrpzgfty6gvwbhf4xx2dbizir5mdzcjpb6k3zhloy" }, "third_party": { "protocol/open_aea/signing/1.0.0": "bafybeihv62fim3wl2bayavfcg3u5e5cxu3b7brtu4cn5xoxd6lqwachasi", diff --git a/packages/valory/agents/optimus/aea-config.yaml b/packages/valory/agents/optimus/aea-config.yaml index 37ec771f..53f8b21e 100644 --- a/packages/valory/agents/optimus/aea-config.yaml +++ b/packages/valory/agents/optimus/aea-config.yaml @@ -35,8 +35,8 @@ protocols: skills: - valory/abstract_abci:0.1.0:bafybeidz54kvxhbdmpruzguuzzq7bjg4pekjb5amqobkxoy4oqknnobopu - valory/abstract_round_abci:0.1.0:bafybeiajjzuh6vf23crp55humonknirvv2f4s3dmdlfzch6tc5ow52pcgm -- valory/liquidity_trader_abci:0.1.0:bafybeif4g4dpoupdi634wvnll4w2adt6ifu2d4orplhmoevplhukv3yyhy -- valory/optimus_abci:0.1.0:bafybeie3jxtlawtkpdcwj45pvz2x4vzm3xm7fjuf24gzz4c2qfecyarqlu +- valory/liquidity_trader_abci:0.1.0:bafybeicll2viv2bs7jmkzr7lskc7qgscvdv3gurlqgzr36npdzvckpja4u +- valory/optimus_abci:0.1.0:bafybeid2luqlruokidipj5s4xp7ygetfyirck5j7wmkgzjqfuydx27p42a - valory/registration_abci:0.1.0:bafybeiffipsowrqrkhjoexem7ern5ob4fabgif7wa6gtlszcoaop2e3oey - valory/reset_pause_abci:0.1.0:bafybeif4lgvbzsmzljesxbphycdv52ka7qnihyjrjpfaseclxadcmm6yiq - valory/termination_abci:0.1.0:bafybeiekkpo5qef5zaeagm3si6v45qxcojvtjqe4a5ceccvk4q7k3xi3bi diff --git a/packages/valory/services/optimus/service.yaml b/packages/valory/services/optimus/service.yaml index a7f23385..877ba29b 100644 --- a/packages/valory/services/optimus/service.yaml +++ b/packages/valory/services/optimus/service.yaml @@ -6,7 +6,7 @@ aea_version: '>=1.0.0, <2.0.0' license: Apache-2.0 fingerprint: {} fingerprint_ignore_patterns: [] -agent: valory/optimus:0.1.0:bafybeiekjqvuxfux6cc7kw7elws6ezsmlokgd4w7xz6pjqb6zjni7itcma +agent: valory/optimus:0.1.0:bafybeieanzpdxesfkufg573qakjyqkxnv4wxr3sd4vmlozzic7gxlx6aqq number_of_agents: 1 deployment: {} --- diff --git a/packages/valory/skills/liquidity_trader_abci/skill.yaml b/packages/valory/skills/liquidity_trader_abci/skill.yaml index df4ba460..fa08282a 100644 --- a/packages/valory/skills/liquidity_trader_abci/skill.yaml +++ b/packages/valory/skills/liquidity_trader_abci/skill.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeia7bn2ahqqwkf63ptje6rfnftuwrsp33sswgpcbh5osbesxxr6g4m - behaviours.py: bafybeig6atyyfcgm4ixs2yovyyzpcexdwunosqgr45n6vhwojavu6nfbmm + behaviours.py: bafybeihi6lt7svxnhkj3w56fbetnp562vcrf7whex2ie5ig5zuor76sydy dialogues.py: bafybeiay23otskx2go5xhtgdwfw2kd6rxd62sxxdu3njv7hageorl5zxzm fsm_specification.yaml: bafybeiabbiulb7k6xkjysulmy6o4ugnhxlpp5jiaeextvwj65q4ttadoeq handlers.py: bafybeidxw2lvgiifmo4siobpwuwbxscuifrdo3gnkjyn6bgexotj5f7zf4 diff --git a/packages/valory/skills/optimus_abci/skill.yaml b/packages/valory/skills/optimus_abci/skill.yaml index 536da53d..c5100d6d 100644 --- a/packages/valory/skills/optimus_abci/skill.yaml +++ b/packages/valory/skills/optimus_abci/skill.yaml @@ -22,7 +22,7 @@ skills: - valory/registration_abci:0.1.0:bafybeiffipsowrqrkhjoexem7ern5ob4fabgif7wa6gtlszcoaop2e3oey - valory/reset_pause_abci:0.1.0:bafybeif4lgvbzsmzljesxbphycdv52ka7qnihyjrjpfaseclxadcmm6yiq - valory/termination_abci:0.1.0:bafybeiekkpo5qef5zaeagm3si6v45qxcojvtjqe4a5ceccvk4q7k3xi3bi -- valory/liquidity_trader_abci:0.1.0:bafybeif4g4dpoupdi634wvnll4w2adt6ifu2d4orplhmoevplhukv3yyhy +- valory/liquidity_trader_abci:0.1.0:bafybeicll2viv2bs7jmkzr7lskc7qgscvdv3gurlqgzr36npdzvckpja4u - valory/transaction_settlement_abci:0.1.0:bafybeielv6eivt2z6nforq43xewl2vmpfwpdu2s2vfogobziljnwsclmlm behaviours: main: