Skip to content

Conversation

@damiramirez
Copy link
Contributor

Motivation

Add serde to specific fields of AuthorizationTuple

Description

To use the L2 Hub, we need to parse the fields of AuthorizationTuple to make them compatible with JavaScript.

Details: Invalid Ethex L2 message: Failed to parse request into ethrex_SendTransaction: invalid type: string "0x0", expected u64
Version: [email protected]
    at getContractError (chunk-7ZVOX3I3.js?v=69061873:218:10)
    at writeContract (chunk-UOLTLXVA.js?v=69061873:587:11)
    at async signUp (passkeyAccounts.ts:55:16)
    at async handleSignUp (AccountCard.tsx:28:46)Caused by: TransactionExecutionError: RPC Request failed.

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

Lines of code report

Total lines added: 4
Total lines removed: 0
Total lines changed: 4

Detailed view
+-----------------------------------------+-------+------+
| File                                    | Lines | Diff |
+-----------------------------------------+-------+------+
| ethrex/crates/common/types/tx_fields.rs | 81    | +4   |
+-----------------------------------------+-------+------+

@damiramirez damiramirez changed the title feat: add serde to AuthorizationTuple fields feat(l1): add serde to AuthorizationTuple fields Nov 13, 2025
@github-actions github-actions bot added the L1 Ethereum client label Nov 13, 2025
@damiramirez damiramirez changed the title feat(l1): add serde to AuthorizationTuple fields feat(l2): add serde to AuthorizationTuple fields Nov 13, 2025
@damiramirez damiramirez added L2 Rollup client and removed L1 Ethereum client labels Nov 13, 2025
@damiramirez damiramirez self-assigned this Nov 13, 2025
@damiramirez damiramirez marked this pull request as ready for review November 13, 2025 23:01
@damiramirez damiramirez requested a review from a team as a code owner November 13, 2025 23:01
Copilot AI review requested due to automatic review settings November 13, 2025 23:01
Copy link
Contributor

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 PR adds custom serde deserializers to AuthorizationTuple fields to enable JavaScript compatibility through the L2 Hub. The deserializers handle both hexadecimal and decimal string representations, addressing parsing failures when JavaScript sends values like "0x0" instead of numeric types.

Key changes:

  • Added deser_hex_or_dec_str deserializers to U256 fields (chain_id, y_parity, r_signature, s_signature)
  • Added deser_hex_or_dec_str deserializer with default attribute to the nonce field (u64)
  • Minor whitespace fix in genesis file

Reviewed Changes

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

File Description
crates/common/types/tx_fields.rs Added serde deserializers to all AuthorizationTuple fields to parse both hex and decimal string formats
fixtures/genesis/l2.json Added missing newline at end of file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-project-automation github-project-automation bot moved this to In Review in ethrex_l1 Nov 14, 2025
@tomip01 tomip01 enabled auto-merge November 14, 2025 15:26
@tomip01 tomip01 added this pull request to the merge queue Nov 14, 2025
Merged via the queue into main with commit f1cfdf8 Nov 14, 2025
42 checks passed
@tomip01 tomip01 deleted the test_sponsor branch November 14, 2025 16:23
@github-project-automation github-project-automation bot moved this from In Review to Done in ethrex_l1 Nov 14, 2025
lakshya-sky pushed a commit to lakshya-sky/ethrex that referenced this pull request Nov 17, 2025
**Motivation**

Add serde to specific fields of `AuthorizationTuple`

**Description**

To use the [L2 Hub](https://github.com/lambdaclass/ethrex_l2_hub), we
need to parse the fields of AuthorizationTuple to make them compatible
with JavaScript.

```
Details: Invalid Ethex L2 message: Failed to parse request into ethrex_SendTransaction: invalid type: string "0x0", expected u64
Version: [email protected]
    at getContractError (chunk-7ZVOX3I3.js?v=69061873:218:10)
    at writeContract (chunk-UOLTLXVA.js?v=69061873:587:11)
    at async signUp (passkeyAccounts.ts:55:16)
    at async handleSignUp (AccountCard.tsx:28:46)Caused by: TransactionExecutionError: RPC Request failed.
```

---------

Co-authored-by: Manuel Iñaki Bilbao <[email protected]>
ricomateo pushed a commit that referenced this pull request Nov 18, 2025
**Motivation**

Add serde to specific fields of `AuthorizationTuple`

**Description**

To use the [L2 Hub](https://github.com/lambdaclass/ethrex_l2_hub), we
need to parse the fields of AuthorizationTuple to make them compatible
with JavaScript.

```
Details: Invalid Ethex L2 message: Failed to parse request into ethrex_SendTransaction: invalid type: string "0x0", expected u64
Version: [email protected]
    at getContractError (chunk-7ZVOX3I3.js?v=69061873:218:10)
    at writeContract (chunk-UOLTLXVA.js?v=69061873:587:11)
    at async signUp (passkeyAccounts.ts:55:16)
    at async handleSignUp (AccountCard.tsx:28:46)Caused by: TransactionExecutionError: RPC Request failed.
```

---------

Co-authored-by: Manuel Iñaki Bilbao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L2 Rollup client

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants