Skip to content

EVMv2 AddOperationV2#10255

Merged
siladu merged 5 commits intobesu-eth:mainfrom
siladu:evmv2-add
Apr 21, 2026
Merged

EVMv2 AddOperationV2#10255
siladu merged 5 commits intobesu-eth:mainfrom
siladu:evmv2-add

Conversation

@siladu
Copy link
Copy Markdown
Contributor

@siladu siladu commented Apr 17, 2026

Part of #10131

Use UInt256.add(UInt256) instead of bytes[] version. Can compare performance of byte version in subsequent PR.

Benchmark                                               (caseName)  Mode  Cnt    Score   Error  Units
AddOperationBenchmark.executeOperation           ADD_RANDOM_RANDOM  avgt   15   79.222 ± 0.998  ns/op
v2.AddOperationBenchmarkV2.executeOperation      ADD_RANDOM_RANDOM  avgt   15   11.103 ± 0.197  ns/op

(Note AddOperationBenchmark uses AddOperationOptimized)

and also results with long[] -> byte[] to use the other algorithm: UInt256.add(byte[],byte[])
main...siladu:besu:evmv2-add-uint256-bytes

Benchmark                                    Mode  Cnt   Score   Error  Units
v2.AddOperationBenchmarkV2.executeOperation  avgt   15  65.264 ± 0.188  ns/op

For reference here's the stack_long_array bench

Benchmark                               Mode  Cnt   Score   Error  Units
AddOperationBenchmark.executeOperation  avgt   15  15.230 ± 0.052  ns/op

siladu and others added 2 commits April 17, 2026 13:17
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Drop redundant arithmetic cases (covered by UInt256PropertyBasedTest) and
focus on structural concerns: stack arity, limb-level read/write wiring,
256-bit wrap, deep-slot preservation, and gas cost.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Copilot AI review requested due to automatic review settings April 17, 2026 03:59
Copy link
Copy Markdown
Contributor

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

Note

Copilot was unable to run its full agentic suite in this review.

Implements EVM v2 ADD using UInt256.add(UInt256) and adds targeted tests/bench updates to validate correctness and measure the performance impact.

Changes:

  • Implemented AddOperationV2.staticOperation(MessageFrame) using UInt256 arithmetic and v2 stack limb wiring.
  • Added a dedicated AddOperationV2Test plus a v2 stack-reading helper for assertions.
  • Updated call sites (EVM run loop + JMH benchmark) and normalized a constant name in MulModOperationV2.

Reviewed changes

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

Show a summary per file
File Description
evm/src/main/java/org/hyperledger/besu/evm/v2/operation/AddOperationV2.java Implements v2 ADD logic using UInt256.add and writes result back to v2 long[] stack.
evm/src/main/java/org/hyperledger/besu/evm/EVM.java Updates v2 dispatch to call the new AddOperationV2.staticOperation(frame) signature.
ethereum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/v2/AddOperationBenchmarkV2.java Aligns benchmark invocation with the updated staticOperation signature.
evm/src/main/java/org/hyperledger/besu/evm/v2/operation/MulModOperationV2.java Renames success constant to uppercase to match constant naming conventions.
evm/src/test/java/org/hyperledger/besu/evm/v2/testutils/TestMessageFrameBuilderV2.java Adds a helper to read a UInt256 from the v2 stack for test assertions.
evm/src/test/java/org/hyperledger/besu/evm/v2/operation/AddOperationV2Test.java Adds parameterized and edge-case tests for v2 ADD stack behavior and gas cost.

Comment on lines +195 to +196
final long[] s = frame.stackDataV2();
final int idx = (frame.stackTopV2() - 1 - offset) << 2;
Comment on lines +60 to +65
final int aOffset = (--top) << 2;
final int bOffset = (--top) << 2;

add(stack, aOffset, bOffset);

