Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove libp2p transport layer #2758

Merged
merged 17 commits into from
Jun 13, 2023
Merged

Remove libp2p transport layer #2758

merged 17 commits into from
Jun 13, 2023

Conversation

acolytec3
Copy link
Contributor

@acolytec3 acolytec3 commented Jun 6, 2023

Libp2p is a big chunk of our client specific dependency tree and it's not used at the moment since we aren't currently continuing to develop the devp2p over libp2p code base (which was needed to allow our browser client to connect to nodejs clients). This PR removes that entire dependency tree (clears 200+ dependencies) and clears a number of potential risk vectors due to very outdated dependencies in that tree.

  • Removes libp2p dependencies in client
  • Clean up docs
  • Various browser build clean-up need up to get client to start without errors in browser

@acolytec3 acolytec3 added dependencies Pull requests that update a dependency file package: client labels Jun 6, 2023
@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #2758 (09c9427) into master (bc9a613) will increase coverage by 1.23%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block 91.08% <ø> (ø)
blockchain 90.72% <ø> (ø)
client 87.12% <100.00%> (-0.33%) ⬇️
common 97.00% <ø> (ø)
devp2p ?
ethash ?
evm ?
rlp ∅ <ø> (?)
statemanager 86.28% <ø> (ø)
trie 89.92% <ø> (ø)
tx 95.67% <ø> (ø)
util 81.13% <ø> (ø)
vm 82.89% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@acolytec3 acolytec3 changed the title Make libp2p optional Remove libp2p transport layer Jun 10, 2023
/**
* @module util
*/
import { bytesToPrefixedHexString } from '@ethereumjs/util'
Copy link
Contributor

@g11tech g11tech Jun 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can use client's src util, it has browser handling, no reason to duplicate i think

@acolytec3 acolytec3 requested a review from g11tech June 12, 2023 15:36
@acolytec3
Copy link
Contributor Author

To test this and verify the browser client works, do:

  1. npm run build:browser from client package
  2. echo '<script src="/dist/bundle.js"></script>' > index.html
  3. npx http-server
  4. Open a browser window and point to 127.0.0.1
  5. Open the developer console and run
ethereumjs.run({
  network: 'goerli',
  syncmode: 'none',
})

You should see the client start up with some logs that look like this:

Full sync mode
bundle.js:2 Initializing account cache size=400000
bundle.js:2 Initializing storage cache size=200000
bundle.js:2 Initializing trie cache size=200000
bundle.js:2 Initializing Ethereumjs client version=v0.7.1 network=goerli chainId=5
bundle.js:2 Starting FullEthereumService with no syncing.
bundle.js:2 Initializing VM execution hardfork=petersburg
bundle.js:2 Setup EVM execution.
bundle.js:2 Setup networking and services.
bundle.js:2 Started eth service.
bundle.js:2 Skipped execution run vmHead=0 canonicalHead=0 hardfork=petersburg execution=true

Copy link
Contributor

@g11tech g11tech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@acolytec3 acolytec3 merged commit c06214a into master Jun 13, 2023
@acolytec3 acolytec3 deleted the make-libp2p-optional branch June 13, 2023 17:25
@holgerd77
Copy link
Member

Nice separation work! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file package: client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants