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): header JSON and RLP serialization hooks (4) #746

Merged
merged 29 commits into from
Feb 25, 2025

Conversation

darioush
Copy link
Collaborator

@darioush darioush commented Jan 13, 2025

  • Implement HeaderExtra RLP and JSON serialization methods
  • remove BlockNonce
  • remove EncodeNonce
  • new functions GetHeaderExtra and SetHeaderExtra
  • Migrate existing custom Header to HeaderSerializable in block_ext.go with only Hash method for RLP code generation
  • Rename files gen_header_json.go to gen_header_serializable_json.go
  • Rename files gen_header_rlp.go to gen_header_serializable_rlp.go

PS by qdm12: inappropriate branch name libevm-upstream-types for historical reasons

@darioush darioush changed the base branch from master to libevm January 13, 2025 23:14
qdm12 added a commit that referenced this pull request Feb 10, 2025
- Uses tip of main libevm dependency + cherry picked commit: ava-labs/libevm@d3f6a5e
- Precompile legacy gas fix (done in ava-labs/libevm@f906679)
- Added `HeaderExtra` not-implemented implementation
- Minimal changes shamelessly copied over from #746
qdm12 added a commit that referenced this pull request Feb 10, 2025
- Uses tip of main libevm dependency + cherry picked commit: ava-labs/libevm@d3f6a5e
- Precompile legacy gas fix (done in ava-labs/libevm@f906679)
- Added `HeaderExtra` not-implemented implementation
- Minimal changes shamelessly copied over from #746
qdm12 added a commit that referenced this pull request Feb 10, 2025
- Uses tip of main libevm dependency + cherry picked commit: ava-labs/libevm@d3f6a5e
- Precompile legacy gas fix (done in ava-labs/libevm@f906679)
- Added `HeaderExtra` not-implemented implementation
- Minimal changes shamelessly copied over from #746
@qdm12 qdm12 force-pushed the libevm-upstream-types branch from f133755 to ef168bd Compare February 10, 2025 15:20
@qdm12 qdm12 changed the title [wip] use header type from libevm chore(core/types): header JSON and RLP serialization hooks Feb 10, 2025
@qdm12 qdm12 changed the base branch from libevm to qdm12/libevm/structure February 10, 2025 15:22
@qdm12 qdm12 changed the title chore(core/types): header JSON and RLP serialization hooks chore(core/types): header JSON and RLP serialization hooks (3) Feb 10, 2025
@qdm12 qdm12 force-pushed the libevm-upstream-types branch 3 times, most recently from 269fb9c to d98039c Compare February 10, 2025 16:21
@qdm12 qdm12 force-pushed the qdm12/libevm/structure branch 2 times, most recently from 7093fc3 to 3e8d4e4 Compare February 12, 2025 12:30
@qdm12 qdm12 force-pushed the libevm-upstream-types branch from d98039c to d52d44f Compare February 12, 2025 12:43
@qdm12 qdm12 force-pushed the qdm12/libevm/structure branch from 3e8d4e4 to 806817d Compare February 12, 2025 12:53
@qdm12 qdm12 force-pushed the libevm-upstream-types branch 2 times, most recently from 59ef836 to c6f5f69 Compare February 12, 2025 12:55
Copy link
Collaborator

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Self review

@qdm12 qdm12 force-pushed the libevm-upstream-types branch from 6ac9728 to e0537f8 Compare February 12, 2025 14:59
@qdm12 qdm12 requested a review from ARR4N February 24, 2025 11:49
Copy link
Contributor

@ARR4N ARR4N left a comment

Choose a reason for hiding this comment

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

The change to the test makes it possibly tautological so it's important to revert it.

…or gen_*.go files

Co-authored-by: Darioush Jalali <[email protected]>
Signed-off-by: Quentin McGaw <[email protected]>
ARR4N
ARR4N previously approved these changes Feb 25, 2025
Copy link
Collaborator Author

@darioush darioush left a comment

Choose a reason for hiding this comment

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

I can't approve this but LGTM

qdm12
qdm12 previously approved these changes Feb 25, 2025
Copy link
Collaborator

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Self approving 🪃 !

qdm12 and others added 9 commits February 25, 2025 16:09
- `ex` -> `headerExtra`
- `exportedFieldsDeepCopied` -> `exportedFieldsPointToDifferentMemory`
- use intrange when iterating over v.NumField()
- `testHeaderEncodings` -> `testHeaderEncodeDecode`
- Add comment why returned value of `testHeaderEncodeDecode` is ignored for TestHeaderJSON
- Rename `b` to `encoded` (named return) in `testHeaderEncodeDecode`
- gen_header_json.go -> gen_header_serializable_json.go
- gen_header_rlp.go -> gen_header_serializable_rlp.go
@qdm12 qdm12 force-pushed the libevm-upstream-types branch from 8ca5efd to 57a6734 Compare February 25, 2025 15:13
Co-authored-by: Arran Schlosberg <[email protected]>
Signed-off-by: Quentin McGaw <[email protected]>
Copy link
Contributor

@ARR4N ARR4N left a comment

Choose a reason for hiding this comment

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

Noting that force push was a no-op.

Copy link
Collaborator

@qdm12 qdm12 left a comment

Choose a reason for hiding this comment

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

Re-approving (given no-op force push)

@qdm12 qdm12 merged commit 0657877 into libevm Feb 25, 2025
6 checks passed
@qdm12 qdm12 deleted the libevm-upstream-types branch February 25, 2025 16:19
qdm12 added a commit that referenced this pull request Feb 25, 2025
- Implement `HeaderExtra` RLP and JSON serialization methods
- remove `BlockNonce`
- remove `EncodeNonce`
- new functions `GetHeaderExtra` and `SetHeaderExtra`
- Migrate existing custom `Header` to `HeaderSerializable` in block_ext.go with only `Hash` method for RLP code generation
- Rename files gen_header_json.go to gen_header_serializable_json.go
- Rename files gen_header_rlp.go to gen_header_serializable_rlp.go

Signed-off-by: Quentin McGaw <[email protected]>
Co-authored-by: Quentin Mc Gaw <[email protected]>
Co-authored-by: Arran Schlosberg <[email protected]>
Co-authored-by: Ceyhun Onur <[email protected]>
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.

4 participants