Skip to content

P2P: Feature: Transaction notice #1499

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

Merged
merged 33 commits into from
Jun 19, 2025
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b9bef03
GH-1475 Start of new transaction_notice_message support
heifner Apr 30, 2025
f2c87f8
GH-1475 Advance read pointer
heifner Apr 30, 2025
fcc0a7e
GH-1475 Use flat_set to track connections instead of duplicating entries
heifner May 1, 2025
fc47682
Merge remote-tracking branch 'spring/main' into GH-1475-trx-notify
heifner May 2, 2025
cb1de87
Revert "GH-1475 Use flat_set to track connections instead of duplicat…
heifner May 2, 2025
6e88fa5
GH-1475 Add processing of transaction_notify_message
heifner May 2, 2025
a01c692
GH-1475 Pass correct args
heifner May 2, 2025
4ccc1a9
GH-1475 Add expiration verification of trx and trx notice. Set min si…
heifner May 5, 2025
ce6fd87
Merge remote-tracking branch 'spring/main' into GH-1475-trx-notify
heifner May 5, 2025
d1ae512
GH-1475 ordered_non_unique seems more appropriate than hashed_non_uni…
heifner May 6, 2025
4f2ab63
Merge remote-tracking branch 'spring/main' into GH-1475-trx-notify
heifner May 12, 2025
159d070
GH-1475 Optimize tracking of local txn cache entries. Previous implem…
heifner May 12, 2025
9674ab1
GH-1475 Optimize add_peer_txn some more
heifner May 12, 2025
0dcec69
GH-1475 Boot multiindex lookup should be as fast as unordered map loo…
heifner May 12, 2025
3500aaf
GH-1475 Use a flat_map and decrement all at once
heifner May 14, 2025
ce02542
Merge remote-tracking branch 'origin/main' into GH-1475-trx-notify
heifner May 15, 2025
bf7ee5b
GH-1475 Switch back to debug level logging
heifner May 15, 2025
d846653
GH-1475 Avoid overhead of by_connection_id index. Entries will be reo…
heifner May 15, 2025
a264db8
GH-1475 Use unorderd_flat_set to track connections
heifner May 16, 2025
8f31405
GH-1475 Use an enum class for protocol version.
heifner May 16, 2025
48bc63a
GH-1475 Remove check of if we have received a notice from connection …
heifner May 16, 2025
446fc5c
GH-1475 Update expiration when trx is received
heifner May 16, 2025
9568000
GH-1475 Use a constant for allowed clock skew. Also updated allowed b…
heifner May 16, 2025
fe31164
GH-1475 Use unordered_flat_map instead of flat_map
heifner May 16, 2025
a0a0578
Merge remote-tracking branch 'spring/main' into GH-1475-trx-notify
heifner May 23, 2025
3a06338
GH-1475 Remove expiration from transaction_notice_message as the valu…
heifner May 23, 2025
d91d87f
GH-1475 Use connection_id_t instead of uint32_t
heifner May 23, 2025
47e6d5b
GH-1475 Simplify tracking/reset of trx_entries_size by using a window…
heifner May 23, 2025
edfc98d
GH-1475 Remove unneeded code
heifner May 23, 2025
99ad66e
GH-1475 Use correct max for trx cache entries
heifner May 23, 2025
71a599b
GH-1475 Switch back to debug logging
heifner May 26, 2025
b7bdf5e
GH-1475 Increase trx notice min size to 1024 from 200
heifner Jun 17, 2025
3713568
GH-1475 Increase trx notice min from 1024 to 4096
heifner Jun 19, 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
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ namespace eosio {
return send_buffer;
}

/// caches result for subsequent calls, only provide same packed_transaction_ptr instance for each invocation.
/// Do not use get_send_buffer() with get_notice_send_buffer(), only one valid per trx_buffer_factory instance.
const send_buffer_type& get_notice_send_buffer( const packed_transaction_ptr& trx ) {
if( !send_buffer ) {
send_buffer = buffer_factory::create_send_buffer( transaction_notice_message{trx->id()} );
}
return send_buffer;
}

private:

static send_buffer_type create_send_buffer( const packed_transaction_ptr& trx ) {
Expand Down
11 changes: 9 additions & 2 deletions plugins/net_plugin/include/eosio/net_plugin/protocol.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ namespace eosio {
block_id_type id;
};

struct transaction_notice_message {
transaction_id_type id;
};

struct gossip_bp_peers_message {
struct bp_peer_info_v1 {
std::string server_endpoint; // externally available address to connect to
Expand Down Expand Up @@ -175,7 +179,8 @@ namespace eosio {
vote_message,
block_nack_message,
block_notice_message,
gossip_bp_peers_message>;
gossip_bp_peers_message,
transaction_notice_message>;

// see protocol net_message
enum class msg_type_t {
Expand All @@ -191,7 +196,8 @@ namespace eosio {
vote_message = fc::get_index<net_message, vote_message>(),
block_nack_message = fc::get_index<net_message, block_nack_message>(),
block_notice_message = fc::get_index<net_message, block_notice_message>(),
gossip_bp_peers_message= fc::get_index<net_message, gossip_bp_peers_message>(),
gossip_bp_peers_message = fc::get_index<net_message, gossip_bp_peers_message>(),
transaction_notice_message = fc::get_index<net_message, transaction_notice_message>(),
unknown
};

Expand Down Expand Up @@ -225,6 +231,7 @@ FC_REFLECT( eosio::request_message, (req_trx)(req_blocks) )
FC_REFLECT( eosio::sync_request_message, (start_block)(end_block) )
FC_REFLECT( eosio::block_nack_message, (id) )
FC_REFLECT( eosio::block_notice_message, (previous)(id) )
FC_REFLECT( eosio::transaction_notice_message, (id) )
FC_REFLECT( eosio::gossip_bp_peers_message::bp_peer_info_v1, (server_endpoint)(outbound_ip_address)(expiration) )
FC_REFLECT( eosio::gossip_bp_peers_message::bp_peer, (version)(producer_name)(bp_peer_info) )
FC_REFLECT_DERIVED(eosio::gossip_bp_peers_message::signed_bp_peer, (eosio::gossip_bp_peers_message::bp_peer), (sig) )
Expand Down
Loading