Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

add tag for the final batch of blocks in a sync #1282

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joecaswell
Copy link
Contributor

deduplicate block send code
fixes #1273 depends on helium/proto#125

deduplicate block send code
update rebar.lock depends on helium/proto#125
@@ -139,8 +139,12 @@ handle_data(client, Data0, #state{blockchain=Chain, path=Path, gossiped_hash=Gos
%% nothing was plausible, see if it has anything else
{noreply, State, blockchain_sync_handler_pb:encode_msg(#blockchain_sync_req_pb{msg={response, true}})};
HighestPlausible ->
lager:info("Eagerly re-gossiping ~p", [blockchain_block:height(HighestPlausible)]),
blockchain_gossip_handler:regossip_block(HighestPlausible, SwarmTID),
case Final of
Copy link
Contributor

Choose a reason for hiding this comment

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

So one thing we'd know now is that if we see the Final flag but we haven't seen the block with GossipedHash we know that this peer has more blocks (or that more blocks exist generally) and we can keep syncing immediately?

Copy link
Contributor

Choose a reason for hiding this comment

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

Which I guess is something you'd call back into the blockchain_worker to before you {stop, normaled below

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When sending final block sync bundle, indicate if the last batch of blocks is 'final'
2 participants