Skip to content

Conversation

@dudong2
Copy link
Member

@dudong2 dudong2 commented Apr 15, 2025

Description

Closes: #XXXX


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

Reviewers Checklist

All items are required.
Please add a note if the item is not applicable
and please add your handle next to the items reviewed
if you only reviewed selected items.

I have...

  • added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • confirmed all author checklist items have been addressed
  • confirmed that this PR does not change production code
  • reviewed content
  • tested instructions (if applicable)
  • confirmed all CI checks have passed

@dudong2 dudong2 self-assigned this Apr 15, 2025
@dudong2 dudong2 requested a review from cloudgray April 16, 2025 04:48
@cloudgray
Copy link

I think testcode is needed.

In case of BLOBHASH and BLOBBASEFEE opcode, we don't hvae to care because it is only used for BlobTx type.

But in case of TLOAD, TSTORE, MCOPY, I think we can test minimal test cases using test contract below.

TLOAD & TSTORE

pragma solidity ^0.8.20;

contract TransientTest {
    function writeAndRead() public returns (uint256) {
        assembly {
            tstore(0x00, 0xdeadbeef)
            let val := tload(0x00)
            mstore(0x00, val)
            return(0x00, 0x20)
        }
    }
}

MCOPY

pragma solidity ^0.8.21;

contract MCopyTest {
    function copyMem() public pure returns (bytes memory) {
        assembly {
            mstore(0x00, 0x11223344556677889900aabbccddeeff)
            mstore(0x20, 0x0) // zero out dest
            mcopy(0x20, 0x00, 32) // copy 32 bytes
            return(0x20, 32)
        }
    }
}

Copy link

@cloudgray cloudgray left a comment

Choose a reason for hiding this comment

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

LGTM!

@dudong2 dudong2 merged commit e37bf10 into basechain/develop Apr 18, 2025
14 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants