Spec for opcode BALANCE#48
Closed
silathdiir wants to merge 5 commits into
Closed
Conversation
* Implement opcode `ADDRESS`. * Add Markdown doc for opcode `ADDRESS`. * Fixed to `gas - 2`.
…thereum#246) * fix: constraint system fix | related fixes in copy circuit * chore: revert unnecessary change * fix: update sha3 gadget, copy lookup only for length > 0
DreamWuGit
reviewed
Aug 15, 2022
DreamWuGit
reviewed
Aug 16, 2022
| tx_id = instruction.call_context_lookup(CallContextFieldTag.TxId) | ||
| is_warm = instruction.add_account_to_access_list(tx_id, address, instruction.reversion_info()) | ||
|
|
||
| balance = instruction.account_read(address, AccountFieldTag.Balance) |
There was a problem hiding this comment.
not sure if need to constrain "If the given account
doesn't exist, then it will push 0 onto the stack instead." in the circuit , what do you think ? @
silathdiir
Author
There was a problem hiding this comment.
It seems that the balance is constrained to be equal with stack_push in next line:
instruction.constrain_equal(instruction.stack_push(), balance)
If the given account doesn't exist, stack_push should be 0 and also constrain balance to be 0. WDYT? Thanks.
Author
There was a problem hiding this comment.
After discussing with @DreamWuGit , will send PR to upstream with this question in comment.
Author
|
Moved to upstream privacy-ethereum#248 |
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.
Circuit: scroll-tech/zkevm-circuits#185