Skip to content
This repository was archived by the owner on Aug 20, 2021. It is now read-only.

Commit 5cf7825

Browse files
d-xoxwvvvvwx
authored andcommitted
build.js: unify proof hash calculation
Uses the same proof hash calculation algorithm for the exhaustiveness specs as the "normal" specs. Should hopefully fix some cache invalidation issues in CI by forcing new runs for exhaustivness specs when the klab commit changes.
1 parent bf26b43 commit 5cf7825

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

lib/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ const make_args = inputs => inputs && inputs.length == 0
218218
&& ".TypedArgs"
219219
|| inputs.map(make_abi_dsl).join(", ")
220220

221-
const makeInterabiExhaustiveness = (alias, cname, contract) => {
221+
const makeInterabiExhaustiveness = (alias, cname, contract, hasher) => {
222222
const if_not_entries = contract.abi
223223
.filter(fabi => fabi.type == "function")
224224
.map(fabi => sha3(fabi.name + `(${fabi.inputs.map(i => i.type).join(",")})`).slice(0, 8))
@@ -245,7 +245,7 @@ const makeInterabiExhaustiveness = (alias, cname, contract) => {
245245
}
246246
})
247247

248-
const id = sha3(spec);
248+
const id = hasher({name: cname, spec: spec});
249249

250250
const status = getStatus(id);
251251

libexec/klab-build-js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ config.get_proof_hash = ({name, spec}) => {
9595
rules: rules_str,
9696
smt_prelude: prelude_str,
9797
spec : spec,
98-
timeout: timeouts[name] || null,
99-
smt_prelude: prelude_str,
98+
timeout: timeouts[name] || null
10099
}
101100
if (memory[name]) proof.memory = memory[name];
102101
return sha3(JSON.stringify(proof))
@@ -109,7 +108,7 @@ Object.keys(config.implementations)
109108
.forEach(alias => {
110109
const cname = config.implementations[alias].name
111110
const name = alias + "__exhaustiveness";
112-
const {id, module, status} = makeInterabiExhaustiveness(alias, cname, config.contracts[cname])
111+
const {id, module, status} = makeInterabiExhaustiveness(alias, cname, config.contracts[cname], config.get_proof_hash)
113112

114113
// TODO - write meta/data and name
115114

0 commit comments

Comments
 (0)