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

feat(p2p): add snappy compression to p2p messages #10348

Closed
Maddiaa0 opened this issue Dec 2, 2024 · 0 comments · Fixed by #10417
Closed

feat(p2p): add snappy compression to p2p messages #10348

Maddiaa0 opened this issue Dec 2, 2024 · 0 comments · Fixed by #10417
Assignees
Labels
C-p2p Component: peer to peer P-high 🔥 Priority: high. Do this task next. team-alpha

Comments

@Maddiaa0
Copy link
Member

Maddiaa0 commented Dec 2, 2024

Overview

P2P messages are currently sent as raw buffers, but they can be compressed.

Ethereum opts to use snappy compression for the propagation of p2p messages (https://github.com/google/snappy), although it is not a perfect compression algorithm it runs very very quickly.

We should see a large improvement here when propagating transactions as although they contain "random" data, they have G1 Points encoded over 4 field elements ~508bits, when they are only ~256 bits each. ( This is done as the points are encoded as Fr scalars, that can be directly used in transcript hashing ).

Add snappy compression on all p2p sending functions

  • in propagate of p2p client
  • in send of reqresp

Add snappy decompression on receipt

  • in processFromPeer of p2p client
  • in recieve of reqresp
@Maddiaa0 Maddiaa0 added C-p2p Component: peer to peer P-high 🔥 Priority: high. Do this task next. team-alpha labels Dec 2, 2024
@Maddiaa0 Maddiaa0 self-assigned this Dec 5, 2024
@Maddiaa0 Maddiaa0 linked a pull request Dec 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-p2p Component: peer to peer P-high 🔥 Priority: high. Do this task next. team-alpha
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant