BigInteger RLP bug
See original GitHub issue@Test
fun testBigIntRLP() {
val bigInt = BigInteger.valueOf(54408193066555392L)
val rlp = bigInt.toRLP()
println(rlp.bytes.size)
val bitInt1 = rlp.toBigIntegerFromRLP()
Assert.assertEquals(bigInt, bitInt1)
}
7
java.lang.AssertionError:
Expected :54408193066555392
Actual :-17649400971372544
same as #49
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
A big bug in TransactionEncode.encode()!!! #562 - GitHub
public static RlpString create(BigInteger value) { // RLP encoding only supports positive integer values if (value.signum() < 1) { return ...
Read more >rlp - Go Packages
If the RLP string is larger than the bit size of the type, decoding will return an error. Decode also supports *big.Int. There...
Read more >rlp::DecoderError - Rust - Docs.rs
Error concerning the RLP decoder. Variants. RlpIsTooBig. [−] Expand description. Data has additional bytes at the end of the valid ...
Read more >net.consensys.cava.rlp.RLPReader.readValue java code examples ...
Read a UInt256 value from the RLP source. isLenient. Determine if this reader is lenient by default. A non-lenient reader will throw InvalidRLPEncodingEx....
Read more >rlp - crates.io: Rust Package Registry
rlp. Recursive-length prefix encoding, decoding, and compression ... Pure Rust implementation of a big integer library which has been designed from the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I will go this way for now. So it is more correct - but we loose one feature for now. Did not yet find a way to support signed bigintegers - happy about ideas there.
thanks for the follow-up. Yea unsigned solves the problem - but still not yet sure how a good fix looks like. Perhaps just allowing unsigned … So I would propose this:
what do you think?