Comments (10)
Hi! check out casper/testing_language.py
. You can see where the letters are registered against different functions.
Note that this issue is a discussion on overhauling the testing language to make it more generic across protocols and extensible in the case that you want to add things beyond the basis of a Make/Send. So keep that in mind when groking the existing test lang.
from cbc-casper.
agreed in general! Would love to chat it through.
from cbc-casper.
WIP spec for the protocol state language. In the base language, there are 4 "commands:" M
, S
, E
, and I
.
M
: make a block. M1-A
says: "validator 1 make a block named A."
S
: send a block. S2-A
says: "send validator 2 the block named A."
E
: equivocate. E1-A\(A, B, C)
says: "validator 1 make a block named A, where you pretend you haven't seen A, B, and C."
I
: make an invalid block. I1-A
says: "validator 1 make an invalid block named A."
Some validity rules:
- A message can only be sent after it is created (by
M
,E
, orI
). - Two messages cannot be created with the same name.
Other notes:
- I wonder if we can combine all block generation into a single command. I don't think having
I
is necessary (b/c in many cases, it could be making an invalid block rather than an equivocation). - Is it worth moving specifying the initial validator set into the language?
- How can we specify validator set changes in the language?
There's absolutely a more rigorous way of defining this - with a CFG or something. Will work on this + get some feedback. Interestingly, it's not a regular language! Also, strangely, I think I can come up with a CFG that specifies the production rules for a CFG that specifies this language. This is b/c the production rules are likely infinite... shot in the dark here though.
from cbc-casper.
A few notes:
- Syntax for
E
looks reasonable. I would just use one deliminator -- white space or comma, not both. I
for DOSing the network?- Would your
E
example be invalid? Even if the validator is pretending he hasn't seen A, we should probably not allow for a block name collision in the testing language.
from cbc-casper.
You're right that E
would be invalid in the above. I think we can simplify the language to just M
and S
and I
.
M
: make a block. M1-A
says: "validator 1 make a block named A." M1-B\(A)
says: "validator 1 make a block B without A in view." M1-C\(A,B)
says: "validator 1 make block C without A and B in view." This allows you to equivocate and make invalid blocks as you want.
S
: send a block. S2-A
says: "send validator 2 the block named A."
I
: make an invalid block. I1-A
says: "validator 1 make an invalid block named A." This is invalid in a very specific way - we can make it so it is missing some field or something.
This allows us to specify that vast majority of protocols states, excluding certain cases where messages were invalid for other reasons (e.g. their estimate is not justified). As all invalid messages are "caught at the door" and all are treated the same (at least this is the case now), this isn't really a concern IMO.
The validity rules are pretty similar:
- A message can only be sent after it is created (by
M
orI
). - Two messages cannot be created with the same name.
from cbc-casper.
LGTM.
Just want to point out that I
doesn't even really change the protocol state at least from the perspective of views, justifications, estimates, etc. It really only is an annoyance (unless a protocol chooses to punish these I
message for whatever reason) given that clients have the tools to assess whether it is invalid.
That said, it might be useful in testing certain things (dos), etc
from cbc-casper.
@djrtwo sounds good. I
could change state, as it means a validator who receives this invalid message would slash the validator who made this message...
Going to get a core PR up in the next couple of days for this.
from cbc-casper.
right right. If the generation of I
is incorporated into the headers of any other message for punishments or otherwise, then agreed. And if that is a potential in designing a cbc casper protocol, then it should be a part of the language
from cbc-casper.
This looks really cool! Scanning over the code and sort of understanding what is going on. What is the best way to start playing with it? Would love to add a guide to the README for test lang. I see test_test_lang.py
but still a little unsure.
from cbc-casper.
Addressed in the test lang PR. Closing.
from cbc-casper.
Related Issues (20)
- Add descriptive comments to casper.py HOT 2
- View becomes positive ontology HOT 1
- Validator Strategies HOT 3
- Network.send to handle sender other than message.sender HOT 1
- Reconsider existing msg_gens used by SimulationRunner HOT 1
- Network that can handle peer connectivity
- Add last_finalized_estimate to protocols that need it HOT 1
- Oracle Comparisons HOT 1
- Add ability to specify initial bets HOT 2
- Add test language to protocols where it is missing HOT 1
- Add different estimate rules for protocols w/ non-deterministic estimates HOT 1
- Add safety detection to protocols where it is missing HOT 1
- Restructure Codebase HOT 16
- CliqueOracle optimisation? HOT 1
- Refactor network delay functions to be more dynamic HOT 1
- Add SkipBlockchain protocol to support skip blocks HOT 1
- Silly typo in wiki HOT 2
- Implement CBC-Casper HOT 1
- some thoughts on "CBC Casper the Friendly Ghost" 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 cbc-casper.