Skip to content

Conversation

@mablr
Copy link
Contributor

@mablr mablr commented Nov 17, 2025

Motivation

Close #12590

Solution

  • Introduced EthFillTransaction to handle filling transaction fields with defaults.
  • Implemented fill_transaction method to populate missing fields like nonce, gas limit, and fees.
  • Added FillTransactionResult struct to encapsulate the response of the new RPC method.
  • Updated tests to verify the functionality of the fill_transaction method, ensuring it correctly fills in required fields and preserves provided values.

heavily inspired from reth impl s/o @kumaryash90

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

- Introduced `EthFillTransaction` to handle filling transaction fields with defaults.
- Implemented `fill_transaction` method to populate missing fields like nonce, gas limit, and fees.
- Added `FillTransactionResult` struct to encapsulate the response of the new RPC method.
- Updated tests to verify the functionality of the `fill_transaction` method, ensuring it correctly fills in required fields and preserves provided values.
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

nice, smol nit

Comment on lines +1276 to +1286
/// Response type for `eth_fillTransaction` RPC method.
///
/// This type represents a transaction that has been "filled" with default values
/// for missing fields like nonce, gas limit, and fee parameters.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct FillTransactionResult<T> {
/// RLP-encoded transaction bytes
pub raw: Bytes,
/// Filled transaction request
pub tx: T,
}
Copy link
Member

Choose a reason for hiding this comment

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

I think we can now upstream this to allo-eth-rpc

@mattsse mattsse added this pull request to the merge queue Nov 18, 2025
Merged via the queue into foundry-rs:master with commit 16cf9fb Nov 18, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this to Done in Foundry Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add support for eth_fillTransaction

2 participants