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

Block: treeshaking tasks #3586

Merged
merged 9 commits into from
Aug 14, 2024
Merged

Block: treeshaking tasks #3586

merged 9 commits into from
Aug 14, 2024

Conversation

ScottyPoi
Copy link
Contributor

@ScottyPoi ScottyPoi commented Aug 13, 2024

Block Treeshaking task cleanup from #3560

  • Kill off from-rpc.ts, header-from-rpc.ts files, move code within function blocks of constructors.ts
  • Create block and header directories, move block.ts and header.ts over, create index.ts file, split constructors.ts into the block and header methods and move over respectively (if this full TODO item is controversial we can also give a quick discussion, I would find it a useful better organizing structure)
  • Rename createBlockFromValuesArray -> createBlockFromBytesArray
  • Rename createBlockHeaderFromValuesArray -> createBlockHeaderFromBytesArray

Copy link

codecov bot commented Aug 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.89%. Comparing base (4470cc3) to head (af630f1).
Report is 4 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

Flag Coverage Δ
block ?
client ?
tx ?
util 69.89% <ø> (?)
wallet ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

I generally really like this approach. One nit about normalizeTxParams that we should address (though can be in a different PR if you want).

export function createBlockHeader(headerData: HeaderData = {}, opts: BlockOptions = {}) {
return new BlockHeader(headerData, opts)
}
export function normalizeTxParams(_txParams: any) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Two things on this function:

  1. It isn't a constructor so ideally we put it in a helpers/utils file.
  2. We have essentially the same function here. Can we harmonize these two and consolidate in one location (maybe in @ethereumjs/util/helpers.ts or internal.ts) The only real difference I see is converting 0x0 to 0x in the transaction signatuere values.

Copy link
Member

Choose a reason for hiding this comment

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

Have put in a dedicated small issue #3587 so we can address in a separate PR

Copy link
Member

@holgerd77 holgerd77 left a comment

Choose a reason for hiding this comment

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

LGTM

@holgerd77 holgerd77 merged commit 1054c4a into master Aug 14, 2024
34 checks passed
@holgerd77 holgerd77 deleted the block-treeshaking branch August 14, 2024 08:13
@ethereumjs ethereumjs deleted a comment from Jamiecaty Aug 26, 2024
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.

4 participants