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

Staging branch for devnet 4 #7607

Open
wants to merge 646 commits into
base: master
Choose a base branch
from
Open

Staging branch for devnet 4 #7607

wants to merge 646 commits into from

Conversation

ak88
Copy link
Contributor

@ak88 ak88 commented Oct 15, 2024

Closes #7525
Closes #7524
Closes #7522
Resolves #7521

Changes

Implements changes from

Types of changes

  • PR modifies two existing engine APIs : engine_getPayloadV4 and engine_getPayloadV4, It incorporates suggestions from pectra-devnet4 doc, which was to exchange requests as a side car and remove them from the block body
  • It removes two engine APIs: engine_getPayloadBodiesByRangeV2 and engine_getPayloadBodiesByHashV2 and all related objects and handlers, which are now obsolete.
  • It introduces a new processor called IExecutionRequestsProcess and gets rid of all kinds of exiting requests processors.
  • Add support for flat request encoding and therefore, a new way for RequestsHash calculation, more info at: https://eips.ethereum.org/EIPS/eip-7685

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

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Few more tests are yet to be written after a few rounds of discussions.

Documentation

Requires documentation update

  • Yes
  • No

Remarks

Please verify the requestsHash calculation, which should be done as follow:

def compute_requests_hash(requests):
    m = sha256()
    for r in requests:
        m.update(sha256(r))
    return m.digest()

block.header.requests_hash = compute_requests_hash(requests)

MarekM25 and others added 30 commits September 16, 2024 14:42
(cherry picked from commit df5ba74)
(cherry picked from commit 77f2423)
(cherry picked from commit bf81101)
(cherry picked from commit 3d94703)
(cherry picked from commit 7dbfcc3)
(cherry picked from commit 0cc3cfe)
(cherry picked from commit 021792d)
(cherry picked from commit f65e216)
(cherry picked from commit 29ea2ec)
(cherry picked from commit 6625445)
(cherry picked from commit 2f70584)
(cherry picked from commit 0da8f10)
(cherry picked from commit e043ac7)
(cherry picked from commit 215628a)
(cherry picked from commit 3b8d8fa)
(cherry picked from commit 62dfc7f)
(cherry picked from commit 3dbb0ef)
(cherry picked from commit 419d727)
(cherry picked from commit 19f3ad5)
(cherry picked from commit 5c1e3dc)
(cherry picked from commit 0739aaa)
This reverts commit 19f3ad5.

(cherry picked from commit d18d4ea)
(cherry picked from commit bf78353)
(cherry picked from commit 6380314)
(cherry picked from commit cf58cd2)
(cherry picked from commit 7974a8b)
@rjnrohit rjnrohit marked this pull request as ready for review October 18, 2024 03:46
}
}

public static ArrayPoolList<byte[]> GetFlatEncodedRequests(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this structure really needed in the block itself?

Copy link
Contributor

Choose a reason for hiding this comment

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

do you mean, is there need to specify ExecutionRequests field in the block ?

It is a workaround to to populate ExecutionRequests in GetPayloadResultV4, which is returned by engine_getPaylaodV4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, i can see that. I was thinking maybe we could isolate it to being in IBlockProductionContext in the cache or something like that.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I was thinking to isolate it, but it would've required to create a wrapper to a block so that result of

Processor.Process(block, ProcessingOptions.ProducingBlock, blockTracer ?? NullBlockTracer.Instance);
contains the requests. Moreover, changes at many places would have to be done, all the way up to the blockProcessor step.

To avoid all of these complexities, I chose to create a new field under Block class

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