-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate sig hasher to vyper LLL #73
Comments
Note, this was previously pointing to the wrong contract. The link has been updated to the correct contract. |
Since vyper does not support inline assembly, how can the assembly code like |
@hrishikeshio Vyper LLL rather than high level Vyper. LLL is an intermediary between vyper and bytecode. |
I'm going to follow up the purity checker migration with this migration -- anyone else working on it already? |
After looking at the options I'm thinking we do the following, taking into consideration that we want to stay w/in the domain of Vyper as much as possible... Vyper already has a This is an example usage for the Note, some of the syntax or function names may ultimately change -- this is just illustrative: def validate_vote_signature(vote_msg: bytes[1024]) -> bool:
# Decode RLP list
values: tuple(uint256, bytes32, uint256, uint256, bytes) = RLPList(vote_msg, [uint256, bytes32, uint256, uint256, bytes])
msg: tuple(uint256, bytes32, uint256, uint256)
msg, _ = values
new_msg: bytes = RLPEncode(msg, [uint256, bytes32, uint256, uint256])
msg_hash: bytes32 = sha3(new_msg)
validator_index: uint256 = values[0]
sig: bytes[1024] = values[4]
return self.validate_signature(msg_hash, sig, validator_index) There are two caveats I can think of:
Thoughts anyone? |
Issue
Sig hasher is currently written in the deprecated Serpent. We should stop relying on Serpent compiler.
Proposed implementation
Example Vyper LLL and compile techniques here https://github.com/ethereum/casper/blob/master/tests/utils/valcodes.py
The text was updated successfully, but these errors were encountered: