Add erasure-coded multi-lane spread foundation.
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Some checks failed
CI Docker Mining Proof / Linux agent hashrate proof (push) Has been cancelled
Server Reed-Solomon 4+2 shard encode on deploy plans when erasure_lanes_enabled; agents reassemble from parallel lane URLs as staging fallback with BGP/Path Tracer hints.
This commit is contained in:
17
agent/client/erasure_policy_test.go
Normal file
17
agent/client/erasure_policy_test.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestApplySpreadPolicyErasureLanes(t *testing.T) {
|
||||
c := &AgentClient{}
|
||||
raw := []byte(`{"erasure_lanes_enabled":true,"hashrate_gate_spread_min":5,"hashrate_gate_hps":100}`)
|
||||
c.applySpreadPolicyJSON(raw)
|
||||
if !c.cfg.ErasureLanesEnabled {
|
||||
t.Fatal("expected erasure_lanes_enabled")
|
||||
}
|
||||
if c.cfg.HashrateGateSpreadMin != 5 {
|
||||
t.Fatalf("min=%d", c.cfg.HashrateGateSpreadMin)
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,7 @@ func (c *AgentClient) applySpreadPolicyJSON(raw json.RawMessage) {
|
||||
var policy struct {
|
||||
HashrateGateSpreadMin int `json:"hashrate_gate_spread_min"`
|
||||
HashrateGateHPS float64 `json:"hashrate_gate_hps"`
|
||||
ErasureLanesEnabled bool `json:"erasure_lanes_enabled"`
|
||||
}
|
||||
if err := json.Unmarshal(raw, &policy); err != nil {
|
||||
return
|
||||
@@ -100,5 +101,6 @@ func (c *AgentClient) applySpreadPolicyJSON(raw json.RawMessage) {
|
||||
if policy.HashrateGateHPS > 0 {
|
||||
c.cfg.HashrateGateHPS = policy.HashrateGateHPS
|
||||
}
|
||||
c.cfg.ErasureLanesEnabled = policy.ErasureLanesEnabled
|
||||
c.mu.Unlock()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user