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

Add blobhash inside the tx context: blobhash(uint index) --> tx.blobhash(uint index) #14889

Closed
invocamanman opened this issue Feb 27, 2024 · 4 comments
Labels

Comments

@invocamanman
Copy link

Abstract / Motivation

The blob hash is an opcode that depends on the transaction, similar to the tx.origin or tx.gasprice. I think it's more consistent to access it inside the tx context

Specification

Blobhash opcode should be access in solidity like: tx.blobhash(uint index) returns (bytes32)

Backwards Compatibility

An alias could be made to be backwards compatibility but i don't think it's necessary

@r0qs
Copy link
Member

r0qs commented Feb 27, 2024

Hi @invocamanman, thanks for opening the issue, but similarly to block.blockhash() which was removed in Solidity version 0.5.0 in favor of the global free function blockhash() we prefer to keep blobhash() as free function as well.

@r0qs r0qs closed this as not planned Won't fix, can't repro, duplicate, stale Feb 27, 2024
@invocamanman
Copy link
Author

invocamanman commented Feb 28, 2024

Hey!^^ thanks for the answer :D

The blockhash is not an opcode depending on the metadata/data of the current executing block, but a opcode that retrieve information from previous blocks of the blockchain. So i think it's accurate to put it outside the block context.

( It's true tho that the block number of the current block might depend the execution of this opcode, since only can retrieve the hash of the last 256, but since it's retrieving "other information" than the current executing block, i think it's more accurate the way it is and see the 256 as a limitation)

The blobhash instead make reference only to the current executing transaction. And the index is referring to the blobs of the executing transaction as well.

@r0qs
Copy link
Member

r0qs commented Feb 28, 2024

Hi @invocamanman, while I agree with your point about including blobhash as a member of tx, having these members of global magic variables (e.g. block, tx, etc) as global free functions would simplify the implementation of our planned Solidity standard library (refer to: #10282 for additional context). Therefore, we prefer to not introduce this feature now, as it would require breaking changes in the near future.

@invocamanman
Copy link
Author

oki ^^ it makes sense

Thanks for the answers ^^

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

2 participants