Skip to content

Commit

Permalink
Merge branch 'GH-986-retry-with-oc' into GH-1039-interrupt-block-vali…
Browse files Browse the repository at this point in the history
…dation
  • Loading branch information
heifner authored Dec 4, 2024
2 parents 1efb62c + c482721 commit 8a3f00a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .cicd/defaults.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cdt":{
"target":"main",
"target":"4.1",
"prerelease":true
},
"referencecontracts":{
Expand Down
13 changes: 8 additions & 5 deletions libraries/chain/include/eosio/chain/wasm_interface_private.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ struct eosvmoc_tier {
bool attempt_tierup = false;
#ifdef EOSIO_EOS_VM_OC_RUNTIME_ENABLED
attempt_tierup = eosvmoc && (eosvmoc_tierup == wasm_interface::vm_oc_enable::oc_all || context.should_use_eos_vm_oc());
const bool allow_oc_interrupt = attempt_tierup && context.is_applying_block() && context.trx_context.has_undo();
if (attempt_tierup) {
const chain::eosvmoc::code_descriptor* cd = nullptr;
chain::eosvmoc::code_cache_base::get_cd_failure failure = chain::eosvmoc::code_cache_base::get_cd_failure::temporary;
Expand Down Expand Up @@ -170,17 +169,21 @@ struct eosvmoc_tier {
}
}
#endif
const bool allow_oc_interrupt = attempt_tierup && context.is_applying_block() && context.trx_context.has_undo();
auto ex = fc::make_scoped_exit([&]() {
eos_vm_oc_compile_interrupt = false;
executing_code_hash.store({}); // indicate no longer executing
if (allow_oc_interrupt) {
eos_vm_oc_compile_interrupt = false;
executing_code_hash.store({}); // indicate no longer executing
}
});
executing_code_hash.store(code_hash);
if (allow_oc_interrupt)
executing_code_hash.store(code_hash);
try {
get_instantiated_module(code_hash, vm_type, vm_version, context.trx_context)->apply(context);
} catch (const interrupt_exception& e) {
if (allow_oc_interrupt && eos_vm_oc_compile_interrupt) {
++eos_vm_oc_compile_interrupt_count;
wlog("EOS VM OC compile complete interrupt of ${r} <= ${a}::${act} code ${h}, interrupt #${c}",
dlog("EOS VM OC compile complete interrupt of ${r} <= ${a}::${act} code ${h}, interrupt #${c}",
("r", context.get_receiver())("a", context.get_action().account)
("act", context.get_action().name)("h", code_hash)("c", eos_vm_oc_compile_interrupt_count));
EOS_THROW(interrupt_oc_exception, "EOS VM OC compile complete interrupt of ${r} <= ${a}::${act} code ${h}, interrupt #${c}",
Expand Down
11 changes: 6 additions & 5 deletions tests/separate_prod_fin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@
# LIB has advanced, which indicate at least 2 of non-producer finalizers have voted.
block_num = cluster.getNode(1).getIrreversibleBlockNum()
block = cluster.getNode(1).getBlock(block_num)
qc_ext = block["qc_extension"]
Print(f'{qc_ext}')
# "11111" is the representation of a bitset showing which finalizers have voted (we have five total finalizers)
if qc_ext["qc"]["active_policy_sig"]["strong_votes"] == "11111":
break
if "qc_extension" in block:
qc_ext = block["qc_extension"]
Print(f'{qc_ext}')
# "11111" is the representation of a bitset showing which finalizers have voted (we have five total finalizers)
if qc_ext["qc"]["active_policy_sig"]["strong_votes"] == "11111":
break
cluster.getNode(1).waitForLibToAdvance()
i += 1
assert i < 3, "Not all finalizers voted"
Expand Down

0 comments on commit 8a3f00a

Please sign in to comment.