feat: add firmware upgrade for antminer stock#182
feat: add firmware upgrade for antminer stock#182b-rowan merged 15 commits into256foundation:masterfrom
Conversation
feat: Implement VNish v1.2.0 miner controls
|
Concept ACK, but I think it might make sense to change the implementation a bit to make |
There was a problem hiding this comment.
Pull request overview
Adds a cross-backend firmware-upgrade capability to the miner trait surface and wires it through the Python bindings, with a concrete Antminer V2020 implementation that can extract the correct image from merged BMU bundles and validates upgrade responses more strictly.
Changes:
- Introduce
UpgradeFirmwaretrait and make it part of the coreMinertrait; add “not supported” impls for non-Antminer backends. - Implement Antminer V2020 firmware upload via
upgrade.cgi, including merged-BMU parsing/selection usingminer_type.cgi. - Expose
supports_upgrade_firmwareandupgrade_firmware()in the Python wrapper.
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/python/miner.rs | Exposes firmware-upgrade capability in the Python API. |
| asic-rs-core/src/traits/miner.rs | Adds UpgradeFirmware trait and includes it in Miner. |
| asic-rs-firmwares/antminer/src/backends/v2020/mod.rs | Implements Antminer firmware upgrade, including BMU bundle parsing and image selection. |
| asic-rs-firmwares/antminer/src/backends/v2020/web.rs | Implements firmware upload HTTP request and response validation; adds miner_type endpoint call. |
| asic-rs-firmwares/antminer/Cargo.toml | Adds crc32fast dependency for BMU CRC validation. |
| asic-rs-firmwares/whatsminer/src/backends/v1/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/whatsminer/src/backends/v2/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/whatsminer/src/backends/v3/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/vnish/src/backends/v1_2_0/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/nerdaxe/src/backends/v1/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/marathon/src/backends/v1/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/luxminer/src/backends/v1/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/epic/src/backends/v1/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/braiins/src/backends/v21_09/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/braiins/src/backends/v25_07/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/bitaxe/src/backends/v2_0_0/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/bitaxe/src/backends/v2_9_0/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/avalonminer/src/backends/avalon_a/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| asic-rs-firmwares/avalonminer/src/backends/avalon_q/mod.rs | Adds UpgradeFirmware impl (unsupported). |
| Cargo.toml | Adds workspace dependency version for crc32fast. |
| Cargo.lock | Locks crc32fast into dependency graph. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
Antminer T21 Firmware Testing Results.md |
|
Starting to get very close now, just a couple smaller style/nit things. |
|
Antminer_Firmware_Upgrade_Tests_2026-03-18.md |
Antminer stock firmware upgrades now support both merged BMU bundles and raw single-image .bmu files. For merged bundles, the backend reads miner_type.cgi, matches the correct internal image to the miner’s model/control-board subtype, and uploads only that selected payload. For raw images, it skips filename heuristics and uploads directly, relying on upgrade.cgi to accept or reject the firmware.
The upload path now also validates the Antminer response more strictly: success requires both HTTP success and the expected JSON payload (code = U000, stats = success), while malformed or rejected responses return explicit errors.