refactor: replace WASM-based PoW solver with a native Go implementation in the pow package#229
refactor: replace WASM-based PoW solver with a native Go implementation in the pow package#229CJackHwang merged 3 commits intomainfrom
Conversation
…to-429 fix(openai): return 429 for empty upstream output
…on in the pow package
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7d561694a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| bizData, _ := data["biz_data"].(map[string]any) | ||
| challenge, _ := bizData["challenge"].(map[string]any) | ||
| answer, err := c.powSolver.Compute(ctx, challenge) | ||
| answer, err := ComputePow(challenge) |
There was a problem hiding this comment.
Honor context cancellation during PoW solve
GetPow still accepts a request-scoped ctx, but this call now invokes ComputePow(challenge) without passing that context. Because the new pure-Go solver performs a CPU-bound search up to difficulty, canceled HTTP requests (client disconnects, timeouts, shutdown) will continue hashing until the loop completes, wasting CPU and delaying goroutine cleanup. Please thread ctx through the solver and check ctx.Done() periodically during the nonce scan.
Useful? React with 👍 / 👎.
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
📝 补充信息 | Additional Information