Re: [Lightning-dev] type,len,value standard

2018-11-16 Thread Christian Decker
Conner Fromknecht writes: >> For a sequence of `type,len,value`, the `type`s must be in ascending order >> -- not explicitly accepted or rejected. It would be easier to check >> uniqueness > (the previous rule we accepted) here for a naive parser (keep >> track of some "minimum allowed type"

Re: [Lightning-dev] type,len,value standard

2018-11-15 Thread Rusty Russell
Conner Fromknecht writes: > Hi ZmnSCPxj, > > Thanks for writing this up! I had started an email, but you beat me to it :) > >> 1. For a sequence of `type,len,value`, each `type` must be unique. -- >> accepted. > > To add to this, it seemed that there was some agreement that repeated fields >

Re: [Lightning-dev] type,len,value standard

2018-11-15 Thread Conner Fromknecht
Hi ZmnSCPxj, Precisely, something like that is what I had in mind. Since the max message size is 65KB, one option could be to only allow the varint to be max 2 bytes where: - if the 8th bit is not set, the lowest 7 bits of the first bytes translate to 0 - 127 - if the 8th bit is set, this

Re: [Lightning-dev] type,len,value standard

2018-11-15 Thread ZmnSCPxj via Lightning-dev
Good morning Conner et al, > > > 5. `len` - one byte or two? I believe we tend to use two bytes for > > > various > > > lengths. > > > > > > > Maybe varint? One byte is not enough for all lengths, but two seems > > excessive > > for uint8 or even uint32. > > Given that messages are

Re: [Lightning-dev] type,len,value standard

2018-11-14 Thread ZmnSCPxj via Lightning-dev
Good morning Conner, > > For a sequence of `type,len,value`, the `type`s must be in ascending order > > -- not explicitly accepted or rejected. It would be easier to check > > uniqueness > (the previous rule we accepted) here for a naive parser (keep > > track of some "minimum allowed type" that

Re: [Lightning-dev] type,len,value standard

2018-11-14 Thread Conner Fromknecht
Hi ZmnSCPxj, Thanks for writing this up! I had started an email, but you beat me to it :) > 1. For a sequence of `type,len,value`, each `type` must be unique. -- > accepted. To add to this, it seemed that there was some agreement that repeated fields should be serialized under a single root