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 DATAHASH opcode #4894

Merged
merged 316 commits into from Jan 21, 2023
Merged

Add DATAHASH opcode #4894

merged 316 commits into from Jan 21, 2023

Conversation

flcl42
Copy link
Contributor

@flcl42 flcl42 commented Nov 11, 2022

Depends on #4867

Add a new opcode according to https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md#opcode-to-get-versioned-hashes

Changes:

  • Add DATAHASH opcode

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Testing

Requires testing

  • Yes
  • No

In case you checked yes, did you write tests??

  • Yes
  • No

Comments about testing , should you have some (optional)

Further comments (optional)

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

rubo and others added 30 commits November 2, 2022 23:36
…b.com/nethermindeth/nethermind into feature/shanghai-eip-4895-withdrawals

# Conflicts:
#	src/Nethermind/Nethermind.Blockchain.Test/Proofs/WithdrawalTrieTests.cs
#	src/Nethermind/Nethermind.Consensus/Processing/BlockProcessor.cs
#	src/Nethermind/Nethermind.Consensus/Withdrawals/IWithdrawalApplier.cs
#	src/Nethermind/Nethermind.Consensus/Withdrawals/ProductionWithdrawalApplier.cs
#	src/Nethermind/Nethermind.Consensus/Withdrawals/ValidationWithdrawalApplier.cs
#	src/Nethermind/Nethermind.Core/BlockHeader.cs
#	src/Nethermind/Nethermind.Core/Specs/IReleaseSpec.cs
#	src/Nethermind/Nethermind.Merge.Plugin.Test/EngineModuleTests.V2.cs
#	src/Nethermind/Nethermind.Serialization.Rlp/WithdrawalDecoder.cs
#	src/Nethermind/Nethermind.Specs/Forks/15_Shanghai.cs
#	src/Nethermind/Nethermind.State/Proofs/WithdrawalTrie.cs
…ion_fix' into feature/shanghai-eip-4895-withdrawals

# Conflicts:
#	src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainParameters.cs
#	src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecBasedSpecProvider.cs
#	src/Nethermind/Nethermind.Specs/ChainSpecStyle/ChainSpecLoader.cs
#	src/Nethermind/Nethermind.Specs/ChainSpecStyle/Json/ChainSpecParamsJson.cs
@flcl42 flcl42 marked this pull request as ready for review January 19, 2023 09:51
@@ -110,9 +110,9 @@ protected TestAllTracerWithOutput Execute(params byte[] code)
return tracer;
}

protected TestAllTracerWithOutput Execute(long blockNumber, long gasLimit, byte[] code, long blockGasLimit = DefaultBlockGasLimit, ulong timestamp = 0)
protected TestAllTracerWithOutput Execute(long blockNumber, long gasLimit, byte[] code, long blockGasLimit = DefaultBlockGasLimit, ulong timestamp = 0, byte[][] blobVersionedHashes = null)
Copy link
Member

Choose a reason for hiding this comment

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

Only tests, but I would consider creating some container (class) for those parameters, to easier evolve them in the future.

Copy link
Contributor Author

@flcl42 flcl42 Jan 20, 2023

Choose a reason for hiding this comment

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

Do you mean just blobVersionedHashes? Or all the stuff like blobVersionedHashes, blobs, kzgs, proof?
blobVersionedHashes byte[][] type looks OK for me, may be UIn256t[] could look better, but would bring redundant type conversions
blobVersionedHashes is always a block part, but blobs, kzgs and proof may be considered as a separate thing, that exists until passed to CL. Still I'd give a try to flat transaction structure, we can easily change in the future without problems with serialization anyway

Copy link
Member

Choose a reason for hiding this comment

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

All parameters, when your method starts to take more than 4-5 it is time to make them into a class/struct of their own. It is nothing crucial and can stay as is, just providing a tip.

@flcl42 flcl42 force-pushed the feature/add-datahash-opcode branch from 2e1fe41 to 4c84274 Compare January 20, 2023 15:35
Base automatically changed from feature/add-blob-spec-fork-and-fields to master January 21, 2023 15:16
@flcl42 flcl42 merged commit 6fe2983 into master Jan 21, 2023
@flcl42 flcl42 deleted the feature/add-datahash-opcode branch January 21, 2023 15:51
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.

None yet

8 participants