Skip to content
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

Binary Protocol + Protocol Organization (step 1) #92

Merged
merged 16 commits into from
Nov 1, 2017

Conversation

djrtwo
Copy link
Collaborator

@djrtwo djrtwo commented Oct 31, 2017

I think we should get it merged in as is for now. Will allow Vlad to generate some binary gifs if he wants.

Stuff:

  • your binary protocol
  • add Protocol class that defines the components of a protocol (pass around as necessary)
  • can specify protocol to casper.py via --protocol (defaults to blockchain) and must specify when making an experiment ("protocol")
  • added some tests
  • minimum separation in testing (much to still do)

NOTE: This is pointed at master. This includes your binary stuff but I already merged in master to here and handled a bunch of conflicts. I recommend merging this into master when ready and closing the other Binary PR.

@djrtwo djrtwo changed the base branch from feat/add_binary to master October 31, 2017 03:57
@djrtwo djrtwo changed the title Protocol Organization (step 1) Binary Protocol + Protocol Organization (step 1) Oct 31, 2017
@naterush
Copy link
Collaborator

naterush commented Nov 1, 2017

@djrtwo I'll check this out and merge it tonight!

@djrtwo
Copy link
Collaborator Author

djrtwo commented Nov 1, 2017 via email

@naterush
Copy link
Collaborator

naterush commented Nov 1, 2017

Starting review now.

Copy link
Collaborator

@naterush naterush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked this our briefly. Gotta hop on a train soon and will be able to review more thoroughly.

Looks much cleaner than before. This is great!

class BinaryView(AbstractView):
"""A view class that also keeps track of a last_finalized_block and children"""
def __init__(self, messages=None):
super().__init__()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add messages here through super, but down in BlockchainView. We should pick one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I say do super.

You have to define add_messages in child, but the parent will always do the "if none, and add_message" call

self.validator_set = validator_set
self.global_view = view_class()
self.global_view = protocol.View(set())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty :)

@naterush
Copy link
Collaborator

naterush commented Nov 1, 2017

This looks good. Merging now.

@naterush naterush merged commit a725943 into master Nov 1, 2017
@zramsay zramsay deleted the chore/protocol-testing branch November 6, 2017 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants