# 治理提案的常见call
补充中,如果有列表中没有的,且不知具体含义或怎么校验的, 通知jj补充
| module | call | 描述 | 检查 | 其他 |
| --- | --- | --- | --- | --- |
| utilities | batch(calls: [call0, call1, ...]) | 按顺序执行calls, 遇到执行失败的call会停止, 不会回退已执行的call || council proposal暂不可用 |
| utilities | batchAll(calls: [call0, call1, ...]) | 按顺序执行calls, 遇到执行失败的call会停止,且回退已执行的call || council proposal暂不可用 |
| utilities | forceBatch(calls: [call0, call1, ...]) | 按顺序执行calls, 遇到失败的call也不会停止,所有的call都会被执行 || council proposal暂不可用 |
| authority | scheduleDispatch(when, priority, with\_delayed\_origin, call) | 创建一个schedule call。when 是执行时间, `At(block)` 表示在哪个区块高度执行, `After(block)`表示多少个区块后执行。priority 表示优先级,一般为0, 如果有多个schedule在同一个区块执行的话,可以指定优先级,数字越小优先级越高。call为要schedule 的call | when一把都是以`At`的形式, 注意提案生效shedule被创建时,区块高度是否还有效 ||
| transactionPause | pauseTransaction(pallet\_name, extrinsic\_name) | 暂停指定extrinsic |||
| transactionPause | unpauseTransaction(pallet\_name, extrinsic\_name) | 恢复指定extrinsic |||
| homa | resetLedgers(updates: [0: [subaccount\_id, maybe\_bonded\_change, maybe\_unlocking\_change], 1: ...] | 校对homa账本:subaccount\_id 为parachain在relaychain上的subaccount id(会对应一个地址),maybe\_bonded\_change 为是否修改ledger的bonded,maybe\_bonded\_change 为是否修改ledger 的 unbonding | 见homa.resetLedgers 的验证 | 通常只走council proposal, 频率大概1~2周一次,影响很大!!!要注意检查! |
| homa | updateBumpEraParams(last\_era\_bumped\_block, frequency) | 修改homa的bump era参数, last\_era\_bumped\_block 为最新的中继链era bumped的blocknumber,frequency 为中继链bump era的频率(polkadot为1天,14400个polkadot block, kusama为6小时, 3600个kusama block), frequency 很少修改, | 见homa.updateBumpEraParams 的验证 | 通常只走council proposal, 一般是和校对homa账本时一起进行, 频率大概1~2周一次,影响大!要注意检查! |
| homa | updateHomaParams(soft\_bonded\_cap\_per\_sub\_account, estimated\_reward\_rate\_per\_era, commission\_rate, fast\_match\_fee\_rate) | soft\_bonded\_cap\_per\_sub\_account 为homa配置的单个subaccount的bonded软上限(在中继链staking的基础上我们会再减少一些,变更的频率极低), estimated\_reward\_rate\_per\_era 为模拟的中继链的每个era的staking rewards rate(受中继链的影响,需要改动时大多是由于中继链staking 收益率发生变化,该参数会配置得比中继链的数值更低一些), commission\_rate 为homa协议从 staking 奖励中的抽水比例(目前karura,acala都是1%,变更频率低),fast\_match\_fee\_rate 为走homa快速赎回的手续费(目前karura,acala都是1%,变更频率低) | estimated\_reward\_rate\_per\_era 这个参数要变更的话,需要检查验证。polkadot一年365个eras, kusama 1460 eras。 (变更的数值 + 100%)^ eras = staking apy, 配置时要求这个值等于或略低于中继链的staking apy | |
| cdpEngine | setCollateralParams(currency\_id, interest\_rate\_per\_sec, liquidation\_ratio, liquidation\_penalty, required\_collateral\_ratio, maximum\_total\_debit\_value) | 变更抵押物参数,currency\_id 为抵押物类型, interest\_rate\_per\_sec 为每秒利率,liquidation\_ratio为清算抵押率, liquidation\_penalty为清算罚金率,required\_collateral\_ratio 为reqired 抵押率, maximum\_total\_debit\_value 为债务上限 | 见cdpEngine.setCollateralParams的验证 ||
| cdpTreasury | setExpectedCollateralAuctionSize(currency\_id, size) | 修改债仓被清算并走拍卖时, auction拆分的lot size, currency\_id 为拍卖的资产类型,size 为每个lot资产的数量 |||
| currencies | updateBalance(who, currency\_id, amount) | mint/burn 资产, who是目标地址, currency\_id 是资产类型, amount 为正数,表示mint该数量的资产, 为负数,表示burn掉该数量的资产 | 关乎资产的发行和销毁,非常重要!!! 小心检查 ||
| dex | listProvisioning(currency_id\_a, currency\_id\_b, min\_contribution\_a, min\_contribution\_b, target\_provision\_a, target\_provision\_b, not\_before) | initialize bootstrap, currency_id\_a, currency\_id\_b 为组成trading pair 的两种token,min\_contribution\_a, min\_contribution\_b 为每次contribute 时两种资产的最小数量(不能将两个都配置成0), target\_provision\_a, target\_provision\_b 为两种token的筹集目标(不能将两个都配置成0), not\_before 为bootstrap 结束的最小容许区块高度 |||
| dex | disableTradingPair(currency\_id\_a, currency\_id\_b) | 关闭交易对,currency_id\_a, currency\_id\_b 为组成trading pair 的两种token |||
| dex | enableTradingPair(currency\_id\_a, currency\_id\_b) | 直接开启交易对(不走bootstrap)或者是重启之前已经diabled的交易对 |||
| incentives | updateClaimRewardDeductionRates(updates: [0: [pool\_id, rate], ...]) | 设置claim reward是的灼烧惩罚(忠诚奖励)比例, updates 为调整的list, pool\_id为奖励池id, rate为灼烧惩罚比例 |||
| incentives | updateIncentiveRewards(updates: [0: [pool\_id], rewards\_list: [0: [reward\_currency\_id, rewards\_per\_5\_blocks ]], ...]) | 设置incentives 奖励数量, updates 为调整的list, pool\_id为奖励池id, rewards\_list为该pool\_id下的奖励的list,reward\_currency\_id 为奖励的token,rewards\_per\_5\_blocks 为每5个block的奖励发放速率 | 重要, 主要检查奖励的token和数量是否符合incentives计划 ||
| operatorMembershipAcala(oracle feeder) | swapMember(remove, add) |替换成员,将remove 替换成 add | 确认remove和add的账户,确认add的feeder能尽快启动喂价 ||
## homa.resetLedgers 的验证
subaccount address 和 subaccount id 的对应:
| subaccount id(Acala/Karura) | subaccount address(Polkadot/Kusama) | 使用情况 |
| --- | --- | --- |
| 0 | acala `15sr8Dvq3AT3Z2Z1y8FnQ4VipekAHhmQnrkgzegUr1tNgbcn`, karura `HTAeD1dokCVs9MwnC1q9s2a7d2kQ52TAjrxE1y5mj5MFLLA ` | Acala, Karura |
| 1 | karura `FDVu3RdH5WsE2yTdXN3QMq6v1XVDK8GKjhq5oFjXe8wZYpL ` | Karura |
| 2 | karura `EMrKvFy7xLgzzdgruXT9oXERt553igEScqgSjoDm3GewPSA ` | Karura |
1. 首先,需要在 Acala/Karura 的 storage homa.relayChainCurrentEra 和 Polkadot/Kusama 的 storage staking.activeEra 时, 才发起该council proposal, 并能确保close时, 上面两个值依然和之前相等。 所以要预留时间和窗口期, 否则应当等待下一个era再去resetLedgers.
2. 先查询 Polkadot/Kusama 上 storage staking.ledgers(subaccount address) 查询结果中的 active 的数值,减去storage staking.minNominatorBond之后(以nominator参与staking时,需要一个最低门槛,每个subaccount在冷启动阶段由系统出了minNominatorBond 进行bond, 所以这部分不属于homa的staking DOT/KSM,应当要减去。目前polkadot的staking.minNominatorBond为10DOT, kusama为0.1KSM)。


3. 再检查resetLedger call中,update的list, 每一项item的第一个参数为 subaccount id, 第二个参数 maybe\_bonded\_change ,如果有值,要检查是不是等于其 subaccount id 对应的 subaccount address 的 步骤2 中的`(active - staking.minNominatorBond)` 的值。(通常只会看到 maybe\_bonded\_change有值, 第三项maybe\_unlocking\_change不会轻易配置)

4. 当执行生效,且Acala/Karura 还没有bump new era时, 可以进行检查,查询
Acala/Karura 上 storage homa.stakingLedgers(subaccount address 对应的 subaccount id) 查询结果中的 bonded。 是不是已经成功变成 步骤2中`(active - staking.minNominatorBond)`

## homa.updateBumpEraParams 的验证
1. 和homa.resetLedgers验证的第1点相同
2. 检查call的参数 last\_era\_bumped\_block , 是和Polkadot/Kusama 最新的 staking.EraPaid 事件所在的区块高度是一致的, 可以通过subscan 查询:
+ Polkadot: https://polkadot.subscan.io/event?address=&module=staking&event=erapaid&startDate=&endDate=&startBlock=&endBlock=&timeType=date&version=9281
+ Kusama: https://kusama.subscan.io/event?address=&module=staking&event=erapaid&startDate=&endDate=&startBlock=&endBlock=&timeType=date&version=9291
3. 当执行生效,且Acala/Karura 还没有bump new era时, 可以进行检查,storage homa.lastEraBumpedBlock 为 步骤2配置的值
## cdpEngine.setCollateralParams 的验证
1. `interest_rate_per_sec` ,每秒的利率,年利率 =(`interest_rate_per_sec`/10^18 + 1)^31536000 - 1
2. `liquidation_ratio`,`required_collateral_ratio`需要检查是否合理,
3. `liquidation_penalty` <= 当前 `liquidation_ratio` - 100% 也需要满足,确保罚金率是有效的