Skip to content

txframe blobify and persist#4220

Draft
advaita-saha wants to merge 22 commits into
masterfrom
txFrame-persist
Draft

txframe blobify and persist#4220
advaita-saha wants to merge 22 commits into
masterfrom
txFrame-persist

Conversation

@advaita-saha
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread execution_chain/db/storage_types.nim Outdated
Comment thread execution_chain/db/tx_frame_db.nim Outdated
Comment thread execution_chain/db/aristo/aristo_tx_blobify.nim Outdated
Comment thread execution_chain/db/aristo/aristo_tx_blobify.nim Outdated
Comment thread execution_chain/db/aristo/aristo_tx_blobify.nim Outdated
Comment thread execution_chain/db/aristo/aristo_tx_blobify.nim Outdated
pos += 2
v

template readU32BE(data: openArray[byte]; pos: var int): uint32 =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like every usage of readU16BE and readU32BE is immediately converted to an int. For readU16BE this is at least safe, but the various U32 fields read in necessarily compatible with signed 32-bit integers? It's true that the EL as a whole realistically probably can't target 32-bit platforms, but especially with some of the ZK efforts, it's proven, as it were, useful to retain 32-bit support for as much of the codebase as is feasible.

The calls for the U32 ones seem to be 100% for initTable, which seems like it could be either capped, or, maybe the values read in realistically won't be larger than a 32-bit signed int can store.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread execution_chain/db/tx_frame_db.nim Outdated
@tersec
Copy link
Copy Markdown
Contributor

tersec commented May 8, 2026

Is this diff cache pruned somewhere when base updates?

@advaita-saha
Copy link
Copy Markdown
Contributor Author

Is this diff cache pruned somewhere when base updates?

Not yet, but will
Logic would be to prune when we load the fcState

…int detour)

blob.len widened to uint64 for the bounds comparisons
aLen + 4 + 4 and kOff + 4 + kLen can't overflow uint64
int(...) only at the final blob.toOpenArray indexing — and by then the bounds check has guaranteed the value fits in int (since it's at most blob.len, itself an int)
@advaita-saha advaita-saha requested a review from tersec May 12, 2026 10:03
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.

2 participants