Skip to content

Conversation

@DougAnderson444
Copy link
Collaborator

@DougAnderson444 DougAnderson444 commented May 4, 2025

This is superseded by #18


This PR adds a wasm component new text-based virtual runtime to execute Plog scripts, which can be run anywhere, including wasm32

The runtime parses the script with pest parser, then evaluates the script.

This architecture makes the execution of scripts very flexible.

Fixes #15
Related #4

@dhuseby
Copy link
Member

dhuseby commented May 5, 2025

🎸 🤟🏻

@DougAnderson444
Copy link
Collaborator Author

This is essentially ready for review.

I took the liberty to update a few adjacent modules, such as provenance-log, cli and fix the bs-trait which were missing Error as assoc type.

Have a look and let me know your thoughts!

@DougAnderson444 DougAnderson444 marked this pull request as ready for review May 12, 2025 13:39
using Return Position Impl Trait In Trait (RPITIT) syntax, which allows
for more efficient async trait implementations without requiring the
`async_trait` macro
@DougAnderson444
Copy link
Collaborator Author

Use RPITIT instead of async-trait macro

@DougAnderson444
Copy link
Collaborator Author

DougAnderson444 commented May 12, 2025

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

@DougAnderson444 DougAnderson444 changed the title Make bs wasm32 compatible Make bs wasm32 compatible (merge Comrade + Bestsign chgs) May 14, 2025
@DougAnderson444
Copy link
Collaborator Author

While I'm here, merging in the other changes I made over in Bestsign crate to here

@DougAnderson444
Copy link
Collaborator Author

You guys want to have a look at this so we can merge?

cc @dhuseby

@DougAnderson444
Copy link
Collaborator Author

Might as well jump right to #18

DougAnderson444 added a commit that referenced this pull request Nov 4, 2025
…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]
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.

Use text-based scripts, such that any wasm runtime can be used

3 participants