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

P2P: Add p2p-listen-endpoint :trx & :blk support #1115

Open
wants to merge 16 commits into
base: GH-1091-block-nack
Choose a base branch
from

Conversation

heifner
Copy link
Member

@heifner heifner commented Jan 23, 2025

Add ability to specify p2p-listen-endpoint connections to be transaction or block only. This allows, for example, a public P2P relay node to specify a public --p2p-listen-endpoint 0.0.0.0:9876:trx so that all connected peers will not send blocks to the relay node. The connected peers will only send transactions. This will reduce the inbound network traffic to the public relay node. Requires the connecting peer to have this PR incorporated. Older versions of nodeos will ignore the request to only send trx/blocks.

  --p2p-listen-endpoint arg (=0.0.0.0:9876:0)
                                        The actual host:port[:trx|:blk][:<rate-
                                        cap>] used to listen for incoming p2p
                                        connections. May be used multiple
                                        times. The optional rate cap will limit
                                        per connection block sync bandwidth to
                                        the specified rate. Total allowed
                                        bandwidth is the rate-cap multiplied by
                                        the connection count limit. A number
                                        alone will be interpreted as bytes per
                                        second. The number may be suffixed with
                                        units. Supported units are: 'B/s',
                                        'KB/s', 'MB/s, 'GB/s', 'TB/s', 'KiB/s',
                                        'MiB/s', 'GiB/s', 'TiB/s'. Transactions
                                        and blocks outside sync mode are not
                                        throttled. The optional 'trx' and 'blk'
                                        indicates to peers that only
                                        transactions 'trx' or blocks 'blk'
                                        should be sent. Examples:
                                           192.168.0.100:9876:1MiB/s
                                           node.eos.io:9876:trx:1512KB/s
                                           node.eos.io:9876:0.5GB/s
                                           [2001:db8:85a3:8d3:1319:8a2e:370:734
                                        8]:9876:250KB/s

Resolves #1101

@heifner heifner added the OCI Work exclusive to OCI team label Jan 23, 2025
@ericpassmore
Copy link
Contributor

Wow very cool

@ericpassmore
Copy link
Contributor

Note:start
category: Other
component: P2P
summary: Allow :trx and :blk support in p2p endpoints
Note:end

@ericpassmore ericpassmore added the enhancement New feature or request label Jan 24, 2025
@heifner heifner linked an issue Jan 24, 2025 that may be closed by this pull request
…te determination if a block request is needed. Also include in the block request_message the peer head. The peer head allows the node to determine if on a fork and send from LIB instead. Also create block_on_fork function to remove duplicate code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request OCI Work exclusive to OCI team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P2P: listen endpoint option to specify no blocks
4 participants