Skip to content
This repository was archived by the owner on Oct 17, 2025. It is now read-only.

Conversation

@Mechanix97
Copy link

@Mechanix97 Mechanix97 commented Jun 11, 2025

After updating the devp2p dependency to point to the geth upstream, the test that included blob were failing.

Test files were regenereated using last fork prague
Also modified mapper.jq to incluide this fork

can be tested from ethrex using

make run-hive SIMULATION=devp2p TEST_PATTERN='eth/blob' HIVE_BRANCH=mecha/update-devp2p-testfiles

github-merge-queue bot pushed a commit to lambdaclass/ethrex that referenced this pull request Jun 18, 2025
**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: Resolves #111, Resolves #222 -->

Closes: 
#1781 
#3122
#3123 
#1416
@mpaulucci
Copy link
Collaborator

Closing in favor of ethereum#1303 (PR to the upstream repo)

@mpaulucci mpaulucci closed this Jul 8, 2025
pedrobergamini pushed a commit to pedrobergamini/ethrex that referenced this pull request Aug 24, 2025
**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: Resolves lambdaclass#111, Resolves lambdaclass#222 -->

Closes: 
lambdaclass#1781 
lambdaclass#3122
lambdaclass#3123 
lambdaclass#1416
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants