Skip to content

Implement EIP-2565 ModExp precompile support in AuRa tests #8373

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

richardgreg
Copy link
Contributor

@richardgreg richardgreg commented Mar 16, 2025

This commit implements the TODO for ModExp precompile EIP-2565 support in ChainSpecLoaderTest.

Changes

  • Added test/Specs/posdao.json with the required chain spec format
  • Created a new test method to verify EIP-2565 transition parameter is properly set
  • Added proper documentation to explain the ModExp precompile gas cost changes

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • Yes
  • No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

@LukaszRozmej LukaszRozmej requested a review from deffrian March 18, 2025 13:39
@richardgreg richardgreg force-pushed the feature/implement-modexp-2565-in-aura-tests branch from c67ba4a to 3ddfd2c Compare March 19, 2025 17:37
This commit implements the TODO for ModExp precompile EIP-2565 support in ChainSpecLoaderTest.
- Added test/Specs/posdao.json with required chain spec format
- Created new test method to verify EIP-2565 transition parameter is properly set
- Added proper documentation to explain the ModExp precompile gas cost changes
@richardgreg richardgreg force-pushed the feature/implement-modexp-2565-in-aura-tests branch from 3ddfd2c to 97ba1ff Compare March 19, 2025 23:06
@benaadams benaadams requested a review from Copilot March 29, 2025 20:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds tests to verify the EIP-2565 ModExp precompile support in AuRa by ensuring that the chain spec parameters and call depth limits are correctly handled under various EVM operations.

  • Adds new tests in CallDepthLimitTests.cs to cover recursive CALL, CREATE, and DELEGATECALL operations failing at maximum depth (1024).
  • Updates ChainSpecLoaderTest.cs to verify that the Eip2565Transition parameter is explicitly set in the chain specification.

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
src/Nethermind/Nethermind.Evm.Test/CallDepthLimitTests.cs Introduces tests for recursive calls, create, and delegatecall failures at max depth to ensure proper handling of gas limits and depth restrictions.
src/Nethermind/Nethermind.AuRa.Test/ChainSpecLoaderTest.cs Adds a test that assigns and verifies the Eip2565Transition parameter in the chain spec.
Files not reviewed (1)
  • src/Nethermind/Nethermind.AuRa.Test/Specs/posdao.json: Language not supported
Comments suppressed due to low confidence (3)

src/Nethermind/Nethermind.Evm.Test/CallDepthLimitTests.cs:158

  • [nitpick] Consider defining a constant (e.g. MAX_CALL_DEPTH) instead of using the magic number 1024 directly for clarity and consistency.
Assert.That(depth, Is.EqualTo((UInt256)1024), "Call should fail at depth 1024");

src/Nethermind/Nethermind.Evm.Test/CallDepthLimitTests.cs:265

  • [nitpick] Consider defining a constant (e.g. MAX_CALL_DEPTH) to replace the magic number 1024, which will improve code clarity and ease updates if the depth limit changes.
Assert.That(depth, Is.EqualTo((UInt256)1024), "CREATE should fail at depth 1024");

src/Nethermind/Nethermind.Evm.Test/CallDepthLimitTests.cs:363

  • [nitpick] Consider replacing the hard-coded value 1024 with a defined constant (e.g. MAX_CALL_DEPTH) to enhance the maintainability of the test cases.
Assert.That(depth, Is.EqualTo((UInt256)1024), "DELEGATECALL should fail at depth 1024");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants