@@ -145,6 +145,17 @@ defmodule FabricSyncGen do
145145 next1000_holes = FabricSyncGen . next_1000_holes_rooted ( rooted_height + 1 , highest_height )
146146 len1000_holes = length ( next1000_holes )
147147
148+ highest_peers = NodePeers . highest_height ( % { min_temporal: temporal_height , sort: :temporal } )
149+ { highest_height , _highest_consensus } = case List . first ( highest_peers ) do
150+ nil -> { temporal_height , rooted_height }
151+ [ _ , _ , highest , consensus | _ ] -> { highest , consensus }
152+ end
153+
154+ next1000_holes_temporal = FabricSyncGen . next_1000_holes_rooted ( temporal_height + 1 , highest_height )
155+ len1000_holes_temporal = length ( next1000_holes_temporal )
156+
157+ #IO.inspect {highest_height, highest_consensus, len1000_holes}
158+
148159 cond do
149160 ! hasQuorum ( ) -> nil
150161
@@ -158,6 +169,16 @@ defmodule FabricSyncGen do
158169 peer_ips = Enum . shuffle ( highest_peers ) |> Enum . map ( & hd ( & 1 ) ) |> Enum . take ( 3 )
159170 send ( NodeGen , { :send_to_some , peer_ips , NodeProto . pack_message ( msg ) } )
160171
172+ len1000_holes_temporal > 0 and len1000_holes_temporal <= 3 ->
173+ if len1000_holes_temporal > 1 do
174+ IO . puts "Syncing #{ len1000_holes_temporal } temporal entries"
175+ end
176+ #IO.inspect {temporal_height, rooted_height, highest_peers}
177+
178+ msg = NodeProto . catchup_tri ( next1000_holes_temporal )
179+ peer_ips = Enum . shuffle ( highest_peers ) |> Enum . map ( & hd ( & 1 ) ) |> Enum . take ( 3 )
180+ send ( NodeGen , { :send_to_some , peer_ips , NodeProto . pack_message ( msg ) } )
181+
161182 len1000_holes > 3 ->
162183 IO . puts "Syncing #{ len1000_holes } entries"
163184 #IO.inspect next1000_holes
0 commit comments