fix(precompiles): bind system_transfer_from to msg.sender#3786
Draft
legion2002 wants to merge 1 commit intomainfrom
Draft
fix(precompiles): bind system_transfer_from to msg.sender#3786legion2002 wants to merge 1 commit intomainfrom
legion2002 wants to merge 1 commit intomainfrom
Conversation
Contributor
📊 Tempo Precompiles CoverageprecompilesCoverage: 5640/7677 lines (73.47%) File details
contractsCoverage: 1/226 lines (0.44%) File details
Total: 5641/7903 lines (71.38%) |
klkvr
reviewed
May 1, 2026
| }; | ||
|
|
||
| scoped_thread_local!(static STORAGE: RefCell<&mut dyn PrecompileStorageProvider>); | ||
| scoped_thread_local!(static MSG_SENDER: Address); |
Member
There was a problem hiding this comment.
hmm not sure i understand the idea here. all precompiles propagate msg_sender manually now so adding this introduces a bit of an inconsistency to how it's handled
also i don't think we need to keep it as a thread local variable, it could just be a part of PrecompileStorageProvider context i believe
Contributor
Author
There was a problem hiding this comment.
Yeah we want to remove manually propogating msg_sender to system transfer from, so we can have better guarantees about TIP 1035.
We want system_transfer_from to receive a trusted msg_sender, instead of trusting whatever the precompile passes to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses the review feedback on PR #3219 by removing the caller-supplied source address from
system_transfer_fromand binding it to the externalmsg.sendercaptured at the precompile boundary.This threads
msg.senderthroughStorageCtx, updates the TIP-20 helper and AMM call sites, and adds regression coverage for the scoped sender context.Validation:
cargo nextest run -p tempo-precompilesLinear: https://linear.app/tempoxyz/issue/CHAIN-1144/tip-1035-implicit-approvals-list