Skip to content

Commit

Permalink
Merge pull request #101 from valory-xyz/chore/improve_notebook
Browse files Browse the repository at this point in the history
Improve notebook
  • Loading branch information
jmoreira-valory authored May 6, 2024
2 parents f8ce708 + 7ecfaa4 commit f3bc82d
Show file tree
Hide file tree
Showing 10 changed files with 816 additions and 98 deletions.
41 changes: 21 additions & 20 deletions packages/packages.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"dev": {
"contract/valory/fpmm_deterministic_factory/0.1.0": "bafybeihi2pozsqbgu6mkepoyqqwqxc3o7ks47tx7vuf5hxfkbsyuskzqjq",
"contract/valory/fpmm_deterministic_factory/0.1.0": "bafybeihcvttq34xxd35tfwzdg2qunatyaq373uwkpo5fe6nlxrzya4tuqe",
"contract/valory/wxdai/0.1.0": "bafybeidalocwbhmbto6ii6adldtpcughtdt6j3v4tv36utevjk2wrdyqie",
"contract/valory/fpmm/0.1.0": "bafybeiai2ruj27nnglvn7yc5atojyojo3fkmofw6wrjgz2ybps2uwdizx4",
"skill/valory/market_creation_manager_abci/0.1.0": "bafybeidmzffvwvh3euspl7rub2mnhhqj4qhurwbryxvxaxsntueu2gelve",
"skill/valory/market_maker_abci/0.1.0": "bafybeic2zhtrusglacvb6uc66w2irybg2xm4wtwuounkmkaox3icmbwdtm",
"agent/valory/market_maker/0.1.0": "bafybeidsov3f5hchknxiyeouoeupqot5o44y2as6u2q4fcqeszz7bycd2a",
"service/valory/market_maker/0.1.0": "bafybeihvw3wntknp4sfhsd3vreth7srtbrme5wqoxj73ameabg3t6mofd4"
"skill/valory/market_creation_manager_abci/0.1.0": "bafybeih2hbwpalkavcelgm2yfv4fqgldwadiyesj4rowmhzzgt3eitmshq",
"skill/valory/market_maker_abci/0.1.0": "bafybeiclluyvzt4gvjhtc2qbcfpdhqq4mb44xszsvu2wx4hmxaehdsmwbi",
"agent/valory/market_maker/0.1.0": "bafybeib2jsel72sqshzqanf5zhraz2oajnrtdavybg3j26fc4kxrn7uabu",
"service/valory/market_maker/0.1.0": "bafybeif2bmcvqmu7s4l445lbcvqbqysvhrqfkdchuae2rs5kfbsaz6qd7i"
},
"third_party": {
"protocol/valory/contract_api/1.0.0": "bafybeidgu7o5llh26xp3u3ebq3yluull5lupiyeu6iooi2xyymdrgnzq5i",
Expand All @@ -18,27 +18,28 @@
"protocol/valory/acn/1.1.0": "bafybeidluaoeakae3exseupaea4i3yvvk5vivyt227xshjlffywwxzcxqe",
"protocol/valory/tendermint/0.1.0": "bafybeig4mi3vmlv5zpbjbfuzcgida6j5f2nhrpedxicmrrfjweqc5r7cra",
"protocol/valory/llm/1.0.0": "bafybeihj2orqapokafg7co3wlogwgf6cckaaj2bz3nuv4rm3opkoyhrlp4",
"contract/valory/service_registry/0.1.0": "bafybeibtaa6tvhzoo4osu3moilxtwxbfwqo3vt7rsr3ugjugzwndzkkmd4",
"contract/valory/gnosis_safe/0.1.0": "bafybeif3n23srpc7kouvry6c5h3qmd4h63vtd3gg7el2upjm6xac6mligi",
"contract/valory/gnosis_safe_proxy_factory/0.1.0": "bafybeic5f3vnd3pkzlhapkzgtrfmer7otjg3xxaflxkadpz6prjxk3salq",
"contract/valory/service_registry/0.1.0": "bafybeigrfupd7lo6aet376rwluqgm33jfghibkbvumfsdgrymqxoopqydq",
"contract/valory/gnosis_safe/0.1.0": "bafybeiag5jjj5c66skkbjnxcjngeufhtcvcpnbnjlgox5mtuo2tk4w3ohi",
"contract/valory/gnosis_safe_proxy_factory/0.1.0": "bafybeiafghfcxrg3apccnrvvw7tfgjbopedbfevmhepw2reyhyertxrilm",
"contract/valory/multisend/0.1.0": "bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y",
"contract/valory/realitio/0.1.0": "bafybeignaxfk7fjlfa4lioflwsfru2z5xln5cyvyew3if5oas2sgm5wuii",
"contract/valory/realitio_proxy/0.1.0": "bafybeidx37xzjjmapwacedgzhum6grfzhp5vhouz4zu3pvpgdy5pgb2fr4",
"contract/valory/conditional_tokens/0.1.0": "bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe",
"contract/valory/mech/0.1.0": "bafybeihahwhu7mxk3bu4ruvvohqdgfrctaaelnbfrbavfzc6qzvdfgdhau",
"contract/valory/mech/0.1.0": "bafybeicvxrwnipnerhesfdylhyielxnssdhlgyt6vhh7wmknkay7fnv2xa",
"contract/valory/erc20/0.1.0": "bafybeifaxbokuzwsbxbwda5vtreznd233eu6sa2dmw4zsyg2p6b3rz7spy",
"contract/valory/delegate/0.1.0": "bafybeiaslboosyvpzccaqgie56wta3aqrdkgfx5vs5ogxu7ebiez67wp6i",
"connection/valory/ipfs/0.1.0": "bafybeieogncafs6j6akrvsj6oi63iwhuunjyssmhz736vrl2sku4jc77za",
"connection/valory/abci/0.1.0": "bafybeigks2eqrpf5zn3qbah2uzf3fcpvqstommftpxlyhs32cjdg32lzea",
"connection/valory/ipfs/0.1.0": "bafybeifqca6e232lbvwrjhd7ioh43bo3evxfkpumdvcr6re2sdwjuntgna",
"connection/valory/abci/0.1.0": "bafybeihhtx7t5fsxaoajzq5nm4hrq57smigx7gqv35bss766txaaffjmsa",
"connection/valory/openai/0.1.0": "bafybeigyehjbahya5mp7vyp5tjvn36rey4btvzskp3ql3mgxp3zu6gwq5a",
"connection/valory/p2p_libp2p_client/0.1.0": "bafybeid3xg5k2ol5adflqloy75ibgljmol6xsvzvezebsg7oudxeeolz7e",
"connection/valory/ledger/0.19.0": "bafybeic3ft7l7ca3qgnderm4xupsfmyoihgi27ukotnz7b5hdczla2enya",
"connection/valory/http_client/0.23.0": "bafybeih5vzo22p2umhqo52nzluaanxx7kejvvpcpdsrdymckkyvmsim6gm",
"skill/valory/abstract_abci/0.1.0": "bafybeibvz3hi25ktgdzm25kih25o5osml62zk4kzpgmzmyrem3hzo2vtnm",
"skill/valory/abstract_round_abci/0.1.0": "bafybeic2emnylfmdtidobgdsxa4tgdelreeimtglqzrmic6cumhpsbfzhe",
"skill/valory/transaction_settlement_abci/0.1.0": "bafybeifhuemoavm6hf4vypg2sl7kng3iv4ipxgpk3itbh5hp73lworpuwq",
"skill/valory/registration_abci/0.1.0": "bafybeibzduasg5pahk2d2glc36wlopg54ybwcdmjqbzozt2lmkp4reqsdu",
"skill/valory/reset_pause_abci/0.1.0": "bafybeib3geaw3o35aigmb4dhplxrjlsef7hbdwrozu4akiunlgyiegshj4",
"skill/valory/termination_abci/0.1.0": "bafybeifnfuy3svz5oz6kwglu35q6jn7ai3riqplyypskb7za5ejyvjmfza",
"skill/valory/mech_interact_abci/0.1.0": "bafybeigilca6rfqu4qw7yhz5lnhzgymj5cabtusx5hjndt7w7kulkn7cga"
"connection/valory/ledger/0.19.0": "bafybeig7woeog4srdby75hpjkmx4rhpkzncbf4h2pm5r6varsp26pf2uhu",
"connection/valory/http_client/0.23.0": "bafybeihi772xgzpqeipp3fhmvpct4y6e6tpjp4sogwqrnf3wqspgeilg4u",
"skill/valory/abstract_abci/0.1.0": "bafybeiedikuvfpdx7xhyrxcpp6ywi2d6qf6uqvlwmhgcal7qhw5duicvym",
"skill/valory/abstract_round_abci/0.1.0": "bafybeia7msuvsouwcky263k6lup5hwcj73pka4pepkgyii6sya2wfawqvy",
"skill/valory/transaction_settlement_abci/0.1.0": "bafybeihfrdgfhu7ijjorvktjplfa4aq3b5as4dtwmkgl6nhy2oz4ayidfu",
"skill/valory/registration_abci/0.1.0": "bafybeihwkqc6klqrk247esh4cumfphosx3yadullxhmrrkovzg2rward5y",
"skill/valory/reset_pause_abci/0.1.0": "bafybeibd5divbbng3klkxlkzfwmwdc7imobcymfx57lf3owbyf7we7xdem",
"skill/valory/termination_abci/0.1.0": "bafybeifw36rnniyjay4f3af6jtfxpeycm5nu4zm4ejoutsk4yh2rv24ysm",
"skill/valory/mech_interact_abci/0.1.0": "bafybeieemsqlorshzgagcevh3u5tym5e2basny6qozfeoutv5sg2a56kg4"
}
}
39 changes: 20 additions & 19 deletions packages/valory/agents/market_maker/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ fingerprint:
__init__.py: bafybeifamf4vln3qgmifksv5icmhnkelqirbaauehuv5hpsu2twesb2vni
fingerprint_ignore_patterns: []
connections:
- valory/abci:0.1.0:bafybeigks2eqrpf5zn3qbah2uzf3fcpvqstommftpxlyhs32cjdg32lzea
- valory/http_client:0.23.0:bafybeih5vzo22p2umhqo52nzluaanxx7kejvvpcpdsrdymckkyvmsim6gm
- valory/ledger:0.19.0:bafybeic3ft7l7ca3qgnderm4xupsfmyoihgi27ukotnz7b5hdczla2enya
- valory/abci:0.1.0:bafybeihhtx7t5fsxaoajzq5nm4hrq57smigx7gqv35bss766txaaffjmsa
- valory/http_client:0.23.0:bafybeihi772xgzpqeipp3fhmvpct4y6e6tpjp4sogwqrnf3wqspgeilg4u
- valory/ledger:0.19.0:bafybeig7woeog4srdby75hpjkmx4rhpkzncbf4h2pm5r6varsp26pf2uhu
- valory/openai:0.1.0:bafybeigyehjbahya5mp7vyp5tjvn36rey4btvzskp3ql3mgxp3zu6gwq5a
- valory/p2p_libp2p_client:0.1.0:bafybeid3xg5k2ol5adflqloy75ibgljmol6xsvzvezebsg7oudxeeolz7e
contracts:
- valory/gnosis_safe:0.1.0:bafybeif3n23srpc7kouvry6c5h3qmd4h63vtd3gg7el2upjm6xac6mligi
- valory/gnosis_safe_proxy_factory:0.1.0:bafybeic5f3vnd3pkzlhapkzgtrfmer7otjg3xxaflxkadpz6prjxk3salq
- valory/gnosis_safe:0.1.0:bafybeiag5jjj5c66skkbjnxcjngeufhtcvcpnbnjlgox5mtuo2tk4w3ohi
- valory/gnosis_safe_proxy_factory:0.1.0:bafybeiafghfcxrg3apccnrvvw7tfgjbopedbfevmhepw2reyhyertxrilm
- valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y
- valory/realitio:0.1.0:bafybeignaxfk7fjlfa4lioflwsfru2z5xln5cyvyew3if5oas2sgm5wuii
- valory/conditional_tokens:0.1.0:bafybeibnzmqmeph4cj5vfh3s622mo2o5627vjjwc6bptrhj4dk65mzgvhe
- valory/fpmm_deterministic_factory:0.1.0:bafybeihi2pozsqbgu6mkepoyqqwqxc3o7ks47tx7vuf5hxfkbsyuskzqjq
- valory/service_registry:0.1.0:bafybeibtaa6tvhzoo4osu3moilxtwxbfwqo3vt7rsr3ugjugzwndzkkmd4
- valory/fpmm_deterministic_factory:0.1.0:bafybeihcvttq34xxd35tfwzdg2qunatyaq373uwkpo5fe6nlxrzya4tuqe
- valory/service_registry:0.1.0:bafybeigrfupd7lo6aet376rwluqgm33jfghibkbvumfsdgrymqxoopqydq
- valory/wxdai:0.1.0:bafybeidalocwbhmbto6ii6adldtpcughtdt6j3v4tv36utevjk2wrdyqie
- valory/fpmm:0.1.0:bafybeiai2ruj27nnglvn7yc5atojyojo3fkmofw6wrjgz2ybps2uwdizx4
protocols:
Expand All @@ -35,15 +35,15 @@ protocols:
- valory/llm:1.0.0:bafybeihj2orqapokafg7co3wlogwgf6cckaaj2bz3nuv4rm3opkoyhrlp4
- valory/tendermint:0.1.0:bafybeig4mi3vmlv5zpbjbfuzcgida6j5f2nhrpedxicmrrfjweqc5r7cra
skills:
- valory/abstract_abci:0.1.0:bafybeibvz3hi25ktgdzm25kih25o5osml62zk4kzpgmzmyrem3hzo2vtnm
- valory/abstract_round_abci:0.1.0:bafybeic2emnylfmdtidobgdsxa4tgdelreeimtglqzrmic6cumhpsbfzhe
- valory/market_maker_abci:0.1.0:bafybeic2zhtrusglacvb6uc66w2irybg2xm4wtwuounkmkaox3icmbwdtm
- valory/registration_abci:0.1.0:bafybeibzduasg5pahk2d2glc36wlopg54ybwcdmjqbzozt2lmkp4reqsdu
- valory/market_creation_manager_abci:0.1.0:bafybeidmzffvwvh3euspl7rub2mnhhqj4qhurwbryxvxaxsntueu2gelve
- valory/reset_pause_abci:0.1.0:bafybeib3geaw3o35aigmb4dhplxrjlsef7hbdwrozu4akiunlgyiegshj4
- valory/termination_abci:0.1.0:bafybeifnfuy3svz5oz6kwglu35q6jn7ai3riqplyypskb7za5ejyvjmfza
- valory/transaction_settlement_abci:0.1.0:bafybeifhuemoavm6hf4vypg2sl7kng3iv4ipxgpk3itbh5hp73lworpuwq
- valory/mech_interact_abci:0.1.0:bafybeigilca6rfqu4qw7yhz5lnhzgymj5cabtusx5hjndt7w7kulkn7cga
- valory/abstract_abci:0.1.0:bafybeiedikuvfpdx7xhyrxcpp6ywi2d6qf6uqvlwmhgcal7qhw5duicvym
- valory/abstract_round_abci:0.1.0:bafybeia7msuvsouwcky263k6lup5hwcj73pka4pepkgyii6sya2wfawqvy
- valory/market_maker_abci:0.1.0:bafybeiclluyvzt4gvjhtc2qbcfpdhqq4mb44xszsvu2wx4hmxaehdsmwbi
- valory/registration_abci:0.1.0:bafybeihwkqc6klqrk247esh4cumfphosx3yadullxhmrrkovzg2rward5y
- valory/market_creation_manager_abci:0.1.0:bafybeih2hbwpalkavcelgm2yfv4fqgldwadiyesj4rowmhzzgt3eitmshq
- valory/reset_pause_abci:0.1.0:bafybeibd5divbbng3klkxlkzfwmwdc7imobcymfx57lf3owbyf7we7xdem
- valory/termination_abci:0.1.0:bafybeifw36rnniyjay4f3af6jtfxpeycm5nu4zm4ejoutsk4yh2rv24ysm
- valory/transaction_settlement_abci:0.1.0:bafybeihfrdgfhu7ijjorvktjplfa4aq3b5as4dtwmkgl6nhy2oz4ayidfu
- valory/mech_interact_abci:0.1.0:bafybeieemsqlorshzgagcevh3u5tym5e2basny6qozfeoutv5sg2a56kg4
default_ledger: ethereum
required_ledgers:
- ethereum
Expand Down Expand Up @@ -76,11 +76,11 @@ logging_config:
skill_exception_policy: stop_and_exit
dependencies:
open-aea-ledger-cosmos:
version: ==1.49.0
version: ==1.51.0
open-aea-ledger-ethereum:
version: ==1.49.0
version: ==1.51.0
open-aea-test-autonomy:
version: ==0.14.8
version: ==0.14.11.post1
default_connection: null
---
public_id: valory/abci:0.1.0
Expand Down Expand Up @@ -219,4 +219,5 @@ models:
google_engine_id: ${str:google_engine_id}
openai_api_key: ${str:openai_api_key}
mech_contract_address: ${str:0x77af31de935740567cf4ff1986d04b2c964a786a}
answer_retry_intervals: ${list:[0, 86400, 259200, 604800, 1209600]}
is_abstract: false
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ contract_interface_paths:
dependencies:
hexbytes: {}
open-aea-ledger-ethereum:
version: ==1.49.0
version: ==1.51.0
open-aea-test-autonomy:
version: ==0.14.8
version: ==0.14.11.post1
web3:
version: <7,>=6.0.0
contracts: []
4 changes: 3 additions & 1 deletion packages/valory/services/market_maker/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeibwz3af6326msp4h3kqehijvmyhaytvyfbo3o2npc2w4b6zrg6pfq
fingerprint_ignore_patterns: []
agent: valory/market_maker:0.1.0:bafybeidsov3f5hchknxiyeouoeupqot5o44y2as6u2q4fcqeszz7bycd2a
agent: valory/market_maker:0.1.0:bafybeib2jsel72sqshzqanf5zhraz2oajnrtdavybg3j26fc4kxrn7uabu
number_of_agents: 1
deployment:
agent:
Expand Down Expand Up @@ -71,6 +71,8 @@ models:
multisend_batch_size: ${MULTISEND_BATCH_SIZE:int:1}
ipfs_address: ${IPFS_ADDRESS:str:https://gateway.autonolas.tech/ipfs/}
mech_contract_address: ${MECH_CONTRACT_ADDRESS:str:0x77af31de935740567cf4ff1986d04b2c964a786a}
answer_retry_intervals: ${ANSWER_RETRY_INTERVALS:list:[0, 86400, 259200, 604800,
1209600]}
on_chain_service_id: ${ON_CHAIN_SERVICE_ID:int:null}
reset_tendermint_after: ${RESET_TENDERMINT_AFTER:int:1}
reset_pause_duration: ${RESET_PAUSE_DURATION:int:1800}
Expand Down
104 changes: 79 additions & 25 deletions packages/valory/skills/market_creation_manager_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -2291,6 +2291,52 @@ def _get_balance(self, account: str) -> Generator[None, None, Optional[int]]:
balance = cast(int, ledger_api_response.state.body.get("get_balance_result"))
return balance

def _eligible_questions_to_answer(
self, unanswered_questions: List[Dict[str, Any]]
) -> List[str]:
"""Determine the eligible questions to answer at this time"""
now = self.last_synced_timestamp
eligible_questions_id = []
answer_retry_intervals = self.params.answer_retry_intervals

self.context.logger.info(f"Answer retry intervals: {answer_retry_intervals}")

for question in unanswered_questions:
question_id = question["question"]["id"].lower()

if question_id in self.shared_state.questions_responded:
continue

if question_id not in self.shared_state.questions_requested_mech:
self.shared_state.questions_requested_mech[question_id] = {
"question": question,
"retries": [],
}

retries = self.shared_state.questions_requested_mech[question_id]["retries"]
n_retries = len(retries)
time_since_last_retry = now - retries[-1] if retries else 0
retry_period = answer_retry_intervals[
min(n_retries, len(answer_retry_intervals) - 1)
]
if n_retries == 0 or time_since_last_retry > retry_period:
eligible_questions_id.append(question_id)

self.context.logger.info(
f"Determined {len(eligible_questions_id)} eligible questions to answer."
)

num_questions = min(
len(eligible_questions_id), self.params.multisend_batch_size
)
random.seed(self.last_synced_timestamp)
random_questions_id = random.sample(eligible_questions_id, num_questions)

self.context.logger.info(
f"Chosen {len(random_questions_id)} eligible questions to answer."
)
return random_questions_id

def get_payload(self) -> Generator[None, None, str]:
"""Get the transaction payload"""
# get the questions to that need to be answered
Expand All @@ -2300,23 +2346,17 @@ def get_payload(self) -> Generator[None, None, str]:
self.context.logger.info("Couldn't get the questions")
return GetPendingQuestionsRound.ERROR_PAYLOAD

filtered_questions = [
question
for question in unanswered_questions
if question["question"]["id"].lower()
not in self.shared_state.questions_requested_mech
]
random.seed(self.last_synced_timestamp)
num_questions = min(len(filtered_questions), self.params.multisend_batch_size)
random_questions = random.sample(filtered_questions, num_questions)
questions = random_questions
eligible_questions_id = self._eligible_questions_to_answer(unanswered_questions)

self.context.logger.info(f"{self.shared_state.questions_requested_mech=}")

if len(questions) == 0:
self.context.logger.info("No questions to close")
if len(eligible_questions_id) == 0:
self.context.logger.info("No eligible questions to answer")
return GetPendingQuestionsRound.NO_TX_PAYLOAD

self.context.logger.info(
f"Got {len(questions)} questions to close. " f"Questions: {questions}"
f"Got {len(eligible_questions_id)} questions to close. "
f"Questions ID: {eligible_questions_id}"
)

safe_address = self.synchronized_data.safe_contract_address
Expand All @@ -2327,7 +2367,7 @@ def get_payload(self) -> Generator[None, None, str]:

self.context.logger.info(f"Address {safe_address!r} has balance {balance}.")
max_num_questions = min(
len(questions), self.params.questions_to_close_batch_size
len(eligible_questions_id), self.params.questions_to_close_batch_size
)
bond_required = self.params.close_question_bond * max_num_questions

Expand All @@ -2342,14 +2382,17 @@ def get_payload(self) -> Generator[None, None, str]:

# Prepare the Mech Requests for these questions
new_mech_requests = []
for question in questions:
question_id = question["question"]["id"].lower()
if question_id in self.shared_state.questions_requested_mech:
# we already processed this question, skip it
self.context.logger.info(
f"Question {question_id} already processed, skipping it."
)
continue
for question_id in eligible_questions_id:
question = self.shared_state.questions_requested_mech[question_id][
"question"
]
retries = self.shared_state.questions_requested_mech[question_id]["retries"]
retries.append(self.last_synced_timestamp)

self.context.logger.info(
f"Requesting mech answer for question {question_id} ({question['title']})."
)
self.context.logger.info(f"Question {question_id} retries: {retries}.")

new_mech_requests.append(
asdict(
Expand All @@ -2360,7 +2403,6 @@ def get_payload(self) -> Generator[None, None, str]:
)
)
)
self.shared_state.questions_requested_mech[question_id] = question

