Skip to content

feat: add EthereumEipXXXXTransaction support - #1678

Merged
Dosik13 merged 18 commits into
mainfrom
feat/add-ethereum-eip-transaction-support
Jun 25, 2026
Merged

feat: add EthereumEipXXXXTransaction support#1678
Dosik13 merged 18 commits into
mainfrom
feat/add-ethereum-eip-transaction-support

Conversation

@Dosik13

@Dosik13 Dosik13 commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Description:

Add native construction and signing of Ethereum transaction data for all four formats (Legacy, EIP-2930, EIP-1559, EIP-7702), so a developer can build and sign an Ethereum transaction inside the SDK and submit it through the existing EthereumTransaction. Implements the cross-SDK proposal in sdk-collaboration-hub.

  • Add EthereumTransactionBody interface (Sign, ToBytes, String) implemented by the Legacy, EIP-2930, EIP-1559, and EIP-7702 transaction types
  • Add native Sign(key) to each transaction type — secp256k1 signing with recovery-id computation, writing R/S and V/RecoveryId back onto the receiver and returning the signed RLP; reject non-ECDSA keys
  • Extract shared _signTypedTransaction and _encodeTypedWithSignature helpers for the typed variants, and split serialization into _toUnsignedRLP / _encodeWithSignature
  • Add paired typed and raw-bytes accessors for every field across all four types (GetValue/SetValue and GetValueBytes/SetValueBytes)
  • Add Ethereum RLP canonical integer encoding helpers (uint64/big.Int to minimal big-endian, zero as empty bytes)
  • Add structured AccessListItem type with getters/setters, AddStorageKey, and RLP helpers; expose it through GetAccessListItems/SetAccessListItems/AddAccessListItem
  • Replace the positional AuthorizationTuple [6][]byte with a structured Authorization type (chainId, address, nonce, yParity, r, s) with constructor, accessors, String, and RLP helpers
  • Add EthereumTransaction.SetEthereumDataFromBody(body) to serialize a signed transaction body directly, returning an error rather than submit an unsigned transaction
  • Add EthereumTransactionData wrapper dispatch over the four types (FromBytes, ToBytes, Sign, GetTransaction, GetData/SetData)
  • Add unit tests covering signing, RLP round-trips, accessors, access lists, authorization lists, and decode error paths

Related issue(s):

Fixes #1742

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Dosik13 added 13 commits April 14, 2026 15:26
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
@lfdt-bot

lfdt-bot commented Apr 14, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codacy-production

codacy-production Bot commented Apr 14, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 66 complexity · 0 duplication

Metric Results
Complexity 66
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@codecov

codecov Bot commented Apr 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.01911% with 25 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
sdk/ethereum_transaction_data.go 87.30% 5 Missing and 3 partials ⚠️
sdk/ethereum_eip1559_transaction.go 95.23% 2 Missing and 3 partials ⚠️
sdk/access_list_item.go 92.98% 2 Missing and 2 partials ⚠️
sdk/ethereum_legacy_transaction.go 95.18% 2 Missing and 2 partials ⚠️
sdk/ethereum_eip7702_transaction.go 98.37% 1 Missing and 1 partial ⚠️
sdk/ethereum_transaction.go 81.81% 1 Missing and 1 partial ⚠️
Files with missing lines Coverage Δ
sdk/authorization.go 100.00% <100.00%> (ø)
sdk/ethereum_eip2930_transaction.go 95.15% <100.00%> (+34.62%) ⬆️
sdk/ethereum_encoding.go 100.00% <100.00%> (ø)
sdk/ethereum_eip7702_transaction.go 92.19% <98.37%> (+92.19%) ⬆️
sdk/ethereum_transaction.go 88.88% <81.81%> (-1.12%) ⬇️
sdk/access_list_item.go 92.98% <92.98%> (ø)
sdk/ethereum_legacy_transaction.go 95.58% <95.18%> (+95.58%) ⬆️
sdk/ethereum_eip1559_transaction.go 94.94% <95.23%> (+33.69%) ⬆️
sdk/ethereum_transaction_data.go 88.52% <87.30%> (+49.54%) ⬆️

... and 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread sdk/access_list_item.go
Dosik13 added 2 commits June 22, 2026 12:16
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
@Dosik13
Dosik13 marked this pull request as ready for review June 22, 2026 09:50
@Dosik13
Dosik13 requested review from a team as code owners June 22, 2026 09:50
@Dosik13
Dosik13 requested a review from gsstoykov June 22, 2026 09:50
Dosik13 added 3 commits June 22, 2026 14:45
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
@Dosik13
Dosik13 merged commit 80f7957 into main Jun 25, 2026
16 checks passed
@Dosik13
Dosik13 deleted the feat/add-ethereum-eip-transaction-support branch June 25, 2026 12:33
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.

Implement native Ethereum transaction data construction and signing

4 participants