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

[Bug] Set from via filler for eth_call and eth_estimateGas #1942

Open
kassandraoftroy opened this issue Jan 22, 2025 · 7 comments · May be fixed by #2092
Open

[Bug] Set from via filler for eth_call and eth_estimateGas #1942

kassandraoftroy opened this issue Jan 22, 2025 · 7 comments · May be fixed by #2092
Assignees
Labels
bug Something isn't working c-provider P-high High Priority
Milestone

Comments

@kassandraoftroy
Copy link

Component

provider, pubsub

What version of Alloy are you on?

0.9.2

Operating System

Linux

Describe the bug

hey there i am having an issue with transaction simulation failing (where if i just skip simulation with the exact same payload and parameters it works)

seems like it has something to do with doing native transfers during my call (simulation) because I get back that I got this error execution reverted, data: "0x9fb7cfe2" which corresponds to this spot in my SC

https://github.com/kassandraoftroy/stealth-gas-contracts/blob/main/src/StealthGasStation.sol#L63

tx payload:

0x589f5407000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000002386f26fc100000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000a4b0855e70013ea969932c7614f34db012cb00d40000000000000000000000000000000000000000000000000000000000000000

on contract address: 0x943285f1a29281e59514fF35Dc16E5a14E123a27

network: holesky testnet, using an alchemy rpc wss://eth-holesky.g.alchemy.com/v2/xxxxxxx

block number: ~3196935 (or current)

source code doing simulation: https://github.com/kassandraoftroy/stealth-gas-backend/blob/main/src/http_server.rs#L164-L186

caller/signer of tx being simulated: 0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1

here you can see that on tenderly simulation the same tx succeeds! https://www.tdly.co/shared/simulation/1efe08e3-a571-4511-82e1-46df3d3bbf05

my suspicion: it may be a bug in simulation where native transfers fail for some reason (maybe forwarding gas? maybe thinking the EOA can't receive eth? idk)

let me know what you think!

@kassandraoftroy kassandraoftroy added the bug Something isn't working label Jan 22, 2025
@mattsse
Copy link
Member

mattsse commented Feb 11, 2025

could you perhaps provide a repro for this?

@DaniPopes
Copy link
Member

Also not entirely sure how this relates to alloy, I would recommend you inspect the RPC request with RUST_LOG=alloy=trace and see if it could be an error in the parameters

@kassandraoftroy
Copy link
Author

hey there I did a full repro and you can see it here: https://github.com/kassandraoftroy/repro-alloy-sim-err

but in the process of doing the repro i think i spotted something! when i add .with_from() to the simulation it works as expected...

i am leaving this open bc the error reported in the execution still seems extremely weird to me (NativeTransferFailed()) and it's what threw me off. if the error is actually downstream of not having .with_from why would i get error that execution fails at this line ? also why do i need to add .with_from to simulations but not when sending transaction? (if i skip simulation it succeeds even without .with_from)

@yash-atreya
Copy link
Member

Adding more context from TG: https://t.me/ethers_rs/43253

if you pass this Tx struct to send_transaction and your provider has a signer and recommended fillers etc, then everything will go smooth, as i suppose the provider will fill in from for you under the hood. But if you estimate_gas on this same tx struct i suppose it won't necessarily fill in from and this was ultimately what made the behavior different in simulation on my call.

Changed title to reflect action item

@yash-atreya yash-atreya added the investigate Able to reproduce, requires investigation label Feb 20, 2025
@yash-atreya yash-atreya changed the title [Bug] Simulation fails when call succeeds [Bug] Set from via filler for eth_call and eth_estimateGas Feb 20, 2025
@yash-atreya yash-atreya added this to the v1.0 milestone Feb 20, 2025
@yash-atreya
Copy link
Member

Resolved by #2011

@mattsse
Copy link
Member

mattsse commented Feb 20, 2025

actually I think this isn't the case already, if I look at fillprovider

we actually never call the new prepare request call

@mattsse mattsse reopened this Feb 20, 2025
@yash-atreya
Copy link
Member

Looking into it

@yash-atreya yash-atreya self-assigned this Feb 20, 2025
@yash-atreya yash-atreya linked a pull request Feb 21, 2025 that will close this issue
3 tasks
@github-project-automation github-project-automation bot moved this to Todo in Alloy Feb 21, 2025
@yash-atreya yash-atreya moved this from Todo to Ready for Review in Alloy Feb 21, 2025
@yash-atreya yash-atreya added P-high High Priority and removed investigate Able to reproduce, requires investigation labels Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c-provider P-high High Priority
Projects
Status: Ready for Review
Development

Successfully merging a pull request may close this issue.

5 participants
@mattsse @kassandraoftroy @yash-atreya @DaniPopes and others