Register-tracing: Elf bytes from accounts instead of walking directories #278
+106
−86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The problem
With
0.9.0theregister-tracingfeature has landed. The way it reaches to the elf bytes is to walk the directories, search for the.sofiles and do theSHA-256hashing onward. This can be skipped because upon loading a program (.so) it finds its way in its own account according to theBPFloader and as a result we can simply fetch the elf bytes from there. Similar to (anza-xyz/mollusk#193)The change
The idea of this PR is to simply fetch the elf bytes from
LiteSVM'saccounts_dbsearching by program_id key. I believe it's a much cleaner solution. Since we need access to theLiteSVMinstance a reference to it is passed in the before/after invocation callbacks.