@@ -114,12 +114,12 @@ defmodule LambdaEthereumConsensus.Libp2pPort do
114
114
GenServer . cast ( __MODULE__ , { :on_tick , time } )
115
115
end
116
116
117
- @ spec notify_new_block ( { Types . slot ( ) , Types . root ( ) } ) :: :ok
118
- def notify_new_block ( data ) do
117
+ @ spec notify_new_block ( Types . slot ( ) , Types . root ( ) ) :: :ok
118
+ def notify_new_block ( slot , head_root ) do
119
119
# TODO: This is quick workarround to notify the libp2p port about new blocks from within
120
120
# the ForkChoice.recompute_head/1 without moving the validators to the store this
121
121
# allows to deferr that move until we simplify the state and remove duplicates.
122
- send ( self ( ) , { :new_block , data } )
122
+ send ( self ( ) , { :new_block , slot , head_root } )
123
123
end
124
124
125
125
@ doc """
@@ -499,8 +499,8 @@ defmodule LambdaEthereumConsensus.Libp2pPort do
499
499
end
500
500
501
501
@ impl GenServer
502
- def handle_info ( { :new_block , data } , % { validators: validators } = state ) do
503
- updated_validators = notify_validators ( validators , { :new_block , data } )
502
+ def handle_info ( { :new_block , slot , head_root } , % { validators: validators } = state ) do
503
+ updated_validators = notify_validators ( validators , { :new_block , slot , head_root } )
504
504
505
505
{ :noreply , % { state | validators: updated_validators } }
506
506
end
@@ -755,7 +755,7 @@ defmodule LambdaEthereumConsensus.Libp2pPort do
755
755
defp notify_validator ( { pubkey , validator } , { :on_tick , slot_data } ) ,
756
756
do: { pubkey , Validator . handle_tick ( slot_data , validator ) }
757
757
758
- defp notify_validator ( { pubkey , validator } , { :new_block , { slot , head_root } } ) ,
758
+ defp notify_validator ( { pubkey , validator } , { :new_block , slot , head_root } ) ,
759
759
do: { pubkey , Validator . handle_new_block ( slot , head_root , validator ) }
760
760
761
761
@ spec compute_slot ( Types . uint64 ( ) , Types . uint64 ( ) ) :: slot_data ( )
0 commit comments