frame.setTopV2(++top);
Comment on lines 69 to 81
private static void add(final long[] stack, final int aOffset, final int bOffset) {
final UInt256 valueA =
new UInt256(stack[aOffset], stack[aOffset + 1], stack[aOffset + 2], stack[aOffset + 3]);
final UInt256 valueB =
new UInt256(stack[bOffset], stack[bOffset + 1], stack[bOffset + 2], stack[bOffset + 3]);

final UInt256 r = valueA.add(valueB);

stack[bOffset] = r.u3();
stack[bOffset + 1] = r.u2();
stack[bOffset + 2] = r.u1();
stack[bOffset + 3] = r.u0();
}
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
Comment thread evm/src/test/java/org/hyperledger/besu/evm/v2/operation/AddOperationV2Test.java Outdated
Comment thread evm/src/test/java/org/hyperledger/besu/evm/v2/operation/AddOperationV2Test.java Outdated
Comment thread evm/src/test/java/org/hyperledger/besu/evm/v2/operation/AddOperationV2Test.java Outdated
Comment thread evm/src/test/java/org/hyperledger/besu/evm/v2/operation/AddOperationV2Test.java Outdated
new TestMessageFrameBuilderV2()
.pushStackItem(Bytes32.fromHexStringLenient("0x1")) // top-2, missing top-1
.build();
assertThat(frame.stackTopV2()).isEqualTo(1);
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.

nit: what are you asserting here? test code?

Copy link
Copy Markdown
Contributor Author

@siladu siladu Apr 21, 2026

Choose a reason for hiding this comment

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

Stack remains unmodified by error codepath

Comment on lines +82 to +85
final UInt256 expected =
expectedResult.equals("0x") || expectedResult.equals("0x0")
? UInt256.ZERO
: UInt256.fromBytesBE(Bytes32.fromHexStringLenient(expectedResult).toArrayUnsafe());
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.

can remove these if check entirely, your inputs are never of this form

Copy link
Copy Markdown
Contributor Author

@siladu siladu Apr 21, 2026

Choose a reason for hiding this comment

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

I have removed ZERO ternary here aa2af3e

Here we want to assert the actual long[] form with expected bytes in String form.
I think UInt256 is a nice convenience to do this and gives a useful output showing the limbs in the case the test fails:

Expected :UInt256[u3=2305843009213693954, u2=3458764513820540931, u1=4611686018427387908, u0=5764607523034234885]
Actual   :UInt256[u3=5260204364768739339, u2=2810246167479189513, u1=-2017612633061982201, u0=-9223372036854775804]

This is also conventional we are following in existing V2 tests.

If not this, what would you suggest for the assert?

final Operation.OperationResult result = AddOperationV2.staticOperation(frame);

assertThat(result.getHaltReason()).isEqualTo(ExceptionalHaltReason.INSUFFICIENT_STACK_ITEMS);
assertThat(frame.stackTopV2()).isEqualTo(1);
Copy link
Copy Markdown
Contributor

@lu-pinto lu-pinto Apr 20, 2026

Choose a reason for hiding this comment

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

nit: on a halt condition you don't care about the state of the stack since your are halting the frame so this assertion is pointless

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I dunno, I think it's reasonable to confirm the operation hasn't modified the stack during its error path, considering it modifies in the happy path.

The fact it isn't used is business logic outside the scope of this test IMO.


final Operation.OperationResult result = AddOperationV2.staticOperation(frame);

assertThat(result.getHaltReason()).isEqualTo(ExceptionalHaltReason.INSUFFICIENT_STACK_ITEMS);
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.

Copy link
Copy Markdown
Contributor

@lu-pinto lu-pinto left a comment

Choose a reason for hiding this comment

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

What about some property tests like the division arithmetics or byte shifting opcodes have? Though I understand if you want to work on it separately to unblock this PR

siladu added 2 commits April 21, 2026 16:39
Don't mutate top
Don't use fromHexStringLenient

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
@siladu
Copy link
Copy Markdown
Contributor Author

siladu commented Apr 21, 2026

What about some property tests like the division arithmetics or byte shifting opcodes have? Though I understand if you want to work on it separately to unblock this PR

I addressed this in the javadoc for AddOperationV2Test:

  • Structural test data for add(a, b) = expected. Arithmetic correctness is covered by
  • UInt256PropertyBasedTest; these cases verify stack arity, limb-level read/write wiring, and
  • 256-bit wrap handling.

Coverage exists here

@siladu
Copy link
Copy Markdown
Contributor Author

siladu commented Apr 21, 2026

Added some zero operand benchmarks to another branch to test with/without fast path, see 102dc44#diff-1dd3d21e8e8983e4ecdba9fc4f1c0664ebc7ce55392d59a04495f0ff10238d98

Benchmark                                            Mode  Cnt   Score   Error  Units
AddOperationBenchmark.executeOperation               avgt   15  85.950 ± 0.591  ns/op
AddOperationBenchmark.fastPathZeroA                  avgt   15  30.074 ± 0.325  ns/op
AddOperationBenchmark.fastPathZeroB                  avgt   15  32.596 ± 0.034  ns/op
# this PR - fast paths removed
v2.AddOperationBenchmarkV2.executeOperation          avgt   15  13.288 ± 0.688  ns/op
v2.AddOperationBenchmarkV2.fastPathZeroA             avgt   15   6.784 ± 0.005  ns/op
v2.AddOperationBenchmarkV2.fastPathZeroB             avgt   15   7.488 ± 0.015  ns/op
# branch - fast paths re-added
v2.AddOperationFastPathBenchmarkV2.executeOperation  avgt   15  25.626 ± 1.479  ns/op
v2.AddOperationFastPathBenchmarkV2.fastPathZeroA     avgt   15   4.774 ± 0.147  ns/op
v2.AddOperationFastPathBenchmarkV2.fastPathZeroB     avgt   15  14.635 ± 0.031  ns/op

@siladu siladu merged commit 11a4595 into besu-eth:main Apr 21, 2026
34 checks passed
@siladu
Copy link
Copy Markdown
Contributor Author

siladu commented Apr 21, 2026

No significant difference between zero fast path or no fast path for ADDMOD

Added some extra cases on separate branch to explore this main...siladu:besu:evmv2-add-bench-fastpath

Benchmark                                                     (caseName)  Mode  Cnt    Score   Error  Units
AddModFastPathOperationBenchmark.executeOperation  ZERO_ADDMOD_128_256_0  avgt   15   36.987 ± 0.830  ns/op
AddModFastPathOperationBenchmark.executeOperation         ADDMOD_0_32_32  avgt   15   37.693 ± 0.174  ns/op
AddModFastPathOperationBenchmark.executeOperation         ADDMOD_32_0_32  avgt   15   37.105 ± 0.469  ns/op
AddModFastPathOperationBenchmark.executeOperation       ADDMOD_0_256_128  avgt   15  102.156 ± 0.682  ns/op
AddModFastPathOperationBenchmark.executeOperation       ADDMOD_256_0_128  avgt   15  100.709 ± 0.732  ns/op
AddModFastPathOperationBenchmark.executeOperation       ADDMOD_0_256_192  avgt   15   92.984 ± 0.615  ns/op
AddModFastPathOperationBenchmark.executeOperation       ADDMOD_256_0_192  avgt   15   95.771 ± 2.254  ns/op
AddModFastPathOperationBenchmark.executeOperation       ADDMOD_0_256_256  avgt   15   59.819 ± 0.387  ns/op
AddModFastPathOperationBenchmark.executeOperation       ADDMOD_256_0_256  avgt   15   59.726 ± 0.670  ns/op
AddModFastPathOperationBenchmark.executeOperation            FULL_RANDOM  avgt   15  117.613 ± 1.958  ns/op
AddModOperationBenchmark.executeOperation          ZERO_ADDMOD_128_256_0  avgt   15   36.788 ± 0.369  ns/op
AddModOperationBenchmark.executeOperation                 ADDMOD_0_32_32  avgt   15   37.832 ± 0.158  ns/op
AddModOperationBenchmark.executeOperation                 ADDMOD_32_0_32  avgt   15   37.250 ± 0.575  ns/op
AddModOperationBenchmark.executeOperation               ADDMOD_0_256_128  avgt   15  102.295 ± 0.646  ns/op
AddModOperationBenchmark.executeOperation               ADDMOD_256_0_128  avgt   15  101.087 ± 0.234  ns/op
AddModOperationBenchmark.executeOperation               ADDMOD_0_256_192  avgt   15   92.784 ± 0.742  ns/op
AddModOperationBenchmark.executeOperation               ADDMOD_256_0_192  avgt   15   93.832 ± 1.016  ns/op
AddModOperationBenchmark.executeOperation               ADDMOD_0_256_256  avgt   15   60.195 ± 0.221  ns/op
AddModOperationBenchmark.executeOperation               ADDMOD_256_0_256  avgt   15   60.214 ± 0.282  ns/op
AddModOperationBenchmark.executeOperation                    FULL_RANDOM  avgt   15  119.087 ± 3.569  ns/op

