[Lightning-dev] Minor protocol revisions.

Anthony Towns aj at erisian.com.au
Tue Sep 29 06:47:40 UTC 2015

On Thu, Sep 24, 2015 at 12:25:11PM +0200, Pierre wrote:
> > 1) Close now has an second ACK stage, which means you know the close ack
> Argh, I already have trouble understanding the rationale behind all
> the existing closing flows and states :-s Would it be possible to
> publish an updated version of the svg ? aj, any chance you could do
> the same with your 'flat' version ?

Yeah. I've updated state.py so the following flow works:

 $ test/test_state_coverage --dump-states | tee STATES
 $ ./state.py  > update.dot
 $ dot -Tsvg update.dot > update.svg

state.py is at https://github.com/ajtowns/lightning/blob/state/state.py

Updated svg is viewable at


Note that some transitions are still missing, notably

(I'm not following why the state coverage testing doesn't do something
more like:

   states = []
   path_to_state = {}
   for s in init_states:
        path_to_states[s] = [s]

   i = 0
   while i < len(states):
       tst_state = states[i]
       p = path_to_states[tst_state]

       for in_pkt in all_packets:
           # enter test state
           for setup_pkt in p[1:]:

           # send packet
           new_state, response_pkt = simulation_send_pkt(in_pkt)

           # document result
           dump_transition(tst_state, in_pkt, new_state, response_pkt)

           # if new state, add it to list to test
           if new_state not in states:
               path_to_state[new_state] = p + [in_pkt]

ie, for every state, throw every packet at it and record what happens;
assuming that any given state behaves the same no matter how you get
into it)


More information about the Lightning-dev mailing list