Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_finalizers host function (#1511) #1561

Merged
merged 19 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1999,9 +1999,8 @@ struct controller_impl {
this->finalizers = std::move(finalizers);
}

void get_finalizers_impl(uint64_t& fthreshold, vector<finalizer_authority>& finalizers) {
fthreshold = this->fthreshold;
finalizers = this->finalizers;
std::pair<uint64_t, vector<finalizer_authority>> get_finalizers_impl() {
fcecin marked this conversation as resolved.
Show resolved Hide resolved
return { fthreshold, finalizers };
}

/**
Expand Down
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ namespace eosio { namespace chain {
int64_t set_proposed_producers( vector<producer_authority> producers );

void set_finalizers( uint64_t fthreshold, vector<finalizer_authority> finalizers );
void get_finalizers( uint64_t& fthreshold, vector<finalizer_authority>& finalizers );
std::pair<uint64_t, vector<finalizer_authority>> get_finalizers() const;

bool light_validation_allowed() const;
bool skip_auth_check()const;
Expand Down
4 changes: 1 addition & 3 deletions libraries/hotstuff/chain_pacemaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,7 @@ namespace eosio { namespace hotstuff {
// - list of string finalizer descriptions instead of eosio name now
// - also return the keys for each finalizer, not just name/description so qc_chain can use them
//
uint64_t fthreshold;
vector<finalizer_authority> finalizers;
_chain->get_finalizers(fthreshold, finalizers);
auto [threshold, finalizers] = _chain->get_finalizers();

// Old code: get eosio::name from the producer schedule
const block_state_ptr& hbs = _chain->head_block_state();
Expand Down
3 changes: 1 addition & 2 deletions libraries/libfc/include/fc/crypto/bls_public_key.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <fc/reflect/variant.hpp>
#include <fc/static_variant.hpp>
#include <bls12-381/bls12-381.hpp>
#include <bls12-381/scalar.hpp>

namespace fc { namespace crypto { namespace blslib {

Expand Down Expand Up @@ -63,7 +62,7 @@ namespace fc { namespace crypto { namespace blslib {
friend std::ostream& operator<< (std::ostream& s, const bls_public_key& k);
friend bool operator == ( const bls_public_key& p1, const bls_public_key& p2) { return p1._pkey.equal(p2._pkey); }
friend bool operator != ( const bls_public_key& p1, const bls_public_key& p2) { return !p1._pkey.equal(p2._pkey); }
friend bool operator < ( const bls_public_key& p1, const bls_public_key& p2) { return bls12_381::scalar::cmp(p1._pkey.x.d, p2._pkey.x.d) < 0; }
friend bool operator < ( const bls_public_key& p1, const bls_public_key& p2) { return p1._pkey.affine().x.cmp(p2._pkey.affine().x) < 0; }
friend struct reflector<bls_public_key>;
friend class bls_private_key;
}; // bls_public_key
Expand Down
Loading