Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
7f66aad
GH-1245 Add gossip_bp_peers_message
heifner Mar 12, 2025
4a48bba
GH-1245 Move max_p2p_address_length to net_utils and enforce in split…
heifner Mar 12, 2025
73ba970
GH-1245 Move net_logger_impl to net_logger.hpp
heifner Mar 14, 2025
d51c6ed
GH-1245 Move buffer_factory into buffer_factor.hpp
heifner Mar 14, 2025
414c22d
GH-1245 Add tracking and validation of gossip_bp_peers_message.
heifner Mar 14, 2025
1f97d9d
GH-1245 Refactor some functionality into auto_bp_peering.hpp
heifner Mar 14, 2025
b337c1a
GH-1245 The gethostname() seems to be testing this python script rath…
heifner Mar 17, 2025
b4abdc7
GH-1245 Support both manually configured bp peers and gossip bp peers.
heifner Mar 17, 2025
a18b4fc
GH-1245 Remove extra loop
heifner Mar 17, 2025
c6bed3b
Merge remote-tracking branch 'spring/gh_1183' into GH-1245-gossip-bp-…
heifner Mar 19, 2025
8c98362
GH-1245 Add is_bp_gossip_peer to connection_status
heifner Mar 19, 2025
1a788ea
GH-1245 Integrate peer_keys_db
heifner Mar 19, 2025
dec942d
GH-1245 Add integration test for bp gossip peering
heifner Mar 21, 2025
b4cf089
GH-1245 Do not include sig in digest
heifner Mar 21, 2025
e8cbb49
GH-1245 Add peerkeys table and actions to system contract
heifner Mar 21, 2025
77bf31d
GH-1245 Update to match system contract
heifner Mar 21, 2025
ac93b63
GH-1245 Track active_schedule so when new peers are received in the s…
heifner Mar 21, 2025
8e7e6bd
GH-1245 Fix startup missing disconnect
heifner Mar 21, 2025
8f0c5c4
Merge remote-tracking branch 'spring/gh_1183' into GH-1245-gossip-bp-…
heifner Mar 21, 2025
292e4c2
GH-1245 Reduce test runtime
heifner Mar 21, 2025
b17234d
GH-1245 Simplify and add comment
heifner Mar 25, 2025
b3fac2f
GH-1245 Add some additional logging
heifner Mar 25, 2025
7cb4faa
GH-1245 Clarify code with extra comments and simplier if logic
heifner Mar 26, 2025
fe41bf2
GH-1245 Simplify logic and make sure no more 4 bp peers is maintained…
heifner Mar 26, 2025
c47600c
GH-1245 Make sig update faster and simpler
heifner Mar 26, 2025
1e8c4d2
GH-1245 Move call to connect_to_active_bp_peers() to net_plugin and a…
heifner Mar 26, 2025
52d8878
GH-1245 Remove duplicate code and avoid calling back into net_plugin …
heifner Mar 26, 2025
d4e2a9e
GH-1245 Verify private key found
heifner Mar 26, 2025
d30b57b
GH-1245 Replace is_gossip_bp_connection and is_configured_bp_connecti…
heifner Mar 26, 2025
d8f3204
Use `unique_ptr` in buffer factory. use `send_buffer_type` consistent…
greg7mdp Mar 27, 2025
8dff9eb
Make copies of buffers when posting them.
greg7mdp Mar 27, 2025
17c0cec
Merge branch 'main' into GH-1245-gossip-bp-peers
heifner Mar 27, 2025
3f12cb2
Add a `const`
greg7mdp Mar 27, 2025
1f96d42
Merge branch 'GH-1245-gossip-bp-peers' of github.com:AntelopeIO/sprin…
greg7mdp Mar 27, 2025
724edc0
Return a value as `send_buffer` can be modified at any time.
greg7mdp Mar 28, 2025
de8699e
Also update return value of `get_gossip_bp_initial_send_buffer`
greg7mdp Mar 28, 2025
95c26bb
Merge pull request #1283 from AntelopeIO/buff_factory_unique_ptr
greg7mdp Mar 28, 2025
18d8057
Merge remote-tracking branch 'spring/main' into GH-1245-gossip-bp-peers
heifner Mar 31, 2025
313dbfd
GH-1245 Verify regpeerkey is final before shutdown
heifner Mar 31, 2025
770049c
Merge remote-tracking branch 'spring/main' into GH-1245-gossip-bp-peers
heifner Apr 9, 2025
818da30
GH-1245 go_away_reason now an enum class
heifner Apr 9, 2025
e686d8d
Merge branch 'main' into GH-1245-gossip-bp-peers
heifner Apr 14, 2025
1260fc0
Merge remote-tracking branch 'spring/gh_1183_3' into GH-1245-gossip-b…
heifner Apr 14, 2025
187c406
Merge remote-tracking branch 'spring/gh_1183_3' into GH-1245-gossip-b…
heifner Apr 14, 2025
f87f2b3
GH-1245 Fix merge issue
heifner Apr 15, 2025
89ead3a
GH-1245 peerkeys table moved to peer_keys.?pp
heifner Apr 16, 2025
2235077
GH-1245 Simplify implementation since protoalvote not populated for m…
heifner Apr 16, 2025
65f3c9e
GH-1245 enable-stale-production so production restarts on node restart
heifner Apr 16, 2025
dff3da9
GH-1245 Integrate peer key retrieval by read-only trx. Required waiti…
heifner Apr 16, 2025
e835f95
Merge remote-tracking branch 'spring/main' into GH-1245-gossip-bp-peers
heifner Apr 16, 2025
9e487c0
GH-1245 Update test for simplified system contract
heifner Apr 16, 2025
b629769
1245 Improve test robustness in face of temp duplicate connections
heifner Apr 16, 2025
b8d8f22
Merge branch 'main' into GH-1245-gossip-bp-peers
heifner Apr 16, 2025
0721d18
Merge remote-tracking branch 'spring/main' into GH-1245-gossip-bp-peers
heifner Apr 18, 2025
596135d
GH-1245 Use peer_name_set_t throughout
heifner Apr 19, 2025
f816643
GH-1245 Verify not webauthn sig and don't check for canonical
heifner Apr 19, 2025
3b8145f
GH-1245 Add and use a new endpoint type instead of using string
heifner Apr 21, 2025
e70d33b
GH-1245 Fix host/port parsing when there is only one colon
heifner Apr 21, 2025
436e188
GH-1245 Fix auto_bp_peering_test.py to check for correct host name
heifner Apr 21, 2025
67e038f
Merge remote-tracking branch 'spring/main' into GH-1245-gossip-bp-peers
heifner Apr 22, 2025
f778d71
GH-1245 Reduce logging on expected already connected calls to resolve…
heifner Apr 22, 2025
75c63e3
GH-1245 Rename fatal_error to invalid_message
heifner Apr 22, 2025
4fe408f
GH-1245 Don't consider a peer outside of top producers a fatal error
heifner Apr 22, 2025
107647b
GH-1245 Add debug log statement when connection first becoming bp gos…
heifner Apr 22, 2025
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
7 changes: 4 additions & 3 deletions libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1322,9 +1322,6 @@ struct controller_impl {
const auto& [ block, id] = t;
wasmif.current_lib(block->block_num());
vote_processor.notify_lib(block->block_num());

// update peer public keys from chainbase db
peer_keys_db.update_peer_keys(self, block->block_num());
});

