From b5bd28e658836cc6859d995b76d92f593b90b284 Mon Sep 17 00:00:00 2001 From: KahanMajmudar Date: Wed, 27 Nov 2024 12:59:07 +0000 Subject: [PATCH] fixed mech config and invalid metadata hash --- packages/packages.json | 12 ++--- packages/valory/agents/mech/aea-config.yaml | 8 ++-- packages/valory/services/mech/service.yaml | 2 +- .../services/mech_quickstart/service.yaml | 2 +- packages/valory/skills/mech_abci/skill.yaml | 44 ++++++++++++++++--- .../valory/skills/task_execution/skill.yaml | 40 +++++++++++++++-- .../skills/task_submission_abci/behaviours.py | 5 +++ .../skills/task_submission_abci/skill.yaml | 4 +- 8 files changed, 95 insertions(+), 22 deletions(-) diff --git a/packages/packages.json b/packages/packages.json index d8e3a92a..fdc73bcd 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -8,14 +8,14 @@ "contract/valory/mech_marketplace/0.1.0": "bafybeigulghv7bvx4evl6kmogvv6gjxovyt22tkwlbdmeretmop2crdmem", "connection/valory/websocket_client/0.1.0": "bafybeic4ag3gqc7kd3k2o3pucddj2odck5yrfbgmwh5veqny7zao5qayli", "skill/valory/contract_subscription/0.1.0": "bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy", - "skill/valory/mech_abci/0.1.0": "bafybeiaaysktq3d5eyl4g45w3qy7e7qlfpc4hiwkzls67geishe7rchrpa", - "skill/valory/task_submission_abci/0.1.0": "bafybeidqfcdgvhp5dkhxeuibv4avpkdhpdmrfwpxwmwkkpjxvs5o6m3aw4", - "skill/valory/task_execution/0.1.0": "bafybeibv46pbo2qntbensudrrkx7dlrnmvufvijpqzqyn3wrztxmr3s6pq", + "skill/valory/mech_abci/0.1.0": "bafybeib3b4zwlzzmoombr4wttiwcc52j6htfr42ibmhl6oishstrsxpjdi", + "skill/valory/task_submission_abci/0.1.0": "bafybeiesrss5ee6ef3azjddm5r244a5hrjvutuc6ci7s3cbegcj72rbegu", + "skill/valory/task_execution/0.1.0": "bafybeia2fp6evs3tz3u7ky75yr5jlsc7rrisandkwuoi3cephi4jq6fuey", "skill/valory/websocket_client/0.1.0": "bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m", "skill/valory/subscription_abci/0.1.0": "bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq", - "agent/valory/mech/0.1.0": "bafybeif6pnr5gydwdhuxtw3y4yldaptgqidt5pl7syjs7rryqsc4lu33j4", - "service/valory/mech/0.1.0": "bafybeihjebdhmx4kaya4tme4d2k43vpuacq2tj4ayo73mwxgh3e7evqu34", - "service/valory/mech_quickstart/0.1.0": "bafybeic7nyt734ysd2agj352zlxhxxemi6laeevclvepzzlm53oqp3hwxi" + "agent/valory/mech/0.1.0": "bafybeie2nknviqfsuvqgkphtpczmua6lvasbmxhox7s45z3wfuvrfs6hmy", + "service/valory/mech/0.1.0": "bafybeia4ta2zmz6n4dltnxvsp7nfttuswyht6caglkbnd6n6jtlfiv3v3i", + "service/valory/mech_quickstart/0.1.0": "bafybeial7457z4c52qhwdjctatqtdrhufsiijdej2rabuazhlpggcy4iyu" }, "third_party": { "protocol/valory/default/1.0.0": "bafybeifqcqy5hfbnd7fjv4mqdjrtujh2vx3p2xhe33y67zoxa6ph7wdpaq", diff --git a/packages/valory/agents/mech/aea-config.yaml b/packages/valory/agents/mech/aea-config.yaml index 6b92d29a..36afa6d6 100644 --- a/packages/valory/agents/mech/aea-config.yaml +++ b/packages/valory/agents/mech/aea-config.yaml @@ -39,12 +39,12 @@ skills: - valory/abstract_abci:0.1.0:bafybeieo7pe5wqjphs5izpz5aujjbubymlxub62b3rhx6yglu65ibalffu - valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti - valory/contract_subscription:0.1.0:bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy -- valory/mech_abci:0.1.0:bafybeiaaysktq3d5eyl4g45w3qy7e7qlfpc4hiwkzls67geishe7rchrpa +- valory/mech_abci:0.1.0:bafybeib3b4zwlzzmoombr4wttiwcc52j6htfr42ibmhl6oishstrsxpjdi - valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq - valory/reset_pause_abci:0.1.0:bafybeihkj6lmaypspyxe5qqrjgnolyck62pyvqoylr24ab6ue4steqcw7e - valory/subscription_abci:0.1.0:bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq -- valory/task_execution:0.1.0:bafybeibv46pbo2qntbensudrrkx7dlrnmvufvijpqzqyn3wrztxmr3s6pq -- valory/task_submission_abci:0.1.0:bafybeidqfcdgvhp5dkhxeuibv4avpkdhpdmrfwpxwmwkkpjxvs5o6m3aw4 +- valory/task_execution:0.1.0:bafybeia2fp6evs3tz3u7ky75yr5jlsc7rrisandkwuoi3cephi4jq6fuey +- valory/task_submission_abci:0.1.0:bafybeiesrss5ee6ef3azjddm5r244a5hrjvutuc6ci7s3cbegcj72rbegu - valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy - valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy - valory/websocket_client:0.1.0:bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m @@ -152,7 +152,7 @@ models: on_chain_service_id: ${int:1} mech_staking_instance_address: ${str:0x0000000000000000000000000000000000000000} mech_marketplace_address: ${str:0x0000000000000000000000000000000000000000} - agent_registry_address: ${str:0x0000000000000000000000000000000000000000} + agent_registry_address: ${str:0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA} agent_id: ${int:3} metadata_hash: ${str:0000000000000000000000000000000000000000000000000000000000000000} share_tm_config_on_startup: ${bool:false} diff --git a/packages/valory/services/mech/service.yaml b/packages/valory/services/mech/service.yaml index ba4eeee7..ea61d0af 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:bafybeif6pnr5gydwdhuxtw3y4yldaptgqidt5pl7syjs7rryqsc4lu33j4 +agent: valory/mech:0.1.0:bafybeie2nknviqfsuvqgkphtpczmua6lvasbmxhox7s45z3wfuvrfs6hmy number_of_agents: 4 deployment: agent: diff --git a/packages/valory/services/mech_quickstart/service.yaml b/packages/valory/services/mech_quickstart/service.yaml index bf215b3e..b9a06db3 100644 --- a/packages/valory/services/mech_quickstart/service.yaml +++ b/packages/valory/services/mech_quickstart/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeiaqaedhfzjxxdfxtygjulorvd4x2h3cbwtiw3xgbigjgsc6qfn7zy fingerprint_ignore_patterns: [] -agent: valory/mech:0.1.0:bafybeif6pnr5gydwdhuxtw3y4yldaptgqidt5pl7syjs7rryqsc4lu33j4 +agent: valory/mech:0.1.0:bafybeie2nknviqfsuvqgkphtpczmua6lvasbmxhox7s45z3wfuvrfs6hmy number_of_agents: 1 deployment: agent: diff --git a/packages/valory/skills/mech_abci/skill.yaml b/packages/valory/skills/mech_abci/skill.yaml index 9899d62c..3cb67d96 100644 --- a/packages/valory/skills/mech_abci/skill.yaml +++ b/packages/valory/skills/mech_abci/skill.yaml @@ -23,7 +23,7 @@ skills: - valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti - valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq - valory/reset_pause_abci:0.1.0:bafybeihkj6lmaypspyxe5qqrjgnolyck62pyvqoylr24ab6ue4steqcw7e -- valory/task_submission_abci:0.1.0:bafybeidqfcdgvhp5dkhxeuibv4avpkdhpdmrfwpxwmwkkpjxvs5o6m3aw4 +- valory/task_submission_abci:0.1.0:bafybeiesrss5ee6ef3azjddm5r244a5hrjvutuc6ci7s3cbegcj72rbegu - valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy - valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy - valory/subscription_abci:0.1.0:bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq @@ -78,12 +78,46 @@ models: class_name: LedgerApiDialogues params: args: - mech_to_config: {} - api_keys: {} + mech_to_config: + '0xFf82123dFB52ab75C417195c5fDB87630145ae81': + use_dynamic_pricing: false + is_marketplace_mech: false + '0x77af31De935740567Cf4fF1986D04B2c964A786a': + use_dynamic_pricing: false + is_marketplace_mech: false + api_keys: + openai: + - dummy_api_key + stabilityai: + - dummy_api_key + google_api_key: + - dummy_api_key + google_engine_id: + - dummy_api_key cleanup_history_depth: 1 cleanup_history_depth_current: null drand_public_key: 868f005eb8e6e4ca0a47c8a77ceaa5309a47978a7c71bc5cce96366b5d7a569937c529eeda66c7293784a9402801af31 - tools_to_package_hash: {} + tools_to_package_hash: + openai-gpt-3.5-turbo-instruct: bafybeicziwfw7nb7gaxso357hrvtdlv6f23grm2c2rlfngpz4vbvoz2bke + openai-gpt-3.5-turbo: bafybeicziwfw7nb7gaxso357hrvtdlv6f23grm2c2rlfngpz4vbvoz2bke + openai-gpt-4: bafybeicziwfw7nb7gaxso357hrvtdlv6f23grm2c2rlfngpz4vbvoz2bke + stabilityai-stable-diffusion-v1-5: bafybeibaalr745aqajcaijykactx2nmg3jviefvnvpuk5kkxlt2yeedc2q + stabilityai-stable-diffusion-xl-beta-v2-2-2: bafybeibaalr745aqajcaijykactx2nmg3jviefvnvpuk5kkxlt2yeedc2q + stabilityai-stable-diffusion-512-v2-1: bafybeibaalr745aqajcaijykactx2nmg3jviefvnvpuk5kkxlt2yeedc2q + stabilityai-stable-diffusion-768-v2-1: bafybeibaalr745aqajcaijykactx2nmg3jviefvnvpuk5kkxlt2yeedc2q + transfer-native: bafybeideuyqn4uslp4ccanzd5tjladzotyi6tiwfxbouecw5ufzgyi4ryy + prediction-offline: bafybeig7yntvhhfufaadhd43zr4loivpit43kwfgban72w43xz4u3tansi + prediction-online: bafybeig7yntvhhfufaadhd43zr4loivpit43kwfgban72w43xz4u3tansi + prediction-online-summarized-info: bafybeig7yntvhhfufaadhd43zr4loivpit43kwfgban72w43xz4u3tansi + prediction-online-sme: bafybeiautzxe3faq53ceogfjtfbml5373wvqpsk77c4k3hjivloblivuxy + prediction-offline-sme: bafybeiautzxe3faq53ceogfjtfbml5373wvqpsk77c4k3hjivloblivuxy + claude-prediction-online: bafybeifp6tn3ovhuz4oipy67ijfdm4y7t2o7en3xuggn6kh5wbwokxmczu + claude-prediction-offline: bafybeifp6tn3ovhuz4oipy67ijfdm4y7t2o7en3xuggn6kh5wbwokxmczu + deepmind-optimization-strong: bafybeievl777e2425q7zy6qkt26luu2i6xzp4q6pquykntx2yzivy3iwum + deepmind-optimization: bafybeievl777e2425q7zy6qkt26luu2i6xzp4q6pquykntx2yzivy3iwum + prediction-sentence-embedding-conservative: bafybeihsyxhchqgtdwsd53z4a2lswt6ri4fre2yg2bpjo36kwboilsp7ai + prediction-sentence-embedding-bold: bafybeihsyxhchqgtdwsd53z4a2lswt6ri4fre2yg2bpjo36kwboilsp7ai + prediction-online-sum-url-content: bafybeial5a56vsowqu4suynnmv5pkt5iebkxtmpgrae57qzi7s6tg4vq6e finalize_timeout: 60.0 genesis_config: genesis_time: '2022-09-26T00:00:00.000000000Z' @@ -148,7 +182,7 @@ models: manual_gas_limit: 1000000 mech_staking_instance_address: '0x0000000000000000000000000000000000000000' mech_marketplace_address: '0x0000000000000000000000000000000000000000' - agent_registry_address: '0x0000000000000000000000000000000000000000' + agent_registry_address: '0xE49CB081e8d96920C38aA7AB90cb0294ab4Bc8EA' agent_id: 3 metadata_hash: '00000000000000000000000000000000000000000000000000' slash_cooldown_hours: 3 diff --git a/packages/valory/skills/task_execution/skill.yaml b/packages/valory/skills/task_execution/skill.yaml index ffeaa712..8e086d0d 100644 --- a/packages/valory/skills/task_execution/skill.yaml +++ b/packages/valory/skills/task_execution/skill.yaml @@ -69,11 +69,45 @@ models: params: args: agent_index: 0 - api_keys: {} - tools_to_package_hash: {} + api_keys: + openai: + - dummy_api_key + stabilityai: + - dummy_api_key + google_api_key: + - dummy_api_key + google_engine_id: + - dummy_api_key + tools_to_package_hash: + openai-gpt-3.5-turbo-instruct: bafybeicziwfw7nb7gaxso357hrvtdlv6f23grm2c2rlfngpz4vbvoz2bke + openai-gpt-3.5-turbo: bafybeicziwfw7nb7gaxso357hrvtdlv6f23grm2c2rlfngpz4vbvoz2bke + openai-gpt-4: bafybeicziwfw7nb7gaxso357hrvtdlv6f23grm2c2rlfngpz4vbvoz2bke + stabilityai-stable-diffusion-v1-5: bafybeibaalr745aqajcaijykactx2nmg3jviefvnvpuk5kkxlt2yeedc2q + stabilityai-stable-diffusion-xl-beta-v2-2-2: bafybeibaalr745aqajcaijykactx2nmg3jviefvnvpuk5kkxlt2yeedc2q + stabilityai-stable-diffusion-512-v2-1: bafybeibaalr745aqajcaijykactx2nmg3jviefvnvpuk5kkxlt2yeedc2q + stabilityai-stable-diffusion-768-v2-1: bafybeibaalr745aqajcaijykactx2nmg3jviefvnvpuk5kkxlt2yeedc2q + transfer-native: bafybeideuyqn4uslp4ccanzd5tjladzotyi6tiwfxbouecw5ufzgyi4ryy + prediction-offline: bafybeig7yntvhhfufaadhd43zr4loivpit43kwfgban72w43xz4u3tansi + prediction-online: bafybeig7yntvhhfufaadhd43zr4loivpit43kwfgban72w43xz4u3tansi + prediction-online-summarized-info: bafybeig7yntvhhfufaadhd43zr4loivpit43kwfgban72w43xz4u3tansi + prediction-online-sme: bafybeiautzxe3faq53ceogfjtfbml5373wvqpsk77c4k3hjivloblivuxy + prediction-offline-sme: bafybeiautzxe3faq53ceogfjtfbml5373wvqpsk77c4k3hjivloblivuxy + claude-prediction-online: bafybeifp6tn3ovhuz4oipy67ijfdm4y7t2o7en3xuggn6kh5wbwokxmczu + claude-prediction-offline: bafybeifp6tn3ovhuz4oipy67ijfdm4y7t2o7en3xuggn6kh5wbwokxmczu + deepmind-optimization-strong: bafybeievl777e2425q7zy6qkt26luu2i6xzp4q6pquykntx2yzivy3iwum + deepmind-optimization: bafybeievl777e2425q7zy6qkt26luu2i6xzp4q6pquykntx2yzivy3iwum + prediction-sentence-embedding-conservative: bafybeihsyxhchqgtdwsd53z4a2lswt6ri4fre2yg2bpjo36kwboilsp7ai + prediction-sentence-embedding-bold: bafybeihsyxhchqgtdwsd53z4a2lswt6ri4fre2yg2bpjo36kwboilsp7ai + prediction-online-sum-url-content: bafybeial5a56vsowqu4suynnmv5pkt5iebkxtmpgrae57qzi7s6tg4vq6e from_block_range: 50000 num_agents: 4 - mech_to_config: {} + mech_to_config: + '0xFf82123dFB52ab75C417195c5fDB87630145ae81': + use_dynamic_pricing: false + is_marketplace_mech: false + '0x77af31De935740567Cf4fF1986D04B2c964A786a': + use_dynamic_pricing: false + is_marketplace_mech: false polling_interval: 30.0 task_deadline: 240.0 max_block_window: 500 diff --git a/packages/valory/skills/task_submission_abci/behaviours.py b/packages/valory/skills/task_submission_abci/behaviours.py index 2bff0d30..42e84ba4 100644 --- a/packages/valory/skills/task_submission_abci/behaviours.py +++ b/packages/valory/skills/task_submission_abci/behaviours.py @@ -146,6 +146,8 @@ def to_multihash(hash_string: str) -> str: """To multihash string.""" # Decode the Base32 CID to bytes cid_bytes = multibase.decode(hash_string) + if not cid_bytes: + return "" # Remove the multicodec prefix (0x01) from the bytes multihash_bytes = multicodec.remove_prefix(cid_bytes) # Convert the multihash bytes to a hexadecimal string @@ -753,6 +755,9 @@ def _should_update_hash(self) -> Generator: self.params.task_mutable_params.latest_metadata_hash = latest_hash configured_hash = self.to_multihash(self.params.metadata_hash) + if configured_hash == "": + self.context.logger.warning("Could not calculate configured hash") + return False latest_hash = self.params.task_mutable_params.latest_metadata_hash return configured_hash != latest_hash diff --git a/packages/valory/skills/task_submission_abci/skill.yaml b/packages/valory/skills/task_submission_abci/skill.yaml index 9b56441a..416169df 100644 --- a/packages/valory/skills/task_submission_abci/skill.yaml +++ b/packages/valory/skills/task_submission_abci/skill.yaml @@ -8,7 +8,7 @@ license: Apache-2.0 aea_version: '>=1.0.0, <2.0.0' fingerprint: __init__.py: bafybeiholqak7ltw6bbmn2c5tn3j7xgzkdlfzp3kcskiqsvmxoih6m4muq - behaviours.py: bafybeial5w6zhx2lmu2ef7ewp36qjp7ke6ydsln2untkftgigeegw6txne + behaviours.py: bafybeidfxaeswymlgcbe3mxfekywqkpod7l7bwmn3p2d2cxakkl2wcm5ga dialogues.py: bafybeibmac3m5u5h6ucoyjr4dazay72dyga656wvjl6z6saapluvjo54ne fsm_specification.yaml: bafybeidtmsmpunr3t77pshd3k2s6dd6hlvhze6inu3gj7xyvlg4wi3tnuu handlers.py: bafybeibe5n7my2vd2wlwo73sbma65epjqc7kxgtittewlylcmvnmoxtxzq @@ -32,7 +32,7 @@ protocols: skills: - valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti - valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy -- valory/task_execution:0.1.0:bafybeibv46pbo2qntbensudrrkx7dlrnmvufvijpqzqyn3wrztxmr3s6pq +- valory/task_execution:0.1.0:bafybeia2fp6evs3tz3u7ky75yr5jlsc7rrisandkwuoi3cephi4jq6fuey behaviours: main: args: {}