Skip to content

Commit

Permalink
Merge branch 'main' into optimize-process_operations
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaRedHand authored Dec 1, 2023
2 parents da29f4d + 3f384cc commit b3be493
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
11 changes: 6 additions & 5 deletions lib/lambda_ethereum_consensus/fork_choice/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,15 @@ defmodule LambdaEthereumConsensus.ForkChoice.Helpers do

# If any children branches contain expected finalized/justified checkpoints,
# add to filtered block-tree and signal viability to parent.
filter_block_tree_result = Enum.map(children, &filter_block_tree(store, &1, blocks))
{filter_block_tree_result, new_blocks} =
Enum.map_reduce(children, blocks, fn root, acc -> filter_block_tree(store, root, acc) end)

cond do
Enum.any?(filter_block_tree_result, fn {b, _} -> b end) ->
{true, Map.put(blocks, block_root, block)}
Enum.any?(filter_block_tree_result) ->
{true, Map.put(new_blocks, block_root, block)}

Enum.any?(children) ->
{false, blocks}
not Enum.empty?(children) ->
{false, new_blocks}

true ->
filter_leaf_block(store, block_root, block, blocks)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ defmodule LambdaEthereumConsensus.StateTransition do
def state_transition(
%BeaconState{} = state,
%SignedBeaconBlock{message: block} = signed_block,
_validate_result
validate_result
) do
# NOTE: we aren't in a state to make validations yet
validate_result = false

state
# Process slots (including those with no blocks) since block
|> process_slots(block.slot)
Expand Down
18 changes: 9 additions & 9 deletions lib/spec/runners/fork_choice.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ defmodule ForkChoiceTestRunner do
alias SszTypes.Store

@disabled_on_block_cases [
"basic",
# "basic",
"incompatible_justification_update_end_of_epoch",
"incompatible_justification_update_start_of_epoch",
"justification_update_beginning_of_epoch",
Expand All @@ -23,28 +23,28 @@ defmodule ForkChoiceTestRunner do
"justified_update_not_realized_finality",
"new_finalized_slot_is_justified_checkpoint_ancestor",
"not_pull_up_current_epoch_block",
"on_block_bad_parent_root",
# "on_block_bad_parent_root",
"on_block_before_finalized",
"on_block_checkpoints",
"on_block_finalized_skip_slots",
"on_block_finalized_skip_slots_not_in_skip_chain",
"on_block_future_block",
"proposer_boost",
"proposer_boost_root_same_slot_untimely_block",
# "on_block_future_block",
# "proposer_boost",
# "proposer_boost_root_same_slot_untimely_block",
"pull_up_on_tick",
"pull_up_past_epoch_block"
]

@disabled_ex_ante_cases [
"ex_ante_attestations_is_greater_than_proposer_boost_with_boost",
# "ex_ante_attestations_is_greater_than_proposer_boost_with_boost",
"ex_ante_sandwich_with_boost_not_sufficient",
"ex_ante_sandwich_with_honest_attestation",
"ex_ante_sandwich_without_attestations",
"ex_ante_vanilla"
"ex_ante_sandwich_without_attestations"
# "ex_ante_vanilla"
]

@disabled_get_head_cases [
"chain_no_attestations",
# "chain_no_attestations",
"discard_equivocations_on_attester_slashing",
"discard_equivocations_slashed_validator_censoring",
"filtered_block_tree",
Expand Down

0 comments on commit b3be493

Please sign in to comment.