Skip to content

perf: split useProofSubmit into usePendingProofs and useProofSubmit - #76

Open
Timothy2025-20 wants to merge 1 commit into
ecotask-network:mainfrom
Timothy2025-20:feature/split-proof-submit-hooks
Open

perf: split useProofSubmit into usePendingProofs and useProofSubmit#76
Timothy2025-20 wants to merge 1 commit into
ecotask-network:mainfrom
Timothy2025-20:feature/split-proof-submit-hooks

Conversation

@Timothy2025-20

Copy link
Copy Markdown

gh pr create
--title "perf: split useProofSubmit into usePendingProofs and useProofSubmit"
--body "## Description
This PR splits the useProofSubmit hook to avoid unnecessary state allocations on HomeScreen.

Changes

  • Created usePendingProofs for HomeScreen (lightweight, only queue count and sync)
  • Kept useProofSubmit for SubmitProofScreen (full submission flow)
  • Both hooks share the same proofQueue module
  • No behavioral change - proof submission, queuing, and sync work identically
  • Added tests for both hooks independently
  • HomeScreen renders fewer state updates when proof state changes

Acceptance Criteria Met

  • HomeScreen only instantiates pending-proof state, not full submission state
  • SubmitProofScreen uses the full useProofSubmit hook
  • No behavioral change — proof submission, queuing, and sync work identically
  • HomeScreen renders fewer state updates when proof state changes
  • Tests for both hooks independently

Closes #56

- Create usePendingProofs for HomeScreen (lightweight, only queue count and sync)
- Keep useProofSubmit for SubmitProofScreen (full submission flow)
- Both hooks share the same proofQueue module
- No behavioral change - proof submission, queuing, and sync work identically
- Add tests for both hooks independently
- HomeScreen renders fewer state updates when proof state changes

Closes ecotask-network#56

@cybermax4200 cybermax4200 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix the workflow

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.

useProofSubmit creates full submission state tree at HomeScreen level unnecessarily

2 participants