Skip to content

Commit

Permalink
GH-1916 fthreshold should be > to ensure Byzantine fault tolerance of…
Browse files Browse the repository at this point in the history
… at least one
  • Loading branch information
heifner committed Nov 28, 2023
1 parent be8ff28 commit 6ca044b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/chain/webassembly/privileged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ namespace eosio { namespace chain { namespace webassembly {

// system contract should perform a duplicate check and fthreshold check before calling
EOS_ASSERT( finalizers.size() == unique_finalizer_keys.size(), wasm_execution_error, "Duplicate finalizer bls key in finalizer set" );
EOS_ASSERT( finset.fthreshold >= f_weight_sum / 2, wasm_execution_error, "Finalizer set threshold cannot be met by finalizer weights" );
EOS_ASSERT( finset.fthreshold > f_weight_sum / 2, wasm_execution_error, "Finalizer set threshold cannot be met by finalizer weights" );

context.control.set_proposed_finalizers( finset );
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/testing/tester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ namespace eosio { namespace testing {
}

transaction_trace_ptr base_tester::set_finalizers(const vector<account_name>& finalizer_names) {
uint64_t fthreshold = finalizer_names.size() * 2 / 3;
uint64_t fthreshold = finalizer_names.size() * 2 / 3 + 1;

fc::variants finalizer_auths;
for (const auto& n: finalizer_names) {
Expand Down

0 comments on commit 6ca044b

Please sign in to comment.