Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally skip failed question claimings #586

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions prediction_market_agent_tooling/markets/omen/omen_resolving.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,25 @@ def claim_bonds_on_realitio_questions(
questions: list[RealityQuestion],
auto_withdraw: bool,
web3: Web3 | None = None,
skip_failed: bool = False,
) -> list[HexBytes]:
claimed_questions: list[HexBytes] = []

for idx, question in enumerate(questions):
logger.info(
f"[{idx+1} / {len(questions)}] Claiming bond for {question.questionId=} {question.url=}"
)
claim_bonds_on_realitio_question(
api_keys, question, auto_withdraw=auto_withdraw, web3=web3
)
claimed_questions.append(question.questionId)
try:
claim_bonds_on_realitio_question(
api_keys, question, auto_withdraw=auto_withdraw, web3=web3
)
claimed_questions.append(question.questionId)
except Exception as e:
if not skip_failed:
raise e
logger.error(
f"Failed to claim bond for {question.url=}, {question.questionId=}: {e}"
)
Comment on lines +54 to +55
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to GCP, here's the error

eb3.exceptions.ContractLogicError: ('execution reverted: History input provided did not match the expected hash', 

I imagine there's a bug with the history input?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No there isn't. That question has just 1 answer, not much to get wrong there. On localhost, it also failed a few times on "already claimed". And then it suddenly passed 🤷 Weird times!


return claimed_questions

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "prediction-market-agent-tooling"
version = "0.57.12"
version = "0.57.13"
description = "Tools to benchmark, deploy and monitor prediction market agents."
authors = ["Gnosis"]
readme = "README.md"
Expand Down
Loading