Comments (5)
Note, this was previously pointing to the wrong contract. The link has been updated to the correct contract.
from casper.
Since vyper does not support inline assembly, how can the assembly code like mstore
be implemented in the vyper implementation?
from casper.
@hrishikeshio Vyper LLL rather than high level Vyper. LLL is an intermediary between vyper and bytecode.
from casper.
I'm going to follow up the purity checker migration with this migration -- anyone else working on it already?
from casper.
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 RLPDecode
built-in which you can see in the example below. There is no RLPEncode
but I'm electing to submit a PR for that to the Vyper repo in lieu of just porting MSG_HASHER
here. This way we can drop msg_hash.se.py
completely and just use the Vyper functions.
This is an example usage for the validate_vote_signature
method in simple_casper.v.py
.
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:
-
Waiting on integration and release of a new Vyper version w/ the required builtins will take some time, blocking this issue (and others that depend on it)
-
As long as the input data represented an RLP list,
msg_hash.se.py
allowed for any arbitrary RLP list elements by just walking the length data (if present) for each element. This approach will be less flexible as the required message format will have to be specified for the Vyper builtins to work. The Casper contract already commits to a specific message format so it doesn't seem like a problem but figured it was worth mentioning to consider before pursuing this approach.
Thoughts anyone?
from casper.
Related Issues (20)
- ubuntu install issue HOT 4
- Can't call `init` and `initialize_epoch` at same block number HOT 1
- Contract warmup period HOT 1
- next_validator_index comment is misleading HOT 2
- `slash` when validator has deposited but not yet reached `start_dynasty` HOT 4
- `assert msg.sender == NULL_SENDER` in `vote` HOT 3
- Port testing to `eth-tester` HOT 2
- Exposing `validate_vote_signature` and `votable`
- Add vyper compiling instructions to README HOT 12
- Getting ready for the Vyper's beta launch HOT 4
- Suggestion: rename the repo to Casper-FFG HOT 5
- Create `voting_period` and seal off vote data HOT 1
- Deploy PURITY_CHECKER and MSG_HASHER with via compile in testing HOT 4
- Collective reward/penalties are opaque HOT 1
- Tests take too long
- Gas cost profiling, optimization, and management HOT 1
- Purity checker does not filter STATICCALL opcode HOT 7
- pytest tests error
- Intertwine Casper with lightning network
- Depracte the repo HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from casper.