@siladu siladu deleted the evmv2-add branch April 21, 2026 10:24
daniellehrner added a commit that referenced this pull request Apr 21, 2026
* enable bal parallelization for all blocks and not only head (#10234)

Signed-off-by: Karim Taam <karim.t2am@gmail.com>

* Add MULMOD to EVMv2 (#10168)

- Add MulModOperationV2, tests and benchmarks
- Rename c -> m in benchmarks following (a * b) % m formula
- Add MulModOperationV2Test covering stack management and underflow

Tests verify correct stack depth reduction (3→1), result placement, zero-modulus special case, cross-limb arithmetic, and that underflow with 0 or 2 items returns INSUFFICIENT_STACK_ITEMS without mutating the stack.

---------

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>

* BlockSimulator fix (#10251)

* BlockSimulator fix

Signed-off-by: Roman <4833306+Filter94@users.noreply.github.com>

Signed-off-by: Roman <4833306+Filter94@users.noreply.github.com>
Co-authored-by: garyschulte <garyschulte@gmail.com>

* Enable NullAway static null-safety analysis for util module (#10046)

* Migrate JSR305 nullness annotations to JSpecify

- Replace javax.annotation.Nullable and javax.annotation.CheckForNull with org.jspecify.annotations.Nullable across 18 Java files
- Update platform constraint to org.jspecify:jspecify:1.0.0
- Replace compileOnly com.google.code.findbugs:jsr305 with compileOnly org.jspecify:jspecify in affected modules

Signed-off-by: Mykim <38449976+Apisapple@users.noreply.github.com>

* feat(util): add opt-in NullAway configuration for Error Prone

Signed-off-by: mykim <kimminyong2034@gmail.com>

* feat(util): enable NullAway with comprehensive nullability fixes

- Add NullAway 0.12.4 to util errorprone dependencies
- Annotate nullable fields/returns in 6 util classes with @nullable
- Fix nullable dereferences: RollingFileWriter, StackTraceMatchFilter, PlatformDetector
- Enable NullAway:ERROR for util main compile, OFF for tests
- Add optional CI job (run-nullaway label) for gradual monitoring
- All util compilation passes with NullAway ERROR by default

Fixes:
  - MemoryBoundCache: mark getIfPresent() return as @nullable
  - ExceptionUtils: annotate rootCause() for nullable input/output
  - RollingFileWriter: guard Path.getParent() null dereference
  - PlatformDetector: make static fields @nullable, add fallback to UNKNOWN
  - BesuVersionUtils: mark VERSION/COMMIT fields as @nullable
  - StackTraceMatchFilter: fix nullable message comparison, builder fields
Signed-off-by: mykim <kimminyong2034@gmail.com>

* style(util): format code for improved readability in StackTraceMatchFilter

Signed-off-by: mykim <kimminyong2034@gmail.com>

* fix(util): PlatformDetector.normalizeGLibcVersion returns UNKNOWN not null

Replace null return with UNKNOWN to satisfy NullAway @nonnull contract.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* fix(util): update getGlibc to return null instead of UNKNOWN

- Return null to account for existing code that expects and handles null values.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* fix(util): remove NullAway flag from util compile command

- Remove the unnecessary -PenableNullAway flag

Signed-off-by: mykim <kimminyong2034@gmail.com>

* docs(util): update getGlibc Javadoc to clarify return value can be null

- Update the Javadoc to reflect the actual behavior of the getGlibc function.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* docs(util): update NullAway optional check job name for clarity

Signed-off-by: mykim <kimminyong2034@gmail.com>

* fix(util): update getGlibc to always return a value instead of null

Signed-off-by: mykim <kimminyong2034@gmail.com>

* fix(util): remove NullAway optional check job from pre-review workflow

Signed-off-by: mykim <kimminyong2034@gmail.com>

* Fix YAML indentation in pre-review workflow

Adjust indentation of GRADLEW_UNIT_TEST_ARGS in .github/workflows/pre-review.yml under unitTests.env to align with surrounding keys.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* feat: Improve version metadata null-safety and bump NullAway to 0.13.1

Signed-off-by: mykim <kimminyong2034@gmail.com>

* chroe: Add jspecify compileOnly dependency

Add org.jspecify:jspecify as a compileOnly dependency to util/build.gradle. This brings JSpecify annotations into the module for static nullness/type-checking without introducing a runtime dependency.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* feat: Use shortVersion() and improve StackTraceMatchFilter

Update acceptance tests to call BesuVersionUtils.shortVersion() directly instead of using orElse("unknown"). In StackTraceMatchFilter, mark the Throwable parameter as @nullable and simplify toString() to return stackContains directly. These changes clarify nullability and streamline version usage/representation.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* docs: Fix Javadoc reference for UNKNOWN constant

Update Javadoc in util/src/main/java/org/hyperledger/besu/util/BesuVersionUtils.java to use {@value #UNKNOWN} instead of {@value UNKNOWN} in shortVersion() and commit() docs so the UNKNOWN field is referenced correctly. No behavioral changes.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* chroe: Remove old verification metadata entries

Delete verification-metadata entries for com.uber.nullaway:nullaway:0.12.4 and org.checkerframework:dataflow-nullaway:3.48.0 (their artifact SHA entries were removed). These versions are superseded in the file by nullaway:0.13.1 and dataflow-nullaway:3.53.0, so the stale metadata was cleaned up.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* Merge pull request #7 from Apisapple/feature/nullaway-util

Feature/nullaway util

Signed-off-by: mykim <kimminyong2034@gmail.com>

* Use UNKNOWN constant in version regex tests

Replace hardcoded "UNKNOWN" literal in regex assertions with BesuVersionUtils.UNKNOWN constant in three unit tests (versionStringIsEthstatsFriendly, noIdentityNodeNameIsEthstatsFriendly, userIdentityNodeNameIsEthstatsFriendly) in BesuVersionUtilsTest. This keeps the tests consistent with the source constant and avoids duplicating the literal value; no behavioral change.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* Use BesuVersionUtils.UNKNOWN constant

Remove the local BESU_VERSION_UNKNOWN constant and use BesuVersionUtils.UNKNOWN instead. Simplify getRuntimeVersionString() to return BesuVersionUtils.shortVersion() directly, construct VersionMetadata with BesuVersionUtils.UNKNOWN on FileNotFoundException, and compare metadata versions against BesuVersionUtils.UNKNOWN. Centralizes the unknown-version sentinel in BesuVersionUtils.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* docs: Clarify rootCause javadoc null behavior

Update Javadoc for ExceptionUtils.rootCause to state it returns the root cause or {@code null} when the input throwable is {@code null}. This documents the method's existing behavior, which already returns null for a null input.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* style: Wrap long regex in BesuVersionUtilsTest

Reformat the long regex in userIdentityNodeNameIsEthstatsFriendly test to improve readability by splitting the string across lines. This is a purely formatting change in util/src/test/java/org/hyperledger/besu/util/BesuVersionUtilsTest.java and does not alter test behavior.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* chore: Use compileOnlyApi for jspecify dependency

Replace compileOnly with compileOnlyApi for org.jspecify:jspecify in util/build.gradle so jspecify annotations are exposed on the compile classpath to consumers of this module. This ensures downstream modules compiling against this artifact can see the jspecify types without packaging the dependency.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* feat: Quote UNKNOWN in version regex tests

Use Pattern.quote(BesuVersionUtils.UNKNOWN) in regex assertions to ensure the UNKNOWN token is matched literally and not treated as a regex. Added import java.util.regex.Pattern and updated three assertions in BesuVersionUtilsTest (versionStringIsEthstatsFriendly, noIdentityNodeNameIsEthstatsFriendly, userIdentityNodeNameIsEthstatsFriendly) to avoid accidental regex interpretation and potential test flakiness.

Signed-off-by: mykim <kimminyong2034@gmail.com>

* style: Apply Spotless formatting

Apply Spotless formatting

Signed-off-by: mykim <kimminyong2034@gmail.com>

---------

Signed-off-by: Mykim <38449976+Apisapple@users.noreply.github.com>
Signed-off-by: mykim <kimminyong2034@gmail.com>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>

* Layered txpool: enable balance check by default (#10175)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Justin Florentine <justin+github@florentine.us>

* remove pre EIP8 handshake support (#10257)

Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Co-authored-by: Justin Florentine <justin+github@florentine.us>

* Minor Mulmod v2 refactor (#10253)

* Refactor stack index logic
* Refactor test helper
* Remove redundant stack param
* Inline mulmod method

---------

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>

* Increase disconnect await timeout in flaky P2P rejection tests (#10267)

Under full test suite load, the multi-hop async disconnect path
(local denies inbound → TCP close → remote Netty event loop →
subscriber callback) can exceed 5s due to thread pool contention.
Raise peerFuture/reasonFuture timeouts to 30s in P2PNetworkTest
and P2PPlainNetworkTest to tolerate CI load without masking bugs.

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

* Include slotNumber in payloadIdentifier generation (#10242)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Usman Saleem <usman@usmans.info>

* Update Gradle plugin for Besu plugin development to 0.2.0 (#10263)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

* Change block access list index to uint32 (#10279)

Signed-off-by: Karim Taam <karim.t2am@gmail.com>

* SystemCallProcessor: remove duplicate logging (#10152)

* remove duplicate logging

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

---------

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* EVMv2 AddOperationV2 (#10255)

* AddOperationV2

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>

* AddOperationV2Test: structural coverage

Drop redundant arithmetic cases (covered by UInt256PropertyBasedTest) and
focus on structural concerns: stack arity, limb-level read/write wiring,
256-bit wrap, deep-slot preservation, and gas cost.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>

* Optimize for JIT

Signed-off-by: Luis Pinto <luis.pinto@consensys.net>

* Address review comments

Don't mutate top
Don't use fromHexStringLenient

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>

---------

Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Luis Pinto <luis.pinto@consensys.net>

* [CHANGELOG] add unreleased section (#10286)

Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

* Enforce that blob_versioned_hashes match blobs (#10278)

Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>

* Implement BaseFee, blobBaseFee, CallValue, GasPrice, Balance and SelfBalance for EVM v2 (#10229)

* Migrate wei operations to EVM v2 (first commit)

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Update SelfBalance benchmarks

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* spotless

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Address comments.

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Add Javadoc

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Add unit tests

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* spotless

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Update datatypes/src/main/java/org/hyperledger/besu/datatypes/Wei.java

Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: ahamlat <ameziane.hamlat@consensys.net>

* Update evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java

Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: ahamlat <ameziane.hamlat@consensys.net>

* Update evm/src/main/java/org/hyperledger/besu/evm/frame/MessageFrame.java

Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: ahamlat <ameziane.hamlat@consensys.net>

* Update datatypes/src/main/java/org/hyperledger/besu/datatypes/Wei.java

Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: ahamlat <ameziane.hamlat@consensys.net>

* Apply refactoring changes

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* remove basefee field

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Fix merge issue

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Address more comments

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Remove not used field

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* spotless

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Undo Balance operation change and add more unit tests

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

* Update AddOperationV2 after merge with main

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>

---------

Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>
Signed-off-by: ahamlat <ameziane.hamlat@consensys.net>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>

---------

Signed-off-by: Karim Taam <karim.t2am@gmail.com>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
Signed-off-by: Roman <4833306+Filter94@users.noreply.github.com>
Signed-off-by: Mykim <38449976+Apisapple@users.noreply.github.com>
Signed-off-by: mykim <kimminyong2034@gmail.com>
Signed-off-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Signed-off-by: stefan.pingel@consensys.net <stefan.pingel@consensys.net>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
Signed-off-by: Ameziane H. <ameziane.hamlat@consensys.net>
Signed-off-by: ahamlat <ameziane.hamlat@consensys.net>
Co-authored-by: Karim Taam <karim.t2am@gmail.com>
Co-authored-by: Simon Dudley <simon.dudley@consensys.net>
Co-authored-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Mykim <kimminyong2034@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Stefan Pingel <16143240+pinges@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Usman Saleem <usman@usmans.info>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Luis Pinto <luis.pinto@consensys.net>
Co-authored-by: ahamlat <ameziane.hamlat@consensys.net>
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.

4 participants