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

chore(core/types): remove block.go and import Block and Body from libevm (6) #760

Merged
merged 39 commits into from
Feb 28, 2025

Conversation

qdm12
Copy link
Collaborator

@qdm12 qdm12 commented Jan 21, 2025

Why this should be merged

Remove core/types/block.go and one step closer to remove core/rawdb entirely

How this works

  • BlockBodyExtra extra payload defined for both Block and Body
    • hook Copy to be used in Block methods Body, WithSeal, WithBody and WithWithdrawals
    • hooks BlockRLPFieldsForEncoding and BlockRLPFieldsForDecoding for RLP codec of Block
    • hooks BodyRLPFieldsForEncoding and BodyRLPFieldsForDecoding for RLP codec of Body
  • SetBlockExtra to set an extra payload BlockBodyExtra on a Block
  • SetBodyExtra to set an extra payload BlockBodyExtra on a Body
  • Block getter pure functions for extra fields: BlockExtDataGasUsed, BlockGasCost, BlockExtData, BlockVersion, BlockExtDataGasUsed, BlockGasCost
  • New import from libevm's core/types: Block, Blocks, Body, CalcUncleHash, NewBlock and NewBlockWithHeader
  • remove now unneeded core/types/block.go
  • add test dependency github.com/google/go-cmp v0.7.0

How this was tested

Existing and new tests

Need to be documented?

No

Need to update RELEASES.md?

No

@qdm12 qdm12 force-pushed the qdm12/core/types/body-libevm branch from 2be5a7b to 87f5043 Compare January 21, 2025 17:26
@qdm12 qdm12 changed the title chore(core/types): body rlp hooks chore(core/types): Body libevm RLP codec hooks Jan 21, 2025
@qdm12 qdm12 changed the base branch from libevm-upstream-types to qdm12/core/types/header-copy-hooks January 22, 2025 09:40
@qdm12 qdm12 force-pushed the qdm12/core/types/header-copy-hooks branch 2 times, most recently from da83d82 to 58f1171 Compare January 22, 2025 09:56
@qdm12 qdm12 force-pushed the qdm12/core/types/body-libevm branch 2 times, most recently from 9978144 to 7027a42 Compare January 22, 2025 09:59
@qdm12 qdm12 force-pushed the qdm12/core/types/body-libevm branch 2 times, most recently from 53eb228 to d65a0d2 Compare January 24, 2025 10:48
@qdm12 qdm12 force-pushed the qdm12/core/types/header-copy-hooks branch 2 times, most recently from 3593f92 to 1daa313 Compare February 10, 2025 16:15
@qdm12 qdm12 changed the title chore(core/types): Body libevm RLP codec hooks chore(core/types): Body RLP codec hooks (5) Feb 10, 2025
@qdm12 qdm12 force-pushed the qdm12/core/types/header-copy-hooks branch 3 times, most recently from da70431 to 3ff7dea Compare February 12, 2025 12:57
@qdm12 qdm12 force-pushed the qdm12/core/types/body-libevm branch from d65a0d2 to 787b67d Compare February 12, 2025 13:03
@qdm12 qdm12 force-pushed the qdm12/core/types/header-copy-hooks branch from 3ff7dea to 783edc9 Compare February 12, 2025 15:06
@qdm12 qdm12 force-pushed the qdm12/core/types/body-libevm branch 2 times, most recently from bb94d07 to 3c3ee20 Compare February 12, 2025 16:54
@qdm12 qdm12 force-pushed the qdm12/core/types/header-copy-hooks branch from bb303d6 to dc264fe Compare February 13, 2025 16:56
@qdm12 qdm12 force-pushed the qdm12/core/types/body-libevm branch 3 times, most recently from e877b8e to 382b527 Compare February 14, 2025 13:29
@qdm12 qdm12 force-pushed the qdm12/core/types/header-copy-hooks branch from dc264fe to b999d7c Compare February 14, 2025 13:30
@qdm12 qdm12 changed the title chore(core/types): Body RLP codec hooks (5) chore(core/types): Body and Block RLP and copy hooks (5) Feb 14, 2025
@qdm12 qdm12 force-pushed the qdm12/core/types/body-libevm branch 2 times, most recently from 825adad to ff1e5bd Compare February 14, 2025 13:57
@qdm12 qdm12 requested a review from ARR4N February 27, 2025 14:56
ARR4N
ARR4N previously approved these changes Feb 28, 2025
@qdm12 qdm12 requested a review from darioush February 28, 2025 13:52
@qdm12 qdm12 force-pushed the qdm12/core/types/body-libevm branch from 26f3c6d to a770faa Compare February 28, 2025 14:18
@qdm12 qdm12 force-pushed the qdm12/core/types/body-libevm branch from a770faa to 37797f0 Compare February 28, 2025 14:19
@qdm12
Copy link
Collaborator Author

qdm12 commented Feb 28, 2025

Last force push adding missing commit pgp signatures on a few commits, sorry about that, I'll recheck my settings.

@qdm12 qdm12 requested a review from ARR4N February 28, 2025 14:53
@qdm12 qdm12 changed the title chore(core/types): Body and Block RLP and copy hooks (6) chore(core/types): remove block.go and import Block and Body from libevm (6) Feb 28, 2025
@qdm12 qdm12 enabled auto-merge (squash) February 28, 2025 14:55
@qdm12 qdm12 disabled auto-merge February 28, 2025 14:56
@qdm12 qdm12 merged commit bd1aabe into libevm Feb 28, 2025
6 checks passed
@qdm12 qdm12 deleted the qdm12/core/types/body-libevm branch February 28, 2025 16:34
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.

3 participants