Skip to content

Conversation

@prasanna-anchorage
Copy link
Contributor

This is broadly to enable decode "partial subsets" of transactions that are often useful for debugging. I tried to do this with a RLP encoded transaction with cast but I found that alloy-rlp supported this functionality. Thanks @mattsse for the pointer

I don't want to use this at all in the normal path but it's useful for Ethereum for 7702 , 4484 type transaction and other custom cross chain requests that we might encounter. The custom type is used as a catch all for now for any quirky half-transactions we have encountered. Eventually when I support Solana, I'll add per message or instructions parser. At that point, adding a "strategy" or "type" may make sense but I don't want to blow this PR up too much.

Best way to use this is via parser_cli

src/parser/cli && cargo run -- --chain ethereum --transaction 0xdf11800314825208941d0dd7a303374bd5f8c57bd8d16e52316d3bfe74
0180c0 --partial
SignablePayload {
    fields: [
        TextV2 {
            common: SignablePayloadFieldCommon {
                fallback_text: "Custom Chain ID 17",
                label: "Network",
            },
            text_v2: SignablePayloadFieldTextV2 {
                text: "Custom Chain ID 17",
            },
        },
        TextV2 {
            common: SignablePayloadFieldCommon {
                fallback_text: "Custom Partial Transaction (converted to EIP-7702)",
                label: "Transaction Type",
            },
            text_v2: SignablePayloadFieldTextV2 {
                text: "Custom Partial Transaction (converted to EIP-7702)",
            },
        },
        TextV2 {
            common: SignablePayloadFieldCommon {
                fallback_text: "0x1D0Dd7A303374BD5F8C57BD8d16e52316D3Bfe74",
                label: "To Address",
            },
            text_v2: SignablePayloadFieldTextV2 {
                text: "0x1D0Dd7A303374BD5F8C57BD8d16e52316D3Bfe74",
            },
        },
        TextV2 {
            common: SignablePayloadFieldCommon {
                fallback_text: "1 wei",
                label: "Value",
            },
            text_v2: SignablePayloadFieldTextV2 {
                text: "1 wei",
            },
        },
        TextV2 {
            common: SignablePayloadFieldCommon {
                fallback_text: "0",
                label: "Nonce",
            },
            text_v2: SignablePayloadFieldTextV2 {
                text: "0",
            },
        },
        TextV2 {
            common: SignablePayloadFieldCommon {
                fallback_text: "21000",
                label: "Gas Limit",
            },
            text_v2: SignablePayloadFieldTextV2 {
                text: "21000",
            },
        },
        TextV2 {
            common: SignablePayloadFieldCommon {
                fallback_text: "23 wei",
                label: "Max Fee Per Gas",
            },
            text_v2: SignablePayloadFieldTextV2 {
                text: "23 wei",
            },
        },
        TextV2 {
            common: SignablePayloadFieldCommon {
                fallback_text: "20 wei",
                label: "Max Priority Fee Per Gas",
            },
            text_v2: SignablePayloadFieldTextV2 {
                text: "20 wei",
            },
        },
    ],
    payload_type: "EthereumTx",
    subtitle: Some(
        "Custom partial transaction converted to EIP-7702 format",
    ),
    title: "Custom Partial Ethereum Transaction",
    version: "0",
}

@prasanna-anchorage prasanna-anchorage requested review from DaniPopes, andrestielau and Copilot and removed request for Copilot September 24, 2025 22:19
@prasanna-anchorage prasanna-anchorage changed the title Support Partial Parsing that allows EIP-7702 as well as custom/less-documented approaches Feat: Support Partial Parsing that allows EIP-7702 as well as custom/less-documented approaches Sep 24, 2025
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