Skip to content

Add support for EIP-7702 transactions #320

Merged
q9f merged 8 commits intoq9f:mainfrom
rojotek:7702-transactions
Apr 16, 2025
Merged

Add support for EIP-7702 transactions #320
q9f merged 8 commits intoq9f:mainfrom
rojotek:7702-transactions

Conversation

@rojotek
Copy link
Contributor

@rojotek rojotek commented Feb 11, 2025

Add support for EIP-7702 transactions following the approach used by 1559. Fixes #321

Adds a new EIP-7702 class, including an authorization nested class.

@rojotek rojotek force-pushed the 7702-transactions branch 2 times, most recently from 66b2342 to e130c26 Compare February 13, 2025 00:40
@rojotek rojotek marked this pull request as ready for review February 13, 2025 00:40
@rojotek rojotek force-pushed the 7702-transactions branch 2 times, most recently from 2c0417e to 4c1e10c Compare February 14, 2025 17:25
@q9f q9f added the enhancement New feature or request label Feb 16, 2025
@codecov
Copy link

codecov bot commented Mar 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.57%. Comparing base (eb154c6) to head (7e60123).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #320      +/-   ##
==========================================
+ Coverage   99.53%   99.57%   +0.03%     
==========================================
  Files          79       81       +2     
  Lines        4964     5354     +390     
==========================================
+ Hits         4941     5331     +390     
  Misses         23       23              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@rojotek rojotek force-pushed the 7702-transactions branch 2 times, most recently from 3c40b45 to d69dc56 Compare March 12, 2025 19:46
case type
when TYPE_7702

# EIP-1559 transaction (type 2)
Copy link
Owner

Choose a reason for hiding this comment

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

nit:

Suggested change
# EIP-1559 transaction (type 2)
# EIP-7702 transaction (type 4)

# types and envelopes.
# Ref: https://eips.ethereum.org/EIPS/eip-7702
class Eip7702
class Authorization
Copy link
Owner

Choose a reason for hiding this comment

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

nit: docs missing

# Ref: https://eips.ethereum.org/EIPS/eip-7702
class Eip7702
class Authorization
attr_reader :chain_id
Copy link
Owner

Choose a reason for hiding this comment

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

nit: docs missing

class Authorization
attr_reader :chain_id

attr_reader :address
Copy link
Owner

Choose a reason for hiding this comment

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

nit: docs missing


attr_reader :address

attr_reader :nonce
Copy link
Owner

Choose a reason for hiding this comment

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

nit: docs missing

return hash
end

def unsigned_encoded
Copy link
Owner

Choose a reason for hiding this comment

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

nit: docs missing

Rlp.encode authorization_data
end

def unsigned_hash
Copy link
Owner

Choose a reason for hiding this comment

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

nit: docs missing

Util.keccak256 unsigned_encoded
end

def raw
Copy link
Owner

Choose a reason for hiding this comment

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

nit: docs missing

authorization_data
end

def ==(o)
Copy link
Owner

Choose a reason for hiding this comment

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

nit: docs missing


# ensure sane values for all mandatory fields
fields = Tx.validate_params fields
fields = Tx.validate_eip1559_params fields
Copy link
Owner

Choose a reason for hiding this comment

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

Does EIP 7702 require 1559?

@q9f q9f merged commit 473f133 into q9f:main Apr 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Support for EIP 7702 Set EOA Account Code Transactions

2 participants