Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for sending type 3 transactions in solidity #15071

Open
PatrickAlphaC opened this issue May 1, 2024 · 0 comments
Open

Support for sending type 3 transactions in solidity #15071

PatrickAlphaC opened this issue May 1, 2024 · 0 comments
Labels

Comments

@PatrickAlphaC
Copy link
Contributor

Abstract

If I'm understanding correctly, solidity currently has support for the new BLOBHASH opcode, and can read from this and can call this opcode with blobhash yul.

However, it's not clear to me if I can send a type 3 transaction with blob data from solidity. Something like the following:

// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;

contract Hi {
    function doStuff() public {
        address randomAddress = address(57);
        randomAddress.call{blobData: hex"0x01"}
    }
}

Motivation

Mainly for foundry scripting this would be helpful. I can see a world where it doesn't make sense to support at the solidity level... Thinking about it more, it starting to make less sense to me, but wanted to make an issue anyways to verify this wouldn't be something the solidity language would support.

Specification

EIP specification:

BLOB_TX_TYPE | Bytes1(0x03)
-- | --
BYTES_PER_FIELD_ELEMENT | 32
FIELD_ELEMENTS_PER_BLOB | 4096
BLS_MODULUS | 52435875175126190479447740508185965837690552500527637822603658699938581184513
VERSIONED_HASH_VERSION_KZG | Bytes1(0x01)
POINT_EVALUATION_PRECOMPILE_ADDRESS | Bytes20(0x0A)
POINT_EVALUATION_PRECOMPILE_GAS | 50000
MAX_BLOB_GAS_PER_BLOCK | 786432
TARGET_BLOB_GAS_PER_BLOCK | 393216
MIN_BASE_FEE_PER_BLOB_GAS | 1
BLOB_BASE_FEE_UPDATE_FRACTION | 3338477
GAS_PER_BLOB | 2**17
HASH_OPCODE_BYTE | Bytes1(0x49)
HASH_OPCODE_GAS | 3
MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS | 4096

BLOB_TX_TYPE	Bytes1(0x03)
BYTES_PER_FIELD_ELEMENT	32
FIELD_ELEMENTS_PER_BLOB	4096
BLS_MODULUS	52435875175126190479447740508185965837690552500527637822603658699938581184513
VERSIONED_HASH_VERSION_KZG	Bytes1(0x01)
POINT_EVALUATION_PRECOMPILE_ADDRESS	Bytes20(0x0A)
POINT_EVALUATION_PRECOMPILE_GAS	50000
MAX_BLOB_GAS_PER_BLOCK	786432
TARGET_BLOB_GAS_PER_BLOCK	393216
MIN_BASE_FEE_PER_BLOB_GAS	1
BLOB_BASE_FEE_UPDATE_FRACTION	3338477
GAS_PER_BLOB	2**17
HASH_OPCODE_BYTE	Bytes1(0x49)
HASH_OPCODE_GAS	3
[MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS](https://github.com/ethereum/consensus-specs/blob/4de1d156c78b555421b72d6067c73b614ab55584/configs/mainnet.yaml#L148)	4096

Perhaps adding some functionality like the following would work.

randomAddress.call{tx_type: hex"0x03" /*(other variables here) */ }

I can see why this would be a bit silly, because the purpose of blobs is to not have the data on-chain, but putting it into the contract would redundantly place the data on-chain.

I can see a world where this isn't supported in solidity but only used as a cheatcode in foundry.

Backwards Compatibility

Since this is additive I don't think it would have an effect on anything prior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant