Check for infinity in eip-196 ecmul (#7509)

* check for infinity before calling out to jni for ecmul
* some changelog clean-up

Signed-off-by: garyschulte <garyschulte@gmail.com>
pull/7537/head
garyschulte 3 months ago committed by GitHub
parent be8f4945b0
commit 8ae0db4b24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 32
      CHANGELOG.md
  2. 7
      evm/src/main/java/org/hyperledger/besu/evm/precompile/AltBN128MulPrecompiledContract.java

@ -2,15 +2,6 @@
## [Unreleased] ## [Unreleased]
### Fixed
- **DebugMetrics**: Fixed a `ClassCastException` occurring in `DebugMetrics` when handling nested metric structures. Previously, `Double` values within these structures were incorrectly cast to `Map` objects, leading to errors. This update allows for proper handling of both direct values and nested structures at the same level. Issue# [#7383](https://github.com/hyperledger/besu/pull/7383)
- `evmtool` was not respecting the `--genesis` setting, resulting in unexpected trace results. [#7433](https://github.com/hyperledger/besu/pull/7433)
### Tests
- Added a comprehensive test case to reproduce the bug and verify the fix for the `ClassCastException` in `DebugMetrics`. This ensures that complex, dynamically nested metric structures can be handled without errors.
## Next release
### Upcoming Breaking Changes ### Upcoming Breaking Changes
### Breaking Changes ### Breaking Changes
@ -20,12 +11,15 @@
- Add 'inbound' field to admin_peers JSON-RPC Call [#7461](https://github.com/hyperledger/besu/pull/7461) - Add 'inbound' field to admin_peers JSON-RPC Call [#7461](https://github.com/hyperledger/besu/pull/7461)
- Add pending block header to `TransactionEvaluationContext` plugin API [#7483](https://github.com/hyperledger/besu/pull/7483) - Add pending block header to `TransactionEvaluationContext` plugin API [#7483](https://github.com/hyperledger/besu/pull/7483)
- Add bootnode to holesky config [#7500](https://github.com/hyperledger/besu/pull/7500) - Add bootnode to holesky config [#7500](https://github.com/hyperledger/besu/pull/7500)
- Implement engine_getClientVersionV1 - Implement engine_getClientVersionV1 [#7512](https://github.com/hyperledger/besu/pull/7512)
- Performance optimzation for ECMUL (1 of 2) [#7509](https://github.com/hyperledger/besu/pull/7509)
### Bug fixes ### Bug fixes
- Fix tracing in precompiled contracts when halting for out of gas [#7318](https://github.com/hyperledger/besu/issues/7318) - Fix tracing in precompiled contracts when halting for out of gas [#7318](https://github.com/hyperledger/besu/issues/7318)
- Correctly release txpool save and restore lock in case of exceptions [#7473](https://github.com/hyperledger/besu/pull/7473) - Correctly release txpool save and restore lock in case of exceptions [#7473](https://github.com/hyperledger/besu/pull/7473)
- Fix for `eth_gasPrice` could not retrieve block error [#7482](https://github.com/hyperledger/besu/pull/7482) - Fix for `eth_gasPrice` could not retrieve block error [#7482](https://github.com/hyperledger/besu/pull/7482)
- **DebugMetrics**: Fixed a `ClassCastException` occurring in `DebugMetrics` when handling nested metric structures. Previously, `Double` values within these structures were incorrectly cast to `Map` objects, leading to errors. This update allows for proper handling of both direct values and nested structures at the same level. Issue# [#7383](https://github.com/hyperledger/besu/pull/7383)
- `evmtool` was not respecting the `--genesis` setting, resulting in unexpected trace results. [#7433](https://github.com/hyperledger/besu/pull/7433)
## 24.8.0 ## 24.8.0
@ -45,8 +39,7 @@
- In process RPC service [#7395](https://github.com/hyperledger/besu/pull/7395) - In process RPC service [#7395](https://github.com/hyperledger/besu/pull/7395)
- Added support for tracing private transactions using `priv_traceTransaction` API. [#6161](https://github.com/hyperledger/besu/pull/6161) - Added support for tracing private transactions using `priv_traceTransaction` API. [#6161](https://github.com/hyperledger/besu/pull/6161)
- Wrap WorldUpdater into EVMWorldupdater [#7434](https://github.com/hyperledger/besu/pull/7434) - Wrap WorldUpdater into EVMWorldupdater [#7434](https://github.com/hyperledger/besu/pull/7434)
- Bump besu-native to 0.9.4 [#7456](https://github.com/hyperledger/besu/pull/7456) - Bump besu-native to 0.9.4 [#7456](https://github.com/hyperledger/besu/pull/7456)=
### Bug fixes ### Bug fixes
- Correct entrypoint in Docker evmtool [#7430](https://github.com/hyperledger/besu/pull/7430) - Correct entrypoint in Docker evmtool [#7430](https://github.com/hyperledger/besu/pull/7430)
@ -54,6 +47,11 @@
- Fix behaviour when starting in a pre-merge network [#7431](https://github.com/hyperledger/besu/pull/7431) - Fix behaviour when starting in a pre-merge network [#7431](https://github.com/hyperledger/besu/pull/7431)
- Fix Null pointer from DNS daemon [#7505](https://github.com/hyperledger/besu/issues/7505) - Fix Null pointer from DNS daemon [#7505](https://github.com/hyperledger/besu/issues/7505)
### Download Links
https://github.com/hyperledger/besu/releases/tag/24.8.0
https://github.com/hyperledger/besu/releases/download/24.8.0/besu-24.8.0.tar.gz / sha256 9671157a623fb94005357bc409d1697a0d62bb6fd434b1733441bb301a9534a4
https://github.com/hyperledger/besu/releases/download/24.8.0/besu-24.8.0.zip / sha256 9ee217d2188e8da89002c3f42e4f85f89aab782e9512bd03520296f0a4dcdd90
## 24.7.1 ## 24.7.1
### Breaking Changes ### Breaking Changes
@ -89,6 +87,11 @@
- Add 30 second timeout to trie log pruner preload [#7365](https://github.com/hyperledger/besu/pull/7365) - Add 30 second timeout to trie log pruner preload [#7365](https://github.com/hyperledger/besu/pull/7365)
- Avoid executing pruner preload during trie log subcommands [#7366](https://github.com/hyperledger/besu/pull/7366) - Avoid executing pruner preload during trie log subcommands [#7366](https://github.com/hyperledger/besu/pull/7366)
### Download Links
https://github.com/hyperledger/besu/releases/tag/24.7.1
https://github.com/hyperledger/besu/releases/download/24.7.1/besu-24.7.1.tar.gz / sha256 59ac352a86fd887225737a5fe4dad1742347edd3c3fbed98b079177e4ea8d544
https://github.com/hyperledger/besu/releases/download/24.7.1/besu-24.7.1.zip / sha256 e616f8100f026a71a146a33847b40257c279b38085b17bb991df045cccb6f832
## 24.7.0 ## 24.7.0
### Upcoming Breaking Changes ### Upcoming Breaking Changes
@ -121,6 +124,11 @@
- Fix "Could not confirm best peer had pivot block" [#7109](https://github.com/hyperledger/besu/issues/7109) - Fix "Could not confirm best peer had pivot block" [#7109](https://github.com/hyperledger/besu/issues/7109)
- Fix "Chain Download Halt" [#6884](https://github.com/hyperledger/besu/issues/6884) - Fix "Chain Download Halt" [#6884](https://github.com/hyperledger/besu/issues/6884)
### Download Links
https://github.com/hyperledger/besu/releases/tag/24.7.0
https://github.com/hyperledger/besu/releases/download/24.7.0/besu-24.7.0.tar.gz / sha256 96cf47defd1d8c10bfc22634e53e3d640eaa81ef58cb0808e5f4265998979530
https://github.com/hyperledger/besu/releases/download/24.7.0/besu-24.7.0.zip / sha256 7e92e2eb469be197af8c8ca7ac494e7a2e7ee91cbdb02d99ff87fb5209e0c2a0
## 24.6.0 ## 24.6.0

@ -38,6 +38,7 @@ public class AltBN128MulPrecompiledContract extends AbstractAltBnPrecompiledCont
new BigInteger( new BigInteger(
"115792089237316195423570985008687907853269984665640564039457584007913129639935"); "115792089237316195423570985008687907853269984665640564039457584007913129639935");
private static final Bytes POINT_AT_INFINITY = Bytes.repeat((byte) 0, 64);
private final long gasCost; private final long gasCost;
private AltBN128MulPrecompiledContract(final GasCalculator gasCalculator, final long gasCost) { private AltBN128MulPrecompiledContract(final GasCalculator gasCalculator, final long gasCost) {
@ -78,6 +79,12 @@ public class AltBN128MulPrecompiledContract extends AbstractAltBnPrecompiledCont
@Override @Override
public PrecompileContractResult computePrecompile( public PrecompileContractResult computePrecompile(
final Bytes input, @Nonnull final MessageFrame messageFrame) { final Bytes input, @Nonnull final MessageFrame messageFrame) {
if (input.size() >= 64 && input.slice(0, 64).equals(POINT_AT_INFINITY)) {
return new PrecompileContractResult(
POINT_AT_INFINITY, false, MessageFrame.State.COMPLETED_SUCCESS, Optional.empty());
}
if (useNative) { if (useNative) {
return computeNative(input, messageFrame); return computeNative(input, messageFrame);
} else { } else {

Loading…
Cancel
Save