Skip to content

Conversation

@GTC6244
Copy link
Contributor

@GTC6244 GTC6244 commented Dec 26, 2025

Pull request overview

This PR introduces a chain fault testing framework to test node behavior when blockchain connectivity is disrupted. The framework leverages Toxiproxy to simulate network faults between nodes and blockchain endpoints, enabling automated testing of node resilience and validator kick mechanisms.

Key changes:

  • Adds new chain fault test infrastructure with proxy-based blockchain connection simulation
  • Implements helper functions to disable/enable chain connections for individual nodes
  • Extends testnet configuration to support signing round timeout customization
  • Adds utility function in Actions to bulk update complaint configurations for testing

@GTC6244 GTC6244 self-assigned this Dec 26, 2025
Copilot AI review requested due to automatic review settings December 26, 2025 22:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a chain fault testing framework to test node behavior when blockchain connectivity is disrupted. The framework leverages Toxiproxy to simulate network faults between nodes and blockchain endpoints, enabling automated testing of node resilience and validator kick mechanisms.

Key changes:

  • Adds new chain fault test infrastructure with proxy-based blockchain connection simulation
  • Implements helper functions to disable/enable chain connections for individual nodes
  • Extends testnet configuration to support signing round timeout customization
  • Adds utility function in Actions to bulk update complaint configurations for testing

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
rust/lit-node/lit-node/tests/toxiproxy/chain_faults.rs New test file implementing chain connection fault testing, specifically testing node kick behavior when a node loses blockchain connectivity
rust/lit-node/lit-node/tests/toxiproxy/mod.rs Exports the new chain_faults module
rust/lit-node/lit-node/tests/common/faults.rs Adds helper functions for chain-specific proxy setup and fault injection (enable/disable chain connections)
rust/lit-node/lit-node-testnet/src/testnet/node_config.rs Extends node configuration builder to support custom signing round timeout settings
rust/lit-node/lit-node-testnet/src/testnet/actions.rs Adds bulk complaint configuration update utility for testing
rust/lit-node/lit-node-testnet/src/lib.rs Integrates signing round timeout configuration into TestSetupBuilder
rust/lit-core/lit-blockchain/src/contracts/mod.rs Implements proxy port remapping for blockchain providers when proxy_chatter feature is enabled
rust/lit-node/lit-node/Cargo.toml Updates feature flags to include blockchain testing support
rust/lit-node/lit-node-testnet/Cargo.toml Removes duplicate proxy-chatter feature definition
rust/lit-core/lit-blockchain/Cargo.toml Adds testing and proxy_chatter feature flags
rust/lit-node/shiva/log_levels.toml Increases lit_blockchain log level to trace for debugging
rust/lit-node/lit-node/src/git_info.rs Updates git commit hash (auto-generated)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Dec 27, 2025

PASS [ 43.194s] (3/3) lit_node::test toxiproxy::perf_tests::load_with_no_latency
PASS [ 43.270s] (2/3) lit_node::test toxiproxy::perf_tests::load_with_50ms_latency_single_link
PASS [ 90.819s] (1/3) lit_node::test toxiproxy::perf_tests::load_with_50ms_latency_all_links

@GTC6244 GTC6244 changed the title Chain fault testing framework Chain fault testing framework + Enable auto-rejoin Jan 3, 2026
Copy link

@DashKash54 DashKash54 left a comment

Choose a reason for hiding this comment

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

Looks good but left a few questions

Choose a reason for hiding this comment

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

Is this the only place we need to update the provider?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup - code is nicely centralized. ;-)

}

// shortcut function to update all complaint configs to the same interval and tolerance for testing
pub async fn update_all_complaint_configs(

Choose a reason for hiding this comment

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

Which testing scenario is this used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used it for the auto-rejoin test ( not part of this PR ). Also used in the upgrade tests ( also not part of this PR! ).

It's basically a shortcut to make tests work faster ;-)

Choose a reason for hiding this comment

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

Can remove the test: kick_node_who_loses_chain_connection since it's being tested in the auto-rejoin test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's probably redundant now. I might leave it and tag it as #[ignore]

Copy link
Contributor

@glitch003 glitch003 left a comment

Choose a reason for hiding this comment

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

yay excited to see this test!

@GTC6244 GTC6244 merged commit c03dacb into master Jan 13, 2026
3 checks passed
@GTC6244 GTC6244 deleted the feature/node-4901-chain-fault-tests-framework branch January 13, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants