[FEATURE] Auto-populate known committees
Describe the feature you'd like
When staking (wallet > click 'stake') if the node was aware of what committees are available, it would be awesome if the field could be autopopulated with the known committees for easier selection.
Motivation
I don't know what I don't know so I'd have to find a listing of all the committees and their relevant numbers to decide who to stake for. Then, I need to manually enter numbers for those committees in the right format.
Additional context
Possible implementation
I would recommend a searchable multi-select field with all known committees listed, then upon selection, the field would be populated correctly with the right syntax. Additionally, there should be data validation on the field to make sure syntax is correct to prevent incorrect entry.
Required Tags
- Priority: Low
- Module: Wallet
If you are delegating or staking - shouldn't the user already be aware of what they are staking for?
I think you could be right, but maybe you're brand new and not really aware of all of the available options.
It'd also be great to know what committees you're staked for. All the user knows is whether it is staked or not. The UI should indicate which committees you have a stake in.
It'd also be great to know what committees you're staked for. All the user knows is whether it is staked or not. The UI should indicate which committees you have a stake in.
Sounds like a separate feature - don't hate it, just out of scope. The explorer shows this info obviously and you can see the committees you're staked for when you click 'edit-stake'
But yeah I can see a need for it
@andrewnguyen22 , @4d04 - threw together a requirements doc based on what's currently in this thread to continue the conversation. Let me know if this captures the spirit of the feature. If this is going too deep documentation wise for current state, let me know as well:
Business Requirements Document (BRD)
Auto-Populate Known Committees in Canopy Web Wallet
1. Introduction
1.1 Purpose
This document outlines the requirements for enhancing the staking process within the Canopy web wallet by introducing an auto-population feature for committee selection. The goal is to streamline the user experience by making the selection process more intuitive, reducing errors, and increasing engagement with the staking mechanism.
1.2 Scope
The feature will introduce a searchable multi-select dropdown in the staking interface that lists all known committees. Users will be able to browse, search, and select committees without needing to manually enter committee identifiers. The system will automatically populate the appropriate fields with validated committee identifiers.
1.3 Stakeholders
- End Users (Stakers): Users who participate in staking within the Canopy network.
- Developers: Responsible for implementing the feature into the web wallet.
- Non Dev Team Members: Ensure the feature aligns with the overall vision of the Canopy ecosystem.
- Quality Assurance (QA) Team: Validate that the feature functions correctly and meets user expectations.
2. Business Objectives
- Improve User Experience: Simplify the staking process by reducing the need for manual committee identifier entry.
- Reduce Errors: Minimize manual input mistakes that can lead to unsuccessful staking transactions.
- Increase Participation: Make staking more accessible to both new and experienced users.
- Enhance Efficiency: Allow users to complete staking actions faster with fewer steps.
3. Functional Requirements
3.1 Searchable Multi-Select Dropdown
- Users should be able to search for committees by name or attributes.
- The dropdown should list all known committees available for staking.
- Selected committees will automatically populate the staking field.
3.2 Automatic Field Population
- Once a committee is selected, its corresponding identifier should be automatically filled into the staking input field.
- Users should be able to select multiple committees as needed.
3.3 Data Validation
- The system should validate that manually entered committee identifiers adhere to the required format.
- Any invalid entries should trigger an error message with corrective suggestions.
3.4 Dynamic Committee Data Updates
- The list of known committees should be dynamically updated to reflect additions, removals, or changes.
- Updates should be fetched in real-time or upon user interaction with the dropdown.
3.5 UI/UX Considerations
- The dropdown should be designed for ease of use, with clear labels and an intuitive search mechanism.
- Feedback should be provided to users for successful selections and invalid entries.
4. Non-Functional Requirements
4.1 Performance
- The dropdown should load committees quickly to avoid delays in user interactions.
- Searching for committees should provide real-time results without noticeable lag.
4.2 Security
- Ensure that committee data retrieval is done securely, preventing unauthorized modifications.
- Validate all user input to mitigate potential security vulnerabilities.
4.3 Compatibility
- The feature should work seamlessly across all modern web browsers.
- Ensure responsiveness of the web wallet.
5. Implementation Considerations
5.1 Backend Integration
- Ensure that the backend supports fetching and validating committee data dynamically.
- Provide APIs that allow the front-end to retrieve the latest committee lists efficiently.
5.2 UI Design Considerations
- Implement a clean and accessible interface for selecting committees.
- Use appropriate visual indicators for errors and successful selections.
5.3 Testing & QA
- Unit tests should be created to verify data validation logic.
- UI testing should confirm that the dropdown behaves as expected across different devices.
- End-to-end testing should validate the full workflow, from committee selection to staking confirmation.
6. Success Metrics
- N/A for this first iteration. Considerations for when web wallet is active:
- Reduction in staking errors: Measure the decrease in failed staking attempts due to incorrect committee identifiers.
- User adoption: Track how often users utilize the dropdown versus manual entry.
- Transaction completion rate: Monitor if the feature leads to an increase in successful staking transactions.
7. Risks & Mitigation Strategies
7.1 Data Inconsistencies
- Risk: Committee lists may become outdated if not updated dynamically.
- Mitigation: Ensure regular data synchronization with the network’s latest committee information.
7.2 UI Complexity
- Risk: A complex UI might overwhelm users instead of simplifying the process.
- Mitigation: Conduct user testing with non dev internal team and iterate on designs based on feedback.
7.3 Performance Issues
- Risk: The dropdown might introduce latency in the staking workflow.
- Mitigation: Optimize data fetching and rendering for minimal impact on performance.
8. Conclusion
Implementing an auto-population feature for committee selection in the Canopy web wallet will significantly improve the staking experience by making it more user-friendly, efficient, and error-free. This enhancement aligns with Canopy’s goal of promoting wider adoption and ease of use within its staking ecosystem. The development team should focus on seamless UI integration, dynamic data management, and robust validation to ensure a successful rollout of this feature.
The only thing I might add is that the UI should confirm their selection after they're going through a list or organize the list in such a way that selections appear obvious, especially if the search process hides selections when scrolling.
For example (X designates a selection):
001 002 003 X 004 005 X 006
Message: Please confirm your selection to stake for 003 and 005. "Yes/No"
Or it could auto-sort the list based on selection so you always see the selection. This way, when you're done you can review the list before clicking OK.
003 X 005 X 001 002 004 006
Just my two cents.
@4d04 - We could do auto sort + message after? Are there any other criteria/ways we would potentially sort this list by? Popularity/volume of stake?
For first iteration can do just committee number and go from there.
This is a good question. Unless we want to encourage broader staking (staking on less popular chains), maybe a sort-by stake amount is a good idea. If sorted by stake, it should also return the amount of stake on that NestedChain.
001 (1.1M CNPY) 002 (150K CNPY)
First version can just be sorted by ID then we can get more feature rich.
Some follow up for @4d04 and @andrewnguyen22 :
Currently in the UI:
-
Stake form is already getting pre-populated with the current committees list if available (committeeList from the validator) else defaulted with placeholder numbers (1 ,22, 50). Edit stake has same behavior.
-
Logic for committeeList:
let committeeList = validator && validator.address && validator.committees && validator.committees.length !== 0 ? validator.committees.join(",") : "";
https://github.com/canopy-network/canopy/blob/c4001ac4412890d5ca1a42e51067d5786b5e0573/cmd/rpc/web/wallet/components/util.js#L13
Assumptions based on current state:
- Users are allowed to stake to multiple committees at the same time
- The amount of stake will be equal across all committees (ex: user inputs 100 CPNY and has 3 committees selected. Total CPNY staked is 300, 100 CPNY per committee)
Clarifying questions:
- It doesn’t look like we have a user staked with multiple committees yet in test, is this correct? I’m seeing just committee 1 and 2 when I go edit on either node 1 or node 2.
- Do we want users to be able to stake on multiple committees from the get go? It may be beneficial to stick with singular committee transactions to start, and then layer in multiples as users become more familiar with the system and demand for that functionality increases.
I can't speak for the first question - I believe so. As for your second question, I'd like this functionality from the git-go. Here's the rationale: Restaking is a major component of the economics and node runners are generally comfortable with this concept. Also, restricting this early on could reduce impact learning when the impacts to node runners are fairly minimal.