-
Notifications
You must be signed in to change notification settings - Fork 0
Make bs wasm32 compatible (merge Comrade + Bestsign chgs) #16
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
Conversation
its the reference impl it has wacc and runtime and parser and ast... what else do you call it
|
🎸 🤟🏻 |
Work in progress
because it runs the script
|
This is essentially ready for review. I took the liberty to update a few adjacent modules, such as Have a look and let me know your thoughts! |
using Return Position Impl Trait In Trait (RPITIT) syntax, which allows for more efficient async trait implementations without requiring the `async_trait` macro
|
Use RPITIT instead of async-trait macro |
|
Scope creep on this PR, sorry about that, but I'm using some of these traits, and rust-analyzer won't work if the work crate doesn't compile |
|
While I'm here, merging in the other changes I made over in Bestsign crate to here |
|
You guys want to have a look at this so we can merge? cc @dhuseby |
|
Might as well jump right to #18 |
…e bs (#18) Major upgrade for BetterSign from my Comrade and BestSign projects. branched off of comrade/bestsign branch 81b2c99 p2p peer wallet evolved traits type-safe fixes #4, #15, supersedes #16 Commits: * scaffold comrade & component * add parser * eval script test passing * fix comments * fixup comments * cleanup * fix bug in lock/unlock curr/proposed stack push * rename crypto to reference its the reference impl it has wacc and runtime and parser and ast... what else do you call it * add wasm component * cleanup * WIP: Start to scaffold the main API Work in progress * nice clean api * add rustdoc comments * scaffold virtual runtime * rename vm -> runtime because it runs the script * haul in deps for wasm runtime * makeruntimes optional and extensible * add runtime trait and Runner bounds * fix typo * scaffold build bytes and justfile recipes * set wasmi_runtime_layer to v0.40 * add wasm32 build, test, just recipes * random module is for wasm32 only * add layer definitions * use Pairable supertrait * tested logs * impl try_unlock * more tests * test passing! * add readme rustdoc tests * small fixes * add direct runtime * switch to direct runtime as default * web tests * rm dead code * use CondSync since wasm32 doesn't need Send + Sync * comrade use Pairs only rm Pairable * mk comrade worspace dep * update lifetime * fix missing dep (again) cryptidtech/multicid@2458479 * update trait to incl Error too * update plog and open * haul in bs-p2p * use Self::Error assoc type in traits * add cond_send for wasm32 and native compat * constraint data references by (Cond)Sync bounds * elide lifetimes where poss, add Panics comments to uncheched fns * rm workspace dep with js feat * trait, associate types, sync and async * add `with_domain` for non-"/" paths * readme edits * add readme * readme * use shiny new traits in bs and cli * READMEs (plural) * README * map_err * use set_error method * WIP: Stash * add prev_cid to VerifyIter * fix comments * first pass (incomplete) * add wallet with updated traits * update deps * fix content-addressable errors and tests * immutable trait * use wallet in browser peer * fix Error types in trait and tests testing passes * add README note for running tests * fix Codec * fix the fix * add entry_key mod * fix bug in verifyiter * add failing comrade tests * upraded, passing tests * cleanup * store BsPeer config to blockstore * add tests to update_plog * update cli plog * use directories for blockstore * save arbitrary data to log and blockstore * add cargo config.toml * add vlad.cid() method * store plog entries to blockstore * use test fixtures * evolve key, keypath and signing traits * tidy up * add dep * use NonZeroUsize for threshold and limit, plus general update * progress VladParams * modernize VladParams API * rn, mv, tightly couple FirstEntryKeyParams to Vlad * refactor open::Config * update cli and docs for VladParams type safety * refactor update::Config * derive first lock script from within Vlad * web tests * add update and load tests * add network to bs-peer * add resolver and interop test * progress tests * passing interop tests * revamp Resolver trait * use ResolverExt in bs crate * complete rustdoc para * add log detail * add error details * plog get_value includes ops * improve native test * downgrade trace * add test README details * add more docs * export DefaultBsPeer * export bs_peer utils * impl Display for Vlad and test it * save swarm config to directories * re-exports * log runtime errors * rename from peerpiper to bettersign * export Client * scaffold bs-server * record plog to DHT * error is not connected and trying to DHT publish * convert Entry to use bon builder, add rustdocs * update checks seqno for lipmaa and sets accordingly * move entry as it gets signed * no more cloning * update tests * add justfile for chromedriver download * new Vlad generate API * add Vlad::try_from_str * Nonce creation methods * better rustdocs * re-export ResolverExt * mv Resolver to network client * docs * add PartialEq * make public fn * impl Clone for BsPeer * entry signing key methods * wrap plog on Arc Mutex * shorter lock hold in block * fix tests (deadlock) * enable StartConfig * derive Hash on types * export Libp2pEvents * entrie vlad goes in DHT as bytes * add tracing * add timeout, SuperResolver supertrait for CondSend so we can use timeout in both wasm and tokio * rm unneeded lock * store entries on update * cleanup deps * updated API and tests * add ability to rotate keys * publish to pubsub too * rm dead import * add vlad length to test output * [email protected]
This is superseded by #18
This PR adds a
wasm componentnew text-based virtual runtime to execute Plog scripts, which can be run anywhere, includingwasm32The runtime parses the script with pest parser, then evaluates the script.
This architecture makes the execution of scripts very flexible.
Fixes #15
Related #4