This repository was archived by the owner on Jul 5, 2024. It is now read-only.
Propagate value of caller when DELEGATECALL#975
Closed
han0110 wants to merge 1 commit into
Closed
Conversation
|
no i think this fix is not correct. Eg: in bus-mapping callop, there is a transfer call.value. With this PR, there will be a transfer from the delegate caller to delegate callee, which is not the correct behavior. |
Collaborator
|
@silathdiir is working a fix for this problem. #973 |
Contributor
Author
|
I see I see, I thought it's a separate issue, but it's actually related, thanks for noticing! Close this one in favor of #973. |
han0110
added a commit
that referenced
this pull request
Dec 23, 2022
…ALL`) (#973) * Add function `call_context_as_word` and fix `current_value` to Word type. * Fix to not invoke `transfer` for call related opcodes (CALLCODE, DELEGATECALL and STATICCALL) expect CALL. * Fix to use `current_call.value` to setup next-call context for DELEGATECALL. * Update to set first transaction with value `1000`. It sets `current_call.value` to 1000. * Fix to setup next call `is_static` as current `is_static` or `is_staticcall`. * Update according to spec code and integrate with non-existing proof. * Merge PR #975 into this PR, and revert the `current_call.value` fix in bus-mapping. * Update zkevm-circuits/src/evm_circuit/execution/callop.rs Co-authored-by: Han <tinghan0110@gmail.com> * Update bus-mapping/src/evm/opcodes/callop.rs Co-authored-by: Han <tinghan0110@gmail.com> * Revert with non-existing callee in test cases, and update `has_value` in circuit. * Revert `current_value` to a Cell. * Enable non-existing accounts in test cases, and set empty hash if account doesn't exist. * Move getting callee existent before `transfer` in bus-mapping. * Fix to reuse `transfer.caller_balance_pair` for `caller_balance` in CALLCODE. * Fix lint and wrong assignment. Co-authored-by: Han <tinghan0110@gmail.com>
noel2004
pushed a commit
to noel2004/zkevm-circuits
that referenced
this pull request
Nov 29, 2023
* Return `ChunkProof` from `chunk_prove` test. * Add `batch_prove` test.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR aims to fix
parse_callto propagate caller's value to next call, and calculate the gas cost correctly (when it's delegate call with propagated value, no need to add extra gas).Resolves #969.