Skip to content

Commit b6c2bed

Browse files
committed
This are the minimum changes to reproduce the invalid signature error
1 parent 8c2bb5f commit b6c2bed

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

lib/lambda_ethereum_consensus/beacon/clock.ex

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ defmodule LambdaEthereumConsensus.Beacon.Clock do
1818
GenServer.start_link(__MODULE__, opts, name: __MODULE__)
1919
end
2020

21-
@spec get_current_time() :: Types.uint64()
22-
def get_current_time(), do: GenServer.call(__MODULE__, :get_current_time)
23-
2421
##########################
2522
### GenServer Callbacks
2623
##########################
@@ -38,11 +35,6 @@ defmodule LambdaEthereumConsensus.Beacon.Clock do
3835
}}
3936
end
4037

41-
@impl true
42-
def handle_call(:get_current_time, _from, %{time: time} = state) do
43-
{:reply, time, state}
44-
end
45-
4638
@impl true
4739
def handle_info(:on_tick, state) do
4840
schedule_next_tick()

lib/lambda_ethereum_consensus/fork_choice/fork_choice.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ defmodule LambdaEthereumConsensus.ForkChoice do
119119

120120
@spec get_current_chain_slot() :: Types.slot()
121121
def get_current_chain_slot() do
122-
time = Clock.get_current_time()
122+
time = :os.system_time(:second)
123123
genesis_time = StoreDb.fetch_genesis_time!()
124124
compute_current_slot(time, genesis_time)
125125
end

lib/lambda_ethereum_consensus/validator/validator.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ defmodule LambdaEthereumConsensus.Validator do
255255
log_debug(validator.index, "publishing attestation", log_md)
256256

257257
Gossip.Attestation.publish(subnet_id, attestation)
258-
|> log_debug_result(validator.index, "published attestation", log_md)
258+
|> log_info_result(validator.index, "published attestation", log_md)
259259

260260
if current_duty.should_aggregate? do
261261
log_debug(validator.index, "collecting for future aggregation", log_md)

lib/lambda_ethereum_consensus/validator/validator_manager.ex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,20 @@ defmodule LambdaEthereumConsensus.Validator.ValidatorManager do
5959

6060
# TODO: The use of a Genserver and cast is still needed to avoid locking at the clock level.
6161
# This is a temporary solution and will be taken off in a future PR.
62-
defp notify_validators(msg), do: GenServer.cast(__MODULE__, {:notify_all, msg})
62+
defp notify_validators(msg), do: GenServer.call(__MODULE__, {:notify_all, msg})
6363

6464
def handle_cast({:notify_all, msg}, validators) do
6565
validators = notify_all(validators, msg)
6666

6767
{:noreply, validators}
6868
end
6969

70+
def handle_call({:notify_all, msg}, _from, validators) do
71+
validators = notify_all(validators, msg)
72+
73+
{:reply, :ok, validators}
74+
end
75+
7076
defp notify_all(validators, msg) do
7177
start_time = System.monotonic_time(:millisecond)
7278

lib/libp2p_port.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ defmodule LambdaEthereumConsensus.Libp2pPort do
226226
direction: "elixir->"
227227
})
228228

229-
call_command(pid, {:publish, %Publish{topic: topic_name, message: message}})
229+
cast_command(pid, {:publish, %Publish{topic: topic_name, message: message}})
230230
end
231231

232232
@doc """
@@ -243,7 +243,7 @@ defmodule LambdaEthereumConsensus.Libp2pPort do
243243

244244
GenServer.cast(pid, {:new_subscriber, topic_name, module})
245245

246-
call_command(pid, {:subscribe, %SubscribeToTopic{name: topic_name}})
246+
cast_command(pid, {:subscribe, %SubscribeToTopic{name: topic_name}})
247247
end
248248

249249
@doc """

network_params.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ participants:
22
- el_type: geth
33
cl_type: lighthouse
44
count: 2
5-
validator_count: 32
5+
validator_count: 27
66
- el_type: geth
77
cl_type: lambda
88
cl_image: lambda_ethereum_consensus:latest
99
use_separate_vc: false
1010
count: 1
11-
validator_count: 32
11+
validator_count: 10
1212
cl_max_mem: 4096

0 commit comments

Comments
 (0)