diff --git a/lib/lambda_ethereum_consensus/p2p/gossip/attestation.ex b/lib/lambda_ethereum_consensus/p2p/gossip/attestation.ex index ac2575e14..565a1eb77 100644 --- a/lib/lambda_ethereum_consensus/p2p/gossip/attestation.ex +++ b/lib/lambda_ethereum_consensus/p2p/gossip/attestation.ex @@ -51,9 +51,9 @@ defmodule LambdaEthereumConsensus.P2P.Gossip.Attestation do Libp2pPort.publish(topic, message) end - @spec collect(non_neg_integer(), Types.AttestationData.t()) :: :ok - def collect(subnet_id, attestation_data) do - GenServer.call(__MODULE__, {:collect, subnet_id, attestation_data}) + @spec collect(non_neg_integer(), Types.Attestation.t()) :: :ok + def collect(subnet_id, attestation) do + GenServer.call(__MODULE__, {:collect, subnet_id, attestation}) join(subnet_id) end @@ -95,9 +95,9 @@ defmodule LambdaEthereumConsensus.P2P.Gossip.Attestation do end @impl true - def handle_call({:collect, subnet_id, attestation_data}, _from, state) do - attestations = Map.put(state.attestations, subnet_id, [attestation_data]) - attnets = Map.put(state.attnets, subnet_id, attestation_data) + def handle_call({:collect, subnet_id, attestation}, _from, state) do + attestations = Map.put(state.attestations, subnet_id, [attestation]) + attnets = Map.put(state.attnets, subnet_id, attestation.data) new_state = %{state | attnets: attnets, attestations: attestations} {:reply, :ok, new_state} end diff --git a/lib/lambda_ethereum_consensus/validator/validator.ex b/lib/lambda_ethereum_consensus/validator/validator.ex index c1fafb105..791f69f6e 100644 --- a/lib/lambda_ethereum_consensus/validator/validator.ex +++ b/lib/lambda_ethereum_consensus/validator/validator.ex @@ -216,7 +216,7 @@ defmodule LambdaEthereumConsensus.Validator do if current_duty.is_aggregator do Logger.info("[Validator] Collecting messages for future aggregation...") - Gossip.Attestation.collect(subnet_id, attestation.data) + Gossip.Attestation.collect(subnet_id, attestation) end end @@ -261,7 +261,7 @@ defmodule LambdaEthereumConsensus.Validator do defp append_signature(aggregate_and_proof, signing_domain, %{privkey: privkey}) do signing_root = Misc.compute_signing_root(aggregate_and_proof, signing_domain) - signature = Bls.sign(privkey, signing_root) + {:ok, signature} = Bls.sign(privkey, signing_root) %Types.SignedAggregateAndProof{message: aggregate_and_proof, signature: signature} end diff --git a/lib/ssz_ex.ex b/lib/ssz_ex.ex index ed8a09b2e..699270358 100644 --- a/lib/ssz_ex.ex +++ b/lib/ssz_ex.ex @@ -701,7 +701,7 @@ defmodule LambdaEthereumConsensus.SszEx do :ok <- check_length(fixed_length, variable_length), {:ok, fixed_parts} <- replace_offsets(fixed_size_values, offsets) - |> encode_schemas do + |> encode_schemas() do (fixed_parts ++ variable_parts) |> Enum.join() |> then(&{:ok, &1})