Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge preset files #3546

Closed
wants to merge 1 commit into from
Closed

Conversation

dapplion
Copy link
Member

@dapplion dapplion commented Nov 9, 2023

Preset values are defined in multiple files, while config values are defined in a single file. 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. Feature config value isolation was nullified when switching to a single config file.

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 requested a review from hwwhww November 9, 2023 10:53
@hwwhww
Copy link
Contributor

hwwhww commented Nov 9, 2023

@dapplion

Thank you for making this PR!

I agree that the merged preset file is easier to maintain.

IIUC client devs once complained that it was confusing when we mixed the in-production and WIP-researchy forks previously. However, the merged config (#2390) broke it again. 😅

I don't feel strongly. It would be better to get more feedback from more users (aka client devs).

@dapplion
Copy link
Member Author

dapplion commented Jan 9, 2024

Closing since there's no much interest in the change

@dapplion dapplion closed this Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants