Changes to rlp project to accomodate bytes v2#56
Draft
lu-pinto wants to merge 5 commits intoConsensys:mainfrom
Draft
Changes to rlp project to accomodate bytes v2#56lu-pinto wants to merge 5 commits intoConsensys:mainfrom
lu-pinto wants to merge 5 commits intoConsensys:mainfrom
Conversation
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>
Signed-off-by: Luis Pinto <luis.pinto@consensys.net>
| @Override | ||
| public byte get(int i) { | ||
| return this.value; | ||
| } |
There was a problem hiding this comment.
Bug: Missing bounds check in ConstantBytesValue get method
The get method in ConstantBytesValue returns the constant value without validating that the index i is within bounds. This allows out-of-bounds access without throwing an IndexOutOfBoundsException, violating the contract established by other Bytes implementations like ArrayWrappingBytes which properly validate indices. The method should check that i is between 0 and size() before returning the value.
|
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
|
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR description
Changes to project
rlpto accomodate bytes v2.Note
Introduces v2 implementations for bytes, RLP, and bigints units with comprehensive tests and JMH benchmarks, and adds JMH plugin/configuration to the build.
me.champeau.jmhplugin with configurablejmhtask, async-profiler options, and compiler flags inbuild.gradle.org.assertj:assertj-core._strListCmdArg,_strCmdArg).org/apache/tuweni/v2/bytes):BytesAPI with array/buffer/bytebuf wrappers, concatenation, mutable variant, and utilities.ArrayWrappingBytes,BufferWrappingBytes,ByteBufWrappingBytes,ByteBufferWrappingBytes,MutableBytes,ConstantBytesValue,ConcatenatedBytes,DelegatingBytes,Utils.bytes/src/jmh/...).org/apache/tuweni/v2/rlp):RLP,RLPReader,RLPWriter,BytesRLPReader/Writer,ByteBufferRLPWriter,AccumulatingRLPWriter,DelegatingRLPWriter.org/apache/tuweni/v2/units/bigints):UInt32,UInt64,UInt256,UInt384with arithmetic/bitwise ops and utils.Written by Cursor Bugbot for commit 286c7e6. This will update automatically on new commits. Configure here.