Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
test-each-commit:
name: 'test each commit'
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request' && github.event.pull_request.commits != 1
if: github.event_name == 'pull_request' # && github.event.pull_request.commits != 1
timeout-minutes: 360 # Use maximum time, see https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes. Assuming a worst case time of 1 hour per commit, this leads to a --max-count=6 below.
env:
MAX_COUNT: 6
Expand Down
9 changes: 7 additions & 2 deletions src/simplicity/dag.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ sha256_midstate simplicity_computeWordCMR(const bitstring* value, size_t n) {
case 0: i = getBit(value, 0); break;
case 1: i = 2 + ((1U * getBit(value, 0) << 1) | getBit(value, 1)); break;
case 2: i = 6 + ((1U * getBit(value, 0) << 3) | (1U * getBit(value, 1) << 2) | (1U * getBit(value, 2) << 1) | getBit(value, 3)); break;
default: SIMPLICITY_UNREACHABLE;
}
memcpy(stack_ptr, &word_cmr[i], sizeof(uint32_t[8]));
} else {
Expand Down Expand Up @@ -174,14 +175,15 @@ void simplicity_computeCommitmentMerkleRoot(dag_node* dag, const uint_fast32_t i
case PAIR:
memcpy(block + j, dag[dag[i].child[1]].cmr.s, sizeof(uint32_t[8]));
j = 0;
/*@fallthrough@*/
__attribute__((fallthrough));
case DISCONNECT: /* Only the first child is used in the CMR. */
case INJL:
case INJR:
case TAKE:
case DROP:
memcpy(block + j, dag[dag[i].child[0]].cmr.s, sizeof(uint32_t[8]));
simplicity_sha256_compression(dag[i].cmr.s, block);
__attribute__((fallthrough));
case IDEN:
case UNIT:
case WITNESS:
Expand Down Expand Up @@ -224,13 +226,14 @@ static void computeIdentityHashRoots(sha256_midstate* ihr, const dag_node* dag,
case DISCONNECT:
memcpy(block + j, ihr[dag[i].child[1]].s, sizeof(uint32_t[8]));
j = 0;
/*@fallthrough@*/
__attribute__((fallthrough));
case INJL:
case INJR:
case TAKE:
case DROP:
memcpy(block + j, ihr[dag[i].child[0]].s, sizeof(uint32_t[8]));
simplicity_sha256_compression(ihr[i].s, block);
__attribute__((fallthrough));
case IDEN:
case UNIT:
case HIDDEN:
Expand Down Expand Up @@ -420,6 +423,7 @@ simplicity_err simplicity_verifyCanonicalOrder(dag_node* dag, const uint_fast32_
continue;
}
if (bottom == child) bottom++;
__attribute__((fallthrough));
case IDEN:
case UNIT:
case WITNESS:
Expand All @@ -444,6 +448,7 @@ simplicity_err simplicity_verifyCanonicalOrder(dag_node* dag, const uint_fast32_
continue;
}
if (bottom == child) bottom++;
__attribute__((fallthrough));
case INJL:
case INJR:
case TAKE:
Expand Down
4 changes: 2 additions & 2 deletions src/simplicity/eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ static simplicity_err runTCO(evalState state, call* stack, const dag_node* dag,
skip(state.activeWriteFrame, pad( INJR == dag[pc].tag
, type_dag[INJ_B(dag, type_dag, pc)].bitSize
, type_dag[INJ_C(dag, type_dag, pc)].bitSize));
/*@fallthrough@*/
__attribute__((fallthrough));
case TAKE:
simplicity_debug_assert(calling);
/* TAIL_CALL(dag[pc].child[0], SAME_TCO); */
Expand Down Expand Up @@ -496,7 +496,7 @@ static simplicity_err runTCO(evalState state, call* stack, const dag_node* dag,
} else {
writeValue(state.activeWriteFrame, &dag[pc].compactValue, dag[pc].targetType, type_dag);
}
/*@fallthrough@*/
__attribute__((fallthrough));
case UNIT:
simplicity_debug_assert(calling);
if (get_tco_flag(&stack[pc])) {
Expand Down
2 changes: 1 addition & 1 deletion test/functional/test_framework/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ def calc_witness_hash(self):
def is_valid(self):
self.calc_sha256()
for tout in self.vout:
if tout.nValue < 0 or tout.nValue > 21000000 * COIN:
if tout.nValue.getAmount() < 0 or tout.nValue.getAmount() > 21000000 * COIN: # ELEMENTS
return False
return True

Expand Down
Loading