Skip to content

[POC] Add Stratum V2 translator#811

Open
pavlenex wants to merge 8 commits into
block:mainfrom
pavlenex:feat/sv2-tproxy-preload
Open

[POC] Add Stratum V2 translator#811
pavlenex wants to merge 8 commits into
block:mainfrom
pavlenex:feat/sv2-tproxy-preload

Conversation

@pavlenex

Copy link
Copy Markdown

This PR is a proof of concept intended to demonstrate the Stratum V2 user experience in Fleet and show that supporting it may be relatively straightforward. It is meant primarily as inspiration and was built with Buzz.

If the team considers the approach and code solid, I’d be happy to continue working on it. Otherwise, please feel free to close the PR - my main goal is to explore the idea, and you know the codebase far better than I do.

The flow is:

  • The user adds an SV2 pool in Proto.
  • When Proto detects an SV2 endpoint, it starts the previously cached sv2-translation-proxy image.
  • Selected SV1 miners are redirected to the translation proxy endpoint.

Since I don’t have a local miner, I tested this by exposing my Proto instance, renting SV1 hashrate from Braiins, and pointing it at the translation proxy endpoint. Proto’s mock devices do not produce real hashrate, so this was the most practical way to verify the full flow. I ran approximately 5-10 PH/s for about an hour without encountering any issues.

The only limitation I noticed is that workers connected from outside the local network do not appear on the dashboard. This may be intentional, since Proto is designed primarily for local use. If it is not intentional, I’d be happy to investigate how externally connected workers could be displayed, but I am not quite sure that should be explored in this PR.

sv2-proto.mp4

If you have any questions please let me know, myself and open-source community behind reference implementation are at your guys disposal.

@pavlenex
pavlenex requested a review from a team as a code owner July 24, 2026 07:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1d03c02ae

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread deployment-files/docker-compose.yaml Outdated
Signed-off-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>
@pavlenex
pavlenex force-pushed the feat/sv2-tproxy-preload branch from a1d03c0 to bfa53c8 Compare July 24, 2026 08:05

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfa53c815b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/internal/domain/sv2/translator/manager.go Outdated
Comment thread server/docker-compose.yaml
Track translated miners so stale profiles can be released or safely replaced. Keep the fixed translator recoverable after crashes and advertise its reachable service address in the development stack.

Co-authored-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>
Signed-off-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a33e425de

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/internal/domain/command/sv2_translation.go Outdated
Keep translated miners registered while ordinary pool assignments are queued and in flight. Release each miner only after its pool update succeeds so failed or partial batches retain a working local endpoint.

Co-authored-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>
Signed-off-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d56f794be8

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread deployment-files/run-fleet.sh Outdated
Comment thread server/internal/domain/command/service.go
…load

Signed-off-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>
@pavlenex
pavlenex force-pushed the feat/sv2-tproxy-preload branch from 8f154be to c8916e8 Compare July 24, 2026 10:57

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c8916e8665

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread deployment-files/docker-compose.yaml Outdated
Comment thread server/cmd/fleetd/main.go
Signed-off-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>
@pavlenex
pavlenex force-pushed the feat/sv2-tproxy-preload branch from ac8082f to 92b0a3d Compare July 24, 2026 11:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92b0a3dcb1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread deployment-files/docker-compose.yaml Outdated
Signed-off-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>
@github-actions github-actions Bot added github_actions Pull requests that update GitHub Actions code automation labels Jul 24, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f60bddd234

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/internal/domain/command/execution_service.go Outdated
Comment thread server/internal/domain/command/sv2_translation.go
Signed-off-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9b699e813

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread server/internal/domain/command/execution_service.go
Signed-off-by: Pavlenex <36959754+pavlenex@users.noreply.github.com>
@pavlenex

Copy link
Copy Markdown
Author

Just reporting back that after all commits things still work. Again, consider this a POC. I am probably overlooking how proto is supposed to work, or certain use-cases.

sv2-proto-updates-2.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation github_actions Pull requests that update GitHub Actions code server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant