plasma icon indicating copy to clipboard operation
plasma copied to clipboard

No constants

Open homakov opened this issue 8 years ago • 5 comments

var opcodes = constants.opcodes;
                       ^

TypeError: Cannot read property 'opcodes' of undefined

bcoin.constants no more?

homakov avatar Sep 09 '17 14:09 homakov

Yeah, plasma was written for an alpha version of bcoin that predated the more stable release. The internals have changed a lot since. Unfortunately I haven't had the time to keep this project updated as much as I've wanted to. I'm hoping eventually to take a day to go through and update it to use the modern bcoin APIs (and also at least get the network layer working again).

chjj avatar Sep 10 '17 07:09 chjj

I tried to replace some vars and stuck at utils.cmp is not a function. The code otherwise looks great. Even if not for production, would serve as great reference implementation for other programmers. Thanks, I hope this day will come soon :)

homakov avatar Sep 10 '17 10:09 homakov

I'd be willing to chip in on getting it caught up with bcoin - @chjj I know bcoin is designed to support multiple wallets in a multi-tenant sort of way, was that a design goal of plasma as well?

patwhite avatar Sep 10 '17 23:09 patwhite

Ok, I've gotten quite a bit of the way: https://github.com/patwhite/plasma/tree/bcoin-upgrade

There are a few sticky places - first, I made a bunch of changes to how you push to transactions because of assertion fails, I tried to follow patterns I saw in bcoin, but feels like a regression to go from enum style to strings (from a push(opcode.OP_IF) to pushSym('OP_IF')). Also didn't know how to push a bn, I serialized to a string...that didn't feel right.

It's still not running any tests, bumping into some crash at a tx.addInput. @chjj or @homakov, would be happy to keep hacking on it with you!

patwhite avatar Sep 11 '17 05:09 patwhite

@patwhite i've done a lot of similar fixes too, so i will keep fixing my version

@chjj why in tests both parties deposit in channel?

   var channelCapacity = 10 * 1e8;
    var channelBalance = channelCapacity / 2;

I haven't seen any use case when both users would need to fund new channel.

homakov avatar Sep 11 '17 11:09 homakov