Skip to content

refactor(p2p): remove simulations package - #2530

Closed
loglapa wants to merge 1 commit into
XinFinOrg:mainfrom
loglapa:refactor/694-remove-p2p-simulations
Closed

refactor(p2p): remove simulations package#2530
loglapa wants to merge 1 commit into
XinFinOrg:mainfrom
loglapa:refactor/694-remove-p2p-simulations

Conversation

@loglapa

@loglapa loglapa commented Aug 20, 2026

Copy link
Copy Markdown

Proposed changes

Closes #694.

Remove the unused p2p/simulations package and the p2psim command, following the corresponding upstream go-ethereum cleanup in ethereum#30250.

The TCPPipe helper is retained under p2p/pipes because it is still used by the RLPx tests. This also removes the obsolete p2psim archive entry and the now-unused direct httprouter dependency.

Validation

  • gofmt and goimports on changed Go files
  • make all
  • make tidy
  • make generate
  • Docker (Go 1.25): go test ./p2p/... -count=1
  • Docker (Go 1.25): make quick-test
  • Docker (Go 1.25): full test suite excluding accounts/abi/abigen
  • Host: go test ./accounts/abi/abigen -count=1
  • git diff --check

The split full-test run is intentional: accounts/abi/abigen.TestBindings/TestOverload has a container-only race that reproduces unchanged on main; it passes natively. All other packages passed in Docker. Full lint reports 69 pre-existing findings (down from 75 on main; the removed six were in the deleted simulations package).

Types of changes

  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Changes that don't change source code or tests
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • revert: Revert something
  • style: Changes that do not affect the meaning of the code
  • test: Adding missing tests or correcting existing tests

Impacted Components

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Checklist

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Tested on a private network from the genesis block and monitored the chain operating correctly for multiple epochs.
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

Summary by CodeRabbit

  • Removed Features

    • Removed the peer-to-peer simulation framework, including network management, event tracking, snapshots, mockers, and simulation execution.
    • Removed the simulation HTTP API, command-line client, WebSocket support, and built-in Docker, executable, and in-process adapters.
    • Removed the ping-pong simulation example and related startup scripts.
  • Documentation

    • Removed simulation guides and example documentation.
  • Maintenance

    • Removed unused networking helpers and dependencies.

Signed-off-by: Vladislav Lapin <v.lapin@scalablesolutions.io>
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 733819bc-43ea-489f-bade-cd61421074f7

📥 Commits

Reviewing files that changed from the base of the PR and between 2d30685 and 7fa7ce4.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (25)
  • build/ci.go
  • cmd/p2psim/main.go
  • go.mod
  • p2p/pipes/pipe.go
  • p2p/rlpx_test.go
  • p2p/simulations/README.md
  • p2p/simulations/adapters/docker.go
  • p2p/simulations/adapters/exec.go
  • p2p/simulations/adapters/inproc.go
  • p2p/simulations/adapters/inproc_test.go
  • p2p/simulations/adapters/state.go
  • p2p/simulations/adapters/types.go
  • p2p/simulations/adapters/ws.go
  • p2p/simulations/adapters/ws_test.go
  • p2p/simulations/events.go
  • p2p/simulations/examples/README.md
  • p2p/simulations/examples/ping-pong.go
  • p2p/simulations/examples/ping-pong.sh
  • p2p/simulations/http.go
  • p2p/simulations/http_test.go
  • p2p/simulations/mocker.go
  • p2p/simulations/mocker_test.go
  • p2p/simulations/network.go
  • p2p/simulations/network_test.go
  • p2p/simulations/simulation.go
💤 Files with no reviewable changes (23)
  • build/ci.go
  • p2p/simulations/adapters/state.go
  • p2p/simulations/adapters/inproc_test.go
  • p2p/simulations/mocker.go
  • p2p/simulations/network_test.go
  • p2p/simulations/README.md
  • p2p/simulations/adapters/ws_test.go
  • p2p/simulations/examples/ping-pong.sh
  • p2p/simulations/adapters/inproc.go
  • p2p/simulations/examples/README.md
  • go.mod
  • p2p/simulations/adapters/docker.go
  • p2p/simulations/simulation.go
  • p2p/simulations/examples/ping-pong.go
  • p2p/simulations/http_test.go
  • p2p/simulations/adapters/exec.go
  • p2p/simulations/adapters/ws.go
  • p2p/simulations/events.go
  • p2p/simulations/http.go
  • p2p/simulations/mocker_test.go
  • p2p/simulations/adapters/types.go
  • cmd/p2psim/main.go
  • p2p/simulations/network.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change removes the p2p/simulations package, its CLI, adapters, HTTP API, examples, documentation, and tests. It also removes related build and module references, deletes NetPipe, and updates an RLPx test import.

Changes

Simulation package removal

Layer / File(s) Summary
Remove simulation stack
cmd/p2psim/main.go, p2p/simulations/*, build/ci.go, go.mod
The simulation CLI, network implementation, adapters, HTTP API, mockers, examples, documentation, and tests are deleted. The p2psim archive entry and direct httprouter requirement are removed.
Clean pipe API references
p2p/pipes/pipe.go, p2p/rlpx_test.go
The exported NetPipe helper is removed. The RLPx test imports p2p/pipes.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 7fa7c

This PR removes the unused simulations package and command while retaining the helper needed by existing tests; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: fjl, zsfelfoldi

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: removing the p2p simulations package.
Description check ✅ Passed The description explains the scope, linked issue, validation, affected components, change types, and checklist status.
Linked Issues check ✅ Passed The changes remove the p2p/simulations package and related p2psim tooling as required by issue #694.
Out of Scope Changes check ✅ Passed The archive, dependency, pipe-helper, and documentation changes directly support removal of the simulations package.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@loglapa
loglapa marked this pull request as ready for review August 20, 2026 17:49
@gzliudan

gzliudan commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

I will remove this package later since I‘m upgrade p2p package. And don't submit PR to main branch.

@loglapa

loglapa commented Aug 21, 2026

Copy link
Copy Markdown
Author

Understood — this package is being removed as part of the p2p upgrade, and new work should not target main. Closing this PR so it does not compete with the ongoing upgrade.

@loglapa loglapa closed this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove package p2p/simulations

2 participants