-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(linking): deep-merge link_references from creation and deployed bytecode #11759
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(linking): deep-merge link_references from creation and deployed bytecode #11759
Conversation
|
Is there a test case we could add for this that would fail before? @klkvr thoughts? |
Yes, added a test case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, left a suggestion for driveby clean up
also need to commit the test files and investigate whether the linking tests are actually testing anything
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs rebase and ci fixes
554024c to
50d62f7
Compare
test / nextest / test unit (x86_64-pc-windows-msvc) (pull_request) I'm sorry but i can't fix this, i can't just test it on my computer, it's not that powerful, and I think making noise here is not the best idea.. |
7625f36 to
514142f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Updated tests. I verified that the added test fails on master and passes in this PR.
Wow, thank you, too. I didn't really know how to revert my incorrect rebase so i was stuck, thank you for your help |
Before: Dependencies were built by shallow-merging link_references maps via extend. When both creation and deployed bytecode contained references under the same file key but with different library names, the latter overwrote the former, dropping dependencies.
After: We deep-merge the inner maps per file, unioning library names and offsets from both sources. This matches how we link and validate both bytecode objects and aligns with forge inspect ... libraries (union semantics). Prevents missing libs when a file has libraries used exclusively in constructor vs runtime.