Skip to content

Changes to units project to accomodate bytes v2#54

Draft
lu-pinto wants to merge 4 commits intoConsensys:mainfrom
lu-pinto:modify-units-project-for-v2
Draft

Changes to units project to accomodate bytes v2#54
lu-pinto wants to merge 4 commits intoConsensys:mainfrom
lu-pinto:modify-units-project-for-v2

Conversation

@lu-pinto
Copy link
Member

@lu-pinto lu-pinto commented Nov 27, 2025

PR description

Changes to project units to accomodate bytes v2.


Note

Adds a new org.apache.tuweni.v2.bytes API and v2.units.bigints (UInt32/64/256/384) with comprehensive tests, integrates JMH benchmarks, and configures build support.

  • Build:
    • Add JMH plugin (conditionally applied) with profiling options and helpers in root build.gradle.
    • Add _strCmdArg/__strListCmdArg utilities.
  • Bytes v2 (bytes/src/main/java/org/apache/tuweni/v2/bytes):
    • New core: Bytes, MutableBytes, Bytes32, Bytes48, ConcatenatedBytes, ConstantBytesValue, DelegatingBytes, wrappers for arrays/buffers (ArrayWrappingBytes, ByteBufferWrappingBytes, ByteBufWrappingBytes, BufferWrappingBytes), and Utils/BytesValues.
    • Minor change in legacy test ConcatenatedBytesTest (extra slice assertion).
  • Benchmarks (bytes/src/jmh/...):
    • Add BytesMegamorphicBenchmarkV1 and BytesMegamorphicBenchmarkV2.
  • Units v2 bigints (units/src/main/java/org/apache/tuweni/v2/units/bigints):
    • Add UInt32, UInt64, UInt256, UInt384 and Utils, with package infos.
    • Add compatibility units/.../bigints/Utils (non-v2).
  • Tests:
    • Extensive tests for v2 bytes and bigints; add AssertJ to bytes tests.

Written by Cursor Bugbot for commit b74808c. This will update automatically on new commits. Configure here.

This is a collapsed view of the previous old commits:

*   0929d61 Merge remote-tracking branch 'upstream/main' into flatten-Bytes-class-hierarchy
* | 6d79491 Miscelaneous fixes
* | a4def2a Fix memleak in Hash and bug in devp2p Packet creation
* | 10e6e81 fix bug in and/or/xor operations with UInt256/UInt384
* | 578e6bb Move bound checks for Bytes implementation out of constructors
* | b9c6b05 Merge branch 'main' into flatten-Bytes-class-hierarchy
* 4100d8b review feedback
* afba2b9 change megamorphic benchmarks to slice and optimize size()
* b2066fc JMH integration fixes
* e40d796 remove InterfaceCall and VirtualCall benchmarks
* dff599a fix ConnectTwoServersTest - missed package changes and port bindings
* 5aba562 add missing package-info.java files
* 1c641ff fix failure in DefaultDiscoveryV5ServiceTest about reusing ports
* 279acd6 bring in old tuweni v1 after move
* ace7910 move all other touched files to org.apache.tuweni.v2 package
* 65f217b mv org.apache.tuweni.bytes.v2 to org.apache.tuweni.v2.bytes
* ebaa8bd Implement Tuweni v2

Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
This is for easy reviewing by making the PR much shorter.

Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
@lu-pinto lu-pinto force-pushed the modify-units-project-for-v2 branch from 8b21511 to b74808c Compare November 27, 2025 17:19
@lu-pinto lu-pinto marked this pull request as draft November 27, 2025 17:22
@github-actions
Copy link

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Dec 12, 2025
@github-actions
Copy link

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Dec 26, 2025
@lu-pinto lu-pinto reopened this Jan 7, 2026
@lu-pinto lu-pinto removed the Stale label Jan 7, 2026
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