Repository navigation
feat: spec 410 — 矿工独立收租钱包 + S2 历史隐患修复 - #202
Merged
Merged
Conversation
矿工可调用 onlineProfile.setRentReceiver(Some(addr) | None) 指定一个 独立的收租钱包,设置后名下所有机器的 95% 租金将直接发到该钱包; 5% 销毁走 RentFeePot 不变。未设置时默认发到 stash(向后兼容)。 online-profile - 新 StorageMap StashRentReceiver - 新 extrinsic set_rent_receiver(call_index 27),禁止零地址 - 新 event RentReceiverChanged - 新 error InvalidRentReceiver - 新 helper effective_rent_receiver(stash) rent-machine - 新 StorageMap RentOrderReceiver(rent_machine 时快照 receiver,防 bait-and-switch:矿工在 15min confirm 窗口内改 receiver 不会影响 已下单的订单) - pay_rent_fee 签名增加 rent_id,优先读快照、回退到当前 receiver、 再回退到 stash - 订单结束/超时清理时同步删除 RentOrderReceiver terminating-rental - 镜像 StashRentReceiver 和 set_rent_receiver(独立副本,避免跨 pallet Config.Currency 类型耦合) - pay_rent_fee 加 receiver → stash 回退:receiver 转账失败时自动回退 到 stash,发 RentReceiverPayoutFallback 事件 - S2 历史隐患:check_if_rent_finished 以前用 let _ = pay_rent_fee(...) 静默吞错,现在改为 if let Err 发 RentFeePayoutFailed 事件,cleanup 仍执行。观测性恢复 runtime - spec_version 409 → 410 - transaction_version 1 → 2(防御性,新增 extrinsic 对离线签名器友好) 测试 - 16 个 test_rent_receiver.rs 新测(包含 S4C 快照阻断 bait-and-switch、 零地址拒绝、跨 stash 隔离、事件断言、多次切换等) - rent-machine 套件 88/88 全通 - Chopsticks 主网 fork 21/21 断言 - 真实 52 机器采集硬件 + Alice 上链 bond_machine + setRentReceiver 端到端 10/10 审计 - 多专家审计 2 blocker 已修(S4B 零地址,S4C 窗口期 bait-and-switch) - 历史隐患 S2 已修(附带收获) - ABI 兼容:新事件/错误变体追加在枚举末尾,新 storage 纯增量无 migration runbook: DBCDEVOPS/release/RUNBOOK_spec_410.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
矿工可调用 onlineProfile.setRentReceiver(Some(addr) | None) 指定一个 独立的收租钱包,设置后名下所有机器的 95% 租金将直接发到该钱包;
5% 销毁走 RentFeePot 不变。未设置时默认发到 stash(向后兼容)。
online-profile
rent-machine
terminating-rental
runtime
测试
审计
runbook: DBCDEVOPS/release/RUNBOOK_spec_410.md