Validator History: Fix gossip version - #295
Conversation
There was a problem hiding this comment.
Pull request overview
Updates validator-history’s gossip Version deserialization to match Agave/Solana v4’s packed minor/prerelease wire format, preventing prerelease versions (e.g., 4.0.0-rc.1) from being misrecorded on-chain. Also adds a small CLI “info” subcommand to report the number of ValidatorHistory accounts.
Changes:
- Implement Agave v4-compatible
Version(de)serialization using a packed-minor wrapper and add unit tests for stable vs prerelease encodings. - Add
InfoValidatorHistoryCountCLI subcommand and wire it into the validator-history CLI command tree. - Introduce a new
commands::infomodule for CLI “info” commands.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/validator-history-cli/src/main.rs | Wires a new InfoValidatorHistoryCount subcommand into the CLI. |
| utils/validator-history-cli/src/commands/mod.rs | Exposes the new info commands module. |
| utils/validator-history-cli/src/commands/info/mod.rs | Adds the info module entrypoint. |
| utils/validator-history-cli/src/commands/info/validator_history_count.rs | Implements the on-chain ValidatorHistory account counting command with optional JSON output. |
| programs/validator-history/src/crds_value.rs | Fixes gossip Version wire decoding for Agave v4 packed-minor prerelease format; adds focused unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ebatsell
left a comment
There was a problem hiding this comment.
could we get an integration test on this instruction that uses the 4.0.0-rc.1 version as input in the format we're getting from gossip as a ContactInfo?
|
They bring new tag (prerelease tag) which is not stored in Validator History account. |
https://github.com/anza-xyz/agave/blob/master/version/src/v4.rs