hirosystems / clarinet

Write, test and deploy high-quality smart contracts to the Stacks blockchain and Bitcoin.
https://hiro.so/clarinet
GNU General Public License v3.0
303 stars 138 forks source link

Simplify dependency graph between clarinet, vm, chainhook #1038

Open hugocaillard opened 1 year ago

hugocaillard commented 1 year ago

With the he current circular dependency between the chainhook and clarinet. (Not at the component level but at repo level.) Which can make it difficult to upgrade certain components such as clarity-vm. Let's see how it could be simplified

cf https://excalidraw.com/#json=C6utZGxw1NmRSpdqJ45by,v4xP6luxStAWKtQF6oUyZQ

Or mermaid version:

flowchart TB
    VM[clarity-vm]
    REPL[clarity-repl]
    CLI[clarinet-cli]
    FILES[clarinet-files]
    SN[stacks-network]

    CHOE[chainhook-event-observer]
    CHT[chainhook-types]

    SNO[stacks-network-orchestrator]

    REPL --> VM

    CLI --> REPL
    CLI --> SN
    CLI --> FILES

    FILES --> CHT

    SN --> CHOE

    CHOE --> CHT
    CHOE --> VM

    SNO --> FILES
    SNO --> REPL
    SNO --> CHOE
lgalabru commented 1 year ago

A clean extraction of the wire format / stacks codec would be key to solve this issue.

smcclellan commented 1 year ago

The Stacks Codec is currently in clarity-repl, ideally would be in clarity-vm. Not high priority but we should do Q3 or Q4 perhaps.