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

Implement proposed batch size to be floor(B/N) #36

Closed
sbellem opened this issue Aug 26, 2017 · 4 comments
Closed

Implement proposed batch size to be floor(B/N) #36

sbellem opened this issue Aug 26, 2017 · 4 comments

Comments

@sbellem
Copy link
Contributor

sbellem commented Aug 26, 2017

@amiller I assume you are well aware of this as there's already a TODO note in the code about implementing the random selection.

Nevertheless, regardless of the size, only one element (tx_to_send[0]) is currently passed to _run_round():

class HoneyBadgerBFT():
    # ...
    def run(self):
        # ...
        while True:
            # ...
            # Select all the transactions (TODO: actual random selection)
            tx_to_send = self.transaction_buffer[:self.B]

            # Run the round
            send_r = _make_send(r)
            recv_r = self._per_round_recv[r].get
            new_tx = self._run_round(r, tx_to_send[0], send_r, recv_r)

So _run_round() and tpke.encrypt() should be capable to take a list or a similar data structure.

tpke.encrypt() would need to be modified so that a string (e.g.: cPickle.dumps(raw)) is passed to the padding operation.

So this issue could be done in two (or three) parts:

  1. Pass a list to _run_round(), e.g.: tx_to_send[:1]
  2. Pass floor(B/N) transactions to _run_round(), e.g.: tx_to_send[:int(B/N)]
  3. Implement the random selection
@amiller
Copy link
Owner

amiller commented Sep 1, 2017

We're already doing a version of this in the demo3 branch but it was made in kind of a rush 6c3f710

@sbellem
Copy link
Contributor Author

sbellem commented Sep 3, 2017

We're already doing a version of this in the demo3 branch but it was made in kind of a rush 6c3f710

Ah ok, cool! I had not looked at other branches!

Feel free to close or leave open, or transform the goal of the issue into incorporating 6c3f710 into dev ...

@afck
Copy link

afck commented Aug 14, 2018

I'd maybe use max(1, floor(B / N)), just so that it also works in use cases with very small batch sizes where B / N would be 0.

@sbellem
Copy link
Contributor Author

sbellem commented Aug 24, 2018

This issue was moved to initc3/HoneyBadgerBFT-Python#28

\cc @afck

@sbellem sbellem closed this as completed Aug 24, 2018
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

No branches or pull requests

3 participants