-
Notifications
You must be signed in to change notification settings - Fork 0
API & Writer Service: Add running_bam field
#23
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
Conversation
| }) | ||
| .unwrap_or(false); | ||
| .map(|entry| ClientType::from_u8(entry.client_type)); | ||
| let is_jito_client = matches!(client_type, Some(ClientType::JitoLabs)); |
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.
There could be a case where both running_jito and running_bam are true. In this case, should we prioritize running_bam?
let running_jito = if matches!(client_type, Some(ClientType::Bam)) {
false
} else {
let is_jito_client = matches!(client_type, Some(ClientType::JitoLabs));
has_tip_account || is_jito_client
}https://www.validators.app/validators/Ft4ADhkxMVfgxNDQFqA3ymaNGC39rCHdUj6H8KEWQqXy?locale=en&network=testnet
{
"vote_account": "AmZs4Pkjs7fXCDfKDfydJnv7xKRk12DgNXynfL3boYty",
"mev_commission_bps": 1000,
"mev_rewards": 0,
"priority_fee_commission_bps": 10000,
"priority_fee_rewards": 0,
"running_jito": true,
"running_bam": true,
"active_stake": 241668580401242
},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.
Is this something the client-side logic can handle? To me, makes sense for the backend (kobe) to expose the correct values for both fields.
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.
Pull Request Overview
This PR adds support for tracking the BAM validator client type alongside the existing Jito client tracking. It also includes development environment improvements by commenting out MongoDB authentication in docker-compose and updating documentation to reflect unauthenticated MongoDB connections.
Key changes:
- Added
running_bamfield to track validators running the BAM client (similar to existingrunning_jitotracking) - Refactored client type detection logic to be more reusable across multiple client types
- Updated MongoDB configuration to run without authentication for easier local development
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/client_type.rs | Added Bam variant to ClientType enum with value mapping of 6 |
| core/src/fetcher.rs | Refactored client type detection and added running_bam field to ChainData |
| core/src/db_models/validators.rs | Added running_bam field to Validator model with documentation |
| api/src/schemas/validator.rs | Added running_bam field to ValidatorEntry schema |
| api/src/resolvers/query_resolver.rs | Populated running_bam field in query responses |
| docker-compose.yml | Commented out MongoDB authentication environment variables |
| README.md | Updated MongoDB connection URI example to remove authentication |
| .gitignore | Removed overly broad .env** pattern |
| .env.example | Added example environment configuration file |
Comments suppressed due to low confidence (1)
core/src/client_type.rs:25
- The documentation comment should be updated to include the new BAM client type mapping (6: BAM) in the list of client type values.
/// - Other values: Stored as `Other(value)`
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
core/src/fetcher.rs
Outdated
| mev_commission_bps, | ||
| mev_revenue_lamports, | ||
| running_jito, | ||
| running_bam: matches!(client_type, Some(ClientType::Bam)), |
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.
Nit; would prefer a let is_bam_client ... just like we have let is_jito_client instead of the inline eval here.
|
|
||
| credentials/ | ||
| scripts/keys | ||
| *.env** |
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.
can we keep plain .env here so someone doesn't accidentally commit their own real one
No description provided.