AntelopeIO / spring

C++ implementation of the Antelope protocol with Savanna consensus
Other
5 stars 1 forks source link

P2P send signed_block directly from disk #612

Open heifner opened 3 weeks ago

heifner commented 3 weeks ago

Currently, when a peer asks for a block:

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.

arhag commented 3 weeks ago

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.