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

Batch window is too wide #133

Closed
dagacha opened this issue Nov 13, 2023 · 2 comments · Fixed by #141
Closed

Batch window is too wide #133

dagacha opened this issue Nov 13, 2023 · 2 comments · Fixed by #141
Assignees
Labels
bug Something isn't working

Comments

@dagacha
Copy link
Collaborator

dagacha commented Nov 13, 2023

Error obtained by running release v0.9.2. Current batch window of 5000 returns RPC error

[2023-11-13 17:25:10,927] [ERROR] [agent] The RPC timed out! This usually happens if the filtering is too wide. The service tried to filter from block 30170114 to 30175114.If this issue persists, please try lowering the EVENT_FILTERING_BATCH_SIZE!
[2023-11-13 17:25:10,928][ERROR] [agent] Could not successfully interact with the valory/conditional_tokens:0.1.0 contract using 'check_redeemed': Message(sender=valory/ledger:0.19.0,to=valory/trader_abci:0.1.0,dialogue_reference=('631e23f23f33a15419cb22da1b0509a269db980dfc8a77761f3fc1b2060ba111', '08f22f9c89ab1cda9f7d4a1e187baa8a9664f32b9cf433ede30ca4715d9d5f10'),message_id=-1,performative=raw_transaction,raw_transaction=RawTransaction: ledger_id=ethereum, body={'error': 'The RPC timed out! This usually happens if the filtering is too wide. The service tried to filter from block 30170114 to 30175114.If this issue persists, please try lowering the EVENT_FILTERING_BATCH_SIZE!'},target=1)

@dagacha dagacha added the bug Something isn't working label Nov 13, 2023
@Adamantios
Copy link
Collaborator

This issue is unpredictable and can occur when the RPC times out. The RPC can time out when the number of the filtering blocks is too wide. For this reason, we have used a small batch size of 5000 as a default.

If you let the service run, it will eventually manage to perform the filtering operation.
Otherwise, you could restart the service with a smaller window as the error message suggests:

If this issue persists, please try lowering the EVENT_FILTERING_BATCH_SIZE

You could try for example:

export EVENT_FILTERING_BATCH_SIZE=4000

Some things to note:

  • Smaller window means more time to complete the round, more RPC requests, and less probable to get timeouts from the RPC provider.
  • Larger window means less time to complete the round, fewer RPC requests, and more probable to get timeouts from the RPC provider.

There is a trade-off when choosing this value, and the optimal value also changes based on the RPC provider that you are using.

@Adamantios
Copy link
Collaborator

#141 adds a dynamic window reduction, which means it should be handled automatically now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants