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.
Issue 1
The revive node currently enforces a hard byte-size limit on the host function that processes LOG data, more specifically, the condition (
len > max_value_size()
) and halts withInvalidOperandOOG
. This diverges from mainnet Ethereum behavior and REVM defaults, where LOG opcodes are limited by gas and memory expansion, not by an explicit byte cap. The cap causes otherwise valid contracts to fail on when deploying evm bytecode to the revive node.Consider the below scenario
On mainnet Ethereum, LOG opcodes charge a base cost, per-topic cost, and per-byte cost for the data region. There is no protocol-level size cap on the data payload. Execution succeeds if the caller can afford gas and memory.
REVM follows this model. It validates topic count (≤ 4) and charges gas. It does not impose a maximum data length by default.
Inside pallet revive host.rs,
log<N>
adds:This check triggers before or around the gas accounting. The next line already charge:
This is a problem because valid bytecode that emits larger events fails on when deployed to the revive node with
InvalidOperandOOG
Example from logs:
This is observable with a minimal reproduction:
What shpuld be happening is:
What is actually happening
InvalidOperandOOG
The impact of this cap it breaks portability of contracts and tests that are otherwise conformant with Ethereum, preventing certain standard patterns (batch events, structured audit logs, and larger metadata) from working and and and and
Ideally, we would want to as a suggestion for TESTING:
Remove the cap
Delete the
max_value_size
check.Keep existing metering:
Issue 2
[Add description tomorrow]
Issue 3
[Add description sometime later]
scc branch used: https://github.com/paritytech/scc-testing/tree/spha/minor-fix
Note
The explanation above still needs work but posting for visibility