You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. I have issues for this blockchain: Basecamp (testnet). Chain id: 123420001114
When I try to call a contract function, I get this error: Invalid v 2026866392 value for chain ID 123420001114. Invalid chain ID? (Eth::Chain::ReplayProtectionError)
Here is a snippet of my code. I use it with my contract but you can take another one, if you want, it doesn't really matter.
where N is the uint32 (max value is 4294967296). But v is larger than max uint32, so pack trims the bytes, rendering invalid signature.
When I replace [v].pack("N") with [v].pack("Q").reverse (N - is uint32 big endian, Q - is uint64 native endian, so I reverse the bytes order. Q> also should work for ruby > 1.9.4), the transaction broadcasts successfully.
Well, what are your thoughts on this? Seems like this is the solution but I dont really know if Q is safe to use here.
The text was updated successfully, but these errors were encountered:
airled
changed the title
Fail transactions for Basecamp testnet
Fail transact for large chain id?
May 29, 2025
Uh oh!
There was an error while loading. Please reload this page.
Hi there. I have issues for this blockchain:
Basecamp (testnet)
. Chain id:123420001114
When I try to call a contract function, I get this error:
Invalid v 2026866392 value for chain ID 123420001114. Invalid chain ID? (Eth::Chain::ReplayProtectionError)
Here is a snippet of my code. I use it with my contract but you can take another one, if you want, it doesn't really matter.
It raises
Invalid v 2026866391 value for chain ID 123420001114. Invalid chain ID? (Eth::Chain::ReplayProtectionError)
My thoughts on the issue.
As far as I understand, this error appears because of the large chain id.
When we call
to_v
hereeth.rb/lib/eth/key.rb
Line 76 in ad012f1
v
is246840002263
And then the lib tries to
[v].pack("N")
hereeth.rb/lib/eth/key.rb
Line 78 in ad012f1
where
N
is theuint32
(max value is4294967296
). Butv
is larger than maxuint32
, sopack
trims the bytes, rendering invalid signature.When I replace
[v].pack("N")
with[v].pack("Q").reverse
(N
- isuint32 big endian
,Q
- isuint64 native endian
, so I reverse the bytes order.Q>
also should work for ruby >1.9.4
), the transaction broadcasts successfully.Well, what are your thoughts on this? Seems like this is the solution but I dont really know if
Q
is safe to use here.The text was updated successfully, but these errors were encountered: