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 changes for flat encoding #7516

Closed
wants to merge 554 commits into from
Closed

add changes for flat encoding #7516

wants to merge 554 commits into from

Conversation

rjnrohit
Copy link
Contributor

@rjnrohit rjnrohit commented Sep 30, 2024

Resolves #7522

Please choose one of the keywords above to refer to the issue this PR solves followed by the issue number (e.g. Fixes #000). If no issue number, remove the line. Also, remove everything marked optional that is not applicable. Remove this note after reading.

Changes

  • List the changes

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

Notes on testing

Optional. Remove if not applicable.

Documentation

Requires documentation update

  • Yes
  • No

If yes, link the PR to the docs update or the issue with the details labeled docs. Remove if not applicable.

Requires explanation in Release Notes

  • Yes
  • No

If yes, fill in the details here. Remove if not applicable.

Remarks

Optional. Remove if not applicable.

rjnrohit and others added 30 commits May 7, 2024 17:19
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
Co-authored-by: Kamil Chodoła <43241881+kamilchodola@users.noreply.github.com>
Co-authored-by: nethermind-machine <76107542+nethermind-machine@users.noreply.github.com>
Co-authored-by: LukaszRozmej <LukaszRozmej@users.noreply.github.com>
Co-authored-by: Daniel Kyutae Jung <45947071+pxyxyrus@users.noreply.github.com>
Co-authored-by: Ahmad Bitar <33181301+smartprogrammer93@users.noreply.github.com>
Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com>
Co-authored-by: Amirul Ashraf <asdacap@gmail.com>
Co-authored-by: yerke26 <160018032+yerke26@users.noreply.github.com>
Co-authored-by: yeerke <ezhumalin01@gmail.com>
Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com>
Co-authored-by: Alexey <me@flcl.me>
Co-authored-by: Nikita Mescheryakov <root@nikitam.io>
Co-authored-by: Lautaro Emanuel <31224949+emlautarom1@users.noreply.github.com>
Co-authored-by: Marcos Antonio Maceo <35319980+stdevMac@users.noreply.github.com>
Co-authored-by: ak88 <anders@nethermind.io>
Co-authored-by: Yaroslav Kukharuk <i.kukharuk@gmail.com>
Co-authored-by: Marek Moraczyński <marekm2504@gmail.com>
Co-authored-by: Ahmad Bitar <amb014@diyarme.com>
Co-authored-by: Oleg Jakushkin <oleg.jakushkin@gmail.com>
Co-authored-by: Kamil Chodoła <kamil@nethermind.io>
Co-authored-by: healthyyyoung <healthyoung@proton.me>
Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

So many allocations!

@rjnrohit rjnrohit marked this pull request as draft September 30, 2024 10:52
@rjnrohit
Copy link
Contributor Author

So many allocations!

Requesting for re-review, addressed this issue in the latest commits

Copy link
Member

@LukaszRozmej LukaszRozmej left a comment

Choose a reason for hiding this comment

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

Why not just use RlpDecoders?

@rjnrohit
Copy link
Contributor Author

rjnrohit commented Sep 30, 2024

Why not just use RlpDecoders?

https://eips.ethereum.org/EIPS/eip-7685#execution-layer
Requests will be encoded as request_type prepended to an opaque byte array request_data. So I'm rlp decoding a list of byte arrays then decoding a request from the byte array

@LukaszRozmej
Copy link
Member

Why not just use RlpDecoders?

https://eips.ethereum.org/EIPS/eip-7685#execution-layer Requests will be encoded as request_type prepended to an opaque byte array request_data. So I'm rlp decoding a list of byte arrays then decoding a request from the byte array

Sounds like something our RlpDecoder infrastructure could support, add decoder for external list, and then call internal decoders for decoding items dependent on type. No byte array allocation needed, everything done on one pooled buffer through NettyRlpStream

int requestsLength = rlpStream.ReadSequenceLength();
int requestsCheck = rlpStream.Position + requestsLength;
// read an array of byte arrays
byte[][] requestsEncoded = rlpStream.DecodeByteArrays();
Copy link
Member

Choose a reason for hiding this comment

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

unneeded, make it lazy, call internal decoders based on type and progressing the stream

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed a commit

@MarekM25
Copy link
Contributor

MarekM25 commented Oct 1, 2024

PR description!

@rjnrohit
Copy link
Contributor Author

rjnrohit commented Oct 2, 2024

PR description!

will add

Base automatically changed from pectra_fix_7702_after_merge to master October 7, 2024 14:00
@rjnrohit rjnrohit closed this Oct 10, 2024
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.

Implement flat-encoding (pectra-devnet-4)
5 participants