feat: extend state endpoint with PoC metadata and remove poc v1#749
feat: extend state endpoint with PoC metadata and remove poc v1#749IgnatovFedor wants to merge 6 commits intoupgrade-v0.2.11from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the PoC (Proof of Compute) v1 implementation from the codebase, keeping only the v2 off-chain validator. The orchestrator that selected between v1 and v2 has been removed, and the system now directly uses the OffChainValidator (v2).
Changes:
- Removed all PoC v1 code including validator, handlers, requests, and tests
- Replaced the orchestrator pattern with direct use of OffChainValidator
- Cleaned up MLNodeClient interface to remove v1 methods
- Removed v1 NATS streams and batch consumers
- Removed IDE configuration files (.idea directory) that shouldn't be in the repository
Reviewed changes
Copilot reviewed 26 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| decentralized-api/poc/validator_v1.go | Removed entire v1 on-chain validator implementation |
| decentralized-api/poc/validator_v1_test.go | Removed v1 validator tests |
| decentralized-api/poc/orchestrator.go | Removed orchestrator that chose between v1 and v2 |
| decentralized-api/poc/migration.go | Removed migration logic for v1/v2 transition |
| decentralized-api/poc/validator.go | Moved common constants (POC_VALIDATE_GET_NODES_RETRIES) from v1 |
| decentralized-api/poc/commit_worker.go | Removed v1/v2 check as v2 is now always used |
| decentralized-api/mlnodeclient/poc_v1_requests.go | Removed all v1 request types and methods |
| decentralized-api/mlnodeclient/poc_v1_requests_test.go | Removed v1 request tests |
| decentralized-api/mlnodeclient/interface.go | Removed v1 methods from MLNodeClient interface |
| decentralized-api/mlnodeclient/mock.go | Removed v1 mock methods and state tracking |
| decentralized-api/main.go | Replaced orchestrator with direct OffChainValidator initialization |
| decentralized-api/internal/server/public/poc_handler.go | Removed v1 mode checks |
| decentralized-api/internal/server/mlnode/server.go | Removed v1 callback routes |
| decentralized-api/internal/server/mlnode/post_generated_artifacts_v1_handler.go | Removed entire v1 handler file |
| decentralized-api/internal/nats/server/server.go | Removed v1 NATS streams |
| decentralized-api/internal/event_listener/*.go | Updated to use OffChainValidator directly instead of orchestrator |
| decentralized-api/cosmosclient/cosmosclient_v1.go | Removed v1 cosmos client methods |
| decentralized-api/cosmosclient/cosmosclient.go | Removed v1 methods from interface |
| decentralized-api/cosmosclient/tx_manager/*.go | Removed v1 batch consumers and publishers |
| decentralized-api/cosmosclient/mock_cosmos_message_client.go | Removed v1 mock methods |
| decentralized-api/broker/node_worker_commands_v1.go | Removed v1 node worker commands |
| decentralized-api/broker/node_worker_commands_v1_test.go | Removed v1 command tests |
| decentralized-api/broker/broker.go | Removed v1-specific logic, now always uses v2 commands |
| .idea/* | Removed IDE configuration files |
Files not reviewed (4)
- .idea/.gitignore: Language not supported
- .idea/inference-ignite.iml: Language not supported
- .idea/modules.xml: Language not supported
- .idea/vcs.xml: Language not supported
Comments suppressed due to low confidence (1)
decentralized-api/poc/validator_v1.go:1
- The PR title mentions "extend state endpoint with PoC metadata" but there are no visible changes to the state endpoint in the diff. The primary changes are the removal of PoC v1 code. Please verify that the PR title accurately describes the changes, or if there are additional changes to the state endpoint that aren't shown in this diff.
af55048 to
ce9ff81
Compare
ce9ff81 to
f71fd2b
Compare
decentralized-api/broker/broker.go
Outdated
There was a problem hiding this comment.
I think we can delete this as well as IsPoCv2Enabled
There was a problem hiding this comment.
I think that can also delete IsV2EndpointsEnabled like IsPoCv2Enabled and IsMigrationMod
| statuses = [proxy_module.poc_status_by_port.get(p, "") for p in healthy_ports] | ||
| if all(s == "GENERATING" for s in statuses): | ||
| poc_status = "GENERATING" | ||
| elif any(s == "GENERATING" for s in statuses): |
There was a problem hiding this comment.
I think VALIDATING is missing
Ryanchen911
left a comment
There was a problem hiding this comment.
IsV2EndpointsEnabled isn't deleted and "VALIDATING" status is missing
decentralized-api/broker/broker.go
Outdated
There was a problem hiding this comment.
I think that can also delete IsV2EndpointsEnabled like IsPoCv2Enabled and IsMigrationMod
| poc_status = "MIXED" | ||
| else: | ||
| poc_status = "IDLE" | ||
|
|
| assert data["inference_healthy"] is True | ||
| assert data["poc_status"] == "IDLE" | ||
| assert data["loaded_model"] is None | ||
|
|
There was a problem hiding this comment.
I think the test about "VALIDATING" status is missing
… code and dead migration flags
|
@x0152 @Ryanchen911 thanks for your feedback!
|
|
hey @Ryanchen911, can I kindly ask you to contact us via email hello@productscience.ai? Thanks. |
|
sure, i'm the member of 6block,I'll send you later! @tcharchian thank you |
State endpoint enrichment & PoC v1 removal
What problem does this solve?
Clients had to make multiple consecutive calls to mlnode to determine full node status. PoC v1 is replaced with v2.
How do you know this is a real problem?
broker.go:queryNodeStatus() - client forced to chain status calls to get a complete picture. PoC v1 is replaced by v2 and no longer served a purpose.
How does this solve the problem?
The state endpoint now returns enriched data, eliminating the need for follow-up status calls. PoC v1 code has been removed entirely.
What risks does this introduce? How can we mitigate those risks?
The enriched response may break existing clients expecting the old schema. Any remaining PoC v1 consumers would lose that endpoint. Mitigation: test checks that go client ignores enriched fields (
cd gonka/decentralized-api && go test ./mlnodeclient/ -run TestClient_NodeState_EnrichedResponse -v 2>&1).How do you know this PR fixes the problem?
The enriched response covers all data previously requiring separate calls. PoC v1 references are gone from the codebase. The broker client currently ignores the new fields safely. In a follow-up, the broker will be updated to consume the enriched data and drop the redundant GetPowStatus call in queryNodeStatus.