Skip to content

Fix tags#255

Merged
curryxbo merged 1 commit intomainfrom
fixTags
Nov 25, 2025
Merged

Fix tags#255
curryxbo merged 1 commit intomainfrom
fixTags

Conversation

@curryxbo
Copy link
Copy Markdown
Contributor

@curryxbo curryxbo commented Nov 25, 2025

1. Purpose or design rationale of this PR

...

2. PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

3. Deployment tag versioning

Has the version in params/version.go been updated?

  • This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
  • Yes

4. Breaking change label

Does this PR have the breaking-change label?

  • This PR is not a breaking change
  • Yes

Summary by CodeRabbit

  • Style
    • Updated JSON field naming convention for fee-related transaction properties, changing from snake_case to camelCase format. This affects the structure of transaction data in API responses.

✏️ Tip: You can customize this high-level summary in your review settings.

@curryxbo curryxbo requested a review from a team as a code owner November 25, 2025 03:04
@curryxbo curryxbo requested review from secmgt and removed request for a team November 25, 2025 03:04
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 25, 2025

Walkthrough

JSON marshaling tags for Alt fee transaction fields are renamed from snake_case to camelCase in both core transaction marshalling and test utilities. FeeTokenID and FeeLimit field tags are updated consistently across two files without modifying field types or logic.

Changes

Cohort / File(s) Summary
JSON tag normalization to camelCase
core/types/transaction_marshalling.go, tests/state_test_util.go
Updated FeeTokenID and FeeLimit JSON marshaling tags from snake_case (fee_token_id, fee_limit) to camelCase (feeTokenID, feeLimit) in txJSON and stTransaction structs respectively

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Homogeneous, repetitive changes across only two files
  • No behavioral or logic modifications; purely cosmetic JSON tag adjustments
  • Straightforward verification that tags match across both files and follow consistent camelCase convention

Possibly related PRs

  • Add hexutil Uint16 #253 — Also modifies FeeTokenID/FeeLimit JSON marshaling in core/types/transaction_marshalling.go, changing field types and serialization alongside tag names
  • Update trace #245 — Modifies the same AltFeeTx fields (FeeTokenID and FeeLimit) and their JSON serialization in TransactionData

Suggested reviewers

  • FletcherMan
  • r3aker86

Poem

🐰 From snake to camel, the JSON tags dance,
Fee fields adopt a stylish new prance,
snake\_case surrender to camelCase reign,
Marshaling harmony flows through the chain! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Fix tags' is vague and does not clearly convey what specific tags were fixed or why they needed fixing. Consider a more descriptive title like 'Convert fee transaction JSON tags to camelCase' to better communicate the specific change being made.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fixTags

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
core/types/transaction_marshalling.go (1)

65-68: AltFeeTx JSON field rename changes external wire format; verify compatibility expectations

Renaming the tags from "fee_token_id"/"fee_limit" to "feeTokenID"/"feeLimit" changes both marshaling and unmarshaling of AltFeeTx JSON. Any existing clients (tests, tooling, RPC consumers) that still emit snake_case keys will now silently produce FeeTokenID == 0 and FeeLimit == nil on decode.

If this JSON has already been exposed outside the repo, consider either:

  • explicitly treating this as a breaking change (and updating downstream callers), or
  • adding a small backward‑compat shim in Transaction.UnmarshalJSON (e.g., pre‑unmarshal into map[string]json.RawMessage and mapping fee_token_idfeeTokenID, fee_limitfeeLimit).

As long as all producers/fixtures are updated to camelCase, the current change is consistent and correct.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 40079aa and 35c6e79.

📒 Files selected for processing (2)
  • core/types/transaction_marshalling.go (1 hunks)
  • tests/state_test_util.go (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Kukoomomo
Repo: morph-l2/go-ethereum PR: 205
File: core/token_gas.go:140-155
Timestamp: 2025-11-10T06:56:24.937Z
Learning: In the ERC20 fee implementation (core/token_gas.go), ERC20 transfer and balance check calls use math.MaxUint64 gas limit. This is intentional given that fee tokens are restricted to an allowlist (via IsTokenActive checks and AllowListSlot/AllowListEnabledSlot in rollup/rcfg/config.go), so only vetted contracts can be invoked. The team has chosen this approach understanding the tradeoffs versus adding fixed gas stipends.
🧬 Code graph analysis (2)
tests/state_test_util.go (1)
accounts/abi/unpack_test.go (1)
  • Int (547-547)
core/types/transaction_marshalling.go (1)
common/hexutil/json.go (2)
  • Uint16 (276-276)
  • Big (156-156)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (go)
🔇 Additional comments (1)
tests/state_test_util.go (1)

116-117: Test transaction tags correctly aligned with production AltFeeTx JSON

Updating stTransaction to use "feeTokenID,omitempty" / "feeLimit,omitempty" keeps the state tests in sync with the core txJSON representation, so marshaled test transactions will match what the node expects.

Just ensure any existing JSON test vectors or tooling that generate state tests have been updated to use the new camelCase field names.

@curryxbo curryxbo merged commit 69718a9 into main Nov 25, 2025
8 checks passed
@curryxbo curryxbo deleted the fixTags branch November 25, 2025 06:17
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.

2 participants