forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recover verified depths for calls to precompiles
Rationale is that if a smart contract at depth N calls a precompile by a CALL opcode (or its variants), there is no corresponding call to the RETURN opcode. Therefore, the ciphertext will remain delegated to depth N + 1 and that might not be the smart contract's original intention. The reason is that if depth N + 1 is EVM bytecode, it will have to go back to N via RETURN. However, if N + 1 is a precompile, it will return "immediately" in Go. In order to solve it, remember the depth set of any verified ciphertext that has a handle to it in a CALL opcode. Then, when returning from the CALL, recover the depth set for the remembered ciphertexts before the call. Rationale is that the CALL is supposed to go back to the same EVM depth in one way or another. Add unit tests to check for these scenarios.
- Loading branch information
1 parent
d0af5bf
commit 39fbc04
Showing
5 changed files
with
207 additions
and
69 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.