Skip to content

device-health-oracle: update link.health and device.health#2711

Open
nikw9944 wants to merge 4 commits intomainfrom
nikw/2669
Open

device-health-oracle: update link.health and device.health#2711
nikw9944 wants to merge 4 commits intomainfrom
nikw/2669

Conversation

@nikw9944
Copy link
Copy Markdown
Contributor

@nikw9944 nikw9944 commented Jan 23, 2026

Summary

  • Add automatic health promotion for devices and links in provisioning states to the device-health-oracle component
  • Implement efficient batched transactions (8 items per batch) to handle large numbers of simultaneous device/link additions while staying within Solana's default 200,000 compute unit budget
  • Fix Go SDK serviceability state enums to match Rust implementation's numeric values (e.g., Deleting=3, Drained=5)
  • Add required signer keypair configuration to execute onchain health state updates

Context

This implements the device-health-oracle portion of RFC12 (network provisioning). The oracle automatically promotes devices and links from provisioning states (DeviceProvisioning, LinkProvisioning, SoftDrained, HardDrained) to ready states without performing actual health checks, matching the current activator behavior.

The batching implementation processes health updates in groups of 8. Transaction wire cost per instruction is only ~9 bytes (accounts are deduplicated as 1-byte indices), so transaction size is not the bottleneck. The limiting factor is compute units: each instruction deserializes GlobalState (which contains variable-length allowlists) plus the device/link account, costing roughly 10,000-20,000 CUs per instruction. With Solana's default 200,000 CU budget, 8 instructions is a conservative limit.

The SDK enum fixes resolve a mismatch where Go used sequential iota values (0,1,2,3...) while Rust uses explicit numeric values with gaps (0,1,3,4,5...). This caused incorrect state interpretation and is now aligned across languages.

Testing Verification

  • Device-health-oracle successfully processes devices in DeviceProvisioning and LinkProvisioning states during e2e tests
  • Batched transactions complete successfully when processing multiple devices/links simultaneously
  • Link onchain allocation test now correctly identifies Deleting status after SDK enum alignment
  • Device-health-oracle container starts successfully with signer keypair mounted in e2e environment

@nikw9944 nikw9944 changed the title device-health-oracle: add oracle to provisioning workflow without checks" device-health-oracle: add oracle to provisioning workflow without checks Jan 23, 2026
@nikw9944 nikw9944 force-pushed the nikw/2669 branch 3 times, most recently from c22987b to 6dc35c6 Compare January 23, 2026 23:13
@nikw9944 nikw9944 marked this pull request as ready for review January 23, 2026 23:14
@nikw9944
Copy link
Copy Markdown
Contributor Author

Note that merging this to main will require deploying device-health-oracle to testnet/mainnet-beta before promoting this change to those environments.

@nikw9944 nikw9944 marked this pull request as draft January 26, 2026 19:09
@nikw9944 nikw9944 self-assigned this Jan 26, 2026
@nikw9944 nikw9944 force-pushed the nikw/2669 branch 2 times, most recently from d7b0a2d to 5e39ca4 Compare January 28, 2026 01:01
@nikw9944 nikw9944 force-pushed the nikw/2669 branch 3 times, most recently from 6d24df5 to 0011997 Compare February 26, 2026 16:50
@nikw9944 nikw9944 changed the title device-health-oracle: add oracle to provisioning workflow without checks device-health-oracle: update link.health and device.health Feb 27, 2026
@nikw9944 nikw9944 linked an issue Feb 27, 2026 that may be closed by this pull request
@nikw9944 nikw9944 force-pushed the nikw/2669 branch 4 times, most recently from deeae2d to 663a2e9 Compare March 24, 2026 20:33
@nikw9944 nikw9944 marked this pull request as ready for review March 24, 2026 20:34
@nikw9944 nikw9944 requested a review from martinsander00 March 24, 2026 20:34
@martinsander00
Copy link
Copy Markdown
Contributor

martinsander00 commented Mar 25, 2026

updatePendingDeviceHealth/updatePendingLinkHealth update all devices, should we change the names? and is the behavior intended or do we want some filtering?

- Use Pubkey::new_unique() for health_oracle in CLI test instead of
  Pubkey::default(), matching the pattern used for other authorities
- Correct maxBatchSize comment: transaction wire cost is ~9 bytes per
  instruction (not 100-120), the actual bottleneck is compute units
  (~10-20k CUs per instruction against 200k default budget)
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.

device-health-oracle: update link.health and device.health

2 participants