|
| 1 | +# ADR 008: Light Client Transaction Gossip & Mempool |
| 2 | + |
| 3 | +## Changelog |
| 4 | + |
| 5 | +- 20.09.2022: Initial Draft |
| 6 | + |
| 7 | +## Context |
| 8 | + |
| 9 | +Rollmint Light Clients cannot validate transactions without a state. Therefore Light Clients should not gossip incoming transactions, and the mempool can be disabled. |
| 10 | + |
| 11 | +### Explanation |
| 12 | + |
| 13 | +There is a wish for the light clients to participate in the P2P Layer. One of the ways a full node participates in the network is to gossip valid transactions throughout the network. Each full node that receives a transaction sends an ABCI message, `CheckTx`, to the application layer to check for validity and receives an `abci.ResponseCheckTx` . |
| 14 | +There are 2 Types of checks. |
| 15 | +Current stateless checks: |
| 16 | + |
| 17 | +- Check that the size is less than the configured maximum transaction size. |
| 18 | +- Call any Pre-Check hooks if defined |
| 19 | +- Check if the proxy connection has an error |
| 20 | +- Check if the transaction is already in cache / mempool |
| 21 | + |
| 22 | +Stateful: |
| 23 | + |
| 24 | +- Checks if transactions and messages are valid based on a committed state |
| 25 | + |
| 26 | +Light clients cannot do stateful checks because they don't have access to the state. |
| 27 | +Light clients can do stateless checks. However, creating invalid transactions that pass the current stateless checks is easy. Light clients could therefore support a DOS attack of the network when they gossip invalid transactions. |
| 28 | +If light clients do not check transactions, they do not need the mempool. |
| 29 | + |
| 30 | +### Libp2p pubsub |
| 31 | + |
| 32 | +If the transaction originates from the light client i.e. submitting a new transaction, then this transaction must be gossiped to the network. |
| 33 | + |
| 34 | +A light client will use the [fan-out](https://docs.libp2p.io/concepts/publish-subscribe/#fan-out) functionality of pubsub. It will send its transaction to the network but will not subscribe to receiving and propagating other transactions. |
| 35 | + |
| 36 | +## Alternative Approaches |
| 37 | + |
| 38 | +- We create more rigorous stateless checks on the transactions that would reduce or prevent the DOS attack and enable transaction gossiping |
| 39 | + |
| 40 | +## Status |
| 41 | + |
| 42 | +Proposed |
| 43 | + |
| 44 | +## Consequences |
| 45 | + |
| 46 | +### Positive |
| 47 | + |
| 48 | +- Reduction of complexity and keeping the light client lightweight |
| 49 | + |
| 50 | +### Negative |
| 51 | + |
| 52 | +- Light clients do not participate in gossiping transactions |
| 53 | + |
| 54 | +## References |
| 55 | + |
| 56 | +Issue #100 [References](https://github.com/celestiaorg/oollmint/issues/100#issuecomment-921848268) |
0 commit comments