Skip to content
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

Commando: "Somewhere, somehow, someone's going to pay." #5370

Merged
merged 18 commits into from
Jul 16, 2022

Commits on Jul 16, 2022

  1. Makefile: use a library archive for CCAN

    The linker discards whole files in an archive if it doesn't need them,
    so saves a bit of space (and time).  Also allows us to add more niche
    things to CCAN (e.g. runes support!) without bloating all the binaries.
    
    We also had many places which depended on $(CCAN_FILES), but that was
    already a dependent of $(ALL_PROGRAMS) and $(ALL_TEST_PROGRAMS).
    
    Before:
    
    ```
    $ size lightningd/lightning*d
       text	   data	    bss	    dec	    hex	filename
    2247683	   8696	  39008	2295387	 23065b	lightningd/lightning_channeld
    2086607	   7432	  38880	2132919	 208bb7	lightningd/lightning_closingd
    2227916	   8056	  39200	2275172	 22b764	lightningd/lightning_connectd
    3369236	 119288	  39240	3527764	 35d454	lightningd/lightningd
    2183551	   8352	  38880	2230783	 2209ff	lightningd/lightning_dualopend
    2196389	   8024	  39136	2243549	 223bdd	lightningd/lightning_gossipd
    2086216	   7488	  39264	2132968	 208be8	lightningd/lightning_hsmd
    2134396	   8136	  39424	2181956	 214b44	lightningd/lightning_onchaind
    2133391	   8352	  38880	2180623	 21460f	lightningd/lightning_openingd
    1512168	   2136	  34384	1548688	 17a190	lightningd/lightning_websocketd
    ```
    
    After:
    ```
    text	   data	    bss	    dec	    hex	filename
    2192065	   8488	  38912	2239465	 222be9	lightningd/lightning_channeld
    2030957	   7224	  38816	2076997	 1fb145	lightningd/lightning_closingd
    2179571	   7968	  39104	2226643	 21f9d3	lightningd/lightning_connectd
    3354296	 119288	  39208	3512792	 3599d8	lightningd/lightningd
    2127933	   8144	  38816	2174893	 212fad	lightningd/lightning_dualopend
    2141699	   7856	  39072	2188627	 216553	lightningd/lightning_gossipd
    2024482	   7288	   5240	2037010	 1f1512	lightningd/lightning_hsmd
    2072074	   7920	   5400	2085394	 1fd212	lightningd/lightning_onchaind
    2077773	   8144	  38816	2124733	 206bbd	lightningd/lightning_openingd
    1408958	   1752	    344	1411054	 1587ee	lightningd/lightning_websocketd
    ```
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    3336f1d View commit details
    Browse the repository at this point in the history
  2. ccan: upgrade to get ccan/runes.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    43ddaf8 View commit details
    Browse the repository at this point in the history
  3. common/json_stream: make json_add_jsonstr take a length.

    This is useful when have have a jsmntok_t.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    d807af6 View commit details
    Browse the repository at this point in the history
  4. libplugin: jsonrpc_request_whole_object_start() for more custom reque…

    …st handling.
    
    commando wants to see the whole reply object, and also not to assume params is
    an object.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    7850d0f View commit details
    Browse the repository at this point in the history
  5. libplugin: datastore helpers.

    Plugins are supposed to store their data in the datastore, and commando does so:
    let's make it easier for them by providing convenience APIs.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    097a553 View commit details
    Browse the repository at this point in the history
  6. plugins/commando: basic commando plugin (no runes yet).

    Signed-off-by: Rusty Russell <[email protected]
    Changelog-Added: Plugins: `commando` a new builtin plugin to send/recv peer commands over the lightning network, using runes.
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    e579650 View commit details
    Browse the repository at this point in the history
  7. commando: support commands larger than 64k.

    This is needed for invoice, which can be asked to commit to giant descriptions
    (though that's antisocial!).
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    7e73e4d View commit details
    Browse the repository at this point in the history
  8. commando: correctly reflect error data field.

    Some JSON error include "data", and we should reflect that.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    048093e View commit details
    Browse the repository at this point in the history
  9. commando: runes infrastructure.

    We support the old commando.py plugin, which stores a random secret,
    as well as a more modern approach which uses makesecret.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    13a53ad View commit details
    Browse the repository at this point in the history
  10. devtools/rune: simple decode tool.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    c6a7471 View commit details
    Browse the repository at this point in the history
  11. commando: add commando-rune command.

    Can both mint new runes, and add one or more restrictions to existing ones.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    2fd81d9 View commit details
    Browse the repository at this point in the history
  12. commando: don't look at messages *at all* unless they've created a rune.

    This means we can leave commando on by default, without an explicit config flag.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    df8242b View commit details
    Browse the repository at this point in the history
  13. commando: require runes for operation.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    3b2767a View commit details
    Browse the repository at this point in the history
  14. doc: document commando and commando-rune.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    cbe3642 View commit details
    Browse the repository at this point in the history
  15. commando: add support for parameters by array, parameter count.

    Awkward to filter, but they're really practical for many commands.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    a06bcfb View commit details
    Browse the repository at this point in the history
  16. commando: add rate for maximum successful rune use per minute.

    I'm assuming that nobody wants a rate slower than 1 per minute; we can
    introduce 'drate' if we want a per-day kind of limit.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    ee6b174 View commit details
    Browse the repository at this point in the history
  17. decode: support decoding runes.

    This is a bit weird since it lives in the offers plugin, but it works
    well.  This should make runes much more approachable for people!
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Jul 16, 2022
    Configuration menu
    Copy the full SHA
    96ab504 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    2e13b72 View commit details
    Browse the repository at this point in the history