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

EIP-2537 #6964

Merged
merged 28 commits into from
May 7, 2024
Merged

EIP-2537 #6964

merged 28 commits into from
May 7, 2024

Conversation

Marchhill
Copy link
Contributor

@Marchhill Marchhill commented Apr 30, 2024

Changes

  • Add Ethereum tests for EIP-2537
  • Implement fast subgroup checks
  • Update precompile addresses and gas costs

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: tests

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No


internal static BigInteger Normalise(in BigInteger x)
{
BigInteger unnormalised = x % BlsBaseFieldOrder;
Copy link
Member

Choose a reason for hiding this comment

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

BigIntegers are painfully slow, do we need simple UInt512 types?

Copy link
Contributor Author

@Marchhill Marchhill May 3, 2024

Choose a reason for hiding this comment

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

At some point the subgroup checks should be implemented in the cryptography library, so probably not worth optimising for now. Just implemented them in C# quickly for the devnet, and because we still might change libraries

@Marchhill Marchhill changed the title EIP-2537 tests EIP-2537 May 2, 2024
src/tests Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

we can revert it now as we're passing all tests, the EIP2537 tests have to be added to the develop in EthereumTests repo

Copy link
Contributor

Choose a reason for hiding this comment

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

oh I think it is done :)

Copy link
Contributor

@MarekM25 MarekM25 left a comment

Choose a reason for hiding this comment

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

don't forget about enabling by timestamp!

@Marchhill
Copy link
Contributor Author

don't forget about enabling by timestamp!

This was already implemented actually, just had to enable it for Prague

@@ -192,7 +192,7 @@ private static void UpdateMetrics(ExecutionOptions opts, UInt256 effectiveGasPri
Metrics.BlockMaxGasPrice = Math.Max(gasPrice, Metrics.BlockMaxGasPrice);

Metrics.AveGasPrice = (Metrics.AveGasPrice * Metrics.Transactions + gasPrice) / (Metrics.Transactions + 1);
Metrics.EstMedianGasPrice += Metrics.AveGasPrice * 0.01f * float.Sign(gasPrice - Metrics.EstMedianGasPrice);
Metrics.EstMedianGasPrice += Metrics.AveGasPrice * 0.01f * float.Sign(gasPrice - Metrics.AveGasPrice);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to do this to get the tests to pass, not sure if it is correct

Copy link
Member

Choose a reason for hiding this comment

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

This shouldn't change.

@MarekM25 MarekM25 self-requested a review May 7, 2024 09:41
@MarekM25 MarekM25 marked this pull request as ready for review May 7, 2024 09:46
@MarekM25 MarekM25 merged commit bf382fe into master May 7, 2024
67 checks passed
@MarekM25 MarekM25 deleted the feature/bls-tests branch May 7, 2024 09:55
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.

3 participants