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

fix: ignore unknown opcodes in source maps #764

Merged
merged 5 commits into from
Jan 13, 2025
Merged

Conversation

fvictorio
Copy link
Member

Closes #763.

As far as I can tell, this can only happens when solc produces source maps that have an error, so I think just ignoring this is fine. I'm not adding a test for this because it seems to only happen in very special circumstances, with older versions of solc.

Copy link

changeset-bot bot commented Jan 6, 2025

🦋 Changeset detected

Latest commit: 801e351

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@nomicfoundation/edr Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@fvictorio fvictorio had a problem deploying to github-action-benchmark January 6, 2025 16:09 — with GitHub Actions Error
crates/edr_solidity/src/source_map.rs Outdated Show resolved Hide resolved
@fvictorio fvictorio had a problem deploying to github-action-benchmark January 10, 2025 15:02 — with GitHub Actions Error
@fvictorio fvictorio temporarily deployed to github-action-benchmark January 10, 2025 15:05 — with GitHub Actions Inactive
@fvictorio
Copy link
Member Author

The Drop write lock immediately after using it commit is unrelated to this fix, but I ran into that when trying to debug something, and @agostbiro suggested we make that change, since it's a more sane handling of the lock.

@fvictorio fvictorio requested review from Wodann and agostbiro January 10, 2025 15:06
Copy link
Member

@agostbiro agostbiro left a comment

Choose a reason for hiding this comment

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

Thanks LGTM with one nit

let opcode = if let Some(opcode) = OpCode::new(bytecode[pc]) {
opcode
} else {
debug!("Invalid opcode {} at pc: {}", bytecode[pc], pc);
Copy link
Member

Choose a reason for hiding this comment

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

nit: I prefer to not to import these macros from log and just write log::debug! so that it's easy to differentiate from tracing::debug!

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Member

@Wodann Wodann left a comment

Choose a reason for hiding this comment

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

Same comment as Agost. Otherwise looks good to me!

@fvictorio fvictorio temporarily deployed to github-action-benchmark January 13, 2025 09:38 — with GitHub Actions Inactive
@fvictorio fvictorio added this pull request to the merge queue Jan 13, 2025
Merged via the queue into main with commit 4ffb4f6 Jan 13, 2025
37 checks passed
@fvictorio fvictorio deleted the invalid-opcode-bug branch January 13, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hardhat Network tracing disabled: VmTraceDecoder failed to be initialized.
4 participants