Skip to content

feat(rpc): add eth_fillTransaction#11552

Draft
0xDevNinja wants to merge 3 commits into
NethermindEth:masterfrom
0xDevNinja:feature/11374-eth-fillTransaction
Draft

feat(rpc): add eth_fillTransaction#11552
0xDevNinja wants to merge 3 commits into
NethermindEth:masterfrom
0xDevNinja:feature/11374-eth-fillTransaction

Conversation

@0xDevNinja

Copy link
Copy Markdown
Contributor

Closes #11374

Changes

  • Add eth_fillTransaction RPC method that fills missing defaults on a partial transaction and returns the unsigned RLP alongside the filled object (geth / reth shape).
  • Fill behaviour:
    • from defaults to the wallet's first account; errors when no wallet accounts are available.
    • chainId defaults to the network chainId.
    • nonce defaults to the pending nonce from the tx pool.
    • EIP-1559 transactions: maxPriorityFeePerGas from the gas-price oracle, maxFeePerGas = 2 * baseFee + tip.
    • Legacy / access-list: gasPrice from the gas-price oracle.
    • gas from eth_estimateGas on Latest.
  • Add FillTransactionResult { raw, tx } data type.

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other:

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Three integration tests via TestRpcBlockchain:

  • Legacy path: gasPrice honoured, nonce / gas / chainId filled when omitted.
  • EIP-1559 path: maxFeePerGas + maxPriorityFeePerGas filled when omitted.
  • Raw RLP round-trips back to the same transaction (to / value / gasPrice asserted).

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

New JSON-RPC method eth_fillTransaction — fills the defaults (nonce, gas, gas pricing, chainId, from) of a partial transaction and returns the unsigned RLP plus the echoed object. Matches geth and reth.

Remarks

Out of scope for this PR (intentional):

  • AccessList auto-generation (belongs in eth_createAccessList).
  • Blob sidecar handling for type-3 transactions.
  • SetCode authorization list filling for type-4.

FillTransactionResult has the same shape as SignTransactionResult from #11517. Happy to fold the two into one type once that lands.

@svlachakis svlachakis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is on hold and we expect spec changes, see our comments on the issue

@0xDevNinja 0xDevNinja marked this pull request as draft May 11, 2026 07:40
@0xDevNinja

Copy link
Copy Markdown
Contributor Author

Thanks for the quick heads-up — apologies, I missed the open discussion on the issue before opening this. Should have read the thread first.

I've converted this to a Draft so it doesn't sit in the review queue while the team decides direction. Two questions raised on the issue I'd find useful to know:

  1. deffrian's safety concern — would the team prefer the raw field dropped entirely (so only the verified tx object is returned and the caller re-encodes after inspection)? Happy to flip the implementation that way if so. The current shape matches geth/reth, but the security argument is a fair one for an offline-signing primitive.
  2. Whether to implement at all — if there's no concrete use case driving this and the security model isn't resolved, I'm fine closing the PR and the issue. Otherwise I'll keep the branch parked and rework once the spec lands.

Let me know what direction works.

@svlachakis

svlachakis commented May 11, 2026

Copy link
Copy Markdown
Contributor

@0xDevNinja keep it parked for now or close just the PR, whatever you prefer. Issue needs to remain open.

Mirrors geth's response for eth_fillTransaction / eth_signTransaction:
the unsigned-or-signed RLP plus the echoed transaction object.
Fills missing defaults on a partial transaction and returns the unsigned RLP
alongside the filled object — matches geth and reth.

Field-by-field behaviour:
- from defaults to the wallet's first account when omitted; error if no wallet
  accounts are available.
- chainId defaults to the configured network chainId.
- nonce defaults to the pending nonce from the tx pool.
- For EIP-1559 transactions: maxPriorityFeePerGas defaults to the gas-price
  oracle's priority-fee estimate; maxFeePerGas defaults to 2 * baseFee + tip.
- For legacy / access-list: gasPrice defaults to the gas-price oracle estimate.
- gas defaults to the eth_estimateGas result on Latest.

Closes NethermindEth#11374.
Three scenarios via TestRpcBlockchain:
- Legacy: nonce/gas/chainId filled when omitted; user-supplied gasPrice retained.
- EIP-1559: maxFeePerGas and maxPriorityFeePerGas filled when omitted.
- Raw RLP round-trips back to the same transaction.
@0xDevNinja 0xDevNinja force-pushed the feature/11374-eth-fillTransaction branch from 0d124fe to 6e0f92f Compare May 18, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eth_fillTransaction

2 participants