Skip to content

add example#78

Merged
tac0turtle merged 2 commits into
mainfrom
marko/add_example
Dec 4, 2025
Merged

add example#78
tac0turtle merged 2 commits into
mainfrom
marko/add_example

Conversation

@tac0turtle

Copy link
Copy Markdown
Contributor

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring

Related Issues

Fixes #(issue)

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Testing

Additional Notes

@tac0turtle tac0turtle marked this pull request as ready for review December 4, 2025 12:57
@tac0turtle tac0turtle requested a review from a team as a code owner December 4, 2025 12:57
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @tac0turtle, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the etc/ev-reth-genesis.json configuration file by adding new parameters to define a smart contract size limit. These additions, contractSizeLimit and contractSizeLimitActivationHeight, are set to specific values, likely serving as an example for how to configure this new functionality within the system's genesis block.

Highlights

  • Genesis Configuration Update: Introduced contractSizeLimit and contractSizeLimitActivationHeight parameters to the etc/ev-reth-genesis.json file, setting a contract size limit of 131072 bytes and activating it from height 0. This appears to be an example configuration for a new feature.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@claude

claude Bot commented Dec 4, 2025

Copy link
Copy Markdown

Claude finished @tac0turtle's task —— View job


Code Review for PR #78: "add example"

Todo List:

  • Read and analyze the changed genesis configuration file
  • Review code quality and JSON structure
  • Check for potential bugs or issues
  • Evaluate performance considerations
  • Assess security concerns
  • Examine test coverage implications
  • Provide comprehensive feedback

Review Summary

This PR adds contract size limit configuration parameters to the etc/ev-reth-genesis.json file, providing an example of how to configure custom contract size limits for the Evolve network.

Code Quality & Best Practices

Strong Points:

  • Proper JSON formatting: Valid JSON structure with consistent indentation
  • Follows existing conventions: New parameters are added within the existing evolve configuration object (/home/runner/work/ev-reth/ev-reth/etc/ev-reth-genesis.json:19-26)
  • Well-documented feature: The implementation has comprehensive documentation in the codebase and README
  • Extensive test coverage: The feature is thoroughly tested in config.rs:398-477 with multiple test scenarios

⚠️ Configuration Analysis

Parameter Values:

  • contractSizeLimit: 131072 (128KB) - 5.3x larger than EIP-170 default (24KB)
  • contractSizeLimitActivationHeight: 0 - Active from genesis block

Considerations:

  1. Size Increase Justification: The 128KB limit is significantly larger than the standard 24KB. While this may be intentional for larger smart contracts, consider documenting the rationale for this specific size choice.

  2. Immediate Activation: Setting activation height to 0 means this limit applies from genesis. This is appropriate for a new network but should be carefully considered for existing networks.

🔒 Security Assessment

Low Risk Areas:

  • No security vulnerabilities: Configuration changes are low-risk
  • Proper validation: The config.rs:108-118 implementation includes proper validation logic
  • Safe defaults: Missing configurations fall back to EIP-170 defaults

Considerations:

  • Memory implications: Larger contract size limits could potentially impact node memory usage during compilation/execution, but 128KB is still reasonable
  • Network consistency: Ensure all network participants use the same genesis configuration

Performance Considerations

Minimal Impact:

  • Configuration parsing: JSON parsing overhead is negligible
  • Runtime overhead: Contract size checking happens only during deployment, not during execution
  • Storage impact: Larger contracts will consume more blockchain storage space

🧪 Test Coverage

Excellent Coverage:

  • Comprehensive unit tests: config.rs:383-477 covers all scenarios including:
    • Default behavior when not set
    • Custom limits with activation heights
    • Boundary conditions and edge cases
  • Integration potential: Consider adding integration tests that validate this specific genesis configuration loads correctly

📋 Recommendations

  1. Documentation Enhancement: Consider adding a comment in the genesis file explaining the rationale for the 128KB limit choice

  2. Validation Check: Run a quick test to ensure the genesis file loads correctly:

    # Test that the genesis configuration parses without errors
    make test-node # or equivalent validation command
  3. Example Documentation: Since this is an "example", consider adding it to the README's examples section with explanation of when these values might be appropriate

🎯 Conclusion

This is a well-implemented configuration change that demonstrates proper usage of the contract size limit feature. The code quality is high, security implications are minimal, and the feature has excellent test coverage. The configuration values are reasonable for an example, though the rationale for the specific 128KB choice could be better documented.

Recommendation: ✅ Approve - This is a solid example configuration that follows best practices.


@tac0turtle tac0turtle merged commit 5ee416f into main Dec 4, 2025
9 checks passed
@tac0turtle tac0turtle deleted the marko/add_example branch December 4, 2025 12:58

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds contractSizeLimit and contractSizeLimitActivationHeight to the ev-reth-genesis.json configuration file. However, the corresponding Rust code to parse and utilize these new fields appears to be missing from this PR. As a result, the changes in the JSON file will have no effect. I've left a specific comment on the JSON file with more details.

Additionally, for better maintainability, I recommend updating the pull request title to be more descriptive (e.g., 'feat: Add contract size limit configuration') and adding a description that explains the purpose of these new configuration options.

Comment thread etc/ev-reth-genesis.json
Comment on lines +24 to +25
"contractSizeLimit": 131072,
"contractSizeLimitActivationHeight": 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

These new configuration fields, contractSizeLimit and contractSizeLimitActivationHeight, are not currently being read from the chainspec. The ChainspecEvolveConfig struct in crates/node/src/config.rs needs to be updated to include these fields for them to have any effect.

For these settings to be used, you'll need to:

  1. Add contract_size_limit and contract_size_limit_activation_height to the ChainspecEvolveConfig struct in crates/node/src/config.rs.
  2. Propagate these fields to EvolvePayloadBuilderConfig.
  3. Handle their initialization within the from_chain_spec function in crates/node/src/config.rs.

Without these changes, the configuration added here will be ignored by the application.

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