You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(l1): track new pooled transaction hashes (lambdaclass#3158)
**Motivation**
We weren't keeping track of the received NewPooledTransationHashes
messages, we were just propagating the incoming msg without validating
them.
<!-- Why does this pull request exist? What are its goals? -->
The PR fixes the following hivetests:
- BlobViolations
This test sends some invalid blob tx announcements and expects the node
to disconnect.
- TestBlobTxWithoutSidecar
This test checks that a blob transaction first advertised/transmitted
without blobs will result in the sending peer being disconnected, and
the full transaction should be successfully retrieved from another peer.
- TestBlobTxWithMismatchedSidecar
This test checks that a blob transaction first advertised/transmitted
without blobs, whose commitment don't correspond to the
blob_versioned_hashes in the transaction, will result in the sending
peer being disconnected, and the full transaction should be successfully
retrieved from another peer.
### Sequence diagram of TestBlobTxWithoutSidecar &
TestBlobTxWithMismatchedSidecar
```mermaid
sequenceDiagram
participant Node
participant BadPeer
participant GoodPeer
%% Setup: Forkchoice Update
Node->>Node: sendForkchoiceUpdated()
%% Stage 1: Bad Peer announces transaction
BadPeer->>Node: NewPooledTransactionHashesMsg<br>(badTx Hash, BlobTxType, Size)
Node->>BadPeer: GetPooledTransactionsPacket<br>(Request badTx)
Note right of BadPeer: stage1.Done()
%% Stage 2: Good Peer announces transaction
Note right of GoodPeer: stage1.Wait()
GoodPeer->>Node: NewPooledTransactionHashesMsg<br>(tx Hash, BlobTxType, Size)
Note right of GoodPeer: stage2.Done()
%% Stage 3: Bad Peer sends invalid transaction and is disconnected
Note right of BadPeer: stage2.Wait()
BadPeer->>Node: PooledTransactionsMsg<br>(badTx, RequestId)
Node->>BadPeer: Disconnect
Note right of BadPeer: stage3.Done()
%% Good Peer sends correct transaction
Note right of GoodPeer: stage3.Wait()
Node->>GoodPeer: GetPooledTransactionsPacket<br>(Request tx)
GoodPeer->>Node: PooledTransactionsMsg<br>(tx, RequestId)
Note right of GoodPeer: No Disconnect<br>close(errc)
%% Synchronization Points
Note over BadPeer,GoodPeer: stage1: Bad Peer announces<br>stage2: Good Peer announces<br>stage3: Bad Peer disconnected
```
You can check the tests code
[here](https://github.com/ethereum/go-ethereum/blob/72d92698a474059f3a73798c6312699c1f210497/cmd/devp2p/internal/ethtest/suite.go#L917)
**Description**
A new field `requested_pooled_txs` was added to the RLPxConnection
struct. In that struct, the request_id and the requested hashed are
stored to check later, when the response is received. By doing these, we
can assure that the received Pooled Transactions match the expected
income.
Some new error types were added.
The fn `get_p2p_transaction` was moved to RLPxConnection.
Can be tested using:
```bash
make run-hive SIMULATION=devp2p TEST_PATTERN='eth/blob' HIVE_BRANCH=mecha/update-devp2p-testfiles SIM_LOG_LEVEL=4
```
The tests can't be activated in the CI yet. We need to update the Hive
fork first. [PR](lambdaclass/hive#35)
<!-- A clear and concise general description of the changes this PR
introduces -->
<!-- Link to issues: Resolveslambdaclass#111, Resolveslambdaclass#222 -->
Closes:
lambdaclass#1781lambdaclass#3122lambdaclass#3123lambdaclass#1416
0 commit comments