lambdaclass / lambdaclass/lambda_ethereum_consensus

Error on duties calculation on low amount of validators setup

Open
#1,334 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P0
Dominant language
Elixir
Stars
109
Forks
41
PR merge metrics
No merged PRs in 30d

Description

This issues happens when we have a small amount of validators in the setup (<10), this is important because this is the most common scenario.

Here are the logs:

shutdown: failed to start child: LambdaEthereumConsensus.Beacon.BeaconNode
      ** (EXIT) an exception was raised:
          ** (ArgumentError) errors were found at the given arguments:
  
    * 1st argument: the table identifier does not refer to an existing ETS table
  
              (stdlib 5.2.3) :ets.member(:beacon_committee, {0, {0, <<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0>>}})
              (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/state_transition/cache.ex:87: LambdaEthereumConsensus.StateTransition.Cache.present?/2
              (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/state_transition/accessors.ex:381: LambdaEthereumConsensus.StateTransition.Accessors.maybe_prefetch_committees/2
              (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/validator/duties.ex:93: anonymous fn/4 in LambdaEthereumConsensus.Validator.Duties.compute_duties_for_epochs/4
              (elixir 1.16.2) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
              (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/validator/validator_set.ex:191: LambdaEthereumConsensus.ValidatorSet.compute_duties/4
              (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/beacon/beacon_node.ex:30: LambdaEthereumConsensus.Beacon.BeaconNode.init/1
              (stdlib 5.2.3) supervisor.erl:330: :supervisor.init/1 
  ** (exit) :terminating
      (kernel 9.2.4) application_controller.erl:505: :application_controller.call/2
      (kernel 9.2.4) application.erl:155: :application."-ensure_all_started/3-lc$^0/1-0-"/1
      (kernel 9.2.4) application.erl:155: :application.ensure_all_started/3
      (mix 1.16.2) lib/mix/tasks/app.start.ex:72: Mix.Tasks.App.Start.start/3
      (mix 1.16.2) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
      (mix 1.16.2) lib/mix/tasks/run.ex:129: Mix.Tasks.Run.run/5
      (mix 1.16.2) lib/mix/tasks/run.ex:85: Mix.Tasks.Run.run/1
      (mix 1.16.2) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with fewer than 10 validators, then start at lib/lambda_ethereum_consensus/state_transition/cache.ex:87 and follow the calls through accessors.ex:381 and validator/duties.ex:93. Check how the :beacon_committee ETS table is used during BeaconNode initialization and validator_set.ex:191. Done means the small-validator setup starts without the ETS-table error and the regression is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.