This repository was archived by the owner on Oct 17, 2025. It is now read-only.
forked from ethereum/hive
-
Couldn't load subscription status.
- Fork 0
Update devp2p testfiles #35
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jun 13, 2025
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
|
Closing in favor of ethereum#1303 (PR to the upstream repo) |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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