Skip to content

feat(config): support deterministic addresses in config #2593

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

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

Conversation

fubuloubu
Copy link
Member

What I did

Support deterministic address config

fixes: #2590

How I did it

Add deterministic DeploymentConfig objects to every network

How to verify it

See issue

Checklist

  • All changes are completed
  • Change is covered in tests
  • Documentation is complete

@fubuloubu fubuloubu requested a review from antazoey April 30, 2025 22:35
@fubuloubu fubuloubu force-pushed the feat/config-deterministic-addresses branch from 3b20684 to e3cf68b Compare May 1, 2025 00:10
Copy link
Member

@antazoey antazoey left a comment

Choose a reason for hiding this comment

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

approved, but see comments! you'll like some of the feedback I think

Note on the tests: macos is currently failing occasionally on the gas flag integration tests, I'm looking into it now.. As long the Ubunutu's pass, can merge

if network_name not in ecosystem.networks:
raise ConfigError(
f"Invalid network '{ecosystem_name}:{network_name}' in deployments config."
)

# NOTE: Merge deterministic deployments after we initializing `NetworkManager.ecosystems`
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# NOTE: Merge deterministic deployments after we initializing `NetworkManager.ecosystems`
# NOTE: Merge deterministic deployments after we initialize `NetworkManager.ecosystems`

if network_name not in ecosystem.networks:
raise ConfigError(
f"Invalid network '{ecosystem_name}:{network_name}' in deployments config."
)

# NOTE: Merge deterministic deployments after we initializing `NetworkManager.ecosystems`
for ecosystem_name, ecosystem in self.network_manager.ecosystems.items():
if ecosystem_name not in self.deployment_data:
Copy link
Member

Choose a reason for hiding this comment

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

you can do this neat trick:

self.deployment_data.setdefault(ecosystem_name, {})

It does exactly the same as what you're doing here:

for ecosystem_name, ecosystem in self.network_manager.ecosystems.items():
            if ecosystem_name not in self.deployment_data:

@@ -297,6 +297,25 @@ def test_deployments(networks_connected_to_tester, owner, vyper_contract_contain
assert deployment.address == instance.address


def test_deterministic_deployments(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
def test_deterministic_deployments(
def test_deployments_deterministic(

I know this sounds backwards, but it lets us do this in pytest:

-k test_deployments

to run all deployments related tests at once, which is something i do a lot: run all related tests at once when sseeing if broke something

Copy link

github-actions bot commented Jun 2, 2025

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days.

@github-actions github-actions bot added the stale No activity for 30 days label Jun 2, 2025
@fubuloubu fubuloubu removed the stale No activity for 30 days label Jun 2, 2025
Copy link

github-actions bot commented Jul 3, 2025

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days.

@github-actions github-actions bot added the stale No activity for 30 days label Jul 3, 2025
Copy link

github-actions bot commented Jul 8, 2025

This PR was closed because it has been inactive for 35 days.

@github-actions github-actions bot added the inactive no recent activity, closed label Jul 8, 2025
@github-actions github-actions bot closed this Jul 8, 2025
@fubuloubu fubuloubu removed stale No activity for 30 days inactive no recent activity, closed labels Jul 12, 2025
@fubuloubu fubuloubu reopened this Jul 12, 2025
@fubuloubu fubuloubu force-pushed the feat/config-deterministic-addresses branch from af2b8c5 to cf5e573 Compare July 14, 2025 19:11
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

Successfully merging this pull request may close these issues.

Allow specifying deterministic deployments via single address
2 participants