self.context.logger.info(f"new_mech_requests: {new_mech_requests}")

Expand Down Expand Up @@ -2432,9 +2474,20 @@ def _get_payload(self) -> Generator[None, None, str]:
if question_id not in self.shared_state.questions_requested_mech:
continue

question = self.shared_state.questions_requested_mech[question_id]

question = self.shared_state.questions_requested_mech[question_id][
"question"
]
retries = self.shared_state.questions_requested_mech[question_id]["retries"]
answer = self._parse_mech_response(response)

if answer is None and len(retries) >= len(
self.params.answer_retry_intervals
):
self.context.logger.info(
f"Question {question} has been retried at timestamps {retries} without success. Assuming question is invalid."
)
answer = ANSWER_INVALID

self.context.logger.info(f"Got answer {answer} for question {question}")

if answer is None:
Expand Down Expand Up @@ -2469,6 +2522,7 @@ def _get_payload(self) -> Generator[None, None, str]:
# try to answer the same question multiple times due to a out-of-sync issue
# between the subgraph and the realitio contract.
self.shared_state.questions_responded.add(question_id)
del self.shared_state.questions_requested_mech[question_id]

if len(txs) == 0:
# something went wrong, respond with ERROR payload for now
Expand Down
3 changes: 3 additions & 0 deletions packages/valory/skills/market_creation_manager_abci/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
self.mech_interact_round_timeout_seconds = self._ensure(
"mech_interact_round_timeout_seconds", kwargs, type_=int
)
self.answer_retry_intervals = self._ensure(
key="answer_retry_intervals", kwargs=kwargs, type_=List[int]
)
super().__init__(*args, **kwargs)


Expand Down
Loading

0 comments on commit f3bc82d

Please sign in to comment.