feat: add V-PROGRAM to address stats sort keys and counts - #292
Merged
Conversation
SortByMessageType gains V_PROGRAM and AddressStats a v_program counter (defaulting to 0 so responses from nodes that do not report it still parse, given extra="forbid").
foxpatch-aleph
approved these changes
Aug 25, 2026
foxpatch-aleph
left a comment
There was a problem hiding this comment.
A small, focused PR that adds V-PROGRAM support to the address stats query and response models. The new enum value, model field with default=0 (for backward compatibility with servers that don't yet return v_program), and docstring update are all correct. The two new unit tests properly verify the filter serialization and model default behavior. No bugs, security issues, or logic errors found.
tests/unit/test_asynchronous_get.py (line 399): Minor: the two new tests are placed after the if __name__ == "__main__" block (line 395). This works fine with pytest but is slightly unusual. Consider moving them above that block for consistency.
|
Failed to retrieve llama text: POST 502: Bad Gateway |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SortByMessageType.V_PROGRAM = "v_program"forAddressesFilter(sort_by=...).AddressStats.v_program: int = 0. The model isextra="forbid", so without this the SDK would fail to parse/api/v1/addresses/stats.jsonthe day pyaleph starts returning av_programcolumn; the default keeps it working with nodes that do not.Note: pyaleph's
get_message_stats_by_addressdoes not expose av_programcolumn yet, sosortBy=v_programis not accepted server-side today. This PR only makes the client ready; the server change is a separate pyaleph PR.Test plan
pytest tests/unit(240 passed)🤖 Generated with Claude Code
https://claude.ai/code/session_018hGRkZE1a3i19yrf2uBasD