合同是否需要强制Oracle在IRS示例中签署了Fix命令?

时间:2018-03-23 08:14:42

标签: corda

我观察到,通常在典型的合同中我们有类似于

的东西
"The signers should be the participants for the state" using
(command.signers.toSet() == state.participants.map { it.owningKey }.toSet())

如果使用此特定命令,我们强制执行,所需的签名者等于参与者(假设交易的参与者总是必须签名),因此节点不会恶意改变流程以回避从某些方获取签名。

在Oracle(RateFixFlow/NodeInterestRate)的IRS演示中,State涉及participantsoracle方。还有一个verifyFixCommand,只要使用Fix命令从Oracle获取费率,就会验证是否满足某些规则。

为什么命令也没有强制执行参与者必须签名 - 加上oracle必须签名以保证修复率由Oracle验证?另外,为什么流程会得到oracle的签名呢?什么阻止了发起者首先绕过获得oracle签名。

有没有任何理由可以不从下面提出类似的规则?即

"The signers should be the participants and oracle for the state" using (command.signers.toSet() == (state.participants.map { it.owningKey } + state.oracle.owningKey).toSet())

1 个答案:

答案 0 :(得分:0)

这是一种疏忽。合同的verify方法应检查所需的签名者。

如果你能创建一个PR来修改它,将不胜感激。贡献指南在这里:https://docs.corda.net/contributing.html