Skip to content

chore(l1,l2): ordered genesis files #2713

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

Merged
merged 31 commits into from
May 15, 2025
Merged

chore(l1,l2): ordered genesis files #2713

merged 31 commits into from
May 15, 2025

Conversation

fkrause98
Copy link
Contributor

@fkrause98 fkrause98 commented May 8, 2025

Motivation

Ordered genesis files make it easy to diff with one another.

Description

  • Add function to write a Genesis json file with its keys ordered.
  • Genesis files are now ordered by key.

Closes #2706.

Copy link

github-actions bot commented May 8, 2025

Lines of code report

Total lines added: 147
Total lines removed: 0
Total lines changed: 147

Detailed view
+-----------------------------------------------------------------+-------+------+
| File                                                            | Lines | Diff |
+-----------------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/bin/system_contracts_updater/main.rs | 35    | +1   |
+-----------------------------------------------------------------+-------+------+
| ethrex/tools/src/genesis.rs                                     | 145   | +145 |
+-----------------------------------------------------------------+-------+------+
| ethrex/tools/src/lib.rs                                         | 1     | +1   |
+-----------------------------------------------------------------+-------+------+

@fkrause98 fkrause98 changed the title Ordered genesis files chore(l1,l2): ordered genesis files May 8, 2025
@fkrause98 fkrause98 marked this pull request as ready for review May 8, 2025 19:25
@fkrause98 fkrause98 requested a review from a team as a code owner May 8, 2025 19:25
Copy link
Collaborator

@mpaulucci mpaulucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure I agree with this approach, now we're mixing fork specific configs like "muirGlacierBlock" with other configs like "depositContractAddress". What is the standard across Ethereum? I have never seen it be alphabetically ordered keys

@fkrause98 fkrause98 force-pushed the ordered_genesis_files branch from 31fe9fe to 14cc4dc Compare May 14, 2025 18:09
@@ -13,7 +13,9 @@ tracing.workspace = true
tinyvec = "1.6.0"
ethereum-types.workspace = true
serde.workspace = true
serde_json.workspace = true
# Preserve order is used to serialize the Genesis struct
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we have to change a dependency in common for tooling? I thought we wanted to decouple them

}
}

fn sort_config(genesis_map: &mut Map<String, Value>) -> Result<Map<String, Value>, String> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we move this code to the tooling part

@fkrause98 fkrause98 added this pull request to the merge queue May 15, 2025
Merged via the queue into main with commit d4d3459 May 15, 2025
27 checks passed
@fkrause98 fkrause98 deleted the ordered_genesis_files branch May 15, 2025 21:16
github-merge-queue bot pushed a commit that referenced this pull request May 16, 2025
**Motivation**

Some changes (probably #2713) undid the fixed changes for the load test
genesis file,
this PR restores it.
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.

Make genesis files easy to compare
4 participants