lambdaclass / lambdaclass/lambda_ethereum_consensus

Eth1Data calculation error

Open
#1,335 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

After starting having long running Sepolia sesions being relatively stable we started to have long running local devnet session as well. Now we are able to find new issues related to validators, here is the first one:

** (MatchError) no match of right hand side value: {MapSet.new([%Types.Eth1Data{deposit_root:
...
6, 250, 91, 132, 49, 23, 22, 223, 209, 2, 41, 210, 137, 55, 249>>}}
    (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/execution/execution_chain.ex:230: LambdaEthereumConsensus.Execution.ExecutionChain.get_first_valid_vote/5
    (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/validator/block_builder.ex:310: LambdaEthereumConsensus.Validator.BlockBuilder.fetch_eth1_data/2
    (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/validator/block_builder.ex:42: LambdaEthereumConsensus.Validator.BlockBuilder.build_block/2
    (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/validator/validator.ex:371: LambdaEthereumConsensus.Validator.propose/3
    (elixir 1.16.2) lib/map.ex:916: Map.update!/3
    (lambda_ethereum_consensus 0.1.0) lib/lambda_ethereum_consensus/validator/validator_set.ex:228: LambdaEthereumConsensus.ValidatorSet.maybe_propose/4
    (lambda_ethereum_consensus 0.1.0) lib/libp2p_port.ex:789: LambdaEthereumConsensus.Libp2pPort.on_tick/2
    (lambda_ethereum_consensus 0.1.0) lib/libp2p_port.ex:512: LambdaEthereumConsensus.Libp2pPort.handle_info/2
Last message: :on_tick 

This is a bug in the calculation when multiple eth1data are present.

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

Start in lib/lambda_ethereum_consensus/execution/execution_chain.ex at get_first_valid_vote/5, then trace the call from lib/lambda_ethereum_consensus/validator/block_builder.ex at fetch_eth1_data/2. Reproduce the long-running local devnet scenario with multiple Eth1Data values and verify block building no longer fails with the reported MatchError.

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
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.