Skip to content

[robohash app] biased coin flip robust reconstruction fails to open "d" & "e" (BeaverMultiply) #460

@sbellem

Description

@sbellem

When running the robohash app with the biased coin flip, based on fixed point arithmetic, robust reconstruction fails. The error occurs in mpc.py as shown below:

hbmpc.peer0.io_1        | 2020-08-19 18:23:55,576:[mpc.py:cb:162]:[ERROR]: Robust reconstruction for share {6087826343110230357947059204667799136441592364043611791189230863245351977037} (id: 49) failed with errors: None!

Although the error consistently occurs at the above location, the preceding code, invoking the opening may differ for different runs of the same code.

Root cause (?)

Upon further inspection, the reconstruction error, in mpc.py appears to "consistently" occur after trying to open d and e in BeaverMultiply (line 19):

class BeaverMultiply(AsyncMixin):
from honeybadgermpc.mpc import Mpc, Share
name = MixinConstants.MultiplyShare
@staticmethod
@TypeCheck()
async def _prog(context: Mpc, x: Share, y: Share):
a, b, ab = context.preproc.get_triples(context)
d, e = await gather(*[(x - a).open(), (y - b).open()])
xy = d * e + d * b + e * a + ab
return xy

Reproducing the error

To reproduce the error, first checkout the branch troubleshoot/robohash/robust-reconstruction/biased-coin-flip, from the initc3 remote, e.g.:

# upstream points to git@github.com:initc3/HoneyBadgerMPC.git -- change if needed
git fetch upstream
git checkout troubleshoot/robohash/robust-reconstruction/biased-coin-flip

Go into robohash directory:

cd apps/robohash
make run

After running make run you should eventually see a terminal window with 7 panes, the 4 bottom ones are MPC servers where the logs from the failing robust reconstruction can be seen, as in the following screenshot:

image

Further troubleshooting

It's not clear (to me 😄) how to proceed forward with finding the exact root cause of the problem. In case this can help here's a bit of information regarding what has been done to get the current information.

Multiple logging statements were added to try to pinpoint where the problem is occurring. The locations of interests are in:

  • apps/robohash/biased_coin.py (from observations, the problem occurs after an instruction call in the function flip_biased_coin line 76, where a lt operation is invoked with a FixedPoint instance)
  • honeybadgermpc/fixedpoint.py (many supporting functions are involved (trunc, trunc_pr, div2m, etc) -- from observations, the "root" has been the FixedPoint class methods __mul__() or lt()
  • honeybadgermpc/progs/mixins/share_arithmetic.py (in BeaverMultiply, _prog function, opening of d and e)
  • honeybadgermpc/reed_solomon.py (_optimistic_update, line 323)
  • honeybadgermpc/mpc.py (inner function cb, line 162)

Example of logs for one MPC server (hbmpc.peer3.io):

image

Tmux tricks

When troubleshooting, it's useful to search the logs. To do so in tmux:

  1. go to the pane you wish to search
  2. enter in the copy mode with ctrl + b [
  3. enter /
  4. enter characters to search, e.g. (mpc.py)

For more information about key combinations in tmux see https://tmuxcheatsheet.com/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions