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

P2P send signed_block directly from disk #612

Closed
heifner opened this issue Aug 21, 2024 · 1 comment · Fixed by #785
Closed

P2P send signed_block directly from disk #612

heifner opened this issue Aug 21, 2024 · 1 comment · Fixed by #785
Assignees
Labels
enhancement New feature or request 👍 lgtm

Comments

@heifner
Copy link
Member

heifner commented Aug 21, 2024

Currently, when a peer asks for a block:

  • signed_block is deserialized off disk
  • signed_block is serialized to net

This can be expensive and add up to considerable CPU, see #611

For blocks retrieved from the block log this is unnecessary. Also note with Savanna, blocks are moved out of the fork database into the block log much quicker. The serialization format on disk is the same as on P2P.

Add a new controller interfaces: fetch_serialied_block_by_number and fetch_serialized_block_by_id. These would pull directly from the block log without having to deserialize/serialize or from the forkdb where serialization would be required. Use these new interfaces in net_plugin to provide blocks to peers.

@heifner heifner added enhancement New feature or request and removed triage labels Aug 21, 2024
@enf-ci-bot enf-ci-bot moved this to Todo in Team Backlog Aug 21, 2024
@heifner heifner added the triage label Aug 21, 2024
@arhag
Copy link
Member

arhag commented Aug 21, 2024

or from the forkdb where serialization would be required

We could also cache the serialization in the fork database so it only has to happen once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request 👍 lgtm
Projects
Status: Done
4 participants