Skip to content

[types] build/usage improvements#864

Merged
olegrok merged 2 commits intomainfrom
improvements
Apr 28, 2025
Merged

[types] build/usage improvements#864
olegrok merged 2 commits intomainfrom
improvements

Conversation

@olegrok
Copy link
Copy Markdown
Contributor

@olegrok olegrok commented Apr 28, 2025

This patch set contains two improvements:

  • Reducing code duplication via reusing FeePack structure
  • Replacing "go:generate" directives to Makefile usage (just to support only one build system and also it will be useful in future when we will change SSZ to RLP encoding).

olegrok added 2 commits April 28, 2025 13:43
That should reduce code duplication.
There are no any reasons to support two separate build systems (Makefile and go generate).
This patch moves "go:generate" directives into Makefile.
@olegrok olegrok requested review from Copilot and shermike April 28, 2025 09:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors fee handling by replacing separate fee fields (FeeCredit, MaxPriorityFeePerGas, and MaxFeePerGas) with a unified FeePack structure and removes obsolete go:generate directives.

  • Reduces code duplication by reusing the FeePack structure in transaction types and related functions.
  • Replaces multiple go:generate directives with Makefile usage for building and future-proofing the encoding system.

Reviewed Changes

Copilot reviewed 27 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
nil/services/rpc/types/types.go Updated transaction creation to use FeePack instead of individual fee fields.
nil/services/rpc/jsonrpc/types.go Embedded FeePack in Transaction and updated conversion in NewTransaction.
nil/services/rpc/txpool_api_test.go Updated test transactions to use FeePack initialization.
nil/services/faucet/jsonrpc.go Replaced fee fields with FeePack creation via NewFeePackFromGas.
nil/internal/types/transaction.go Refactored TransactionDigest and related conversions to use FeePack.
*Other files (version_info.go, signature.go, receipt.go, log.go, exec_errors.go, collator.go, block.go, account.go, etc.) Removed redundant go:generate directives and updated fee pack usage accordingly.
Files not reviewed (1)
  • nil/internal/types/Makefile.inc: Language not supported

@olegrok olegrok added this pull request to the merge queue Apr 28, 2025
Merged via the queue into main with commit d9ffcf2 Apr 28, 2025
16 checks passed
@olegrok olegrok deleted the improvements branch April 28, 2025 11:46
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