feat: Deduplicate localize method for Step.sol#12
Closed
pcw109550 wants to merge 2 commits intotip/pcw109550/fetch-monorepo-contractsfrom
Closed
feat: Deduplicate localize method for Step.sol#12pcw109550 wants to merge 2 commits intotip/pcw109550/fetch-monorepo-contractsfrom
Step.sol#12pcw109550 wants to merge 2 commits intotip/pcw109550/fetch-monorepo-contractsfrom
Conversation
83cb772 to
6a384a8
Compare
f6b2a85 to
6a0fc01
Compare
e7da1f6 to
6b0f2ee
Compare
6a0fc01 to
bbcd6c0
Compare
6b0f2ee to
0b86f77
Compare
bbcd6c0 to
3f7fcd6
Compare
This was referenced Feb 8, 2024
Merged
Collaborator
|
I think the problem is that the gas cost of |
This intentionally hints foundry to compile PreimageOracle.sol required for rvgo tests
3f7fcd6 to
2d09372
Compare
953dbcb to
d706fbf
Compare
Contributor
Yes, this is fine. The Preimage localization isn't too complex, just a few lines of code - I'd opt for duplicating the code rather than adding complexity here. |
Member
Author
|
Thanks for everyone's feedback: Agree with all of you and will close this. |
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.
Description
Upstream cannon directly embeds
PreimageKeyLibmethods to its step contract. By including library functions(which only holds internal methods), bytecodes oflocalizemethod will be stored in step contract and called byJUMPinstruction.In asterisc's case, this change is nontrivial because entire
Stepmethod is implemented in yul. Previous PRs relied on duplication of implementation inside of STF code.I found a workaround; define wrapper method which calls
localizemethod from the library. The compiler thinks this method is not used by anywhere when it is not declared as public method, so explicitly mark as public. After that, delegatecall the method, to preservemsg.sender.However after finding this approach, It feels like it is overly complicated. Should we allow duplications and copy-paste
localizeimplementation, by closing this PR?Is there any better method while deduplication?
Tests
EVM mode tests will cover this diff.
Additional context
Current dependencies on/for this PR:
Step.sol#12 (this PR)