alloy-rs / alloy

Transports, Middleware, and Networks for the Alloy project
https://alloy.rs
Apache License 2.0
664 stars 239 forks source link

feat: make eth_call and eth_estimateGas default to using Pending block #1568

Closed prestwich closed 1 month ago

prestwich commented 1 month ago

Changes default behavior of eth_call and eth_estimateGas to use the "pending" block tag.

Motivation

per discussion in slack channel

Users do not expect to simulate on latest height and timestamp, and will get subtly incorrect outputs when calls read block.height or block.timestamp. Users generally expect the next value when simulating, as they are anticipating submitting a transaction. This changes default client behavior to specify "pending" for those calls

PR Checklist