Skip to content

Conversation

@ptrus
Copy link
Member

@ptrus ptrus commented Dec 10, 2025

Fixes: #1218

TODO:

  • don't merge this until explorer is able to handle the int->string changes for the voting power etc
    • was done but not yet pushed to prod, lets just merge this

@ptrus ptrus requested a review from Copilot December 15, 2025 08:37
@ptrus ptrus force-pushed the ptrus/feature/validator-ids branch 3 times, most recently from 456791b to 711d298 Compare December 15, 2025 08:39
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 support for filtering validators by entity ID or node ID in the /v1/consensus/validators endpoint. Users can now query validators using an id parameter that accepts base64-encoded ed25519 public keys corresponding to either the entity ID or node ID.

Key Changes

  • Added id query parameter to the validators endpoint that filters by entity or node ID
  • Updated database query to support filtering by both entity and node IDs
  • Added comprehensive E2E test coverage for the new filtering capability

Reviewed changes

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

Show a summary per file
File Description
api/spec/v1.yaml Added id query parameter documentation for validator filtering
storage/client/client.go Passed new id parameter to database query
storage/client/queries/queries.go Updated SQL query to filter by entity or node ID
tests/e2e_regression/run.sh Fixed shell script compatibility for macOS and Linux
tests/e2e_regression/*/test_cases.sh Added test cases for entity ID and node ID filtering
tests/e2e_regression//expected/ Added expected responses for new test cases
.changelog/1222.feature.md Added changelog entry

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

# The command to invoke psql (complete with connection params)
# HACK: Assuming `make` returns a docker command, sed removes -i and -t flags because we'll be running without a TTY.
psql="$(make --dry-run --no-print-directory psql | sed -E 's/\s-i?ti?\s/ /')"
psql="$(make --dry-run --no-print-directory psql | sed -E 's/ -i?t?i?t? / /g')"
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

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

The regex pattern -i?t?i?t? can match unexpected flag combinations. The intent appears to be removing -i, -t, -it, or -ti flags, but this pattern could match invalid sequences like -itt or -tit. Use the pattern s/ -(it|ti|i|t) / /g instead to explicitly match only valid flag combinations.

Suggested change
psql="$(make --dry-run --no-print-directory psql | sed -E 's/ -i?t?i?t? / /g')"
psql="$(make --dry-run --no-print-directory psql | sed -E 's/ -(it|ti|i|t) / /g')"

Copilot uses AI. Check for mistakes.
@ptrus ptrus force-pushed the ptrus/feature/validator-ids branch 2 times, most recently from d9ceb42 to 8667faf Compare December 15, 2025 10:03
@ptrus ptrus requested a review from Copilot December 15, 2025 10:03
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

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.


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

@ptrus ptrus force-pushed the ptrus/feature/validator-ids branch from 93515a1 to 0a3a6a3 Compare December 21, 2025 18:47
@ptrus ptrus merged commit d5b0b26 into main Dec 21, 2025
20 checks passed
@ptrus ptrus deleted the ptrus/feature/validator-ids branch December 21, 2025 18:54
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.

Add ability to search for validators by their Entity ID and/or Node ID(s)

2 participants