my-cloud / ruthenium

Golang implementation of the Ruthenium protocol
The Unlicense
11 stars 1 forks source link

There is no incentive to respect transaction gossip protocol #196

Closed JeremyPansier closed 1 year ago

JeremyPansier commented 1 year ago

To Reproduce Steps to reproduce the behavior:

  1. Run a node using this repository implementation
  2. Run a node that is hoarding transactions and not broadcasting them to the other nodes

Expected behavior The second node will not get rewards or will have less chance to get rewards.

Actual behavior The second node might be the only one to get the reward for the transactions it has hoarded.

JeremyPansier commented 1 year ago

In a blockchain network, it is possible to detect if a node is not following the transaction gossip protocol. This can be done in several ways:

Monitoring network activity: By monitoring the network, it is possible to detect if a node is not broadcasting transactions as expected. For example, if a node is the first to receive a transaction but does not broadcast it to other nodes, this could indicate that the node is hoarding transactions and not following the transaction gossip protocol.

Analyzing transaction history: The transaction history of a node can also be analyzed to determine if it is following the transaction gossip protocol. If a node is not broadcasting transactions in a timely manner, this could indicate that the node is hoarding transactions and not following the protocol.

Checking network statistics: Many blockchain networks provide network statistics that can be used to determine if a node is following the transaction gossip protocol. For example, if a node has a low number of broadcast transactions, this could indicate that the node is not following the protocol.

Community feedback: In a decentralized network, the community plays a crucial role in ensuring the health of the network. If members of the community observe a node not following the transaction gossip protocol, they may bring this to the attention of the network or take other measures to enforce the rules.

By using these methods, it is possible to detect if a node is not following the transaction gossip protocol and take appropriate action to maintain the health of the network.

JeremyPansier commented 1 year ago

I think the most suitable option for Ruthenium is checking network statistics.

One of these statistics is the number of broadcast transactions made by a node. If a node has a low number of broadcast transactions, this could indicate that it is not following the transaction gossip protocol and is hoarding transactions. By monitoring this statistic, other nodes in the network can determine if a node is not following the protocol and take appropriate action, such as isolating the node or flagging it to the network administrators. This helps to maintain the health and integrity of the network, as all nodes are expected to contribute to the dissemination of transactions.

In practice, the node API letting to Add a transaction might be modified to take a request value that is like a TransactionRequest holding the target of the sender node. This way, the node receiving the request might increase a score associated to the sender node. This score might be used to incentive nodes broadcasting transactions. The incentive might be to give it more chance to be selected when verifying neighbor blocks.