Skip to content

Light protocol get_tx_info() validation #1302

Open
@yangzhe1990

Description

@yangzhe1990

There is a FIXME in get_tx_info about not having non-existence proof.

The current situation is, that we have existence proof, however a block may contain the same transaction for two times, one executed fail due to incorrect nonce, the other succeed. We can also have the same transaction in multiple blocks in the same epoch, or in different epochs.

To summarize I think there are several issues:

  1. Positive get_tx_info returned with a zero transaction execution gas should be dropped; An honest node never return such non-executed transaction.

  2. For a non-existent reply from peer, the light node can only request another peer. If the light node maintains the most recent blocks, it's possible that the light node check for all epochs where the transaction is packed into, however to check if the transaction is executed, the light node must check the executed nonce of the sender by getAccount, then also rule out other transactions from the same sender with the same nonce by getting receipts for other transactions.

  3. To update the reputation of the peer, keep in mind that the status of the transaction can only change after the epoch where transaction is executed. Where is the executed epochs of the peer? Is an attack taking place so that different peer see different pivot chain? The rpc request must be bounded with an epoch range.

We should figure out:

a) How is get_tx_info useful for the light node. Is it only required to answer client rpc request;
b) Shall we remove the support of transaction receipt for light node? User should connect to a trusted full node for this feature;
c) It seems that the best solution to this problem is to maintain block receipts in a hash based receipts trie for a defined number of epochs and include the root into the block hash. However it's will be hard fork to support this because it changes block structure definition.
d) Should we implement 2)? It's significant amount of work to implement, but it seems to solve the problem of retrieving information and figuring out malicious peer without a hard fork.

Metadata

Metadata

Assignees

Labels

P3Low PriorityenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions