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

Issue 7273 geth style genesis #7609

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

cloudspores
Copy link
Contributor

@cloudspores cloudspores commented Sep 12, 2024

PR description

Fixed Issue(s)

Fixes #7273
Allowing Besu to parse a Geth-style genesis like other clients, so interoperability testing and multi-client network operation is simpler.

Thanks for sending a pull request! Have you done the following?

  • Checked out our contribution guidelines?
  • Considered documentation and added the doc-change-required label to this PR if updates are required.
  • Considered the changelog and included an update if required.
  • For database changes (e.g. KeyValueSegmentIdentifier) considered compatibility and performed forwards and backwards compatibility tests

Locally, you can run these tests to catch failures early:

  • unit tests: ./gradlew build
  • acceptance tests: ./gradlew acceptanceTest
  • integration tests: ./gradlew integrationTest
  • reference tests: ./gradlew ethereum:referenceTests:referenceTests

Add new classes for analyzing, converting, and validating
Geth-style genesis files. Update existing classes to support the
new functionality. This improves Besu's ability to work with
Geth-compatible genesis files, enhancing interoperability.

Key changes:
- Add GenesisFileAnalyzer, GenesisFileConverter, GenesisFileValidator
- Update GenesisConfigFile and GenesisReader for compatibility
- Add tests for new functionality
- Update build.gradle and verification-metadata.xml

Signed-off-by: Ade Lucas <[email protected]>
Update GenesisFileHandlingTest and GenesisFileConverter to resolve
test failures. This commit addresses issues that were causing tests
to fail, improving the reliability of our test suite.

Key changes:
- Modify GenesisFileHandlingTest to correct failing assertions
- Adjust GenesisFileConverter to align with expected test outcomes
- Ensure consistency between test expectations and actual behavior

Signed-off-by: Ade Lucas <[email protected]>
Remove debugging print statements

Signed-off-by: Ade Lucas <[email protected]>
   This commit introduces support for Geth-style genesis files in Besu:
   - Modified GenesisConfigFile, GenesisFileAnalyzer, GenesisFileConverter, and GenesisReader
   - Added new GenesisFileHandler
   - Removed GenesisFileValidator and GenesisFileAnalyzerTest
   - Updated GenesisFileHandlingTest

   This feature enhances Besu's compatibility with Geth genesis configurations.

Signed-off-by: Ade Lucas <[email protected]>
   Added entry for Geth-style genesis file support in the Features section.

Signed-off-by: Ade Lucas <[email protected]>
Update the gradle/verification-metadata.xml file to reflect recent
dependency changes and ensure consistent builds across environments.

Signed-off-by: Ade Lucas <[email protected]>
cloudspores and others added 6 commits September 12, 2024 15:15
   This commit updates a comment

   This feature enhances Besu's compatibility with Geth genesis configurations.

Signed-off-by: Ade Lucas <[email protected]>
This commit addresses bugs in GenesisFileAnalyzer and GenesisFileHandler
related to the normalization of genesis file field names. The fixes ensure
correct handling of field names across different genesis file formats.

- Updated GenesisFileAnalyzer to properly normalize field names
- Corrected field name handling in GenesisFileHandler
- Updated related tests in GenesisFileHandlingTest

Signed-off-by: Ade Lucas <[email protected]>
This commit addresses four ambiguous testcases.

- Removed related tests in GenesisFileHandlingTest

Signed-off-by: Ade Lucas <[email protected]>
@cloudspores cloudspores marked this pull request as ready for review September 18, 2024 19:35
Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

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

Overall looks good, there are some minor things to remove or change.
For the tests, I suggest to add also some real world geth genesis files, for example from the current Pectra devnets, where genesis.json is in geth format and besu.json is in Besu

CHANGELOG.md Outdated Show resolved Hide resolved
config/build.gradle Outdated Show resolved Hide resolved
gradle/verification-metadata.xml Outdated Show resolved Hide resolved
gradle/verification-metadata.xml Outdated Show resolved Hide resolved
…er handling of extraData. Added testcases for official genesis files.

Signed-off-by: Ade Lucas <[email protected]>
Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

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

Nice to have the test against real world genesis files.

Before approving I would like to understand potential performance penalty of the extra parsing, see my comment #7273 (comment)

- Updated build.gradle to remove tuweni 2.3.1 refrences.

Signed-off-by: Ade Lucas <[email protected]>
Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

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

LGTM
Before approving I would like to understand potential performance penalty of the extra parsing, see my comment #7273 (comment)

Copy link

github-actions bot commented Nov 8, 2024

This pr is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the Stale label Nov 8, 2024
@fab-10
Copy link
Contributor

fab-10 commented Nov 8, 2024

I can take care of this one, evaluating the performance impact

@fab-10 fab-10 self-assigned this Nov 8, 2024
@github-actions github-actions bot removed the Stale label Nov 9, 2024
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.

Allowing Besu to parse a Geth-style genesis like other clients
2 participants