From affaf5f4a6ae79b385a7c444be32662f2759bf99 Mon Sep 17 00:00:00 2001 From: angrybayblade Date: Tue, 13 Jun 2023 09:53:17 +0000 Subject: [PATCH] fix: remove data request call and rename ACN protocol --- packages/packages.json | 10 +++++----- packages/valory/agents/mech/aea-config.yaml | 6 +++--- packages/valory/services/mech/service.yaml | 2 +- packages/valory/skills/mech_abci/dialogues.py | 8 ++++---- packages/valory/skills/mech_abci/skill.yaml | 8 ++++---- .../skills/task_execution_abci/behaviours.py | 15 +++++++-------- .../skills/task_execution_abci/dialogues.py | 16 ++++++++-------- .../valory/skills/task_execution_abci/skill.yaml | 10 +++++----- 8 files changed, 37 insertions(+), 38 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index 8965bf13..2ebd7494 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -2,13 +2,13 @@ "dev": { "connection/valory/websocket_client/0.1.0": "bafybeibffszgha5w424ifiwovx5tsvccaylaj3vmfgpe44gettsqhlm6nu", "skill/valory/contract_subscription/0.1.0": "bafybeihozkmtmfs3iqrreewvnixx6hod4rpcfdxqu4c6cfmubwwojc2dzu", - "agent/valory/mech/0.1.0": "bafybeietap2r7nzcmezyhx5rokrmr3bkyzkiukei7aj6dnkjl4zshv3hsu", + "agent/valory/mech/0.1.0": "bafybeia3saa5nr5rir645t3opxnmjuyvga25px4325wgyvl3awl76kcyh4", "skill/valory/multiplexer_abci/0.1.0": "bafybeidyydry6axhrqeibmfvnjvbvm2nuxlieginygijcu5nqa3672iwsu", - "skill/valory/task_execution_abci/0.1.0": "bafybeic5bqckuc5lefz3bcqthon3xftelehbcobv54fiprsziv6eyub2fy", - "skill/valory/mech_abci/0.1.0": "bafybeigirnsco4dzqdfa7qi5tu2kkr3svc2nvrr37zjwvbpkkwubc33c7y", + "skill/valory/task_execution_abci/0.1.0": "bafybeia22rnntr4mityeeu6ra76xxxqyjpprshrilt6grtqdvqfmnxlsgu", + "skill/valory/mech_abci/0.1.0": "bafybeiht52tfyvkn2pbtbrr3pd5755uuagrracujwfozke3yorep5xhq5y", "contract/valory/agent_mech/0.1.0": "bafybeib7v5fujyrio64trg5vmkuxpz42mc6fwjrmdyg3dr6ifudkn5rhle", - "service/valory/mech/0.1.0": "bafybeiau2et5tbsezp7nsfybveqokewae5ve5rgvfszq6g622yp76fvxny", - "protocol/valory/mech_acn/0.1.0": "bafybeiepwg7kp72m37v5keeebwvrhy555flvfwor2l36gow6gl5g676ja4" + "service/valory/mech/0.1.0": "bafybeignpj77t3b6ti6qjtithbfdbu5r3in7frb7cvyyqjjbovuzpmxskq", + "protocol/valory/acn_data_share/0.1.0": "bafybeic4swglw76p644ocpxtu7eozo5c7zxzkperh7hom36rufqaxle4sq" }, "third_party": { "protocol/fetchai/default/1.0.0": "bafybeieqqzgzuappi2ped42upgzad5gt3mxiyjhojwibxm4o367ffsian4", diff --git a/packages/valory/agents/mech/aea-config.yaml b/packages/valory/agents/mech/aea-config.yaml index dfa12147..9bfa35ad 100644 --- a/packages/valory/agents/mech/aea-config.yaml +++ b/packages/valory/agents/mech/aea-config.yaml @@ -29,16 +29,16 @@ protocols: - valory/ipfs:0.1.0:bafybeic72ncgqbzoz2guj4p4yjqulid7mv6yroeh65hxznloamoveeg7hq - valory/ledger_api:1.0.0:bafybeibo4bdtcrxi2suyzldwoetjar6pqfzm6vt5xal22ravkkcvdmtksi - valory/tendermint:0.1.0:bafybeicusvezoqlmyt6iqomcbwaz3xkhk2qf3d56q5zprmj3xdxfy64k54 -- valory/mech_acn:0.1.0:bafybeiepwg7kp72m37v5keeebwvrhy555flvfwor2l36gow6gl5g676ja4 +- valory/acn_data_share:0.1.0:bafybeic4swglw76p644ocpxtu7eozo5c7zxzkperh7hom36rufqaxle4sq skills: - valory/abstract_abci:0.1.0:bafybeiet34ju7typtkqyfn572sacef5krrsb6d4vpfnviqi6kzunje3xny - valory/abstract_round_abci:0.1.0:bafybeibdljcw2wchyderkonobpdpyb36yioagqcaoqldydw5bi6vvempma - valory/contract_subscription:0.1.0:bafybeihozkmtmfs3iqrreewvnixx6hod4rpcfdxqu4c6cfmubwwojc2dzu -- valory/mech_abci:0.1.0:bafybeigirnsco4dzqdfa7qi5tu2kkr3svc2nvrr37zjwvbpkkwubc33c7y +- valory/mech_abci:0.1.0:bafybeiht52tfyvkn2pbtbrr3pd5755uuagrracujwfozke3yorep5xhq5y - valory/multiplexer_abci:0.1.0:bafybeidyydry6axhrqeibmfvnjvbvm2nuxlieginygijcu5nqa3672iwsu - valory/registration_abci:0.1.0:bafybeidqcszsitlmsofegmbprny22hqlent2o6luxng5a46gplytexrtbq - valory/reset_pause_abci:0.1.0:bafybeidprdrxzbloz5imufkbpvetvkhywdvq3fopbhdzztfnud4onsdsce -- valory/task_execution_abci:0.1.0:bafybeic5bqckuc5lefz3bcqthon3xftelehbcobv54fiprsziv6eyub2fy +- valory/task_execution_abci:0.1.0:bafybeia22rnntr4mityeeu6ra76xxxqyjpprshrilt6grtqdvqfmnxlsgu - valory/termination_abci:0.1.0:bafybeif33wyu6w7yrrhyacpt627i5g6nec2kiepsm5xx2b44zq657dch3a - valory/transaction_settlement_abci:0.1.0:bafybeiaeu47qmeeqipn6jnz4ymbxwqb66axvx3ddzocnni4zehbhiupc54 default_ledger: ethereum diff --git a/packages/valory/services/mech/service.yaml b/packages/valory/services/mech/service.yaml index 178aa664..9ad082b4 100644 --- a/packages/valory/services/mech/service.yaml +++ b/packages/valory/services/mech/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeif7ia4jdlazy6745ke2k2x5yoqlwsgwr6sbztbgqtwvs3ndm2p7ba fingerprint_ignore_patterns: [] -agent: valory/mech:0.1.0:bafybeietap2r7nzcmezyhx5rokrmr3bkyzkiukei7aj6dnkjl4zshv3hsu +agent: valory/mech:0.1.0:bafybeia3saa5nr5rir645t3opxnmjuyvga25px4325wgyvl3awl76kcyh4 number_of_agents: 4 deployment: agent: diff --git a/packages/valory/skills/mech_abci/dialogues.py b/packages/valory/skills/mech_abci/dialogues.py index ed02e5e5..e628cec7 100644 --- a/packages/valory/skills/mech_abci/dialogues.py +++ b/packages/valory/skills/mech_abci/dialogues.py @@ -62,10 +62,10 @@ TendermintDialogues as BaseTendermintDialogues, ) from packages.valory.skills.task_execution_abci.dialogues import ( - MechAcnDialogue as BaseMechAcnDialogue, + AcnDataShareDialogue as BaseAcnDataShareDialogue, ) from packages.valory.skills.task_execution_abci.dialogues import ( - MechAcnDialogues as BaseMechAcnDialogues, + AcnDataShareDialogues as BaseAcnDataShareDialogues, ) @@ -96,5 +96,5 @@ IpfsDialogue = BaseIpfsDialogue IpfsDialogues = BaseIpfsDialogues -MechAcnDialogue = BaseMechAcnDialogue -MechAcnDialogues = BaseMechAcnDialogues +AcnDataShareDialogue = BaseAcnDataShareDialogue +AcnDataShareDialogues = BaseAcnDataShareDialogues diff --git a/packages/valory/skills/mech_abci/skill.yaml b/packages/valory/skills/mech_abci/skill.yaml index a8f08ba8..9cba9d34 100644 --- a/packages/valory/skills/mech_abci/skill.yaml +++ b/packages/valory/skills/mech_abci/skill.yaml @@ -9,7 +9,7 @@ fingerprint: __init__.py: bafybeihscyr3poal6eyk6jeywtbdq552piwpbh2uo5h7bepjqdeivgiyem behaviours.py: bafybeihgtg4l7qcu33ptyfn6cnohm3tcxlpkdqijyc5zjxmci6lqzxmogy composition.py: bafybeiektjao3czojlipbcj2oglrk4hsch76d7ft3zw3vpcerewvvi6idy - dialogues.py: bafybeifoalla4kyqhaxhdwrhepq3v7eo7gdwkzypgkfegq3qqrtywjmwh4 + dialogues.py: bafybeidhmgdnhxcgv35vahz3ycoiduug23kfyqvttqnywjp3eiuqal4bzy fsm_specification.yaml: bafybeieeqdr76xgxqjdqalip7agguutwsn23n5xgop4ziach7l4hiqxvqm handlers.py: bafybeiffuduhg433qsu6lbet5jsaub63bzv2l4x756aj2fbnu5bnfu4ble models.py: bafybeic3miniq5lacarxspyxuvmlnwervwf2wmpnvw2gxpgk77fzyzcpvq @@ -22,7 +22,7 @@ skills: - valory/multiplexer_abci:0.1.0:bafybeidyydry6axhrqeibmfvnjvbvm2nuxlieginygijcu5nqa3672iwsu - valory/registration_abci:0.1.0:bafybeidqcszsitlmsofegmbprny22hqlent2o6luxng5a46gplytexrtbq - valory/reset_pause_abci:0.1.0:bafybeidprdrxzbloz5imufkbpvetvkhywdvq3fopbhdzztfnud4onsdsce -- valory/task_execution_abci:0.1.0:bafybeic5bqckuc5lefz3bcqthon3xftelehbcobv54fiprsziv6eyub2fy +- valory/task_execution_abci:0.1.0:bafybeia22rnntr4mityeeu6ra76xxxqyjpprshrilt6grtqdvqfmnxlsgu - valory/termination_abci:0.1.0:bafybeif33wyu6w7yrrhyacpt627i5g6nec2kiepsm5xx2b44zq657dch3a - valory/transaction_settlement_abci:0.1.0:bafybeiaeu47qmeeqipn6jnz4ymbxwqb66axvx3ddzocnni4zehbhiupc54 behaviours: @@ -71,9 +71,9 @@ models: ledger_api_dialogues: args: {} class_name: LedgerApiDialogues - mech_acn_requests_dialogues: + acn_data_share_dialogues: args: {} - class_name: MechAcnDialogues + class_name: AcnDataShareDialogues params: args: agent_mech_contract_address: '0xFf82123dFB52ab75C417195c5fDB87630145ae81' diff --git a/packages/valory/skills/task_execution_abci/behaviours.py b/packages/valory/skills/task_execution_abci/behaviours.py index 01c66a48..2fb32e13 100644 --- a/packages/valory/skills/task_execution_abci/behaviours.py +++ b/packages/valory/skills/task_execution_abci/behaviours.py @@ -41,9 +41,9 @@ MultiSendContract, MultiSendOperation, ) +from packages.valory.protocols.acn_data_share.dialogues import AcnDataShareDialogues +from packages.valory.protocols.acn_data_share.message import AcnDataShareMessage from packages.valory.protocols.contract_api import ContractApiMessage -from packages.valory.protocols.mech_acn.dialogues import MechAcnDialogues -from packages.valory.protocols.mech_acn.message import MechAcnMessage from packages.valory.skills.abstract_round_abci.base import AbstractRound from packages.valory.skills.abstract_round_abci.behaviours import ( AbstractRoundBehaviour, @@ -234,9 +234,6 @@ def get_task_result( # pylint: disable=R0914,R1710 # respond with no_op and no multisend transactions deliver_msg = "no_op" request_id = cast(str, self.request_id) - self.data_requests.set_data( - request_id=str(self.request_id), data=deliver_msg - ) self.send_data_to_acn( sender_address=self.sender_address, request_id=str(self.request_id), @@ -306,12 +303,14 @@ def send_data_to_acn( data: Any, ) -> None: """Handle callbacks.""" - self.context.logger.info(f"Sending data to ACN for request ID {request_id}") + self.context.logger.info( + f"Sending data to {sender_address} via ACN for request ID {request_id}" + ) response, _ = cast( - MechAcnDialogues, self.context.mech_acn_requests_dialogues + AcnDataShareDialogues, self.context.acn_data_share_dialogues ).create( counterparty=sender_address, - performative=MechAcnMessage.Performative.DATA, + performative=AcnDataShareMessage.Performative.DATA, request_id=request_id, content=data, ) diff --git a/packages/valory/skills/task_execution_abci/dialogues.py b/packages/valory/skills/task_execution_abci/dialogues.py index b4f15039..54e439d9 100644 --- a/packages/valory/skills/task_execution_abci/dialogues.py +++ b/packages/valory/skills/task_execution_abci/dialogues.py @@ -26,11 +26,11 @@ from aea.protocols.dialogue.base import Dialogue as BaseDialogue from aea.skills.base import Model -from packages.valory.protocols.mech_acn.dialogues import ( - MechAcnDialogue as BaseMechAcnDialogue, +from packages.valory.protocols.acn_data_share.dialogues import ( + AcnDataShareDialogue as BaseAcnDataShareDialogue, ) -from packages.valory.protocols.mech_acn.dialogues import ( - MechAcnDialogues as BaseMechAcnDialogues, +from packages.valory.protocols.acn_data_share.dialogues import ( + AcnDataShareDialogues as BaseAcnDataShareDialogues, ) from packages.valory.skills.abstract_round_abci.dialogues import ( AbciDialogue as BaseAbciDialogue, @@ -104,10 +104,10 @@ IpfsDialogues = BaseIpfsDialogues -MechAcnDialogue = BaseMechAcnDialogue +AcnDataShareDialogue = BaseAcnDataShareDialogue -class MechAcnDialogues(Model, BaseMechAcnDialogues): +class AcnDataShareDialogues(Model, BaseAcnDataShareDialogues): """The dialogues class keeps track of all dialogues.""" def __init__(self, **kwargs: Any) -> None: @@ -127,9 +127,9 @@ def role_from_first_message( # pylint: disable=unused-argument :param receiver_address: the address of the receiving agent :return: The role of the agent """ - return MechAcnDialogue.Role.AGENT + return AcnDataShareDialogue.Role.AGENT - BaseMechAcnDialogues.__init__( + BaseAcnDataShareDialogues.__init__( self, self_address=str(self.context.agent_address), role_from_first_message=role_from_first_message, diff --git a/packages/valory/skills/task_execution_abci/skill.yaml b/packages/valory/skills/task_execution_abci/skill.yaml index 05be9238..5ee39083 100644 --- a/packages/valory/skills/task_execution_abci/skill.yaml +++ b/packages/valory/skills/task_execution_abci/skill.yaml @@ -7,8 +7,8 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeihrkpey6kxur2uoimrskq2wfpelqidxeapdxie6iuv2x7dk77ksvu - behaviours.py: bafybeicld7dc2g5lfxsuqh4jbgcu5keqist4hgmoims6sqq5zoyop7vkza - dialogues.py: bafybeidcnees5jaau5haflyvn2p52z7c4jc4kc457eruvwz65yas74pvbm + behaviours.py: bafybeifv6nafolbw2zbsvgoiio334fmafiwdsifpngusz3nk6fjcosc5eq + dialogues.py: bafybeibmac3m5u5h6ucoyjr4dazay72dyga656wvjl6z6saapluvjo54ne fsm_specification.yaml: bafybeiggzywf6zpq2mb4ite6ptnb2zqcjjdhyu7jyb5npn7id4hcrm5tiy handlers.py: bafybeibe5n7my2vd2wlwo73sbma65epjqc7kxgtittewlylcmvnmoxtxzq io_/__init__.py: bafybeifxgmmwjqzezzn3e6keh2bfo4cyo7y5dq2ept3stfmgglbrzfl5rq @@ -26,7 +26,7 @@ contracts: - valory/multisend:0.1.0:bafybeigjywkl7hydjsrkogob3xebj2ifhqwmfhhxoeyrndzhhxi5u6amey protocols: - valory/contract_api:1.0.0:bafybeidv6wxpjyb2sdyibnmmum45et4zcla6tl63bnol6ztyoqvpl4spmy -- valory/mech_acn:0.1.0:bafybeiepwg7kp72m37v5keeebwvrhy555flvfwor2l36gow6gl5g676ja4 +- valory/acn_data_share:0.1.0:bafybeic4swglw76p644ocpxtu7eozo5c7zxzkperh7hom36rufqaxle4sq skills: - valory/abstract_round_abci:0.1.0:bafybeibdljcw2wchyderkonobpdpyb36yioagqcaoqldydw5bi6vvempma - valory/transaction_settlement_abci:0.1.0:bafybeiaeu47qmeeqipn6jnz4ymbxwqb66axvx3ddzocnni4zehbhiupc54 @@ -76,9 +76,9 @@ models: ledger_api_dialogues: args: {} class_name: LedgerApiDialogues - mech_acn_requests_dialogues: + acn_data_share_dialogues: args: {} - class_name: MechAcnDialogues + class_name: AcnDataShareDialogue params: args: api_keys_json: