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

Consolidated EIP-4844 #5724

Merged
merged 3 commits into from
Jul 26, 2023
Merged

Consolidated EIP-4844 #5724

merged 3 commits into from
Jul 26, 2023

Conversation

jflo
Copy link
Contributor

@jflo jflo commented Jul 25, 2023

Implements EIP-4844.

  • introduces a Hardfork class to the protocol schedule system
  • new Engine APIs required for CL to work on 4844
  • refactors Engine API tests to reuse OR override prior versions
  • new DataGas type for tracking block cost for 4844 data
  • new VersionedHash type to reflect that a versioned hash is not quite a pure sha256
  • incorporates wrapped jc-kzg library for KZG point evaluations
  • New transaction type, and domain objects for constituent parts to represent the Blobs, KZGCommitments, and Proofs used for 4844
  • RLP encoders and decoders to support new transaction type
  • gas pricing calculators for the new type of gas
  • plugin-api version was changed

@github-actions
Copy link

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.
  • I thought about the changelog and included a changelog update if required.
  • If my PR includes database changes (e.g. KeyValueSegmentIdentifier) I have thought about compatibility and performed forwards and backwards compatibility tests

@@ -188,6 +189,7 @@
Hash.fromHexString(mixHash), // mixHash
Bytes.fromHexStringLenient(nonce).toLong(),
withdrawalsRoot != null ? Hash.fromHexString(withdrawalsRoot) : null,
dataGasUsed != null ? Long.parseLong(dataGasUsed) : 0,

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
@@ -341,6 +389,98 @@
return INVALID;
}

protected ValidationResult<RpcErrorType> validateForkSupported(
final Object id, final EnginePayloadParameter payloadParameter) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'id' is never used.
jflo and others added 3 commits July 26, 2023 10:35
* introduces a Hardfork class to the protocol schedule system
* new Engine APIs required for CL to work on 4844
* new DataGas type for tracking block cost for 4844 data
* new VersionedHash type to reflect that a versioned hash is not quite a pure sha256
* incorporates wrapped jc-kzg library for KZG point evaluations
* New transaction type, and domain objects for constituent parts to represent the Blobs, KZGCommitments, and Proofs used for 4844
* RLP encoders and decoders to support new transaction type
* gas pricing calculators for the new type of gas
* plugin-api version was changed

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Signed-off-by: Justin Florentine <justin+github@florentine.us>
Cancun gas claculator was inheriting from london, should have been shanghai.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
@jflo jflo marked this pull request as ready for review July 26, 2023 14:53
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

LGTM

if (!forkValidationResult.isValid()) {
return new JsonRpcErrorResponse(reqId, forkValidationResult.getInvalidReason());
}
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

is this left in deliberately?

VersionedHash.SHA256_VERSION_ID, Sha256Hash.hash(commitment));
}

*/
Copy link
Contributor

Choose a reason for hiding this comment

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

deliberately left in here?

/** Calculates the excess data gas for a parent block header. */
public class ExcessDataGasCalculator {
/**
* public class ExcessDataGasCalculator { /** Calculates the excess data gas for a parent block
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* public class ExcessDataGasCalculator { /** Calculates the excess data gas for a parent block
* Calculates the excess data gas for a parent block

@@ -147,6 +147,6 @@ public void implementsDataFeedShouldReturnFalse() {

@Test
public void dataPriceShouldReturnsZero() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public void dataPriceShouldReturnsZero() {
public void dataPricePerGasShouldReturnZero() {

Copy link
Contributor

Choose a reason for hiding this comment

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

lol

@jflo jflo merged commit 1c099e8 into hyperledger:main Jul 26, 2023
8 checks passed
@jflo jflo mentioned this pull request Jul 26, 2023
@garyschulte
Copy link
Contributor

congrats @jflo, a monumental merge

elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
* Implements EIP-4844.

* introduces a Hardfork class to the protocol schedule system
* new Engine APIs required for CL to work on 4844
* new DataGas type for tracking block cost for 4844 data
* new VersionedHash type to reflect that a versioned hash is not quite a pure sha256
* incorporates wrapped jc-kzg library for KZG point evaluations
* New transaction type, and domain objects for constituent parts to represent the Blobs, KZGCommitments, and Proofs used for 4844
* RLP encoders and decoders to support new transaction type
* gas pricing calculators for the new type of gas
* plugin-api version was changed

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>

* junit5 updates

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* update t8n test

Cancun gas claculator was inheriting from london, should have been shanghai.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>

---------

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Co-authored-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
garyschulte added a commit to garyschulte/besu that referenced this pull request Aug 28, 2023
* Implements EIP-4844.

* introduces a Hardfork class to the protocol schedule system
* new Engine APIs required for CL to work on 4844
* new DataGas type for tracking block cost for 4844 data
* new VersionedHash type to reflect that a versioned hash is not quite a pure sha256
* incorporates wrapped jc-kzg library for KZG point evaluations
* New transaction type, and domain objects for constituent parts to represent the Blobs, KZGCommitments, and Proofs used for 4844
* RLP encoders and decoders to support new transaction type
* gas pricing calculators for the new type of gas
* plugin-api version was changed

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>

* junit5 updates

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* update t8n test

Cancun gas claculator was inheriting from london, should have been shanghai.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>

---------

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Co-authored-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
garyschulte added a commit to garyschulte/besu that referenced this pull request Aug 28, 2023
* Implements EIP-4844.

* introduces a Hardfork class to the protocol schedule system
* new Engine APIs required for CL to work on 4844
* new DataGas type for tracking block cost for 4844 data
* new VersionedHash type to reflect that a versioned hash is not quite a pure sha256
* incorporates wrapped jc-kzg library for KZG point evaluations
* New transaction type, and domain objects for constituent parts to represent the Blobs, KZGCommitments, and Proofs used for 4844
* RLP encoders and decoders to support new transaction type
* gas pricing calculators for the new type of gas
* plugin-api version was changed

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>

* junit5 updates

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* update t8n test

Cancun gas claculator was inheriting from london, should have been shanghai.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>

---------

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Co-authored-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
garyschulte added a commit to garyschulte/besu that referenced this pull request Aug 28, 2023
* Implements EIP-4844.

* introduces a Hardfork class to the protocol schedule system
* new Engine APIs required for CL to work on 4844
* new DataGas type for tracking block cost for 4844 data
* new VersionedHash type to reflect that a versioned hash is not quite a pure sha256
* incorporates wrapped jc-kzg library for KZG point evaluations
* New transaction type, and domain objects for constituent parts to represent the Blobs, KZGCommitments, and Proofs used for 4844
* RLP encoders and decoders to support new transaction type
* gas pricing calculators for the new type of gas
* plugin-api version was changed

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>

* junit5 updates

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* update t8n test

Cancun gas claculator was inheriting from london, should have been shanghai.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>

---------

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Co-authored-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Signed-off-by: garyschulte <garyschulte@gmail.com>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
* Implements EIP-4844.

* introduces a Hardfork class to the protocol schedule system
* new Engine APIs required for CL to work on 4844
* new DataGas type for tracking block cost for 4844 data
* new VersionedHash type to reflect that a versioned hash is not quite a pure sha256
* incorporates wrapped jc-kzg library for KZG point evaluations
* New transaction type, and domain objects for constituent parts to represent the Blobs, KZGCommitments, and Proofs used for 4844
* RLP encoders and decoders to support new transaction type
* gas pricing calculators for the new type of gas
* plugin-api version was changed

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>

* junit5 updates

Signed-off-by: Justin Florentine <justin+github@florentine.us>

* update t8n test

Cancun gas claculator was inheriting from london, should have been shanghai.

Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>

---------

Signed-off-by: Justin Florentine <justin+github@florentine.us>
Signed-off-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Co-authored-by: Jiri Peinlich <jiri.peinlich@gmail.com>
Co-authored-by: Jason Frame <jason.frame@consensys.net>
Co-authored-by: garyschulte <garyschulte@gmail.com>
Co-authored-by: Fabio Di Fabio <fabio.difabio@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
Co-authored-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
Co-authored-by: Gabriel-Trintinalia <gabriel.trintinalia@consensys.net>
Co-authored-by: Stefan <stefan.pingel@consensys.net>
Co-authored-by: spencer-tb <spencer@spencertaylorbrown.uk>
Co-authored-by: Danno Ferrin <danno.ferrin@swirldslabs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants