Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EIP-7702: Change transaction validity rules according to latest spec #1032

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions test/state/errors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ enum ErrorCode : int
BLOB_GAS_LIMIT_EXCEEDED,
CREATE_SET_CODE_TX,
EMPTY_AUTHORIZATION_LIST,
INVALID_AUTHORIZATION_SIGNATURE,
AUTHORIZATION_SIGNATURE_S_TOO_HIGH,
UNKNOWN_ERROR,
};

Expand Down Expand Up @@ -81,10 +79,6 @@ inline const std::error_category& evmone_category() noexcept
return "set code transaction must not be a create transaction";
case EMPTY_AUTHORIZATION_LIST:
return "empty authorization list";
case INVALID_AUTHORIZATION_SIGNATURE:
return "invalid authorization signature";
case AUTHORIZATION_SIGNATURE_S_TOO_HIGH:
return "authorization signature s value too high";
case UNKNOWN_ERROR:
return "Unknown error";
default:
Expand Down
9 changes: 0 additions & 9 deletions test/state/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ namespace evmone::state
{
namespace
{
constexpr auto SECP256K1N = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141_u256;
constexpr auto SECP256K1N_OVER_2 = SECP256K1N / 2;
// EIP-7702: The cost of authorization that sets delegation to an account that didn't exist before
constexpr auto AUTHORIZATION_EMPTY_ACCOUNT_COST = 25000;
// EIP-7702: The cost of authorization that sets delegation to an account that already exists
Expand Down Expand Up @@ -343,13 +341,6 @@ std::variant<int64_t, std::error_code> validate_transaction(const Account& sende
return make_error_code(CREATE_SET_CODE_TX);
if (tx.authorization_list.empty())
return make_error_code(EMPTY_AUTHORIZATION_LIST);
for (const auto& auth : tx.authorization_list)
{
if (auth.v != 0 && auth.v != 1)
return make_error_code(INVALID_AUTHORIZATION_SIGNATURE);
if (auth.s > SECP256K1N_OVER_2)
return make_error_code(AUTHORIZATION_SIGNATURE_S_TOO_HIGH);
}
break;

default:;
Expand Down