Skip to content

Merge preset files - #3

Closed
dapplion wants to merge 1 commit into
devfrom
preset-single-file
Closed

Merge preset files#3
dapplion wants to merge 1 commit into
devfrom
preset-single-file

Conversation

@dapplion

@dapplion dapplion commented Nov 9, 2023

Copy link
Copy Markdown
Owner

Preset in defined in multiple files, while the config is defined in one file. I couldn't find a good reason to keep the preset variables split in different files, and this PR should proof that the specs run just fine too. Having all preset variables in a single file should make it a bit simpler to manage them, no need to de-duplicate or parse multiple files.

Merging of the files is done with the script

DIRECTORY=$1
OUTPUT_FILE=$2

FILE_ORDER=("phase0" "altair" "bellatrix" "capella" "deneb" "custody_game" "eip6110" "sharding" "whisk")
for filename in "${FILE_ORDER[@]}"; do
    file_path="$DIRECTORY/$filename.yaml"
    sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' "$file_path" >> $OUTPUT_FILE
    echo -e "\n" >> $OUTPUT_FILE
done

Running two commands from the consensus-specs root dir

bash ../merge_files.sh presets/mainnet presets/mainnet.yaml
bash ../merge_files.sh presets/minimal presets/minimal.yaml

If mantainers want to verify that the merging is consistent and correct, they can run the script locally and check no git diff

@dapplion
dapplion force-pushed the preset-single-file branch 3 times, most recently from b9f2292 to b66e587 Compare November 9, 2023 07:53
@dapplion dapplion closed this Nov 9, 2023
dapplion pushed a commit that referenced this pull request May 26, 2024
New consolidation tests, comments
dapplion pushed a commit that referenced this pull request May 19, 2026
Two upstream tests added by ethereum/consensus-specs PRs ethereum#5033 and ethereum#5049
assume Ethereum mainnet's larger default test state where validators are
sparse across sync committee subnets. On the Gnosis (this fork's mainnet)
preset the default state has 128 validators, exactly equal to the
subcommittee size, so:

- test_gossip_sync_committee_contribution_and_proof__reject_aggregator_not_in_subcommittee:
  no validator exists outside the subcommittee, so the negative mutation
  is a no-op and validation correctly returns valid.
- test_gossip_sync_committee_message__reject_wrong_subnet: validators occupy
  all subnets, so every subnet is valid for them and there is no wrong
  subnet to pick.

Detect both cases and return early with a comment, matching the precedent
set by PR #3's adaptations (e.g. test_switch_to_compounding_requests_when_too_little_consolidation_churn_limit).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant