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

ProviderContextManager is not concurrency-aware #2348

Open
fubuloubu opened this issue Oct 27, 2024 · 7 comments
Open

ProviderContextManager is not concurrency-aware #2348

fubuloubu opened this issue Oct 27, 2024 · 7 comments

Comments

@fubuloubu
Copy link
Member

Ran into this with a Silverback bot using the new FORK_MODE PR in the Silverback SDK (currently solving with an async concurrency lock)

Not sure this can be resolved without full async support of Ape's network management stack

Copy link

linear bot commented Oct 27, 2024

fubuloubu added a commit to ApeWorX/silverback that referenced this issue Oct 27, 2024
@fubuloubu
Copy link
Member Author

Not quite sure what the issue was, but it lead to weird "trying to fork network mainnet-fork is not possible" or "ecosystem 'base' has no network mainnet-fork-fork" bugs

@antazoey
Copy link
Member

Not quite sure what the issue was, but it lead to weird "trying to fork network mainnet-fork is not possible" or "ecosystem 'base' has no network mainnet-fork-fork" bugs

i can at least improve the error

@antazoey
Copy link
Member

Maybe this helps a little? #2349

@fubuloubu
Copy link
Member Author

Maybe this helps a little? #2349

Yes I believe that will prevent the error, but not totally ideal

I will learn if it works well enough or not when I try to implement backtesting to silverback (at some later date)

for reference, the backtesting mode of silverback takes a range of blocks and executes each block (and relevant event logs/transactions) in an isolated fork that only exists for the span of that one block

@antazoey
Copy link
Member

Wha about a fork-lock for each network so you can't fork until you hold the lock, waiting for other threads / processes to release the lock

@fubuloubu
Copy link
Member Author

Wha about a fork-lock for each network so you can't fork until you hold the lock, waiting for other threads / processes to release the lock

I don't think we need that now with the synchronous version, I will test this fix to see if it works good enough for my use case and get back to you

fubuloubu added a commit to ApeWorX/silverback that referenced this issue Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@fubuloubu @antazoey and others