Summary
hyptest truncates QRVM log topics from 64 bytes to 32 bytes before semantic event formatting. The QRVM host records the complete qrvmc::bytes64 topic, so this affects the test harness and can hide errors in the upper half of indexed values.
Affected path
ExecutionFramework::recordedLogs() transforms each qrvmc::bytes64 topic through QRVMHost::convertFromQRVMC(), which returns an h256. LogRecord::topics is also declared as std::vector<h256>.
Minimal reproduction
contract C {
event Pair(address indexed first, address indexed second);
function emitPair(address first, address second) public {
emit Pair(first, second);
}
}
Call emitPair with two 64-byte addresses that have the same first 32 bytes and different final 32 bytes. Raw QRVMC log inspection retains both halves of both topics. The current semantic output prints only the first half, so the two indexed values appear identical. The same truncation formats a right-aligned indexed uint256(2) as zero.
Expected behavior
hyptest must preserve all 64 topic bytes. For an indexed address, semantic output should contain Q followed by all 128 hexadecimal digits. Event signature matching should continue to compare the 32-byte Keccak digest left-aligned in the 64-byte topic.
Suggested fix
- Store recorded topics as
h512.
- Copy all bytes from
qrvmc::bytes64 into the test record.
- Match non-anonymous event signatures against a left-aligned
h512 digest.
- Format indexed addresses from the complete 64-byte topic.
- Keep the existing 32-byte digest interpretation for indexed dynamic and composite values where the ABI stores a hash.
Validation target
Add a semantic regression with two indexed 64-byte addresses whose upper or lower halves differ. Run it under legacy and via-IR codegen with default and optimized execution, then run the existing events suite to update any expectations that previously encoded the truncation. A local full-width recorder fix passes the two-address regression in all four modes, the 42-case event suite in default and optimized modes, and the full default semantic suite with 1,468 of 1,468 cases.
Impact
This does not indicate production QRVM topic truncation. It is a test-oracle defect: semantic tests can pass while failing to observe differences in bytes 32 through 63 of an indexed topic.
Summary
hyptesttruncates QRVM log topics from 64 bytes to 32 bytes before semantic event formatting. The QRVM host records the completeqrvmc::bytes64topic, so this affects the test harness and can hide errors in the upper half of indexed values.Affected path
ExecutionFramework::recordedLogs()transforms eachqrvmc::bytes64topic throughQRVMHost::convertFromQRVMC(), which returns anh256.LogRecord::topicsis also declared asstd::vector<h256>.Minimal reproduction
Call
emitPairwith two 64-byte addresses that have the same first 32 bytes and different final 32 bytes. Raw QRVMC log inspection retains both halves of both topics. The current semantic output prints only the first half, so the two indexed values appear identical. The same truncation formats a right-aligned indexeduint256(2)as zero.Expected behavior
hyptestmust preserve all 64 topic bytes. For an indexedaddress, semantic output should containQfollowed by all 128 hexadecimal digits. Event signature matching should continue to compare the 32-byte Keccak digest left-aligned in the 64-byte topic.Suggested fix
h512.qrvmc::bytes64into the test record.h512digest.Validation target
Add a semantic regression with two indexed 64-byte addresses whose upper or lower halves differ. Run it under legacy and via-IR codegen with default and optimized execution, then run the existing events suite to update any expectations that previously encoded the truncation. A local full-width recorder fix passes the two-address regression in all four modes, the 42-case event suite in default and optimized modes, and the full default semantic suite with 1,468 of 1,468 cases.
Impact
This does not indicate production QRVM topic truncation. It is a test-oracle defect: semantic tests can pass while failing to observe differences in bytes 32 through 63 of an indexed topic.