Repository navigation
platform: copy 64 bytes per memcpy iteration on OpenVM - #10
Merged
maximmenshikov merged 1 commit intoNov 21, 2026
Merged
Conversation
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.
Changes
__wrap_memcpyinplatform/entry.Scopies 64 bytes per loop iteration while 64 or more bytes are left, then at most one 32-byte block, then 8-byte words, as before.__wrap_memmovestill tail-calls__wrap_memcpyfor forward copies. The 64-byte loop reads each 32-byte half before it stores it, as the 32-byte loop did, so a destination below the source still reads every source byte before it overwrites it.Measurement
OpenVM metered cost (
execute_metered_cost, trace cells) and instret of the Nethermind stateless guest on 5 mainnet blocks (4.5 to 60 Mgas). Both arms link the samelibopenvm.a; onlyopenvm_entry.odiffers. The zkVM is deterministic, so one run per arm is exact. Both arms commit the same public values on every block.Small blocks gain the most, because copies are a larger share of their work.
Tests
tests/platform/run.shpasses under qemu-user: memcpy at every source and destination offset 0-15 and length 0-600, memmove forward, reverse and overlapping at -40 to +40 bytes, memset.