-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add Firo peers #9
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe changes made in the pull request involve updating the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
… for reliable peer discovery.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (1)
contrib/systemd/electrumx.conf (1)
12-12
: Standardize service configuration formatThe SERVICES entries follow a consistent pattern but consider the following improvements:
- Separate SSL and TCP services into distinct configuration entries for better clarity
- Consider adding service priority indicators
Example format:
-SERVICES = ssl://electrumx01.firo.org:50002, tcp://electrumx01.firo.org:50001 +SSL_SERVICES = ssl://electrumx01.firo.org:50002 +TCP_SERVICES = tcp://electrumx01.firo.org:50001 +SERVICE_PRIORITY = ssl,tcpAlso applies to: 15-15, 18-18, 21-21
@@ -7,5 +7,18 @@ DAEMON_URL = http://username:password@hostname:port/ | |||
|
|||
# COIN = Bitcoin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add explicit COIN setting for Firo
The commented out COIN = Bitcoin
setting needs to be updated for Firo. This might be causing the peer validation issues reported in the logs.
Apply this change:
-# COIN = Bitcoin
+COIN = Firo
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
# COIN = Bitcoin | |
COIN = Firo |
PEER_HOST = electrumx01.firo.org | ||
SERVICES = ssl://electrumx01.firo.org:50002, tcp://electrumx01.firo.org:50001 | ||
|
||
PEER_HOST = electrumx02.firo.org | ||
SERVICES = ssl://electrumx02.firo.org:50002, tcp://electrumx02.firo.org:50001 | ||
|
||
PEER_HOST = electrumx03.firo.org | ||
SERVICES = ssl://electrumx03.firo.org:50002, tcp://electrumx03.firo.org:50001 | ||
|
||
PEER_HOST = electrumx.firo.org | ||
SERVICES = ssl://electrumx.firo.org:50002, tcp://electrumx.firo.org:50001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Based on the code analysis, I can now provide the final response:
Multiple PEER_HOST entries are not supported - use REPORT_SERVICES instead
The codebase shows that PEER_HOST is actually obsolete. The configuration should use REPORT_SERVICES for peer announcement. The current configuration format is incorrect because:
- The code explicitly marks PEER_HOST as obsolete in
Env.__init__
:self.obsolete(["MAX_SUBSCRIPTIONS", "MAX_SUBS", "MAX_SESSION_SUBS", "BANDWIDTH_LIMIT", "HOST", "TCP_PORT", "SSL_PORT", "RPC_HOST", "RPC_PORT", "REPORT_HOST"...])
- The proper way to configure services is through the SERVICES and REPORT_SERVICES settings, as shown in the Env class implementation.
Correct configuration should look like:
SERVICES = ssl://0.0.0.0:50002,tcp://0.0.0.0:50001
REPORT_SERVICES = ssl://electrumx01.firo.org:50002,tcp://electrumx01.firo.org:50001,ssl://electrumx02.firo.org:50002,tcp://electrumx02.firo.org:50001,ssl://electrumx03.firo.org:50002,tcp://electrumx03.firo.org:50001,ssl://electrumx.firo.org:50002,tcp://electrumx.firo.org:50001
🔗 Analysis chain
Verify peer configuration format and DNS resolution
- Multiple PEER_HOST entries might conflict. ElectrumX typically expects a single PEER_HOST setting. Consider using a comma-separated list or REPORT_HOST instead.
- Let's verify the DNS resolution for these peers:
Consider consolidating the peer configurations into a single REPORT_HOST setting or using environment-specific configuration files to avoid potential conflicts.
Let me gather more information about the configuration format by checking the ElectrumX codebase for how PEER_HOST is handled.
Let me check the actual configuration handling code to understand how PEER_HOST is processed.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify DNS resolution and TCP/SSL port accessibility for the new peers
echo "Checking DNS resolution for peer hosts..."
for host in electrumx01.firo.org electrumx02.firo.org electrumx03.firo.org electrumx.firo.org; do
echo "Resolving $host..."
host $host
done
# Search for any existing peer configurations in the codebase
echo -e "\nChecking for existing peer configurations..."
rg -l "PEER_HOST|REPORT_HOST" --type conf
# Check if these hosts are already defined in coins.py
echo -e "\nVerifying peer definitions in coins.py..."
rg "firo.org" --type py
Length of output: 1805
Script:
#!/bin/bash
# Search for PEER_HOST handling in the codebase
echo "Checking PEER_HOST handling in the code..."
rg "PEER_HOST" -A 5 --type py
# Check for any documentation or examples about peer configuration
echo -e "\nChecking for configuration documentation..."
fd README -t f -X cat {}
Length of output: 1369
Script:
#!/bin/bash
# Search for configuration handling in the server setup
echo "Checking server configuration handling..."
ast-grep --pattern 'class Env {
$$$
}'
# Look for specific configuration parsing
echo -e "\nChecking configuration parsing..."
rg -l "class.*Env" --type py | xargs cat
# Check for any sample configuration files
echo -e "\nChecking sample configurations..."
fd -e conf -e cfg -e sample -X cat {}
Length of output: 11986
Summary by CodeRabbit
New Features
Bug Fixes