-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure Nimbus doesn't overflow converting uint64
to int64
#2366
Comments
as I was mentioning in the libp2p issue, using |
https://news.ycombinator.com/item?id=14174958 580/2 years.. maybe it's ok after all. |
Yeah, none of these are really immediate, practical issues. Some are probably fine (e.g., the SSZ one likely is, because those HashLists/Arrays only get bounds up to 2^40 in Eth2) in principle. Others are fine for hundreds or thousands of years. Others have pretty benign failure modes (the genesis time one). The libp2p thing is a real edge case. The point is to collect all of them, so they can be prioritized and addressed. As regards whether unsigned or signed is a better representation, this comes up in https://github.com/status-im/nim-chronos/blob/master/chronos/timer.nim where converts that back to a signed 64-bit integer. So the underlying source of |
status-im/nim-eth#332 isn't part of nbc or its dependencies, so doesn't block updating to 1.2.10. Removing from this issue. |
#2398 addresses the DbSeq one. At this point, what remains either I didn't discover for this bug or is the libp2p one, which shouldn't block the 1.2.10 update, and if people want to keep track of it, can track vacp2p/nim-libp2p#538 directly, so there's little remaining use for this issue. |
nim-lang/Nim#15210 renders this more acute in order to update to Nim 1.2.10 or later.
handlePrune
(handlePrune()
potentially overflowsint64
vacp2p/nim-libp2p#538)if target.int64 <= minTargetEpoch
,if int64(slot) <= minSlot
,SlashingProtectionDB_v2
type usingint64
rather thanuint64
for its prepared SQL statements' types, etc)unixGenesis = fromUnix(genesis_time.int64)
intime.nim
(low-priority, because it's effectively statically verifiable data made at chain creation time, so nbc can just not support chains made by people who insist on silly timestamps in the far future; it's not an attack vector the way the rest of these could be)SyncInfo(head_slot: headSlot, sync_distance: int64(wallSlot - headSlot))
)let queryRes = s.selectStmt.exec(int64(idx) + 1) do (recordBytes: openArray[byte]):
whereidx
is auint64
)nextPow2Int64
function, but also elsewherelayer(nextPow2(a.maxChunks.uint64).int64)
)The text was updated successfully, but these errors were encountered: