File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,9 +108,12 @@ defmodule Fabric do
108108 end
109109
110110 def entries_by_height ( height ) do
111+ softfork_deny_hash = :persistent_term . get ( SoftforkDenyHash , [ ] )
112+
111113 % { db: db , cf: cf } = :persistent_term . get ( { :rocksdb , Fabric } )
112114 RocksDB . get_prefix ( "#{ height } :" , % { db: db , cf: cf . entry_by_height } )
113115 |> Enum . map ( & Entry . unpack ( entry_by_hash ( elem ( & 1 , 0 ) ) ) )
116+ |> Enum . reject ( & & 1 . hash in softfork_deny_hash )
114117 end
115118
116119 def entries_last_x ( cnt ) do
@@ -136,7 +139,10 @@ defmodule Fabric do
136139 end
137140
138141 def consensuses_by_height ( height ) do
142+ softfork_deny_hash = :persistent_term . get ( SoftforkDenyHash , [ ] )
143+
139144 entries = Fabric . entries_by_height ( height )
145+ |> Enum . reject ( & & 1 . hash in softfork_deny_hash )
140146 Enum . map ( entries , fn ( entry ) ->
141147 map = consensuses_by_entryhash ( entry . hash ) || % { }
142148 Enum . map ( map , fn { mutations_hash , % { mask: mask , aggsig: aggsig } } ->
Original file line number Diff line number Diff line change @@ -244,7 +244,11 @@ defmodule FabricGen do
244244
245245 #prevent double-entries due to severe system lag (you shouldnt be validator in the first place)
246246 lastSlot = :persistent_term . get ( :last_made_entry_slot , nil )
247- emptyHeight = Fabric . entries_by_height ( next_height ) == [ ]
247+
248+ rooted_tip = Fabric . rooted_tip ( )
249+ emptyHeight = Fabric . entries_by_height ( next_height )
250+ |> Enum . filter ( & & 1 . header_unpacked . prev_hash == rooted_tip )
251+ emptyHeight = emptyHeight == [ ]
248252
249253 cond do
250254 ! FabricSyncAttestGen . isQuorumSynced ( ) -> nil
You can’t perform that action at this time.
0 commit comments