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

Blob gas info in receipts #5767

Merged
merged 10 commits into from
Jun 6, 2023

Conversation

deffrian
Copy link
Contributor

@deffrian deffrian commented Jun 4, 2023

Fixes Closes Resolves #
ethereum/execution-apis#398

Changes

  • DataGasUsed and DataGasPrice

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

@flcl42 flcl42 changed the base branch from feature/eip-4844-v6 to feature/eip-4844-gas-calculations June 5, 2023 08:54
Comment on lines 82 to 89
UInt256 effectiveGasPrice = t.CalculateEffectiveGasPrice(isEip1559Enabled, block.BaseFeePerGas);
UInt256? dataGasPrice = null;
ulong? dataGasUsed = null;
if (t.SupportsBlobs)
{
dataGasPrice = IntrinsicGasCalculator.CalculateDataGasPrice(block.Header, t);
dataGasUsed = IntrinsicGasCalculator.CalculateDataGas(t);
}
Copy link
Member

Choose a reason for hiding this comment

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

This code seems to get duplicated. Maybe lets calculate TxGasInfo in one call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean something like tx.GetGasInfo()?

@@ -45,4 +45,23 @@ public interface IBlockchainBridge : ILogFinder
void RunTreeVisitor(ITreeVisitor treeVisitor, Keccak stateRoot);

}

public class TxGasInfo
Copy link
Member

Choose a reason for hiding this comment

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

struct

Comment on lines 844 to 847
if (postEip4844)
blockchainBridge.GetReceiptAndGasInfo(Arg.Any<Keccak>()).Returns((receipt, new(UInt256.One, 2, 3), 0));
else
blockchainBridge.GetReceiptAndGasInfo(Arg.Any<Keccak>()).Returns((receipt, new(UInt256.One), 0));
Copy link
Member

Choose a reason for hiding this comment

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

would prefer blockchainBridge.GetReceiptAndGasInfo(Arg.Any<Keccak>()).Returns((receipt, postEip4844 ? new(UInt256.One, 2, 3) : new(UInt256.One), 0));

Nikita Mescheryakov added 2 commits June 5, 2023 22:25
…s' into feature/eip-4844-dataGas

# Conflicts:
#	src/Nethermind/Nethermind.Evm/IntrinsicGasCalculator.cs
@deffrian deffrian merged commit 7d0de36 into feature/eip-4844-gas-calculations Jun 6, 2023
@deffrian deffrian deleted the feature/eip-4844-dataGas branch June 6, 2023 08:52
flcl42 pushed a commit that referenced this pull request Jun 7, 2023
* Blob gas info in receipts

* Fix gas price

* Fix spaces

* Add tests

* Supports blobs

* Ignore on null

* Fix suggestions

* Fix build

---------

Co-authored-by: Nikita Mescheryakov <[email protected]>
flcl42 pushed a commit that referenced this pull request Jun 12, 2023
* Blob gas info in receipts

* Fix gas price

* Fix spaces

* Add tests

* Supports blobs

* Ignore on null

* Fix suggestions

* Fix build

---------

Co-authored-by: Nikita Mescheryakov <[email protected]>
flcl42 added a commit that referenced this pull request Jun 30, 2023
* Add data gas calculations

* ChainSpecs/BlockProcessing: Fix syncing on Genesis block due to ExcessDataGas mismatch.

* TxValidator: Move KZG version check into network wrapper verification.

* ExcessData gas on genesis block

* Check versioned hash earlier

* Remake gas, preview

* Fix recursion

* Add tests, refactor

* Get rid of parent block header finder

* Clean up

* Clean up checks

* Fix tests

* Fix header mapping to rpc

* Fix data gas calculations

* Add safety checks

* Fix and improve

* Blob gas info in receipts (#5767)

* Blob gas info in receipts

* Fix gas price

* Fix spaces

* Add tests

* Supports blobs

* Ignore on null

* Fix suggestions

* Fix build

---------

Co-authored-by: Nikita Mescheryakov <[email protected]>

* Increase data gas limits

* Clean up

* Add more blob space

* Fix tests; clean up

* Add tests, refacator

* Fix MaxFeePerDataGas affects consensus on low balance

* Improve max fee per data gas fix

* Fix receipts

* Add overflow checks

* Fix tests

* Fix encoding; improve text; clean up

* Add gas fields to the local 4844 network genesis

* Refactor BlockValidator

* Add additional check

---------

Co-authored-by: spencer-tb <[email protected]>
Co-authored-by: Nikita Mescheryakov <[email protected]>
Co-authored-by: Nikita Mescheryakov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants