Skip to content

Conversation

@wanwiset25
Copy link
Collaborator

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

Types of changes

What types of changes does your code introduce to XDC network?
Put an in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)
  • Regular KTLO or any of the maintaince work. e.g code style
  • CICD Improvement

Impacted Components

Which part of the codebase this PR will touch base on,

Put an in the boxes that apply

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Checklist

Put an in the boxes once you have confirmed below actions (or provide reasons on not doing so) that

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

Copilot AI review requested due to automatic review settings January 20, 2026 00:02
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. 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.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

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 adds functionality to publish node coinbase addresses to the stats server, enabling better node identification and monitoring. The changes modify the ethstats service to extract and send the coinbase address from the node's account manager, and update deployment scripts to make stats server configuration more flexible through environment variables.

Changes:

  • Modified ethstats service to fetch and publish coinbase address from the first account in AccountManager
  • Added new Coinbase field to nodeInfo struct that is sent to the stats server during authentication
  • Refactored deployment scripts to extract hardcoded stats server configuration into environment variables with sensible defaults

Reviewed changes

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

File Description
ethstats/ethstats.go Added AccountManager interface method, coinbase field to Service struct, and logic to extract and publish coinbase address
cicd/testnet/start.sh Extracted stats server configuration to environment variables, changed GC_MODE default from archive to full
cicd/mainnet/start.sh Extracted stats server configuration to environment variables, changed GC_MODE default from archive to full
cicd/local/start.sh Extracted stats server configuration to environment variables, added ethstats flag to XDC command

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

accounts := am.Accounts()
if len(accounts) > 0 {
coinbase := accounts[0]
ethstats.coinbase = coinbase.String0x()
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The variable coinbase is of type accounts.Account, not common.Address. The String0x() method is defined on common.Address. You need to access the Address field of the Account struct. Change this to coinbase.Address.String0x().

Suggested change
ethstats.coinbase = coinbase.String0x()
ethstats.coinbase = coinbase.Address.String0x()

Copilot uses AI. Check for mistakes.
fi

gc_mode=archive
gc_mode=full
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The default GC_MODE has been changed from "archive" to "full". This is a significant behavioral change that could affect historical data retention. Archive mode stores all historical state, while full mode only stores recent state. Please ensure this change is intentional and documented, as it may impact nodes that rely on historical state queries.

Copilot uses AI. Check for mistakes.
fi

gc_mode=archive
gc_mode=full
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The default GC_MODE has been changed from "archive" to "full". This is a significant behavioral change that could affect historical data retention. Archive mode stores all historical state, while full mode only stores recent state. Please ensure this change is intentional and documented, as it may impact nodes that rely on historical state queries.

Copilot uses AI. Check for mistakes.
Comment on lines +212 to 218
if am := backend.AccountManager(); am != nil {
accounts := am.Accounts()
if len(accounts) > 0 {
coinbase := accounts[0]
ethstats.coinbase = coinbase.String0x()
}
}
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

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

The new coinbase functionality added in the New() function lacks test coverage. Consider adding a test case to verify that the coinbase address is correctly extracted from the AccountManager and stored in the Service struct, as well as a test case for when AccountManager is nil or has no accounts.

Copilot uses AI. Check for mistakes.
engine: engine,
server: node.Server(),
node: parts[0],
coinbase: "", // will be set below
Copy link
Collaborator

Choose a reason for hiding this comment

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

coinbase: "" this line can be removed

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.

5 participants