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: cast run does not decode events on local node with chain id 1337 #9255

Closed
drortirosh opened this issue Nov 3, 2024 · 3 comments
Closed
Labels
C-cast Command: cast T-bug Type: bug T-to-investigate Type: to investigate

Comments

@drortirosh
Copy link

Component

Cast

Describe the feature you would like

doing cast run <tx> doesn't always fully decode calls and events. When executed against local node, it does parse methodIds, but not events.
However, when decoding transaction on external chains (event testnet, like sepolia), it parses both methods and events.

Apparently, it depends on the "chainId" of the local node, and when chainId is "1337", it fails to decode some information.
with Anvil, I can add --chain-id, but some of my tests require geth, which can't easily change the chainid.

suggestion
Either should be able to "push" symbol information to chain-id specific, or add a fallback, that if methodid/topicid are missing for a specific chain, then use them from another (after all, they can't differ much, the methodid/topicid depend on the method name and parameter types. the only thing that can differ between networks is the parameter names)

Additional context

No response

@drortirosh drortirosh added T-feature Type: feature T-needs-triage Type: this issue needs to be labelled labels Nov 3, 2024
@zerosnacks zerosnacks changed the title cast run partial decode bug: cast run does not decode events on local node with chain id 1337 Nov 4, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Nov 4, 2024
@zerosnacks zerosnacks added C-cast Command: cast T-to-investigate Type: to investigate T-bug Type: bug and removed T-needs-triage Type: this issue needs to be labelled T-feature Type: feature labels Nov 4, 2024
@grandizzy
Copy link
Collaborator

grandizzy commented Nov 5, 2024

I think we're fetching that from etherscan API that is mapped to chain id (https://github.com/alloy-rs/chains/blob/main/src/named.rs#L1047), what you could try is to map the dev chainId "1337" (https://github.com/alloy-rs/chains/blob/main/src/named.rs#L170) to an Etherscan url / api, see https://book.getfoundry.sh/reference/config/etherscan
Pls lmk if this helps, thank you

le: sorry, just noticed that's cast run so no foundry.toml config. maybe we can make etherscan url option available in cast run

@grandizzy
Copy link
Collaborator

possible related #3473

@grandizzy
Copy link
Collaborator

marking as dupe of #8606 and going to track impl there. thank you!

@grandizzy grandizzy closed this as not planned Won't fix, can't repro, duplicate, stale Nov 14, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast T-bug Type: bug T-to-investigate Type: to investigate
Projects
Status: Done
Development

No branches or pull requests

3 participants