Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 11, 2025

Fix DXP-710

fix: consider localnet in check_studio_based_rpc for leader-only mode

Summary

This PR fixes the issue where running gltest on localnet with leader_only=True would show a warning "Leader only mode: True (enabled on non-studio network - will have no effect)" and would not actually enable leader-only mode.

Changes:

  • Modified check_studio_based_rpc() in gltest_cli/config/types.py to return True for both "studionet" and "localnet" (previously only "studionet")
  • Added test case test_check_studio_based_rpc_with_localnet() to verify localnet returns True
  • Updated test_check_studio_based_rpc_with_non_studionet() to use testnet_asimov instead of localnet for the negative case
  • Updated test_general_config_chain_methods_compatibility() to expect True for localnet

Impact:
This change affects three call sites where check_studio_based_rpc() is used to determine whether to enable leader-only mode:

  1. Warning message in gltest_cli/config/plugin.py
  2. Leader-only flag in gltest/contracts/contract.py (write operations)
  3. Leader-only flag in gltest/contracts/contract_factory.py (deployments)

Review & Testing Checklist for Human

  • Test leader-only mode on localnet: Run gltest --leader-only tests/ on localnet and verify:
    • No warning about "enabled on non-studio network" appears
    • Leader-only mode is actually enabled (check logs or behavior)
    • Contracts deploy and execute correctly
  • Consider method naming: The method check_studio_based_rpc() now returns True for localnet, which may be semantically confusing. Consider if it should be renamed to something like supports_leader_only_mode() or is_leader_only_network() in a follow-up PR
  • Verify no side effects: Confirm there are no other places in the codebase that rely on check_studio_based_rpc() returning False for localnet

Notes

- Updated check_studio_based_rpc() to return True for both studionet and localnet
- Added test case for localnet returning True from check_studio_based_rpc()
- Updated test_check_studio_based_rpc_with_non_studionet to use testnet_asimov
- Updated test_general_config_chain_methods_compatibility to expect True for localnet

This fixes the warning 'Leader only mode: True (enabled on non-studio network - will have no effect)' when running gltest on localnet with leader_only mode enabled.

Co-Authored-By: daniel@genlayerlabs.com <danielrojasc888@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link

coderabbitai bot commented Nov 11, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@danieljrc888 danieljrc888 self-assigned this Nov 11, 2025
@cristiam86 cristiam86 merged commit 8f1d3cb into main Nov 12, 2025
3 checks passed
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.

3 participants