#define SET_APP_HANDLER( receiver, contract, action) \
Expand Down Expand Up @@ -5787,6 +5784,10 @@ void controller::set_peer_keys_retrieval_active(bool active) {
my->peer_keys_db.set_active(active);
}

flat_set<name> controller::update_peer_keys(uint32_t lib_number) {
return my->peer_keys_db.update_peer_keys(*this, lib_number);
}

std::optional<public_key_type> controller::get_peer_key(name n) const {
return my->peer_keys_db.get_peer_key(n);
}
Expand Down
2 changes: 2 additions & 0 deletions libraries/chain/include/eosio/chain/controller.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ namespace eosio::chain {
chain_id_type get_chain_id()const;

void set_peer_keys_retrieval_active(bool active);
// call on main thread with irreversible block
flat_set<name> update_peer_keys(uint32_t lib_number);
std::optional<public_key_type> get_peer_key(name n) const; // thread safe

// thread safe
Expand Down
4 changes: 2 additions & 2 deletions libraries/chain/include/eosio/chain/peer_keys_db.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class peer_keys_db_t {

void set_active(bool b) { _active = b; }

// must be called from main thread
size_t update_peer_keys(const controller& chain, uint32_t lib_number);
// must be called from main thread, returns any new or updated producers
flat_set<name> update_peer_keys(const controller& chain, uint32_t lib_number);

// safe to be called from any thread
std::optional<public_key_type> get_peer_key(name n) const;
Expand Down
12 changes: 6 additions & 6 deletions libraries/chain/peer_keys_db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ size_t peer_keys_db_t::size() const {

// we update the keys that were registered up to lib_number (inclusive)
// --------------------------------------------------------------------
size_t peer_keys_db_t::update_peer_keys(const controller& chain, uint32_t lib_number) {
size_t num_updated = 0;
flat_set<name> peer_keys_db_t::update_peer_keys(const controller& chain, uint32_t lib_number) {
flat_set<name> result;
if (!_active || lib_number <= _block_num)
return num_updated; // nothing to do
return result; // nothing to do

try {
const auto& db = chain.db();
Expand All @@ -38,7 +38,7 @@ size_t peer_keys_db_t::update_peer_keys(const controller& chain, uint32_t lib_nu
if (upper == lower) {
// no new keys registered
_block_num = lib_number;
return num_updated;
return result;
}

fc::lock_guard g(_m); // we only need to protect access to _peer_key_map
Expand Down Expand Up @@ -75,15 +75,15 @@ size_t peer_keys_db_t::update_peer_keys(const controller& chain, uint32_t lib_nu
EOS_ASSERT(data.pubkey->valid(), misc_exception, "deserialized invalid public key from `peerkeys`");

_peer_key_map[row_name] = *data.pubkey;
++num_updated;
result.insert(row_name);
}
}
FC_LOG_AND_DROP(("skipping invalid record deserialized from `peerkeys`"));
}

_block_num = lib_number; // mark that we have updated up to lib_number
} FC_LOG_AND_DROP(("Error when updating peer_keys_db"));
return num_updated;
return result;
}

} // namespace eosio::chain
Loading