Skip to content

feat: add abstract rpc configuration in localnet guide + foreign policy serialization fix#2180

Merged
netrome merged 5 commits intomainfrom
2177-add-abstract-rpc-configuration-in-localnet-guide
Feb 19, 2026
Merged

feat: add abstract rpc configuration in localnet guide + foreign policy serialization fix#2180
netrome merged 5 commits intomainfrom
2177-add-abstract-rpc-configuration-in-localnet-guide

Conversation

@netrome
Copy link
Collaborator

@netrome netrome commented Feb 19, 2026

closes #2177

Additionally, this PR also adds configuration for Starknet and two small broken-window fixes:

  1. Abstract wasn't listed as a supported chain.
  2. The foreign policy config serialized a bunch of null fields.

@netrome netrome self-assigned this Feb 19, 2026
@netrome netrome linked an issue Feb 19, 2026 that may be closed by this pull request
Comment on lines +790 to +791
dtos::ForeignChain::Abstract
| dtos::ForeignChain::Solana
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the broken-window fix

Copy link
Contributor

@gilcu3 gilcu3 Feb 19, 2026

Choose a reason for hiding this comment

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

strange that we missed this, didn't we have an end2end test for Abstract?

"request": {
"request": {
"Starknet": {
"tx_id": "025c84e568751d2e3189357b3f48690e4e987084204bc82ebde1d51ec3948fd8",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will probably not work after some time as starknet RPCs may not serve all txs forever, but adding some "refresh" or query script to generate these args felt out of scope for now.

@netrome netrome marked this pull request as ready for review February 19, 2026 13:21
@netrome netrome force-pushed the 2177-add-abstract-rpc-configuration-in-localnet-guide branch from 83ba95f to 4268e58 Compare February 19, 2026 13:21
@claude
Copy link

claude bot commented Feb 19, 2026

PR title type suggestion: This PR modifies a source code file (crates/node/src/coordinator.rs) along with documentation files. If the coordinator change includes logic or configuration modifications, consider using feat: or chore: instead of docs:.
Suggested title: feat: add abstract rpc configuration in localnet guide (if adding new functionality) or chore: add abstract rpc configuration support (if routine maintenance).

@claude
Copy link

claude bot commented Feb 19, 2026

PR title type suggestion: This PR modifies source code in crates/node/src/coordinator.rs alongside documentation changes. If these changes add new RPC configuration functionality, the type prefix should probably be feat: instead of docs:.
Suggested title: feat: add abstract rpc configuration in localnet guide

@claude
Copy link

claude bot commented Feb 19, 2026

Code Review

This PR adds Abstract and Starknet RPC configuration to the localnet guide, adds a Starknet foreign tx verification args file, and fixes a bug where Abstract was missing from is_supported_foreign_chain.

Potential Issue

is_supported_foreign_chain is a manual allowlist without exhaustive matching (coordinator.rs:787-796)

The ForeignChain enum has 8 variants (Solana, Bitcoin, Ethereum, Base, Bnb, Arbitrum, Abstract, Starknet), but is_supported_foreign_chain only matches 5 of them. The fact that Abstract was missing until this "broken-window fix" demonstrates the fragility of this approach — every time a new variant is added to ForeignChain, someone must remember to update this function.

Since the enum is #[non_exhaustive], an exhaustive match isn't possible from outside the defining crate. However, consider one of:

  1. Explicitly return false for the unsupported variants and add a wildcard with a comment, making it clear which chains are intentionally unsupported:

    fn is_supported_foreign_chain(chain: &dtos::ForeignChain) -> bool {
        match chain {
            dtos::ForeignChain::Abstract
            | dtos::ForeignChain::Solana
            | dtos::ForeignChain::Bitcoin
            | dtos::ForeignChain::Ethereum
            | dtos::ForeignChain::Starknet => true,
            // Intentionally unsupported:
            dtos::ForeignChain::Base
            | dtos::ForeignChain::Bnb
            | dtos::ForeignChain::Arbitrum => false,
            // Non-exhaustive catch-all for future variants
            _ => false,
        }
    }

    This way, when a new variant is added, it falls to the wildcard and is explicitly unsupported rather than silently dropped. More importantly, the intent is documented.

  2. Add a unit test for the unsupported variants to make the intent explicit and ensure it's reviewed when new variants are added.

This is not a merge blocker given the existing code already had this pattern, but it's worth addressing since this PR is literally fixing the exact class of bug this pattern enables.

Minor note

The test is_supported_foreign_chain__supports_abstract follows the project convention from CONTRIBUTING.md but uses supports_ instead of should_support_. The existing starknet test uses the same pattern, so this is consistent within the file. Not a blocker.

No other critical issues found. The docs changes, config template updates, and the bug fix with its accompanying test all look correct.

@netrome
Copy link
Collaborator Author

netrome commented Feb 19, 2026

PR title type suggestion: This PR modifies source code in crates/node/src/coordinator.rs alongside documentation changes. If these changes add new RPC configuration functionality, the type prefix should probably be feat: instead of docs:. Suggested title: feat: add abstract rpc configuration in localnet guide

Nah, that's a broken-window fix. Could be broken out but this is mainly a docs PR.

@netrome
Copy link
Collaborator Author

netrome commented Feb 19, 2026

Code Review

This PR adds Abstract and Starknet RPC configuration to the localnet guide, adds a Starknet foreign tx verification args file, and fixes a bug where Abstract was missing from is_supported_foreign_chain.

Potential Issue

is_supported_foreign_chain is a manual allowlist without exhaustive matching (coordinator.rs:787-796)

The ForeignChain enum has 8 variants (Solana, Bitcoin, Ethereum, Base, Bnb, Arbitrum, Abstract, Starknet), but is_supported_foreign_chain only matches 5 of them. The fact that Abstract was missing until this "broken-window fix" demonstrates the fragility of this approach — every time a new variant is added to ForeignChain, someone must remember to update this function.

Since the enum is #[non_exhaustive], an exhaustive match isn't possible from outside the defining crate. However, consider one of:

1. **Explicitly return `false` for the unsupported variants and add a wildcard with a comment**, making it clear which chains are intentionally unsupported:
   ```rust
   fn is_supported_foreign_chain(chain: &dtos::ForeignChain) -> bool {
       match chain {
           dtos::ForeignChain::Abstract
           | dtos::ForeignChain::Solana
           | dtos::ForeignChain::Bitcoin
           | dtos::ForeignChain::Ethereum
           | dtos::ForeignChain::Starknet => true,
           // Intentionally unsupported:
           dtos::ForeignChain::Base
           | dtos::ForeignChain::Bnb
           | dtos::ForeignChain::Arbitrum => false,
           // Non-exhaustive catch-all for future variants
           _ => false,
       }
   }
   ```
   
   
       
         
       
   
         
       
   
       
     
   This way, when a new variant is added, it falls to the wildcard and is explicitly unsupported rather than silently dropped. More importantly, the intent is documented.

2. **Add a unit test for the unsupported variants** to make the intent explicit and ensure it's reviewed when new variants are added.

This is not a merge blocker given the existing code already had this pattern, but it's worth addressing since this PR is literally fixing the exact class of bug this pattern enables.

Minor note

The test is_supported_foreign_chain__supports_abstract follows the project convention from CONTRIBUTING.md but uses supports_ instead of should_support_. The existing starknet test uses the same pattern, so this is consistent within the file. Not a blocker.

No other critical issues found. The docs changes, config template updates, and the bug fix with its accompanying test all look correct.

Thanks, you make some good points - but the concrete suggestions doesn't seem to improve the situation as it would still be easy to "forget" about this change and they don't provide compile time guarantees. We should focus on better and more comprehensive testing instead imo.

Comment on lines 25 to 36
pub struct ForeignChainsConfig {
#[serde(default)]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub solana: Option<SolanaChainConfig>,
#[serde(default)]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub bitcoin: Option<BitcoinChainConfig>,
#[serde(default)]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ethereum: Option<EthereumChainConfig>,
#[serde(default)]
#[serde(default, skip_serializing_if = "Option::is_none")]
#[serde(rename = "abstract")]
pub abstract_chain: Option<AbstractChainConfig>,
#[serde(default)]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub starknet: Option<StarknetChainConfig>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Another unrelated broken-window fix. I noted a bunch of ethereum: null and solana: null fields appearing in the config. Don't know where we write to the config file, but let's primarily just not add these.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah I see we added this for the web_ui host+port to SocketAddr change, that explains why we're writing to the config. Fair enough.

@claude
Copy link

claude bot commented Feb 19, 2026

PR title type suggestion: This PR modifies source code files (crates/node/src/) in addition to documentation, so the type prefix should probably be feat: instead of docs:.
Suggested title: feat: add abstract rpc configuration support

gilcu3
gilcu3 previously approved these changes Feb 19, 2026
Copy link
Contributor

@gilcu3 gilcu3 left a comment

Choose a reason for hiding this comment

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

Thank you!

@claude
Copy link

claude bot commented Feb 19, 2026

PR title type suggestion: This PR adds new source code functionality for Abstract chain RPC configuration support across multiple files (foreign_chains.rs, coordinator.rs). While documentation is included, the primary intent is implementing a new feature. The type prefix should probably be feat: instead of docs:.

Suggested title: feat: add abstract rpc configuration support

# Keep generated YAML tags intact by editing only the trailing `foreign_chains` section.
config_text = (
re.sub(r"\nforeign_chains:\n[\s\S]*\Z", "\n", config_text).rstrip() + "\n"
re.sub(r"\nforeign_chains:[\s\S]*\Z", "\n", config_text).rstrip() + "\n"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Needed because the serialization format changed now. This would look like foreign_chains: {}

@netrome netrome changed the title docs: add abstract rpc configuration in localnet guide feat: add abstract rpc configuration in localnet guide + foreign policy serialization fix Feb 19, 2026
@netrome netrome enabled auto-merge February 19, 2026 14:12
@netrome netrome added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit ea2e6a1 Feb 19, 2026
14 checks passed
@netrome netrome deleted the 2177-add-abstract-rpc-configuration-in-localnet-guide branch February 19, 2026 14:55
@netrome netrome deleted the 2177-add-abstract-rpc-configuration-in-localnet-guide branch February 19, 2026 14:55
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.

Add abstract RPC configuration in localnet guide

3 participants