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

feat: support mesc #8760

Merged
merged 1 commit into from
Aug 29, 2024
Merged

feat: support mesc #8760

merged 1 commit into from
Aug 29, 2024

Conversation

onbjerg
Copy link
Member

@onbjerg onbjerg commented Aug 27, 2024

Motivation

mesc is a cross-tool endpoint management tool that allows users to manage endpoints across chains, set defaults, and aliases.

We already have some pre-existing ways to do this in Foundry (i.e. rpc aliases in foundry.toml), but supporting mesc makes sense going forward. I'd also recommend that we consider deprecating the endpoint management stuff we have currently at some point in the future.

Solution

Before looking at rpc aliases in foundry.toml, we query mesc first. mesc can handle things like the chain name, chain ID, a raw url, aliases and more.

This PR does not change the default foundry url based on mesc as I felt that might be too big of a change, given setting an RPC url in some contexts ends up enabling forking or other behavior

Closes #8502

@onbjerg onbjerg added T-feature Type: feature C-forge Command: forge A-config Area: config labels Aug 27, 2024
Copy link
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

lgtm, just a question on priority of aliases

crates/config/src/lib.rs Show resolved Hide resolved
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

cool, love this

@onbjerg onbjerg enabled auto-merge (squash) August 29, 2024 12:21
@onbjerg onbjerg merged commit 98ab45e into master Aug 29, 2024
21 checks passed
@onbjerg onbjerg deleted the onbjerg/mesc branch August 29, 2024 12:27
return Some(endpoint.map(Cow::Owned))
}

if let Ok(Some(endpoint)) = mesc::get_endpoint_by_query(maybe_alias, Some("foundry")) {
Copy link
Member

Choose a reason for hiding this comment

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

We're ignoring the Err variant here, is this right? @onbjerg @klkvr

Copy link
Member Author

Choose a reason for hiding this comment

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

there are errors in there related to eg mesc not being enabled and such, which is why i chose to ignore it. don't want it to fail for people not using mesc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-config Area: config C-forge Command: forge T-feature Type: feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(config): add MESC support
4 participants