Skip to content

hotfix: reject type 4 transactions#2456

Merged
carneiro-cw merged 2 commits intomainfrom
reject_tx_type4
Feb 27, 2026
Merged

hotfix: reject type 4 transactions#2456
carneiro-cw merged 2 commits intomainfrom
reject_tx_type4

Conversation

@carneiro-cw
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Incomplete logging

The warning for rejecting unsupported transaction types only logs tx_hash but omits the actual tx_type, making diagnosis harder.

// HOTFIX: this is a temporary stopgap measure to prevent type 4 transactions which currently cause the followers to crash
if tx.transaction_info.tx_type.is_some_and(|t| t > 3) {
    tracing::warn!(%tx_hash, "rejecting unsuported transaction type");
Error code specificity

Returning a generic ParameterInvalid RPC error may obscure the cause; consider defining a more specific error code or message for unsupported transaction types.

    tracing::warn!(%tx_hash, "rejecting unsuported transaction type");
    return Err(RpcError::ParameterInvalid.into())
}
Typo in log message

The warning message has a typo in "unsuported"; correct the spelling to "unsupported".

tracing::warn!(%tx_hash, "rejecting unsuported transaction type");

@github-actions
Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Add missing semicolon

Add a missing semicolon after the return statement to ensure correct Rust syntax and
prevent a compile error.

src/eth/rpc/rpc_server.rs [1249]

-return Err(RpcError::ParameterInvalid.into())
+return Err(RpcError::ParameterInvalid.into());
Suggestion importance[1-10]: 8

__

Why: The missing semicolon causes a compile error in Rust; adding it is critical for the code to compile.

Medium
Restrict rejection to type 4

Restrict the check to only reject type 4 transactions, as the comment indicates, so
you don’t inadvertently block future types >4.

src/eth/rpc/rpc_server.rs [1247]

-if tx.transaction_info.tx_type.is_some_and(|t| t > 3) {
+if tx.transaction_info.tx_type == Some(4) {
Suggestion importance[1-10]: 6

__

Why: Limiting the rejection to only type 4 aligns with the hotfix comment and avoids blocking future transaction types unnecessarily.

Low
General
Fix typo in log message

Correct the spelling of "unsupported" in the log message to improve clarity. This
avoids confusing or missed log searches due to typos.

src/eth/rpc/rpc_server.rs [1248]

-tracing::warn!(%tx_hash, "rejecting unsuported transaction type");
+tracing::warn!(%tx_hash, "rejecting unsupported transaction type");
Suggestion importance[1-10]: 5

__

Why: The log message had a typo ("unsuported"); correcting it to "unsupported" improves clarity and consistency.

Low

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.74%. Comparing base (d5188d5) to head (b6b8e9f).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/eth/rpc/rpc_server.rs 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2456      +/-   ##
==========================================
- Coverage   84.41%   83.74%   -0.68%     
==========================================
  Files         141      141              
  Lines       10808    10895      +87     
==========================================
  Hits         9124     9124              
- Misses       1684     1771      +87     
Flag Coverage Δ
contracts-rocks-asset-transit-desk 43.62% <50.00%> (-0.02%) ⬇️
contracts-rocks-balance-freezer 42.71% <50.00%> (+<0.01%) ⬆️
contracts-rocks-balance-tracker 43.06% <50.00%> (+<0.01%) ⬆️
contracts-rocks-base 43.62% <50.00%> (+<0.01%) ⬆️
contracts-rocks-blueprint 43.97% <50.00%> (+<0.01%) ⬆️
contracts-rocks-capybara-finance 44.30% <50.00%> (+<0.01%) ⬆️
contracts-rocks-capybara-finance-v2 44.36% <50.00%> (+<0.01%) ⬆️
contracts-rocks-card-payment-processor 44.07% <50.00%> (+<0.01%) ⬆️
contracts-rocks-card-payment-processor-v2 44.36% <50.00%> (+<0.01%) ⬆️
contracts-rocks-cashier 43.97% <50.00%> (+<0.01%) ⬆️
contracts-rocks-credit-agent 43.26% <50.00%> (+<0.01%) ⬆️
contracts-rocks-multisig 43.96% <50.00%> (+<0.01%) ⬆️
contracts-rocks-net-yield-distributor 43.97% <50.00%> (-0.02%) ⬇️
contracts-rocks-periphery 42.71% <50.00%> (+<0.01%) ⬆️
contracts-rocks-shared-wallet-controller 44.02% <50.00%> (+<0.01%) ⬆️
contracts-rocks-token 44.09% <50.00%> (+<0.01%) ⬆️
contracts-rocks-treasury 43.68% <50.00%> (+<0.01%) ⬆️
e2e-admin-password 22.82% <0.00%> (-0.03%) ⬇️
e2e-clock-stratus 25.67% <0.00%> (-0.02%) ⬇️
e2e-genesis 27.21% <0.00%> (-0.02%) ⬇️
e2e-importer-offline 59.94% <50.00%> (-0.22%) ⬇️
e2e-rpc-downloader 55.15% <50.00%> (-0.01%) ⬇️
e2e-stratus 57.59% <50.00%> (-0.04%) ⬇️
leader-follower- 61.72% <50.00%> (+<0.01%) ⬆️
rust-tests 30.45% <0.00%> (-0.28%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@carneiro-cw carneiro-cw merged commit 7c7d831 into main Feb 27, 2026
51 checks passed
@carneiro-cw carneiro-cw deleted the reject_tx_type4 branch February 27, 2026 20:47
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