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

fix: contract_type cache corruption #2540

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

BowTiedDevil
Copy link
Contributor

Fixes #2539

@fubuloubu fubuloubu changed the title Fix for contract_type cache corruption fix: contract_type cache corruption Mar 7, 2025
Copy link
Contributor

@bitwise-constructs bitwise-constructs left a comment

Choose a reason for hiding this comment

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

Clean fix, thank you

@BowTiedDevil BowTiedDevil marked this pull request as ready for review March 7, 2025 17:10
@antazoey
Copy link
Member

antazoey commented Mar 8, 2025

I'd like a test for this before calling it good, but I am happy to write such test.

address, contract_type=contract_type
)
# Store contract_type in cache only if missing
if (contract := self.chain_manager.contracts.instance_at(address)) is None:
Copy link
Member

Choose a reason for hiding this comment

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

I don't think instance_at() returns None, you probably want .get_contract_type() here.

Suggested change
if (contract := self.chain_manager.contracts.instance_at(address)) is None:
if (contract_type := self.chain_manager.contracts.get_contract_type(address)) is None:

@BowTiedDevil
Copy link
Contributor Author

I'd like a test for this before calling it good, but I am happy to write such test.

If you have a test in mind, please do! I am traveling today but can get back to the workstation to pick up this (and other) changes on Monday morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants