-
Notifications
You must be signed in to change notification settings - Fork 116
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
test: add check in e2e test to ensure deletion of stale ballots #3503
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughThe pull request updates the changelog and modifies several components. A new field, ConfirmationParams, is introduced (while deprecating confirmation_count) and Sui chain information is added. Enhancements include invoking a new EnsureNoStaleBallots method in E2E tests to verify stale ballot deletion, pagination support for ballot queries via additional CLI options, and sorting improvements in observer responses based on ballot creation height. Refactoring of Bitcoin observer and signer components further streamlines the code. Changes
Sequence Diagram(s)sequenceDiagram
participant TR as Test Runner
participant ER as E2ERunner (EnsureNoStaleBallots)
participant ZC as Zetacore Client
participant OC as Observer Client
TR->>ER: Invoke EnsureNoStaleBallots()
ER->>ZC: Request current block height
ZC-->>ER: Return current block height
ER->>ER: Calculate stale block start (current - maturity blocks)
ER->>OC: Query for ballots
OC-->>ER: Return list of ballots
ER->>ER: Verify first ballot's creation height > stale start
ER-->>TR: Return verification result
sequenceDiagram
participant U as User
participant CLI as CLI Command
participant QH as Query Handler
participant GS as gRPC Service (Ballot Keeper)
U->>CLI: Run ballot query with pagination flags
CLI->>QH: Process pagination options (--count-total, --limit, etc.)
QH->>GS: Forward paginated query request
GS->>GS: Retrieve and sort ballots by creation height
GS-->>QH: Return sorted ballot list
QH-->>CLI: Provide paginated results
CLI-->>U: Display ballot data
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #3503 +/- ##
========================================
Coverage 65.42% 65.42%
========================================
Files 442 442
Lines 30531 30534 +3
========================================
+ Hits 19974 19977 +3
Misses 9702 9702
Partials 855 855
|
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.
overall looks good to me
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.
Actionable comments posted: 3
🧹 Nitpick comments (1)
cmd/zetae2e/local/local.go (1)
544-544
: Add skip flag for stale ballot check.For consistency with other verification checks (like
skipTrackerCheck
), consider adding a flag to optionally skip the stale ballot verification.Consider adding a flag and conditional check:
+ cmd.Flags().Bool(flagSkipStaleBallotCheck, false, "set to true to skip stale ballot check") // ... - deployerRunner.EnsureNoStaleBallots() + if !skipStaleBallotCheck { + deployerRunner.EnsureNoStaleBallots() + }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
changelog.md
(1 hunks)cmd/zetae2e/local/local.go
(1 hunks)docs/cli/zetacored/cli.md
(1 hunks)e2e/runner/require.go
(2 hunks)x/observer/client/cli/query_ballot.go
(1 hunks)x/observer/keeper/grpc_query_ballot.go
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.go`: Review the Go code, point out issues relative to ...
**/*.go
: Review the Go code, point out issues relative to principles of clean code, expressiveness, and performance.
x/observer/keeper/grpc_query_ballot.go
cmd/zetae2e/local/local.go
e2e/runner/require.go
x/observer/client/cli/query_ballot.go
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: start-e2e-test / e2e
🔇 Additional comments (7)
changelog.md (1)
21-22
: Confirm New Test Entry Formatting.The new bullet for PR [3503] clearly conveys the addition of an e2e test to ensure the deletion of stale ballots. Its formatting and description are consistent with other test-related entries in the changelog.
docs/cli/zetacored/cli.md (6)
7227-7227
: New Flag Addition: --count-total
The newly introduced '--count-total' flag effectively enhances the CLI by enabling users to obtain the total record count for ballot queries. The description is succinct and consistent with the style of other CLI options.
7232-7232
: New Flag Addition: --limit
The addition of the '--limit' flag, with a default value of 100, clearly specifies the pagination limit for ballot queries. Ensure that this default matches the logic implemented in the backend settings for pagination.
7234-7234
: New Flag Addition: --offset
The '--offset' flag provides a straightforward method to specify the starting record for pagination. Please verify that its behavior in the CLI is fully compatible with the underlying pagination mechanism.
7236-7236
: New Flag Addition: --page
The '--page' flag is a user-friendly enhancement that automatically adjusts the offset based on the page number, with a default of 1. Confirm that this implementation is in sync with the pagination strategy adopted in the codebase.
7237-7237
: New Flag Addition: --page-key
The '--page-key' option offers advanced pagination control. Ensure that there is adequate supporting documentation elsewhere to guide users on scenarios where a pagination key might be preferred over offset-based pagination.
7238-7238
: New Flag Addition: --reverse
The '--reverse' flag is a valuable addition for altering the sort order to descending. Verify that the reverse ordering is properly implemented and that corresponding end-to-end tests cover this functionality.
…rder-list-ballots-query
Description
How Has This Been Tested?
Summary by CodeRabbit
New Features
Bug Fixes